Title: [197349] releases/WebKitGTK/webkit-2.12/Source/_javascript_Core
Revision
197349
Author
[email protected]
Date
2016-02-29 05:32:24 -0800 (Mon, 29 Feb 2016)

Log Message

Revert "Merge r197303 - Shrink UnlinkedCodeBlock a bit."

This reverts commit 200002afed4ac67e3cff10bfa9d7e32d879c9a1f.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog (197348 => 197349)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog	2016-02-29 13:32:10 UTC (rev 197348)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog	2016-02-29 13:32:24 UTC (rev 197349)
@@ -1,31 +1,3 @@
-2016-02-28  Andreas Kling  <[email protected]>
-
-        Shrink UnlinkedCodeBlock a bit.
-        <https://webkit.org/b/154797>
-
-        Reviewed by Anders Carlsson.
-
-        Move profiler-related members of UnlinkedCodeBlock into its RareData
-        structure, saving 40 bytes, and then reorder the other members of
-        UnlinkedCodeBlock to save another 24 bytes, netting a nice total 64.
-
-        The VM member was removed entirely since UnlinkedCodeBlock is a cell
-        and can retrieve its VM through MarkedBlock header lookup.
-
-        * bytecode/UnlinkedCodeBlock.cpp:
-        (JSC::UnlinkedCodeBlock::vm):
-        (JSC::UnlinkedCodeBlock::typeProfilerExpressionInfoForBytecodeOffset):
-        (JSC::UnlinkedCodeBlock::addTypeProfilerExpressionInfo):
-        (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): Deleted.
-        * bytecode/UnlinkedCodeBlock.h:
-        (JSC::UnlinkedCodeBlock::addRegExp):
-        (JSC::UnlinkedCodeBlock::addConstant):
-        (JSC::UnlinkedCodeBlock::addFunctionDecl):
-        (JSC::UnlinkedCodeBlock::addFunctionExpr):
-        (JSC::UnlinkedCodeBlock::addOpProfileControlFlowBytecodeOffset):
-        (JSC::UnlinkedCodeBlock::opProfileControlFlowBytecodeOffsets):
-        (JSC::UnlinkedCodeBlock::vm): Deleted.
-
 2016-02-27  Filip Pizlo  <[email protected]>
 
         FTL should lower its abstract heaps to B3 heap ranges

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp (197348 => 197349)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp	2016-02-29 13:32:10 UTC (rev 197348)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.cpp	2016-02-29 13:32:24 UTC (rev 197349)
@@ -56,6 +56,7 @@
     , m_numVars(0)
     , m_numCalleeLocals(0)
     , m_numParameters(0)
+    , m_vm(vm)
     , m_globalObjectRegister(VirtualRegister())
     , m_usesEval(info.usesEval())
     , m_isStrictMode(info.isStrictMode())
@@ -84,11 +85,6 @@
     ASSERT(m_constructorKind == static_cast<unsigned>(info.constructorKind()));
 }
 
-VM* UnlinkedCodeBlock::vm() const
-{
-    return MarkedBlock::blockFor(this)->vm();
-}
-
 void UnlinkedCodeBlock::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
     UnlinkedCodeBlock* thisObject = jsCast<UnlinkedCodeBlock*>(cell);
