Title: [201531] trunk/Source/_javascript_Core
Revision
201531
Author
commit-qu...@webkit.org
Date
2016-05-31 15:10:10 -0700 (Tue, 31 May 2016)

Log Message

Unreviewed, rolling out r201359.
https://bugs.webkit.org/show_bug.cgi?id=158238

"It was not a speedup on anything" (Requested by saamyjoon on
#webkit).

Reverted changeset:

"We can cache lookups to JSScope::abstractResolve inside
CodeBlock::finishCreation"
https://bugs.webkit.org/show_bug.cgi?id=158036
http://trac.webkit.org/changeset/201359

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (201530 => 201531)


--- trunk/Source/_javascript_Core/ChangeLog	2016-05-31 21:59:03 UTC (rev 201530)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-05-31 22:10:10 UTC (rev 201531)
@@ -1,3 +1,18 @@
+2016-05-31  Commit Queue  <commit-qu...@webkit.org>
+
+        Unreviewed, rolling out r201359.
+        https://bugs.webkit.org/show_bug.cgi?id=158238
+
+        "It was not a speedup on anything" (Requested by saamyjoon on
+        #webkit).
+
+        Reverted changeset:
+
+        "We can cache lookups to JSScope::abstractResolve inside
+        CodeBlock::finishCreation"
+        https://bugs.webkit.org/show_bug.cgi?id=158036
+        http://trac.webkit.org/changeset/201359
+
 2016-05-31  Yusuke Suzuki  <utatane....@gmail.com>
 
         [JSC] Recover parser performance regression by async support

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (201530 => 201531)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2016-05-31 21:59:03 UTC (rev 201530)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2016-05-31 22:10:10 UTC (rev 201531)
@@ -1865,37 +1865,6 @@
     setNumParameters(other.numParameters());
 }
 
-struct AbstractResolveKey {
-    AbstractResolveKey()
-        : m_impl(nullptr)
-    { }
-    AbstractResolveKey(size_t depth, const Identifier& ident, GetOrPut getOrPut, ResolveType resolveType, InitializationMode initializationMode)
-        : m_depth(depth)
-        , m_impl(ident.impl())
-        , m_getOrPut(getOrPut)
-        , m_resolveType(resolveType)
-        , m_initializationMode(initializationMode)
-    { }
-
-
-    bool operator==(const AbstractResolveKey& other) const
-    { 
-        return m_impl == other.m_impl
-            && m_depth == other.m_depth
-            && m_getOrPut == other.m_getOrPut
-            && m_resolveType == other.m_resolveType
-            && m_initializationMode == other.m_initializationMode;
-    }
-
-    bool isNull() const { return !m_impl; }
-
-    size_t m_depth;
-    UniquedStringImpl* m_impl;
-    GetOrPut m_getOrPut;
-    ResolveType m_resolveType;
-    InitializationMode m_initializationMode;
-};
-
 void CodeBlock::finishCreation(VM& vm, CopyParsedBlockTag, CodeBlock& other)
 {
     Base::finishCreation(vm);
@@ -2064,19 +2033,6 @@
     setCalleeSaveRegisters(RegisterSet::llintBaselineCalleeSaveRegisters());
 #endif
 
-    AbstractResolveKey lastResolveKey;
-    ResolveOp lastCachedOp;
-    auto cachedAbstractResolve = [&] (size_t localScopeDepth, const Identifier& ident, GetOrPut getOrPut, ResolveType resolveType, InitializationMode initializationMode) -> const ResolveOp& {
-        AbstractResolveKey key(localScopeDepth, ident, getOrPut, resolveType, initializationMode);
-        if (key == lastResolveKey) {
-            ASSERT(!lastResolveKey.isNull());
-            return lastCachedOp;
-        }
-        lastCachedOp = JSScope::abstractResolve(m_globalObject->globalExec(), localScopeDepth, scope, ident, getOrPut, resolveType, initializationMode);
-        lastResolveKey = key;
-        return lastCachedOp;
-    };
-
     // Copy and translate the UnlinkedInstructions
     unsigned instructionCount = unlinkedCodeBlock->instructions().count();
     UnlinkedInstructionStream::Reader instructionReader(unlinkedCodeBlock->instructions());
@@ -2188,7 +2144,7 @@
             RELEASE_ASSERT(type != LocalClosureVar);
             int localScopeDepth = pc[5].u.operand;
 
-            const ResolveOp& op = cachedAbstractResolve(localScopeDepth, ident, Get, type, InitializationMode::NotInitialization);
+            ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), localScopeDepth, scope, ident, Get, type, InitializationMode::NotInitialization);
             instructions[i + 4].u.operand = op.type;
             instructions[i + 5].u.operand = op.depth;
             if (op.lexicalEnvironment) {
@@ -2225,7 +2181,7 @@
             }
 
             const Identifier& ident = identifier(pc[3].u.operand);
