Changeset 237492 in webkit
- Timestamp:
- Oct 27, 2018, 7:41:22 AM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 9 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/UnlinkedFunctionExecutable.cpp (modified) (2 diffs)
-
bytecode/UnlinkedFunctionExecutable.h (modified) (1 diff)
-
parser/SourceCodeKey.h (modified) (4 diffs)
-
runtime/CodeCache.cpp (modified) (3 diffs)
-
runtime/CodeCache.h (modified) (1 diff)
-
runtime/FunctionConstructor.cpp (modified) (1 diff)
-
runtime/FunctionExecutable.cpp (modified) (1 diff)
-
runtime/FunctionExecutable.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r237486 r237492 1 2018-10-27 Yusuke Suzuki <yusukesuzuki@slowstart.org> 2 3 Unreviewed, partial rolling in r237254 4 https://bugs.webkit.org/show_bug.cgi?id=190340 5 6 We do not use the added function right now to investigate what is the reason of the regression. 7 It also does not include any Parser.{h,cpp} changes to ensure that Parser.cpp's inlining decision 8 seems culprit of the regression on iOS devices. 9 10 * bytecode/UnlinkedFunctionExecutable.cpp: 11 (JSC::UnlinkedFunctionExecutable::fromGlobalCode): 12 * bytecode/UnlinkedFunctionExecutable.h: 13 * parser/SourceCodeKey.h: 14 (JSC::SourceCodeKey::SourceCodeKey): 15 (JSC::SourceCodeKey::operator== const): 16 * runtime/CodeCache.cpp: 17 (JSC::CodeCache::getUnlinkedGlobalCodeBlock): 18 (JSC::CodeCache::getUnlinkedGlobalFunctionExecutable): 19 * runtime/CodeCache.h: 20 * runtime/FunctionConstructor.cpp: 21 (JSC::constructFunctionSkippingEvalEnabledCheck): 22 * runtime/FunctionExecutable.cpp: 23 (JSC::FunctionExecutable::fromGlobalCode): 24 * runtime/FunctionExecutable.h: 25 1 26 2018-10-26 Commit Queue <commit-queue@webkit.org> 2 27 -
trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp
r237478 r237492 175 175 UnlinkedFunctionExecutable* UnlinkedFunctionExecutable::fromGlobalCode( 176 176 const Identifier& name, ExecState& exec, const SourceCode& source, 177 JSObject*& exception, int overrideLineNumber )177 JSObject*& exception, int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition) 178 178 { 179 179 ParserError error; … … 182 182 CodeCache* codeCache = vm.codeCache(); 183 183 DebuggerMode debuggerMode = globalObject.hasInteractiveDebugger() ? DebuggerOn : DebuggerOff; 184 UnlinkedFunctionExecutable* executable = codeCache->getUnlinkedGlobalFunctionExecutable(vm, name, source, debuggerMode, error);184 UnlinkedFunctionExecutable* executable = codeCache->getUnlinkedGlobalFunctionExecutable(vm, name, source, debuggerMode, functionConstructorParametersEndPosition, error); 185 185 186 186 if (globalObject.hasDebugger()) -
trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
r237478 r237492 108 108 static UnlinkedFunctionExecutable* fromGlobalCode( 109 109 const Identifier&, ExecState&, const SourceCode&, JSObject*& exception, 110 int overrideLineNumber );110 int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition); 111 111 112 112 JS_EXPORT_PRIVATE FunctionExecutable* link(VM&, const SourceCode& parentSource, std::optional<int> overrideLineNumber = std::nullopt, Intrinsic = NoIntrinsic); -
trunk/Source/JavaScriptCore/parser/SourceCodeKey.h
r237478 r237492 30 30 #include "UnlinkedSourceCode.h" 31 31 #include <wtf/HashTraits.h> 32 #include <wtf/Hasher.h> 32 33 33 34 namespace JSC { … … 72 73 class SourceCodeKey { 73 74 public: 74 SourceCodeKey() 75 { 76 } 75 SourceCodeKey() = default; 77 76 78 77 SourceCodeKey( 79 78 const UnlinkedSourceCode& sourceCode, const String& name, SourceCodeType codeType, JSParserStrictMode strictMode, 80 79 JSParserScriptMode scriptMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext, 81 DebuggerMode debuggerMode, TypeProfilerEnabled typeProfilerEnabled, ControlFlowProfilerEnabled controlFlowProfilerEnabled )80 DebuggerMode debuggerMode, TypeProfilerEnabled typeProfilerEnabled, ControlFlowProfilerEnabled controlFlowProfilerEnabled, std::optional<int> functionConstructorParametersEndPosition) 82 81 : m_sourceCode(sourceCode) 83 82 , m_name(name) 84 83 , m_flags(codeType, strictMode, scriptMode, derivedContextType, evalContextType, isArrowFunctionContext, debuggerMode, typeProfilerEnabled, controlFlowProfilerEnabled) 85 , m_hash(sourceCode.hash() ^ m_flags.bits()) 84 , m_functionConstructorParametersEndPosition(functionConstructorParametersEndPosition.value_or(-1)) 85 , m_hash(sourceCode.hash() ^ computeHash(m_flags.bits(), m_functionConstructorParametersEndPosition)) 86 86 { 87 87 } … … 109 109 && length() == other.length() 110 110 && m_flags == other.m_flags 111 && m_functionConstructorParametersEndPosition == other.m_functionConstructorParametersEndPosition 111 112 && m_name == other.m_name 112 113 && string() == other.string(); … … 128 129 String m_name; 129 130 SourceCodeFlags m_flags; 130 unsigned m_hash; 131 int m_functionConstructorParametersEndPosition { -1 }; 132 unsigned m_hash { 0 }; 131 133 }; 132 134 -
trunk/Source/JavaScriptCore/runtime/CodeCache.cpp
r237478 r237492 58 58 derivedContextType, evalContextType, isArrowFunctionContext, debuggerMode, 59 59 vm.typeProfiler() ? TypeProfilerEnabled::Yes : TypeProfilerEnabled::No, 60 vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No); 60 vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No, 61 std::nullopt); 61 62 SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key); 62 63 if (cache && Options::useCodeCache()) { … … 96 97 } 97 98 98 UnlinkedFunctionExecutable* CodeCache::getUnlinkedGlobalFunctionExecutable(VM& vm, const Identifier& name, const SourceCode& source, DebuggerMode debuggerMode, ParserError& error)99 UnlinkedFunctionExecutable* CodeCache::getUnlinkedGlobalFunctionExecutable(VM& vm, const Identifier& name, const SourceCode& source, DebuggerMode debuggerMode, std::optional<int> functionConstructorParametersEndPosition, ParserError& error) 99 100 { 100 101 bool isArrowFunctionContext = false; … … 108 109 debuggerMode, 109 110 vm.typeProfiler() ? TypeProfilerEnabled::Yes : TypeProfilerEnabled::No, 110 vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No); 111 vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No, 112 functionConstructorParametersEndPosition); 111 113 SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key); 112 114 if (cache && Options::useCodeCache()) { -
trunk/Source/JavaScriptCore/runtime/CodeCache.h
r237478 r237492 195 195 UnlinkedEvalCodeBlock* getUnlinkedEvalCodeBlock(VM&, IndirectEvalExecutable*, const SourceCode&, JSParserStrictMode, DebuggerMode, ParserError&, EvalContextType); 196 196 UnlinkedModuleProgramCodeBlock* getUnlinkedModuleProgramCodeBlock(VM&, ModuleProgramExecutable*, const SourceCode&, DebuggerMode, ParserError&); 197 UnlinkedFunctionExecutable* getUnlinkedGlobalFunctionExecutable(VM&, const Identifier&, const SourceCode&, DebuggerMode, ParserError&);197 UnlinkedFunctionExecutable* getUnlinkedGlobalFunctionExecutable(VM&, const Identifier&, const SourceCode&, DebuggerMode, std::optional<int> functionConstructorParametersEndPosition, ParserError&); 198 198 199 199 void clear() { m_sourceCode.clear(); } -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r237478 r237492 170 170 SourceCode source = makeSource(program, sourceOrigin, sourceURL, position); 171 171 JSObject* exception = nullptr; 172 FunctionExecutable* function = FunctionExecutable::fromGlobalCode(functionName, *exec, source, exception, overrideLineNumber );172 FunctionExecutable* function = FunctionExecutable::fromGlobalCode(functionName, *exec, source, exception, overrideLineNumber, std::nullopt); 173 173 if (!function) { 174 174 ASSERT(exception); -
trunk/Source/JavaScriptCore/runtime/FunctionExecutable.cpp
r237478 r237492 95 95 FunctionExecutable* FunctionExecutable::fromGlobalCode( 96 96 const Identifier& name, ExecState& exec, const SourceCode& source, 97 JSObject*& exception, int overrideLineNumber )97 JSObject*& exception, int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition) 98 98 { 99 99 UnlinkedFunctionExecutable* unlinkedExecutable = 100 100 UnlinkedFunctionExecutable::fromGlobalCode( 101 name, exec, source, exception, overrideLineNumber );101 name, exec, source, exception, overrideLineNumber, functionConstructorParametersEndPosition); 102 102 if (!unlinkedExecutable) 103 103 return nullptr; -
trunk/Source/JavaScriptCore/runtime/FunctionExecutable.h
r237478 r237492 56 56 static FunctionExecutable* fromGlobalCode( 57 57 const Identifier& name, ExecState&, const SourceCode&, 58 JSObject*& exception, int overrideLineNumber );58 JSObject*& exception, int overrideLineNumber, std::optional<int> functionConstructorParametersEndPosition); 59 59 60 60 static void destroy(JSCell*);
Note:
See TracChangeset
for help on using the changeset viewer.