Changeset 237128 in webkit for trunk/Source/JavaScriptCore/runtime/CodeCache.cpp
- Timestamp:
- Oct 15, 2018, 11:42:44 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/CodeCache.cpp
r237054 r237128 58 58 derivedContextType, evalContextType, isArrowFunctionContext, debuggerMode, 59 59 vm.typeProfiler() ? TypeProfilerEnabled::Yes : TypeProfilerEnabled::No, 60 vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No, 61 std::nullopt); 60 vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No); 62 61 SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key); 63 62 if (cache && Options::useCodeCache()) { … … 97 96 } 98 97 99 UnlinkedFunctionExecutable* CodeCache::getUnlinkedGlobalFunctionExecutable(VM& vm, const Identifier& name, const SourceCode& source, DebuggerMode debuggerMode, std::optional<int> functionConstructorParametersEndPosition,ParserError& error)98 UnlinkedFunctionExecutable* CodeCache::getUnlinkedGlobalFunctionExecutable(VM& vm, const Identifier& name, const SourceCode& source, DebuggerMode debuggerMode, ParserError& error) 100 99 { 101 100 bool isArrowFunctionContext = false; … … 109 108 debuggerMode, 110 109 vm.typeProfiler() ? TypeProfilerEnabled::Yes : TypeProfilerEnabled::No, 111 vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No, 112 functionConstructorParametersEndPosition); 110 vm.controlFlowProfiler() ? ControlFlowProfilerEnabled::Yes : ControlFlowProfilerEnabled::No); 113 111 SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key); 114 112 if (cache && Options::useCodeCache()) { … … 120 118 121 119 JSTextPosition positionBeforeLastNewline; 122 std::unique_ptr<ProgramNode> program = parseFunctionForFunctionConstructor(vm, source, error, &positionBeforeLastNewline, functionConstructorParametersEndPosition); 120 std::unique_ptr<ProgramNode> program = parse<ProgramNode>( 121 &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin, 122 JSParserStrictMode::NotStrict, JSParserScriptMode::Classic, SourceParseMode::ProgramMode, SuperBinding::NotNeeded, 123 error, &positionBeforeLastNewline); 123 124 if (!program) { 124 125 RELEASE_ASSERT(error.isValid()); … … 127 128 128 129 // This function assumes an input string that would result in a single function declaration. 129 StatementNode* funcDecl = program->singleStatement(); 130 StatementNode* statement = program->singleStatement(); 131 if (UNLIKELY(!statement)) { 132 JSToken token; 133 error = ParserError(ParserError::SyntaxError, ParserError::SyntaxErrorIrrecoverable, token, "Parser error", -1); 134 return nullptr; 135 } 136 ASSERT(statement->isBlock()); 137 138 StatementNode* funcDecl = static_cast<BlockNode*>(statement)->singleStatement(); 130 139 if (UNLIKELY(!funcDecl)) { 131 140 JSToken token;
Note:
See TracChangeset
for help on using the changeset viewer.