Changeset 201531 in webkit
- Timestamp:
- May 31, 2016, 3:10:10 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/CodeBlock.cpp (modified) (6 diffs)
-
runtime/GetPutInfo.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r201523 r201531 1 2016-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 1 16 2016-05-31 Yusuke Suzuki <utatane.tea@gmail.com> 2 17 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r201487 r201531 1866 1866 } 1867 1867 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) const1882 {1883 return m_impl == other.m_impl1884 && m_depth == other.m_depth1885 && m_getOrPut == other.m_getOrPut1886 && m_resolveType == other.m_resolveType1887 && 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 1899 1868 void CodeBlock::finishCreation(VM& vm, CopyParsedBlockTag, CodeBlock& other) 1900 1869 { … … 2065 2034 #endif 2066 2035 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 2080 2036 // Copy and translate the UnlinkedInstructions 2081 2037 unsigned instructionCount = unlinkedCodeBlock->instructions().count(); … … 2189 2145 int localScopeDepth = pc[5].u.operand; 2190 2146 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); 2192 2148 instructions[i + 4].u.operand = op.type; 2193 2149 instructions[i + 5].u.operand = op.depth; … … 2226 2182 2227 2183 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); 2229 2185 2230 2186 instructions[i + 4].u.operand = GetPutInfo(getPutInfo.resolveMode(), op.type, getPutInfo.initializationMode()).operand(); … … 2261 2217 int localScopeDepth = pc[5].u.operand; 2262 2218 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()); 2264 2220 2265 2221 instructions[i + 4].u.operand = GetPutInfo(getPutInfo.resolveMode(), op.type, getPutInfo.initializationMode()).operand(); … … 2295 2251 // Even though type profiling may be profiling either a Get or a Put, we can always claim a Get because 2296 2252 // 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); 2298 2254 2299 2255 if (op.type == ClosureVar || op.type == ModuleVar) -
trunk/Source/JavaScriptCore/runtime/GetPutInfo.h
r201359 r201531 180 180 181 181 struct ResolveOp { 182 ResolveOp()183 : depth(0)184 , structure(nullptr)185 , lexicalEnvironment(nullptr)186 , watchpointSet(nullptr)187 , importedName(nullptr)188 { }189 190 182 ResolveOp(ResolveType type, size_t depth, Structure* structure, JSLexicalEnvironment* lexicalEnvironment, WatchpointSet* watchpointSet, uintptr_t operand, UniquedStringImpl* importedName = nullptr) 191 183 : type(type)
Note:
See TracChangeset
for help on using the changeset viewer.