-            const ResolveOp& op = cachedAbstractResolve(localScopeDepth, ident, Get, getPutInfo.resolveType(), InitializationMode::NotInitialization);
+            ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), localScopeDepth, scope, ident, Get, getPutInfo.resolveType(), InitializationMode::NotInitialization);
 
             instructions[i + 4].u.operand = GetPutInfo(getPutInfo.resolveMode(), op.type, getPutInfo.initializationMode()).operand();
             if (op.type == ModuleVar)
@@ -2260,7 +2216,7 @@
             const Identifier& ident = identifier(pc[2].u.operand);
             int localScopeDepth = pc[5].u.operand;
             instructions[i + 5].u.pointer = nullptr;
-            const ResolveOp& op = cachedAbstractResolve(localScopeDepth, ident, Put, getPutInfo.resolveType(), getPutInfo.initializationMode());
+            ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), localScopeDepth, scope, ident, Put, getPutInfo.resolveType(), getPutInfo.initializationMode());
 
             instructions[i + 4].u.operand = GetPutInfo(getPutInfo.resolveMode(), op.type, getPutInfo.initializationMode()).operand();
             if (op.type == GlobalVar || op.type == GlobalVarWithVarInjectionChecks || op.type == GlobalLexicalVar || op.type == GlobalLexicalVarWithVarInjectionChecks)
@@ -2294,7 +2250,7 @@
                 ResolveType type = static_cast<ResolveType>(pc[5].u.operand);
                 // Even though type profiling may be profiling either a Get or a Put, we can always claim a Get because
                 // we're abstractly "read"ing from a JSScope.
-                const ResolveOp& op = cachedAbstractResolve(localScopeDepth, ident, Get, type, InitializationMode::NotInitialization);
+                ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), localScopeDepth, scope, ident, Get, type, InitializationMode::NotInitialization);
 
                 if (op.type == ClosureVar || op.type == ModuleVar)
                     symbolTable = op.lexicalEnvironment->symbolTable();

Modified: trunk/Source/_javascript_Core/runtime/GetPutInfo.h (201530 => 201531)


--- trunk/Source/_javascript_Core/runtime/GetPutInfo.h	2016-05-31 21:59:03 UTC (rev 201530)
+++ trunk/Source/_javascript_Core/runtime/GetPutInfo.h	2016-05-31 22:10:10 UTC (rev 201531)
@@ -179,14 +179,6 @@
 }
 
 struct ResolveOp {
-    ResolveOp()
-        : depth(0)
-        , structure(nullptr)
-        , lexicalEnvironment(nullptr)
-        , watchpointSet(nullptr)
-        , importedName(nullptr)
-    { }
-
     ResolveOp(ResolveType type, size_t depth, Structure* structure, JSLexicalEnvironment* lexicalEnvironment, WatchpointSet* watchpointSet, uintptr_t operand, UniquedStringImpl* importedName = nullptr)
         : type(type)
         , depth(depth)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to