@@ -265,10 +261,9 @@
 
 bool UnlinkedCodeBlock::typeProfilerExpressionInfoForBytecodeOffset(unsigned bytecodeOffset, unsigned& startDivot, unsigned& endDivot)
 {
-    ASSERT(m_rareData);
     static const bool verbose = false;
-    auto iter = m_rareData->m_typeProfilerInfoMap.find(bytecodeOffset);
-    if (iter == m_rareData->m_typeProfilerInfoMap.end()) {
+    auto iter = m_typeProfilerInfoMap.find(bytecodeOffset);
+    if (iter == m_typeProfilerInfoMap.end()) {
         if (verbose)
             dataLogF("Don't have assignment info for offset:%u\n", bytecodeOffset);
         startDivot = UINT_MAX;
@@ -276,7 +271,7 @@
         return false;
     }
     
-    RareData::TypeProfilerExpressionRange& range = iter->value;
+    TypeProfilerExpressionRange& range = iter->value;
     startDivot = range.m_startDivot;
     endDivot = range.m_endDivot;
     return true;
@@ -284,11 +279,10 @@
 
 void UnlinkedCodeBlock::addTypeProfilerExpressionInfo(unsigned instructionOffset, unsigned startDivot, unsigned endDivot)
 {
-    createRareDataIfNecessary();
-    RareData::TypeProfilerExpressionRange range;
+    TypeProfilerExpressionRange range;
     range.m_startDivot = startDivot;
     range.m_endDivot = endDivot;
-    m_rareData->m_typeProfilerInfoMap.set(instructionOffset, range);
+    m_typeProfilerInfoMap.set(instructionOffset, range);  
 }
 
 void UnlinkedProgramCodeBlock::visitChildren(JSCell* cell, SlotVisitor& visitor)

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h (197348 => 197349)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h	2016-02-29 13:32:10 UTC (rev 197348)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h	2016-02-29 13:32:24 UTC (rev 197349)
@@ -148,7 +148,7 @@
     {
         createRareDataIfNecessary();
         unsigned size = m_rareData->m_regexps.size();
-        m_rareData->m_regexps.append(WriteBarrier<RegExp>(*vm(), this, r));
+        m_rareData->m_regexps.append(WriteBarrier<RegExp>(*m_vm, this, r));
         return size;
     }
     unsigned numberOfRegExps() const
@@ -170,7 +170,7 @@
     {
         unsigned result = m_constantRegisters.size();
         m_constantRegisters.append(WriteBarrier<Unknown>());
-        m_constantRegisters.last().set(*vm(), this, v);
+        m_constantRegisters.last().set(*m_vm, this, v);
         m_constantsSourceCodeRepresentation.append(sourceCodeRepresentation);
         return result;
     }
@@ -249,7 +249,7 @@
     {
         unsigned size = m_functionDecls.size();
         m_functionDecls.append(WriteBarrier<UnlinkedFunctionExecutable>());
-        m_functionDecls.last().set(*vm(), this, n);
+        m_functionDecls.last().set(*m_vm, this, n);
         return size;
     }
     UnlinkedFunctionExecutable* functionDecl(int index) { return m_functionDecls[index].get(); }
@@ -258,7 +258,7 @@
     {
         unsigned size = m_functionExprs.size();
         m_functionExprs.append(WriteBarrier<UnlinkedFunctionExecutable>());
-        m_functionExprs.last().set(*vm(), this, n);
+        m_functionExprs.last().set(*m_vm, this, n);
         return size;
     }
     UnlinkedFunctionExecutable* functionExpr(int index) { return m_functionExprs[index].get(); }
@@ -269,7 +269,7 @@
     void addExceptionHandler(const UnlinkedHandlerInfo& handler) { createRareDataIfNecessary(); return m_rareData->m_exceptionHandlers.append(handler); }
     UnlinkedHandlerInfo& exceptionHandler(int index) { ASSERT(m_rareData); return m_rareData->m_exceptionHandlers[index]; }
 
-    VM* vm() const;
+    VM* vm() const { return m_vm; }
 
     UnlinkedArrayProfile addArrayProfile() { return m_arrayProfileCount++; }
     unsigned numberOfArrayProfiles() { return m_arrayProfileCount; }
@@ -345,16 +345,8 @@
     ALWAYS_INLINE unsigned startColumn() const { return 0; }
     unsigned endColumn() const { return m_endColumn; }
 
-    void addOpProfileControlFlowBytecodeOffset(size_t offset)
-    {
-        createRareDataIfNecessary();
-        m_rareData->m_opProfileControlFlowBytecodeOffsets.append(offset);
-    }
-    const Vector<size_t>& opProfileControlFlowBytecodeOffsets() const
-    {
-        ASSERT(m_rareData);
-        return m_rareData->m_opProfileControlFlowBytecodeOffsets;
-    }
+    void addOpProfileControlFlowBytecodeOffset(size_t offset) { m_opProfileControlFlowBytecodeOffsets.append(offset); }
+    const Vector<size_t>& opProfileControlFlowBytecodeOffsets() const { return m_opProfileControlFlowBytecodeOffsets; }
 
     void dumpExpressionRangeInfo(); // For debugging purpose only.
 
@@ -377,10 +369,11 @@
 
     void getLineAndColumn(ExpressionRangeInfo&, unsigned& line, unsigned& column);
 
-    int m_numParameters;
-
     std::unique_ptr<UnlinkedInstructionStream> m_unlinkedInstructions;
 
+    int m_numParameters;
+    VM* m_vm;
+
     VirtualRegister m_thisRegister;
     VirtualRegister m_scopeRegister;
     VirtualRegister m_globalObjectRegister;
@@ -405,17 +398,17 @@
 
     Vector<unsigned> m_jumpTargets;
 
-    Vector<unsigned> m_propertyAccessInstructions;
-
     // Constant Pools
     Vector<Identifier> m_identifiers;
     Vector<WriteBarrier<Unknown>> m_constantRegisters;
     Vector<SourceCodeRepresentation> m_constantsSourceCodeRepresentation;
+    std::array<unsigned, LinkTimeConstantCount> m_linkTimeConstants;
     typedef Vector<WriteBarrier<UnlinkedFunctionExecutable>> FunctionExpressionVector;
     FunctionExpressionVector m_functionDecls;
     FunctionExpressionVector m_functionExprs;
-    std::array<unsigned, LinkTimeConstantCount> m_linkTimeConstants;
 
+    Vector<unsigned> m_propertyAccessInstructions;
+
     unsigned m_arrayProfileCount;
     unsigned m_arrayAllocationProfileCount;
     unsigned m_objectAllocationProfileCount;
@@ -439,18 +432,17 @@
         Vector<UnlinkedStringJumpTable> m_stringSwitchJumpTables;
 
         Vector<ExpressionRangeInfo::FatPosition> m_expressionInfoFatPositions;
-
-        struct TypeProfilerExpressionRange {
-            unsigned m_startDivot;
-            unsigned m_endDivot;
-        };
-        HashMap<unsigned, TypeProfilerExpressionRange> m_typeProfilerInfoMap;
-        Vector<size_t> m_opProfileControlFlowBytecodeOffsets;
     };
 
 private:
     std::unique_ptr<RareData> m_rareData;
     Vector<ExpressionRangeInfo> m_expressionInfo;
+    struct TypeProfilerExpressionRange {
+        unsigned m_startDivot;
+        unsigned m_endDivot;
+    };
+    HashMap<unsigned, TypeProfilerExpressionRange> m_typeProfilerInfoMap;
+    Vector<size_t> m_opProfileControlFlowBytecodeOffsets;
 
 protected:
     static void visitChildren(JSCell*, SlotVisitor&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to