⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 201531 in webkit


Ignore:
Timestamp:
May 31, 2016, 3:10:10 PM (10 years ago)
Author:
commit-queue@webkit.org
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

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r201523 r201531  
     12016-05-31  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r201359.
     4        https://bugs.webkit.org/show_bug.cgi?id=158238
     5
     6        "It was not a speedup on anything" (Requested by saamyjoon on
     7        #webkit).
     8
     9        Reverted changeset:
     10
     11        "We can cache lookups to JSScope::abstractResolve inside
     12        CodeBlock::finishCreation"
     13        https://bugs.webkit.org/show_bug.cgi?id=158036
     14        http://trac.webkit.org/changeset/201359
     15
    1162016-05-31  Yusuke Suzuki  <utatane.tea@gmail.com>
    217
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r201487 r201531  
    18661866}
    18671867
    1868 struct AbstractResolveKey {
    1869     AbstractResolveKey()
    1870         : m_impl(nullptr)
    1871     { }
    1872     AbstractResolveKey(size_t depth, const Identifier& ident, GetOrPut getOrPut, ResolveType resolveType, InitializationMode initializationMode)
    1873         : m_depth(depth)
    1874         , m_impl(ident.impl())
    1875         , m_getOrPut(getOrPut)
    1876         , m_resolveType(resolveType)
    1877         , m_initializationMode(initializationMode)
    1878     { }
    1879 
    1880 
    1881     bool operator==(const AbstractResolveKey& other) const
    1882     {
    1883         return m_impl == other.m_impl
    1884             && m_depth == other.m_depth
    1885             && m_getOrPut == other.m_getOrPut
    1886             && m_resolveType == other.m_resolveType
    1887             && m_initializationMode == other.m_initializationMode;
    1888     }
    1889 
    1890     bool isNull() const { return !m_impl; }
    1891 
    1892     size_t m_depth;
    1893     UniquedStringImpl* m_impl;
    1894     GetOrPut m_getOrPut;
    1895     ResolveType m_resolveType;
    1896     InitializationMode m_initializationMode;
    1897 };
    1898 
    18991868void CodeBlock::finishCreation(VM& vm, CopyParsedBlockTag, CodeBlock& other)
    19001869{
     
    20652034#endif
    20662035
    2067     AbstractResolveKey lastResolveKey;
    2068     ResolveOp lastCachedOp;
    2069     auto cachedAbstractResolve = [&] (size_t localScopeDepth, const Identifier& ident, GetOrPut getOrPut, ResolveType resolveType, InitializationMode initializationMode) -> const ResolveOp& {
    2070         AbstractResolveKey key(localScopeDepth, ident, getOrPut, resolveType, initializationMode);
    2071         if (key == lastResolveKey) {
    2072             ASSERT(!lastResolveKey.isNull());
    2073             return lastCachedOp;
    2074         }
    2075         lastCachedOp = JSScope::abstractResolve(m_globalObject->globalExec(), localScopeDepth, scope, ident, getOrPut, resolveType, initializationMode);
    2076         lastResolveKey = key;
    2077         return lastCachedOp;
    2078     };
    2079 
    20802036    // Copy and translate the UnlinkedInstructions
    20812037    unsigned instructionCount = unlinkedCodeBlock->instructions().count();
     
    21892145            int localScopeDepth = pc[5].u.operand;
    21902146
    2191             const ResolveOp& op = cachedAbstractResolve(localScopeDepth, ident, Get, type, InitializationMode::NotInitialization);
     2147            ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), localScopeDepth, scope, ident, Get, type, InitializationMode::NotInitialization);
    21922148            instructions[i + 4].u.operand = op.type;
    21932149            instructions[i + 5].u.operand = op.depth;
     
    22262182
    22272183            const Identifier& ident = identifier(pc[3].u.operand);
    2228             const ResolveOp& op = cachedAbstractResolve(localScopeDepth, ident, Get, getPutInfo.resolveType(), InitializationMode::NotInitialization);
     2184            ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), localScopeDepth, scope, ident, Get, getPutInfo.resolveType(), InitializationMode::NotInitialization);
    22292185
    22302186            instructions[i + 4].u.operand = GetPutInfo(getPutInfo.resolveMode(), op.type, getPutInfo.initializationMode()).operand();
     
    22612217            int localScopeDepth = pc[5].u.operand;
    22622218            instructions[i + 5].u.pointer = nullptr;
    2263             const ResolveOp& op = cachedAbstractResolve(localScopeDepth, ident, Put, getPutInfo.resolveType(), getPutInfo.initializationMode());
     2219            ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), localScopeDepth, scope, ident, Put, getPutInfo.resolveType(), getPutInfo.initializationMode());
    22642220
    22652221            instructions[i + 4].u.operand = GetPutInfo(getPutInfo.resolveMode(), op.type, getPutInfo.initializationMode()).operand();
     
    22952251                // Even though type profiling may be profiling either a Get or a Put, we can always claim a Get because
    22962252                // we're abstractly "read"ing from a JSScope.
    2297                 const ResolveOp& op = cachedAbstractResolve(localScopeDepth, ident, Get, type, InitializationMode::NotInitialization);
     2253                ResolveOp op = JSScope::abstractResolve(m_globalObject->globalExec(), localScopeDepth, scope, ident, Get, type, InitializationMode::NotInitialization);
    22982254
    22992255                if (op.type == ClosureVar || op.type == ModuleVar)
  • trunk/Source/JavaScriptCore/runtime/GetPutInfo.h

    r201359 r201531  
    180180
    181181struct ResolveOp {
    182     ResolveOp()
    183         : depth(0)
    184         , structure(nullptr)
    185         , lexicalEnvironment(nullptr)
    186         , watchpointSet(nullptr)
    187         , importedName(nullptr)
    188     { }
    189 
    190182    ResolveOp(ResolveType type, size_t depth, Structure* structure, JSLexicalEnvironment* lexicalEnvironment, WatchpointSet* watchpointSet, uintptr_t operand, UniquedStringImpl* importedName = nullptr)
    191183        : type(type)
Note: See TracChangeset for help on using the changeset viewer.