WebKit Bugzilla
Attachment 361477 Details for
Bug 194419
: [JSC] Shrink sizeof(CodeBlock) more
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194419-20190207174739.patch (text/plain), 84.85 KB, created by
Yusuke Suzuki
on 2019-02-07 17:47:40 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-02-07 17:47:40 PST
Size:
84.85 KB
patch
obsolete
>Subversion Revision: 241169 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 1a08fea7c578a822a7e8194a2b6220555548a836..2226ba194714ac3dedb2cb72f0dc0680ac9889e8 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,155 @@ >+2019-02-07 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Shrink sizeof(CodeBlock) more >+ https://bugs.webkit.org/show_bug.cgi?id=194419 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch further shrinks the size of CodeBlock, from 352 to 296 (304). >+ >+ 1. CodeBlock copies so many data from ScriptExecutable even if ScriptExecutable >+ has the same information. These data is not touched in CodeBlock::~CodeBlock, >+ so we can just use the data in ScriptExecutable instead of holding it in CodeBlock. >+ >+ 2. We remove m_instructions pointer since the ownership is managed by UnlinkedCodeBlock. >+ And we do not touch it in CodeBlock::~CodeBlock. >+ >+ 3. We move m_calleeSaveRegisters from CodeBlock to CodeBlock::JITData. For baseline and LLInt >+ cases, this patch offers RegisterAtOffsetList::llintBaselineCalleeSaveRegisters() which returns >+ singleton to `const RegisterAtOffsetList*` usable for LLInt and Baseline JIT CodeBlocks. >+ >+ 4. Move m_catchProfiles to RareData and materialize only when op_catch's slow path is called. >+ >+ 5. Drop ownerScriptExecutable. ownerExecutable() returns ScriptExecutable*. >+ >+ * bytecode/CodeBlock.cpp: >+ (JSC::CodeBlock::hash const): >+ (JSC::CodeBlock::sourceCodeForTools const): >+ (JSC::CodeBlock::dumpAssumingJITType const): >+ (JSC::CodeBlock::dumpSource): >+ (JSC::CodeBlock::CodeBlock): >+ (JSC::CodeBlock::finishCreation): >+ (JSC::CodeBlock::propagateTransitions): >+ (JSC::CodeBlock::finalizeLLIntInlineCaches): >+ (JSC::CodeBlock::setCalleeSaveRegisters): >+ (JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffset): >+ (JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffsetSlow): >+ (JSC::CodeBlock::lineNumberForBytecodeOffset): >+ (JSC::CodeBlock::expressionRangeForBytecodeOffset const): >+ (JSC::CodeBlock::hasOpDebugForLineAndColumn): >+ (JSC::CodeBlock::newReplacement): >+ (JSC::CodeBlock::replacement): >+ (JSC::CodeBlock::computeCapabilityLevel): >+ (JSC::CodeBlock::jettison): >+ (JSC::CodeBlock::calleeSaveRegisters const): >+ (JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters): >+ (JSC::CodeBlock::updateOSRExitCounterAndCheckIfNeedToReoptimize): >+ (JSC::CodeBlock::getArrayProfile): >+ (JSC::CodeBlock::updateAllPredictionsAndCountLiveness): >+ (JSC::CodeBlock::notifyLexicalBindingUpdate): >+ (JSC::CodeBlock::tryGetValueProfileForBytecodeOffset): >+ (JSC::CodeBlock::validate): >+ (JSC::CodeBlock::outOfLineJumpTarget): >+ (JSC::CodeBlock::arithProfileForBytecodeOffset): >+ (JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler): >+ * bytecode/CodeBlock.h: >+ (JSC::CodeBlock::specializationKind const): >+ (JSC::CodeBlock::isStrictMode const): >+ (JSC::CodeBlock::isConstructor const): >+ (JSC::CodeBlock::codeType const): >+ (JSC::CodeBlock::isKnownNotImmediate): >+ (JSC::CodeBlock::instructions const): >+ (JSC::CodeBlock::ownerExecutable const): >+ (JSC::CodeBlock::thisRegister const): >+ (JSC::CodeBlock::source const): >+ (JSC::CodeBlock::sourceOffset const): >+ (JSC::CodeBlock::firstLineColumnOffset const): >+ (JSC::CodeBlock::createRareDataIfNecessary): >+ (JSC::CodeBlock::ownerScriptExecutable const): Deleted. >+ (JSC::CodeBlock::setThisRegister): Deleted. >+ (JSC::CodeBlock::calleeSaveRegisters const): Deleted. >+ * bytecode/EvalCodeBlock.h: >+ * bytecode/FunctionCodeBlock.h: >+ * bytecode/GlobalCodeBlock.h: >+ (JSC::GlobalCodeBlock::GlobalCodeBlock): >+ * bytecode/ModuleProgramCodeBlock.h: >+ * bytecode/ProgramCodeBlock.h: >+ * debugger/Debugger.cpp: >+ (JSC::Debugger::toggleBreakpoint): >+ * debugger/DebuggerCallFrame.cpp: >+ (JSC::DebuggerCallFrame::sourceID const): >+ (JSC::DebuggerCallFrame::sourceIDForCallFrame): >+ * debugger/DebuggerScope.cpp: >+ (JSC::DebuggerScope::location const): >+ * dfg/DFGByteCodeParser.cpp: >+ (JSC::DFG::ByteCodeParser::InlineStackEntry::executable): >+ (JSC::DFG::ByteCodeParser::inliningCost): >+ (JSC::DFG::ByteCodeParser::parseCodeBlock): >+ * dfg/DFGCapabilities.cpp: >+ (JSC::DFG::isSupportedForInlining): >+ (JSC::DFG::mightCompileEval): >+ (JSC::DFG::mightCompileProgram): >+ (JSC::DFG::mightCompileFunctionForCall): >+ (JSC::DFG::mightCompileFunctionForConstruct): >+ (JSC::DFG::canUseOSRExitFuzzing): >+ * dfg/DFGGraph.h: >+ (JSC::DFG::Graph::executableFor): >+ * dfg/DFGJITCompiler.cpp: >+ (JSC::DFG::JITCompiler::compileFunction): >+ * dfg/DFGOSREntry.cpp: >+ (JSC::DFG::prepareOSREntry): >+ * dfg/DFGOSRExit.cpp: >+ (JSC::DFG::restoreCalleeSavesFor): >+ (JSC::DFG::saveCalleeSavesFor): >+ (JSC::DFG::saveOrCopyCalleeSavesFor): >+ * dfg/DFGOSRExitCompilerCommon.cpp: >+ (JSC::DFG::handleExitCounts): >+ * dfg/DFGOperations.cpp: >+ * dfg/DFGToFTLDeferredCompilationCallback.cpp: >+ (JSC::DFG::ToFTLDeferredCompilationCallback::compilationDidComplete): >+ * ftl/FTLCapabilities.cpp: >+ (JSC::FTL::canCompile): >+ * ftl/FTLLink.cpp: >+ (JSC::FTL::link): >+ * ftl/FTLOSRExitCompiler.cpp: >+ (JSC::FTL::compileStub): >+ * interpreter/CallFrame.cpp: >+ (JSC::CallFrame::callerSourceOrigin): >+ * interpreter/Interpreter.cpp: >+ (JSC::eval): >+ (JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const): >+ * interpreter/StackVisitor.cpp: >+ (JSC::StackVisitor::Frame::calleeSaveRegisters): >+ (JSC::StackVisitor::Frame::sourceURL const): >+ (JSC::StackVisitor::Frame::sourceID): >+ (JSC::StackVisitor::Frame::computeLineAndColumn const): >+ * interpreter/StackVisitor.h: >+ * jit/AssemblyHelpers.h: >+ (JSC::AssemblyHelpers::emitSaveCalleeSavesFor): >+ (JSC::AssemblyHelpers::emitSaveOrCopyCalleeSavesFor): >+ (JSC::AssemblyHelpers::emitRestoreCalleeSavesFor): >+ * jit/CallFrameShuffleData.cpp: >+ (JSC::CallFrameShuffleData::setupCalleeSaveRegisters): >+ * jit/JIT.cpp: >+ (JSC::JIT::compileWithoutLinking): >+ * jit/JITToDFGDeferredCompilationCallback.cpp: >+ (JSC::JITToDFGDeferredCompilationCallback::compilationDidComplete): >+ * jit/JITWorklist.cpp: >+ (JSC::JITWorklist::Plan::finalize): >+ (JSC::JITWorklist::compileNow): >+ * jit/RegisterAtOffsetList.cpp: >+ (JSC::RegisterAtOffsetList::llintBaselineCalleeSaveRegisters): >+ * jit/RegisterAtOffsetList.h: >+ (JSC::RegisterAtOffsetList::at const): >+ * runtime/ErrorInstance.cpp: >+ (JSC::appendSourceToError): >+ * runtime/ScriptExecutable.cpp: >+ (JSC::ScriptExecutable::newCodeBlockFor): >+ * runtime/StackFrame.cpp: >+ (JSC::StackFrame::sourceID const): >+ (JSC::StackFrame::sourceURL const): >+ (JSC::StackFrame::computeLineAndColumn const): >+ > 2019-02-07 Mark Lam <mark.lam@apple.com> > > Fix more doesGC() for CheckTraps, GetMapBucket, and Switch nodes. >diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp >index b4f228cca8cc59f1798d11566169f07981e85d9b..545e92b0644f0c9127c66224516c6a8cb5fcb241 100644 >--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp >+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp >@@ -147,7 +147,7 @@ CodeBlockHash CodeBlock::hash() const > { > if (!m_hash) { > RELEASE_ASSERT(isSafeToComputeHash()); >- m_hash = CodeBlockHash(ownerScriptExecutable()->source(), specializationKind()); >+ m_hash = CodeBlockHash(ownerExecutable()->source(), specializationKind()); > } > return m_hash; > } >@@ -155,9 +155,9 @@ CodeBlockHash CodeBlock::hash() const > CString CodeBlock::sourceCodeForTools() const > { > if (codeType() != FunctionCode) >- return ownerScriptExecutable()->source().toUTF8(); >+ return ownerExecutable()->source().toUTF8(); > >- SourceProvider* provider = source(); >+ SourceProvider* provider = source().provider(); > FunctionExecutable* executable = jsCast<FunctionExecutable*>(ownerExecutable()); > UnlinkedFunctionExecutable* unlinked = executable->unlinkedExecutable(); > unsigned unlinkedStartOffset = unlinked->startOffset(); >@@ -195,15 +195,15 @@ void CodeBlock::dumpAssumingJITType(PrintStream& out, JITCode::JITType jitType) > out.print(", ", instructionCount()); > if (this->jitType() == JITCode::BaselineJIT && m_shouldAlwaysBeInlined) > out.print(" (ShouldAlwaysBeInlined)"); >- if (ownerScriptExecutable()->neverInline()) >+ if (ownerExecutable()->neverInline()) > out.print(" (NeverInline)"); >- if (ownerScriptExecutable()->neverOptimize()) >+ if (ownerExecutable()->neverOptimize()) > out.print(" (NeverOptimize)"); >- else if (ownerScriptExecutable()->neverFTLOptimize()) >+ else if (ownerExecutable()->neverFTLOptimize()) > out.print(" (NeverFTLOptimize)"); >- if (ownerScriptExecutable()->didTryToEnterInLoop()) >+ if (ownerExecutable()->didTryToEnterInLoop()) > out.print(" (DidTryToEnterInLoop)"); >- if (ownerScriptExecutable()->isStrictMode()) >+ if (ownerExecutable()->isStrictMode()) > out.print(" (StrictMode)"); > if (m_didFailJITCompilation) > out.print(" (JITFail)"); >@@ -226,7 +226,7 @@ void CodeBlock::dumpSource() > > void CodeBlock::dumpSource(PrintStream& out) > { >- ScriptExecutable* executable = ownerScriptExecutable(); >+ ScriptExecutable* executable = ownerExecutable(); > if (executable->isFunctionExecutable()) { > FunctionExecutable* functionExecutable = reinterpret_cast<FunctionExecutable*>(executable); > StringView source = functionExecutable->source().provider()->getRange( >@@ -294,27 +294,19 @@ CodeBlock::CodeBlock(VM* vm, Structure* structure, CopyParsedBlockTag, CodeBlock > , m_didFailJITCompilation(false) > , m_didFailFTLCompilation(false) > , m_hasBeenCompiledWithFTL(false) >- , m_isConstructor(other.m_isConstructor) >- , m_isStrictMode(other.m_isStrictMode) >- , m_codeType(other.m_codeType) > , m_numCalleeLocals(other.m_numCalleeLocals) > , m_numVars(other.m_numVars) > , m_numberOfArgumentsToSkip(other.m_numberOfArgumentsToSkip) > , m_hasDebuggerStatement(false) > , m_steppingMode(SteppingModeDisabled) > , m_numBreakpoints(0) >+ , m_instructionCount(other.m_instructionCount) >+ , m_scopeRegister(other.m_scopeRegister) >+ , m_hash(other.m_hash) > , m_unlinkedCode(*other.vm(), this, other.m_unlinkedCode.get()) > , m_ownerExecutable(*other.vm(), this, other.m_ownerExecutable.get()) > , m_vm(other.m_vm) >- , m_instructions(other.m_instructions) > , m_instructionsRawPointer(other.m_instructionsRawPointer) >- , m_instructionCount(other.m_instructionCount) >- , m_thisRegister(other.m_thisRegister) >- , m_scopeRegister(other.m_scopeRegister) >- , m_hash(other.m_hash) >- , m_source(other.m_source) >- , m_sourceOffset(other.m_sourceOffset) >- , m_firstLineColumnOffset(other.m_firstLineColumnOffset) > , m_constantRegisters(other.m_constantRegisters) > , m_constantsSourceCodeRepresentation(other.m_constantsSourceCodeRepresentation) > , m_functionDecls(other.m_functionDecls) >@@ -328,6 +320,7 @@ CodeBlock::CodeBlock(VM* vm, Structure* structure, CopyParsedBlockTag, CodeBlock > ASSERT(heap()->isDeferred()); > ASSERT(m_scopeRegister.isLocal()); > >+ ASSERT(source().provider()); > setNumParameters(other.numParameters()); > > vm->heap.codeBlockSet().add(this); >@@ -350,8 +343,7 @@ void CodeBlock::finishCreation(VM& vm, CopyParsedBlockTag, CodeBlock& other) > } > } > >-CodeBlock::CodeBlock(VM* vm, Structure* structure, ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlinkedCodeBlock, >- JSScope* scope, RefPtr<SourceProvider>&& sourceProvider, unsigned sourceOffset, unsigned firstLineColumnOffset) >+CodeBlock::CodeBlock(VM* vm, Structure* structure, ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlinkedCodeBlock, JSScope* scope) > : JSCell(*vm, structure) > , m_globalObject(*vm, this, scope->globalObject(*vm)) > , m_shouldAlwaysBeInlined(true) >@@ -361,24 +353,16 @@ CodeBlock::CodeBlock(VM* vm, Structure* structure, ScriptExecutable* ownerExecut > , m_didFailJITCompilation(false) > , m_didFailFTLCompilation(false) > , m_hasBeenCompiledWithFTL(false) >- , m_isConstructor(unlinkedCodeBlock->isConstructor()) >- , m_isStrictMode(unlinkedCodeBlock->isStrictMode()) >- , m_codeType(unlinkedCodeBlock->codeType()) > , m_numCalleeLocals(unlinkedCodeBlock->numCalleeLocals()) > , m_numVars(unlinkedCodeBlock->numVars()) > , m_hasDebuggerStatement(false) > , m_steppingMode(SteppingModeDisabled) > , m_numBreakpoints(0) >+ , m_scopeRegister(unlinkedCodeBlock->scopeRegister()) > , m_unlinkedCode(*vm, this, unlinkedCodeBlock) > , m_ownerExecutable(*vm, this, ownerExecutable) > , m_vm(vm) >- , m_instructions(&unlinkedCodeBlock->instructions()) >- , m_instructionsRawPointer(m_instructions->rawPointer()) >- , m_thisRegister(unlinkedCodeBlock->thisRegister()) >- , m_scopeRegister(unlinkedCodeBlock->scopeRegister()) >- , m_source(WTFMove(sourceProvider)) >- , m_sourceOffset(sourceOffset) >- , m_firstLineColumnOffset(firstLineColumnOffset) >+ , m_instructionsRawPointer(unlinkedCodeBlock->instructions().rawPointer()) > , m_osrExitCounter(0) > , m_optimizationDelayCounter(0) > , m_reoptimizationRetryCounter(0) >@@ -388,7 +372,7 @@ CodeBlock::CodeBlock(VM* vm, Structure* structure, ScriptExecutable* ownerExecut > ASSERT(heap()->isDeferred()); > ASSERT(m_scopeRegister.isLocal()); > >- ASSERT(m_source); >+ ASSERT(source().provider()); > setNumParameters(unlinkedCodeBlock->numParameters()); > > vm->heap.codeBlockSet().add(this); >@@ -462,7 +446,7 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink > const UnlinkedHandlerInfo& unlinkedHandler = unlinkedCodeBlock->exceptionHandler(i); > HandlerInfo& handler = m_rareData->m_exceptionHandlers[i]; > #if ENABLE(JIT) >- MacroAssemblerCodePtr<BytecodePtrTag> codePtr = m_instructions->at(unlinkedHandler.target)->isWide() >+ MacroAssemblerCodePtr<BytecodePtrTag> codePtr = instructions().at(unlinkedHandler.target)->isWide() > ? LLInt::getWideCodePtr<BytecodePtrTag>(op_catch) > : LLInt::getCodePtr<BytecodePtrTag>(op_catch); > handler.initialize(unlinkedHandler, CodeLocationLabel<ExceptionHandlerPtrTag>(codePtr.retagged<ExceptionHandlerPtrTag>())); >@@ -496,10 +480,6 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink > } > } > >-#if !ENABLE(C_LOOP) >- setCalleeSaveRegisters(RegisterSet::llintBaselineCalleeSaveRegisters()); >-#endif >- > // Bookkeep the strongly referenced module environments. > HashSet<JSModuleEnvironment*> stronglyReferencedModuleEnvironments; > >@@ -543,7 +523,7 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink > break; \ > } > >- for (const auto& instruction : *m_instructions) { >+ for (const auto& instruction : instructions()) { > OpcodeID opcodeID = instruction->opcodeID(); > m_instructionCount += opcodeLengths[opcodeID]; > switch (opcodeID) { >@@ -805,7 +785,7 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink > if (vm.controlFlowProfiler()) > insertBasicBlockBoundariesForControlFlowProfiler(); > >- // Set optimization thresholds only after m_instructions is initialized, since these >+ // Set optimization thresholds only after instructions is initialized, since these > // rely on the instruction count (and are in theory permitted to also inspect the > // instruction stream to more accurate assess the cost of tier-up). > optimizeAfterWarmUp(); >@@ -1091,7 +1071,7 @@ void CodeBlock::propagateTransitions(const ConcurrentJSLocker&, SlotVisitor& vis > if (jitType() == JITCode::InterpreterThunk) { > const Vector<InstructionStream::Offset>& propertyAccessInstructions = m_unlinkedCode->propertyAccessInstructions(); > for (size_t i = 0; i < propertyAccessInstructions.size(); ++i) { >- auto instruction = m_instructions->at(propertyAccessInstructions[i]); >+ auto instruction = instructions().at(propertyAccessInstructions[i]); > if (instruction->is<OpPutById>()) { > auto& metadata = instruction->as<OpPutById>().metadata(this); > StructureID oldStructureID = metadata.m_oldStructureID; >@@ -1221,7 +1201,7 @@ void CodeBlock::finalizeLLIntInlineCaches() > }; > > for (size_t size = propertyAccessInstructions.size(), i = 0; i < size; ++i) { >- const auto curInstruction = m_instructions->at(propertyAccessInstructions[i]); >+ const auto curInstruction = instructions().at(propertyAccessInstructions[i]); > switch (curInstruction->opcodeID()) { > case op_get_by_id: { > auto& metadata = curInstruction->as<OpGetById>().metadata(this); >@@ -1528,6 +1508,18 @@ unsigned CodeBlock::rareCaseProfileCountForBytecodeOffset(const ConcurrentJSLock > return 0; > } > >+void CodeBlock::setCalleeSaveRegisters(RegisterSet calleeSaveRegisters) >+{ >+ ConcurrentJSLocker locker(m_lock); >+ ensureJITData(locker).m_calleeSaveRegisters = std::make_unique<RegisterAtOffsetList>(calleeSaveRegisters); >+} >+ >+void CodeBlock::setCalleeSaveRegisters(std::unique_ptr<RegisterAtOffsetList> registerAtOffsetList) >+{ >+ ConcurrentJSLocker locker(m_lock); >+ ensureJITData(locker).m_calleeSaveRegisters = WTFMove(registerAtOffsetList); >+} >+ > void CodeBlock::resetJITData() > { > RELEASE_ASSERT(!JITCode::isJIT(jitType())); >@@ -1716,14 +1708,16 @@ CallSiteIndex CodeBlock::newExceptionHandlingCallSiteIndex(CallSiteIndex origina > > void CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffset(InstructionStream::Offset bytecodeOffset) > { >- auto instruction = m_instructions->at(bytecodeOffset); >+ auto instruction = instructions().at(bytecodeOffset); > OpCatch op = instruction->as<OpCatch>(); > auto& metadata = op.metadata(this); > if (!!metadata.m_buffer) { > #if !ASSERT_DISABLED > ConcurrentJSLocker locker(m_lock); > bool found = false; >- for (auto& profile : m_catchProfiles) { >+ auto* rareData = m_rareData.get(); >+ ASSERT(rareData); >+ for (auto& profile : rareData->m_catchProfiles) { > if (profile.get() == metadata.m_buffer) { > found = true; > break; >@@ -1746,7 +1740,7 @@ void CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffsetSlow(const OpCatch > // we can avoid profiling them and extracting them when doing OSR entry > // into the DFG. > >- auto nextOffset = m_instructions->at(bytecodeOffset).next().offset(); >+ auto nextOffset = instructions().at(bytecodeOffset).next().offset(); > FastBitVector liveLocals = bytecodeLiveness.getLivenessInfoAtBytecodeOffset(this, nextOffset); > Vector<VirtualRegister> liveOperands; > liveOperands.reserveInitialCapacity(liveLocals.bitCount()); >@@ -1762,16 +1756,17 @@ void CodeBlock::ensureCatchLivenessIsComputedForBytecodeOffsetSlow(const OpCatch > for (unsigned i = 0; i < profiles->m_size; ++i) > profiles->m_buffer.get()[i].m_operand = liveOperands[i].offset(); > >+ createRareDataIfNecessary(); >+ > // The compiler thread will read this pointer value and then proceed to dereference it > // if it is not null. We need to make sure all above stores happen before this store so > // the compiler thread reads fully initialized data. > WTF::storeStoreFence(); > > op.metadata(this).m_buffer = profiles.get(); >- > { > ConcurrentJSLocker locker(m_lock); >- m_catchProfiles.append(WTFMove(profiles)); >+ m_rareData->m_catchProfiles.append(WTFMove(profiles)); > } > } > >@@ -1794,7 +1789,7 @@ void CodeBlock::removeExceptionHandlerForCallSite(CallSiteIndex callSiteIndex) > unsigned CodeBlock::lineNumberForBytecodeOffset(unsigned bytecodeOffset) > { > RELEASE_ASSERT(bytecodeOffset < instructions().size()); >- return ownerScriptExecutable()->firstLine() + m_unlinkedCode->lineNumberForBytecodeOffset(bytecodeOffset); >+ return ownerExecutable()->firstLine() + m_unlinkedCode->lineNumberForBytecodeOffset(bytecodeOffset); > } > > unsigned CodeBlock::columnNumberForBytecodeOffset(unsigned bytecodeOffset) >@@ -1811,14 +1806,14 @@ unsigned CodeBlock::columnNumberForBytecodeOffset(unsigned bytecodeOffset) > void CodeBlock::expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset, unsigned& line, unsigned& column) const > { > m_unlinkedCode->expressionRangeForBytecodeOffset(bytecodeOffset, divot, startOffset, endOffset, line, column); >- divot += m_sourceOffset; >+ divot += sourceOffset(); > column += line ? 1 : firstLineColumnOffset(); >- line += ownerScriptExecutable()->firstLine(); >+ line += ownerExecutable()->firstLine(); > } > > bool CodeBlock::hasOpDebugForLineAndColumn(unsigned line, unsigned column) > { >- for (const auto& it : *m_instructions) { >+ for (const auto& it : instructions()) { > if (it->is<OpDebug>()) { > int unused; > unsigned opDebugLine; >@@ -1896,7 +1891,7 @@ void CodeBlock::linkIncomingCall(ExecState* callerFrame, LLIntCallLinkInfo* inco > > CodeBlock* CodeBlock::newReplacement() > { >- return ownerScriptExecutable()->newReplacementCodeBlockFor(specializationKind()); >+ return ownerExecutable()->newReplacementCodeBlockFor(specializationKind()); > } > > #if ENABLE(JIT) >@@ -1905,7 +1900,7 @@ CodeBlock* CodeBlock::replacement() > const ClassInfo* classInfo = this->classInfo(*vm()); > > if (classInfo == FunctionCodeBlock::info()) >- return jsCast<FunctionExecutable*>(ownerExecutable())->codeBlockFor(m_isConstructor ? CodeForConstruct : CodeForCall); >+ return jsCast<FunctionExecutable*>(ownerExecutable())->codeBlockFor(isConstructor() ? CodeForConstruct : CodeForCall); > > if (classInfo == EvalCodeBlock::info()) > return jsCast<EvalExecutable*>(ownerExecutable())->codeBlock(); >@@ -1925,7 +1920,7 @@ DFG::CapabilityLevel CodeBlock::computeCapabilityLevel() > const ClassInfo* classInfo = this->classInfo(*vm()); > > if (classInfo == FunctionCodeBlock::info()) { >- if (m_isConstructor) >+ if (isConstructor()) > return DFG::functionForConstructCapabilityLevel(this); > return DFG::functionForCallCapabilityLevel(this); > } >@@ -2006,7 +2001,7 @@ void CodeBlock::jettison(Profiler::JettisonReason reason, ReoptimizationMode mod > // This accomplishes (1), and does its own book-keeping about whether it has already happened. > if (!jitCode()->dfgCommon()->invalidate()) { > // We've already been invalidated. >- RELEASE_ASSERT(this != replacement() || (vm.heap.isCurrentThreadBusy() && !Heap::isMarked(ownerScriptExecutable()))); >+ RELEASE_ASSERT(this != replacement() || (vm.heap.isCurrentThreadBusy() && !Heap::isMarked(ownerExecutable()))); > return; > } > } >@@ -2038,11 +2033,11 @@ void CodeBlock::jettison(Profiler::JettisonReason reason, ReoptimizationMode mod > > // Jettison can happen during GC. We don't want to install code to a dead executable > // because that would add a dead object to the remembered set. >- if (vm.heap.isCurrentThreadBusy() && !Heap::isMarked(ownerScriptExecutable())) >+ if (vm.heap.isCurrentThreadBusy() && !Heap::isMarked(ownerExecutable())) > return; > > // This accomplishes (2). >- ownerScriptExecutable()->installCode(vm, alternative(), codeType(), specializationKind()); >+ ownerExecutable()->installCode(vm, alternative(), codeType(), specializationKind()); > > #if ENABLE(DFG_JIT) > if (DFG::shouldDumpDisassembly()) >@@ -2196,15 +2191,17 @@ unsigned CodeBlock::reoptimizationRetryCounter() const > } > > #if !ENABLE(C_LOOP) >-void CodeBlock::setCalleeSaveRegisters(RegisterSet calleeSaveRegisters) >+const RegisterAtOffsetList* CodeBlock::calleeSaveRegisters() const > { >- m_calleeSaveRegisters = std::make_unique<RegisterAtOffsetList>(calleeSaveRegisters); >+#if ENABLE(JIT) >+ if (auto* jitData = m_jitData.get()) { >+ if (const RegisterAtOffsetList* registers = jitData->m_calleeSaveRegisters.get()) >+ return registers; >+ } >+#endif >+ return &RegisterAtOffsetList::llintBaselineCalleeSaveRegisters(); > } > >-void CodeBlock::setCalleeSaveRegisters(std::unique_ptr<RegisterAtOffsetList> registerAtOffsetList) >-{ >- m_calleeSaveRegisters = WTFMove(registerAtOffsetList); >-} > > static size_t roundCalleeSaveSpaceAsVirtualRegisters(size_t calleeSaveRegisters) > { >@@ -2220,7 +2217,7 @@ size_t CodeBlock::llintBaselineCalleeSaveSpaceAsVirtualRegisters() > > size_t CodeBlock::calleeSaveSpaceAsVirtualRegisters() > { >- return roundCalleeSaveSpaceAsVirtualRegisters(m_calleeSaveRegisters->size()); >+ return roundCalleeSaveSpaceAsVirtualRegisters(calleeSaveRegisters()->size()); > } > #endif > >@@ -2398,7 +2395,7 @@ auto CodeBlock::updateOSRExitCounterAndCheckIfNeedToReoptimize(DFG::OSRExitState > > bool didTryToEnterInLoop = false; > for (InlineCallFrame* inlineCallFrame = exit.m_codeOrigin.inlineCallFrame; inlineCallFrame; inlineCallFrame = inlineCallFrame->directCaller.inlineCallFrame) { >- if (inlineCallFrame->baselineCodeBlock->ownerScriptExecutable()->didTryToEnterInLoop()) { >+ if (inlineCallFrame->baselineCodeBlock->ownerExecutable()->didTryToEnterInLoop()) { > didTryToEnterInLoop = true; > break; > } >@@ -2555,7 +2552,7 @@ bool CodeBlock::shouldReoptimizeFromLoopNow() > > ArrayProfile* CodeBlock::getArrayProfile(const ConcurrentJSLocker&, unsigned bytecodeOffset) > { >- auto instruction = m_instructions->at(bytecodeOffset); >+ auto instruction = instructions().at(bytecodeOffset); > switch (instruction->opcodeID()) { > #define CASE(Op) \ > case Op::opcodeID: \ >@@ -2629,10 +2626,12 @@ void CodeBlock::updateAllPredictionsAndCountLiveness(unsigned& numberOfLiveNonAr > profile.computeUpdatedPrediction(locker); > }); > >- for (auto& profileBucket : m_catchProfiles) { >- profileBucket->forEach([&] (ValueProfileAndOperand& profile) { >- profile.m_profile.computeUpdatedPrediction(locker); >- }); >+ if (auto* rareData = m_rareData.get()) { >+ for (auto& profileBucket : rareData->m_catchProfiles) { >+ profileBucket->forEach([&] (ValueProfileAndOperand& profile) { >+ profile.m_profile.computeUpdatedPrediction(locker); >+ }); >+ } > } > > #if ENABLE(DFG_JIT) >@@ -2753,7 +2752,7 @@ void CodeBlock::notifyLexicalBindingUpdate() > return symbolTable->contains(locker, uid); > }; > >- for (const auto& instruction : *m_instructions) { >+ for (const auto& instruction : instructions()) { > OpcodeID opcodeID = instruction->opcodeID(); > switch (opcodeID) { > case op_resolve_scope: { >@@ -2888,7 +2887,7 @@ String CodeBlock::nameForRegister(VirtualRegister virtualRegister) > > ValueProfile* CodeBlock::tryGetValueProfileForBytecodeOffset(int bytecodeOffset) > { >- auto instruction = m_instructions->at(bytecodeOffset); >+ auto instruction = instructions().at(bytecodeOffset); > switch (instruction->opcodeID()) { > > #define CASE(Op) \ >@@ -2942,7 +2941,7 @@ void CodeBlock::validate() > } > } > >- for (const auto& instruction : *m_instructions) { >+ for (const auto& instruction : instructions()) { > OpcodeID opcode = instruction->opcodeID(); > if (!!baselineAlternative()->handlerForBytecodeOffset(instruction.offset())) { > if (opcode == op_catch || opcode == op_enter) { >@@ -2999,12 +2998,12 @@ const Instruction* CodeBlock::outOfLineJumpTarget(const Instruction* pc) > { > int offset = bytecodeOffset(pc); > int target = m_unlinkedCode->outOfLineJumpOffset(offset); >- return m_instructions->at(offset + target).ptr(); >+ return instructions().at(offset + target).ptr(); > } > > ArithProfile* CodeBlock::arithProfileForBytecodeOffset(InstructionStream::Offset bytecodeOffset) > { >- return arithProfileForPC(m_instructions->at(bytecodeOffset).ptr()); >+ return arithProfileForPC(instructions().at(bytecodeOffset).ptr()); > } > > ArithProfile* CodeBlock::arithProfileForPC(const Instruction* pc) >@@ -3055,7 +3054,7 @@ void CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler() > // Because op_profile_control_flow is emitted at the beginning of every basic block, finding > // the next op_profile_control_flow will give us the text range of a single basic block. > size_t startIdx = bytecodeOffsets[i]; >- auto instruction = m_instructions->at(startIdx); >+ auto instruction = instructions().at(startIdx); > RELEASE_ASSERT(instruction->opcodeID() == op_profile_control_flow); > auto bytecode = instruction->as<OpProfileControlFlow>(); > auto& metadata = bytecode.metadata(this); >@@ -3063,11 +3062,11 @@ void CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler() > int basicBlockEndOffset; > if (i + 1 < offsetsLength) { > size_t endIdx = bytecodeOffsets[i + 1]; >- auto endInstruction = m_instructions->at(endIdx); >+ auto endInstruction = instructions().at(endIdx); > RELEASE_ASSERT(endInstruction->opcodeID() == op_profile_control_flow); > basicBlockEndOffset = endInstruction->as<OpProfileControlFlow>().m_textOffset - 1; > } else { >- basicBlockEndOffset = m_sourceOffset + ownerScriptExecutable()->source().length() - 1; // Offset before the closing brace. >+ basicBlockEndOffset = sourceOffset() + ownerExecutable()->source().length() - 1; // Offset before the closing brace. > basicBlockStartOffset = std::min(basicBlockStartOffset, basicBlockEndOffset); // Some start offsets may be at the closing brace, ensure it is the offset before. > } > >@@ -3095,7 +3094,7 @@ void CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler() > continue; > } > >- BasicBlockLocation* basicBlockLocation = vm()->controlFlowProfiler()->getBasicBlockLocation(ownerScriptExecutable()->sourceID(), basicBlockStartOffset, basicBlockEndOffset); >+ BasicBlockLocation* basicBlockLocation = vm()->controlFlowProfiler()->getBasicBlockLocation(ownerExecutable()->sourceID(), basicBlockStartOffset, basicBlockEndOffset); > > // Find all functions that are enclosed within the range: [basicBlockStartOffset, basicBlockEndOffset] > // and insert these functions' start/end offsets as gaps in the current BasicBlockLocation. >diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h >index 2b380db2babbf5b9848f3d3157e45847fc8dbb08..db2cd92cf55ff7bcb43cf2dc566e34594a88832e 100644 >--- a/Source/JavaScriptCore/bytecode/CodeBlock.h >+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h >@@ -121,7 +121,7 @@ class CodeBlock : public JSCell { > > protected: > CodeBlock(VM*, Structure*, CopyParsedBlockTag, CodeBlock& other); >- CodeBlock(VM*, Structure*, ScriptExecutable* ownerExecutable, UnlinkedCodeBlock*, JSScope*, RefPtr<SourceProvider>&&, unsigned sourceOffset, unsigned firstLineColumnOffset); >+ CodeBlock(VM*, Structure*, ScriptExecutable* ownerExecutable, UnlinkedCodeBlock*, JSScope*); > > void finishCreation(VM&, CopyParsedBlockTag, CodeBlock& other); > bool finishCreation(VM&, ScriptExecutable* ownerExecutable, UnlinkedCodeBlock*, JSScope*); >@@ -179,7 +179,7 @@ class CodeBlock : public JSCell { > > CodeSpecializationKind specializationKind() const > { >- return specializationFromIsConstruct(m_isConstructor); >+ return specializationFromIsConstruct(isConstructor()); > } > > CodeBlock* alternativeForJettison(); >@@ -211,8 +211,10 @@ class CodeBlock : public JSCell { > > void dumpMathICStats(); > >- bool isStrictMode() const { return m_isStrictMode; } >+ bool isStrictMode() const { return m_unlinkedCode->isStrictMode(); } >+ bool isConstructor() const { return m_unlinkedCode->isConstructor(); } > ECMAMode ecmaMode() const { return isStrictMode() ? StrictMode : NotStrictMode; } >+ CodeType codeType() const { return m_unlinkedCode->codeType(); } > > JSParserScriptMode scriptMode() const { return m_unlinkedCode->scriptMode(); } > >@@ -221,7 +223,7 @@ class CodeBlock : public JSCell { > > inline bool isKnownNotImmediate(int index) > { >- if (index == m_thisRegister.offset() && !m_isStrictMode) >+ if (index == thisRegister().offset() && !isStrictMode()) > return true; > > if (isConstantRegisterIndex(index)) >@@ -263,6 +265,7 @@ class CodeBlock : public JSCell { > SentinelLinkedList<PolymorphicCallNode, BasicRawSentinelNode<PolymorphicCallNode>> m_incomingPolymorphicCalls; > SegmentedVector<RareCaseProfile, 8> m_rareCaseProfiles; > std::unique_ptr<PCToCodeOriginMap> m_pcToCodeOriginMap; >+ std::unique_ptr<RegisterAtOffsetList> m_calleeSaveRegisters; > JITCodeMap m_jitCodeMap; > }; > >@@ -320,6 +323,9 @@ class CodeBlock : public JSCell { > void setPCToCodeOriginMap(std::unique_ptr<PCToCodeOriginMap>&&); > Optional<CodeOrigin> findPC(void* pc); > >+ void setCalleeSaveRegisters(RegisterSet); >+ void setCalleeSaveRegisters(std::unique_ptr<RegisterAtOffsetList>); >+ > RareCaseProfile* addRareCaseProfile(int bytecodeOffset); > RareCaseProfile* rareCaseProfileForBytecodeOffset(const ConcurrentJSLocker&, int bytecodeOffset); > unsigned rareCaseProfileCountForBytecodeOffset(const ConcurrentJSLocker&, int bytecodeOffset); >@@ -374,7 +380,7 @@ class CodeBlock : public JSCell { > return returnAddress - instructionsBegin; > } > >- const InstructionStream& instructions() const { return *m_instructions; } >+ const InstructionStream& instructions() const { return m_unlinkedCode->instructions(); } > > size_t predictedMachineCodeSize(); > >@@ -420,15 +426,13 @@ class CodeBlock : public JSCell { > > void jettison(Profiler::JettisonReason, ReoptimizationMode = DontCountReoptimization, const FireDetail* = nullptr); > >- ExecutableBase* ownerExecutable() const { return m_ownerExecutable.get(); } >- ScriptExecutable* ownerScriptExecutable() const { return jsCast<ScriptExecutable*>(m_ownerExecutable.get()); } >+ ScriptExecutable* ownerExecutable() const { return m_ownerExecutable.get(); } > > ExecutableToCodeBlockEdge* ownerEdge() const { return m_ownerEdge.get(); } > > VM* vm() const { return m_vm; } > >- void setThisRegister(VirtualRegister thisRegister) { m_thisRegister = thisRegister; } >- VirtualRegister thisRegister() const { return m_thisRegister; } >+ VirtualRegister thisRegister() const { return m_unlinkedCode->thisRegister(); } > > bool usesEval() const { return m_unlinkedCode->usesEval(); } > >@@ -443,11 +447,6 @@ class CodeBlock : public JSCell { > return m_scopeRegister; > } > >- CodeType codeType() const >- { >- return static_cast<CodeType>(m_codeType); >- } >- > PutPropertySlot::Context putByIdContext() const > { > if (codeType() == EvalCode) >@@ -455,9 +454,9 @@ class CodeBlock : public JSCell { > return PutPropertySlot::PutById; > } > >- SourceProvider* source() const { return m_source.get(); } >- unsigned sourceOffset() const { return m_sourceOffset; } >- unsigned firstLineColumnOffset() const { return m_firstLineColumnOffset; } >+ const SourceCode& source() const { return m_ownerExecutable->source(); } >+ unsigned sourceOffset() const { return m_ownerExecutable->source().startOffset(); } >+ unsigned firstLineColumnOffset() const { return m_ownerExecutable->startColumn(); } > > size_t numberOfJumpTargets() const { return m_unlinkedCode->numberOfJumpTargets(); } > unsigned jumpTarget(int index) const { return m_unlinkedCode->jumpTarget(index); } >@@ -662,10 +661,7 @@ class CodeBlock : public JSCell { > void countReoptimization(); > > #if !ENABLE(C_LOOP) >- void setCalleeSaveRegisters(RegisterSet); >- void setCalleeSaveRegisters(std::unique_ptr<RegisterAtOffsetList>); >- >- RegisterAtOffsetList* calleeSaveRegisters() const { return m_calleeSaveRegisters.get(); } >+ const RegisterAtOffsetList* calleeSaveRegisters() const; > > static unsigned numberOfLLIntBaselineCalleeSaveRegisters() { return RegisterSet::llintBaselineCalleeSaveRegisters().numberOfSetRegisters(); } > static size_t llintBaselineCalleeSaveSpaceAsVirtualRegisters(); >@@ -834,9 +830,6 @@ class CodeBlock : public JSCell { > bool m_didFailJITCompilation : 1; > bool m_didFailFTLCompilation : 1; > bool m_hasBeenCompiledWithFTL : 1; >- bool m_isConstructor : 1; >- bool m_isStrictMode : 1; >- unsigned m_codeType : 2; // CodeType > > // Internal methods for use by validation code. It would be private if it wasn't > // for the fact that we use it from anonymous namespaces. >@@ -852,6 +845,8 @@ class CodeBlock : public JSCell { > Vector<SimpleJumpTable> m_switchJumpTables; > Vector<StringJumpTable> m_stringSwitchJumpTables; > >+ Vector<std::unique_ptr<ValueProfileAndOperandBuffer>> m_catchProfiles; >+ > DirectEvalCodeCache m_directEvalCodeCache; > }; > >@@ -942,8 +937,11 @@ class CodeBlock : public JSCell { > > void createRareDataIfNecessary() > { >- if (!m_rareData) >- m_rareData = std::make_unique<RareData>(); >+ if (!m_rareData) { >+ auto rareData = std::make_unique<RareData>(); >+ WTF::storeStoreFence(); // m_catchProfiles can be touched from compiler threads. >+ m_rareData = WTFMove(rareData); >+ } > } > > void insertBasicBlockBoundariesForControlFlowProfiler(); >@@ -962,28 +960,19 @@ class CodeBlock : public JSCell { > unsigned m_numBreakpoints : 30; > }; > }; >- WriteBarrier<UnlinkedCodeBlock> m_unlinkedCode; >- WriteBarrier<ExecutableBase> m_ownerExecutable; >- WriteBarrier<ExecutableToCodeBlockEdge> m_ownerEdge; >- VM* m_vm; >- >- const InstructionStream* m_instructions; >- const void* m_instructionsRawPointer { nullptr }; > unsigned m_instructionCount { 0 }; >- VirtualRegister m_thisRegister; > VirtualRegister m_scopeRegister; > mutable CodeBlockHash m_hash; > >- RefPtr<SourceProvider> m_source; >- unsigned m_sourceOffset; >- unsigned m_firstLineColumnOffset; >+ WriteBarrier<UnlinkedCodeBlock> m_unlinkedCode; >+ WriteBarrier<ScriptExecutable> m_ownerExecutable; >+ WriteBarrier<ExecutableToCodeBlockEdge> m_ownerEdge; >+ VM* m_vm; > >+ const void* m_instructionsRawPointer { nullptr }; > SentinelLinkedList<LLIntCallLinkInfo, BasicRawSentinelNode<LLIntCallLinkInfo>> m_incomingLLIntCalls; > StructureWatchpointMap m_llintGetByIdWatchpointMap; > RefPtr<JITCode> m_jitCode; >-#if !ENABLE(C_LOOP) >- std::unique_ptr<RegisterAtOffsetList> m_calleeSaveRegisters; >-#endif > #if ENABLE(JIT) > std::unique_ptr<JITData> m_jitData; > #endif >@@ -993,7 +982,6 @@ class CodeBlock : public JSCell { > CompressedLazyOperandValueProfileHolder m_lazyOperandValueProfiles; > #endif > RefCountedArray<ValueProfile> m_argumentValueProfiles; >- Vector<std::unique_ptr<ValueProfileAndOperandBuffer>> m_catchProfiles; > > // Constant Pool > COMPILE_ASSERT(sizeof(Register) == sizeof(WriteBarrier<Unknown>), Register_must_be_same_size_as_WriteBarrier_Unknown); >@@ -1010,6 +998,7 @@ class CodeBlock : public JSCell { > > BaselineExecutionCounter m_jitExecuteCounter; > uint32_t m_osrExitCounter; >+ > uint16_t m_optimizationDelayCounter; > uint16_t m_reoptimizationRetryCounter; > >diff --git a/Source/JavaScriptCore/bytecode/EvalCodeBlock.h b/Source/JavaScriptCore/bytecode/EvalCodeBlock.h >index e568a8def0341a18e84905b277fa1e7893117f85..b9f28d02c7142947d981cb07a9c5522a081fa79e 100644 >--- a/Source/JavaScriptCore/bytecode/EvalCodeBlock.h >+++ b/Source/JavaScriptCore/bytecode/EvalCodeBlock.h >@@ -52,11 +52,10 @@ class EvalCodeBlock final : public GlobalCodeBlock { > return instance; > } > >- static EvalCodeBlock* create(VM* vm, EvalExecutable* ownerExecutable, UnlinkedEvalCodeBlock* unlinkedCodeBlock, >- JSScope* scope, RefPtr<SourceProvider>&& sourceProvider) >+ static EvalCodeBlock* create(VM* vm, EvalExecutable* ownerExecutable, UnlinkedEvalCodeBlock* unlinkedCodeBlock, JSScope* scope) > { > EvalCodeBlock* instance = new (NotNull, allocateCell<EvalCodeBlock>(vm->heap)) >- EvalCodeBlock(vm, vm->evalCodeBlockStructure.get(), ownerExecutable, unlinkedCodeBlock, scope, WTFMove(sourceProvider)); >+ EvalCodeBlock(vm, vm->evalCodeBlockStructure.get(), ownerExecutable, unlinkedCodeBlock, scope); > if (!instance->finishCreation(*vm, ownerExecutable, unlinkedCodeBlock, scope)) > return nullptr; > return instance; >@@ -75,9 +74,8 @@ class EvalCodeBlock final : public GlobalCodeBlock { > { > } > >- EvalCodeBlock(VM* vm, Structure* structure, EvalExecutable* ownerExecutable, UnlinkedEvalCodeBlock* unlinkedCodeBlock, >- JSScope* scope, RefPtr<SourceProvider>&& sourceProvider) >- : GlobalCodeBlock(vm, structure, ownerExecutable, unlinkedCodeBlock, scope, WTFMove(sourceProvider), 0, 1) >+ EvalCodeBlock(VM* vm, Structure* structure, EvalExecutable* ownerExecutable, UnlinkedEvalCodeBlock* unlinkedCodeBlock, JSScope* scope) >+ : GlobalCodeBlock(vm, structure, ownerExecutable, unlinkedCodeBlock, scope) > { > } > }; >diff --git a/Source/JavaScriptCore/bytecode/FunctionCodeBlock.h b/Source/JavaScriptCore/bytecode/FunctionCodeBlock.h >index cccb5c553d37a7ec879dcb1ed542e9e277d88182..853fae95de3aa2842cd0c7658a56d13a9950eea5 100644 >--- a/Source/JavaScriptCore/bytecode/FunctionCodeBlock.h >+++ b/Source/JavaScriptCore/bytecode/FunctionCodeBlock.h >@@ -53,11 +53,10 @@ class FunctionCodeBlock final : public CodeBlock { > return instance; > } > >- static FunctionCodeBlock* create(VM* vm, FunctionExecutable* ownerExecutable, UnlinkedFunctionCodeBlock* unlinkedCodeBlock, JSScope* scope, >- RefPtr<SourceProvider>&& sourceProvider, unsigned sourceOffset, unsigned firstLineColumnOffset) >+ static FunctionCodeBlock* create(VM* vm, FunctionExecutable* ownerExecutable, UnlinkedFunctionCodeBlock* unlinkedCodeBlock, JSScope* scope) > { > FunctionCodeBlock* instance = new (NotNull, allocateCell<FunctionCodeBlock>(vm->heap)) >- FunctionCodeBlock(vm, vm->functionCodeBlockStructure.get(), ownerExecutable, unlinkedCodeBlock, scope, WTFMove(sourceProvider), sourceOffset, firstLineColumnOffset); >+ FunctionCodeBlock(vm, vm->functionCodeBlockStructure.get(), ownerExecutable, unlinkedCodeBlock, scope); > if (!instance->finishCreation(*vm, ownerExecutable, unlinkedCodeBlock, scope)) > return nullptr; > return instance; >@@ -74,9 +73,8 @@ class FunctionCodeBlock final : public CodeBlock { > { > } > >- FunctionCodeBlock(VM* vm, Structure* structure, FunctionExecutable* ownerExecutable, UnlinkedFunctionCodeBlock* unlinkedCodeBlock, JSScope* scope, >- RefPtr<SourceProvider>&& sourceProvider, unsigned sourceOffset, unsigned firstLineColumnOffset) >- : CodeBlock(vm, structure, ownerExecutable, unlinkedCodeBlock, scope, WTFMove(sourceProvider), sourceOffset, firstLineColumnOffset) >+ FunctionCodeBlock(VM* vm, Structure* structure, FunctionExecutable* ownerExecutable, UnlinkedFunctionCodeBlock* unlinkedCodeBlock, JSScope* scope) >+ : CodeBlock(vm, structure, ownerExecutable, unlinkedCodeBlock, scope) > { > } > }; >diff --git a/Source/JavaScriptCore/bytecode/GlobalCodeBlock.h b/Source/JavaScriptCore/bytecode/GlobalCodeBlock.h >index a7a3067b867c77394c6da5f7d7c2c407bd88f018..e11b790520c83db71efc32290113121cc2bbfc82 100644 >--- a/Source/JavaScriptCore/bytecode/GlobalCodeBlock.h >+++ b/Source/JavaScriptCore/bytecode/GlobalCodeBlock.h >@@ -45,8 +45,8 @@ class GlobalCodeBlock : public CodeBlock { > { > } > >- GlobalCodeBlock(VM* vm, Structure* structure, ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlinkedCodeBlock, JSScope* scope, RefPtr<SourceProvider>&& sourceProvider, unsigned sourceOffset, unsigned firstLineColumnOffset) >- : CodeBlock(vm, structure, ownerExecutable, unlinkedCodeBlock, scope, WTFMove(sourceProvider), sourceOffset, firstLineColumnOffset) >+ GlobalCodeBlock(VM* vm, Structure* structure, ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlinkedCodeBlock, JSScope* scope) >+ : CodeBlock(vm, structure, ownerExecutable, unlinkedCodeBlock, scope) > { > } > }; >diff --git a/Source/JavaScriptCore/bytecode/ModuleProgramCodeBlock.h b/Source/JavaScriptCore/bytecode/ModuleProgramCodeBlock.h >index 467b3d56d0381f49209678328da2b96778614b04..23556cd1c5b9800daffc62096acfc7e362cb45dd 100644 >--- a/Source/JavaScriptCore/bytecode/ModuleProgramCodeBlock.h >+++ b/Source/JavaScriptCore/bytecode/ModuleProgramCodeBlock.h >@@ -53,11 +53,10 @@ class ModuleProgramCodeBlock final : public GlobalCodeBlock { > return instance; > } > >- static ModuleProgramCodeBlock* create(VM* vm, ModuleProgramExecutable* ownerExecutable, UnlinkedModuleProgramCodeBlock* unlinkedCodeBlock, >- JSScope* scope, RefPtr<SourceProvider>&& sourceProvider, unsigned firstLineColumnOffset) >+ static ModuleProgramCodeBlock* create(VM* vm, ModuleProgramExecutable* ownerExecutable, UnlinkedModuleProgramCodeBlock* unlinkedCodeBlock, JSScope* scope) > { > ModuleProgramCodeBlock* instance = new (NotNull, allocateCell<ModuleProgramCodeBlock>(vm->heap)) >- ModuleProgramCodeBlock(vm, vm->moduleProgramCodeBlockStructure.get(), ownerExecutable, unlinkedCodeBlock, scope, WTFMove(sourceProvider), firstLineColumnOffset); >+ ModuleProgramCodeBlock(vm, vm->moduleProgramCodeBlockStructure.get(), ownerExecutable, unlinkedCodeBlock, scope); > if (!instance->finishCreation(*vm, ownerExecutable, unlinkedCodeBlock, scope)) > return nullptr; > return instance; >@@ -74,9 +73,8 @@ class ModuleProgramCodeBlock final : public GlobalCodeBlock { > { > } > >- ModuleProgramCodeBlock(VM* vm, Structure* structure, ModuleProgramExecutable* ownerExecutable, UnlinkedModuleProgramCodeBlock* unlinkedCodeBlock, >- JSScope* scope, RefPtr<SourceProvider>&& sourceProvider, unsigned firstLineColumnOffset) >- : GlobalCodeBlock(vm, structure, ownerExecutable, unlinkedCodeBlock, scope, WTFMove(sourceProvider), 0, firstLineColumnOffset) >+ ModuleProgramCodeBlock(VM* vm, Structure* structure, ModuleProgramExecutable* ownerExecutable, UnlinkedModuleProgramCodeBlock* unlinkedCodeBlock, JSScope* scope) >+ : GlobalCodeBlock(vm, structure, ownerExecutable, unlinkedCodeBlock, scope) > { > } > }; >diff --git a/Source/JavaScriptCore/bytecode/ProgramCodeBlock.h b/Source/JavaScriptCore/bytecode/ProgramCodeBlock.h >index e8ba30fe5bccf229c5c7b7c7c14b77fda7b77776..eb795fd38e7080e5290ccb4019cf1fa71691f412 100644 >--- a/Source/JavaScriptCore/bytecode/ProgramCodeBlock.h >+++ b/Source/JavaScriptCore/bytecode/ProgramCodeBlock.h >@@ -53,11 +53,10 @@ class ProgramCodeBlock final : public GlobalCodeBlock { > return instance; > } > >- static ProgramCodeBlock* create(VM* vm, ProgramExecutable* ownerExecutable, UnlinkedProgramCodeBlock* unlinkedCodeBlock, >- JSScope* scope, RefPtr<SourceProvider>&& sourceProvider, unsigned firstLineColumnOffset) >+ static ProgramCodeBlock* create(VM* vm, ProgramExecutable* ownerExecutable, UnlinkedProgramCodeBlock* unlinkedCodeBlock, JSScope* scope) > { > ProgramCodeBlock* instance = new (NotNull, allocateCell<ProgramCodeBlock>(vm->heap)) >- ProgramCodeBlock(vm, vm->programCodeBlockStructure.get(), ownerExecutable, unlinkedCodeBlock, scope, WTFMove(sourceProvider), firstLineColumnOffset); >+ ProgramCodeBlock(vm, vm->programCodeBlockStructure.get(), ownerExecutable, unlinkedCodeBlock, scope); > if (!instance->finishCreation(*vm, ownerExecutable, unlinkedCodeBlock, scope)) > return nullptr; > return instance; >@@ -74,9 +73,8 @@ class ProgramCodeBlock final : public GlobalCodeBlock { > { > } > >- ProgramCodeBlock(VM* vm, Structure* structure, ProgramExecutable* ownerExecutable, UnlinkedProgramCodeBlock* unlinkedCodeBlock, >- JSScope* scope, RefPtr<SourceProvider>&& sourceProvider, unsigned firstLineColumnOffset) >- : GlobalCodeBlock(vm, structure, ownerExecutable, unlinkedCodeBlock, scope, WTFMove(sourceProvider), 0, firstLineColumnOffset) >+ ProgramCodeBlock(VM* vm, Structure* structure, ProgramExecutable* ownerExecutable, UnlinkedProgramCodeBlock* unlinkedCodeBlock, JSScope* scope) >+ : GlobalCodeBlock(vm, structure, ownerExecutable, unlinkedCodeBlock, scope) > { > } > }; >diff --git a/Source/JavaScriptCore/debugger/Debugger.cpp b/Source/JavaScriptCore/debugger/Debugger.cpp >index 40c13728eaef9d9d96ed0fe0bec6ab3a0805e979..09a6ded96e077e34c44d07ad93efa16a70c8609e 100644 >--- a/Source/JavaScriptCore/debugger/Debugger.cpp >+++ b/Source/JavaScriptCore/debugger/Debugger.cpp >@@ -262,7 +262,7 @@ void Debugger::toggleBreakpoint(CodeBlock* codeBlock, Breakpoint& breakpoint, Br > { > ASSERT(breakpoint.resolved); > >- ScriptExecutable* executable = codeBlock->ownerScriptExecutable(); >+ ScriptExecutable* executable = codeBlock->ownerExecutable(); > > SourceID sourceID = static_cast<SourceID>(executable->sourceID()); > if (breakpoint.sourceID != sourceID) >diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp >index b30a8625d23ee069c6747072573c727f5eb2d22a..e9dfbc2c088725d1d706548a4c11b577f8b45df1 100644 >--- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp >+++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp >@@ -129,7 +129,7 @@ SourceID DebuggerCallFrame::sourceID() const > if (!isValid()) > return noSourceID; > if (isTailDeleted()) >- return m_shadowChickenFrame.codeBlock->ownerScriptExecutable()->sourceID(); >+ return m_shadowChickenFrame.codeBlock->ownerExecutable()->sourceID(); > return sourceIDForCallFrame(m_validMachineFrame); > } > >@@ -316,7 +316,7 @@ SourceID DebuggerCallFrame::sourceIDForCallFrame(CallFrame* callFrame) > CodeBlock* codeBlock = callFrame->codeBlock(); > if (!codeBlock) > return noSourceID; >- return codeBlock->ownerScriptExecutable()->sourceID(); >+ return codeBlock->ownerExecutable()->sourceID(); > } > > } // namespace JSC >diff --git a/Source/JavaScriptCore/debugger/DebuggerScope.cpp b/Source/JavaScriptCore/debugger/DebuggerScope.cpp >index b1e7aec54d2d0764d14f96df12f04c7960a5de39..2f34411b47a187d20ef2c4f11e8a9b32e70afeca 100644 >--- a/Source/JavaScriptCore/debugger/DebuggerScope.cpp >+++ b/Source/JavaScriptCore/debugger/DebuggerScope.cpp >@@ -245,7 +245,7 @@ DebuggerLocation DebuggerScope::location() const > if (!codeBlock) > return DebuggerLocation(); > >- ScriptExecutable* executable = codeBlock->ownerScriptExecutable(); >+ ScriptExecutable* executable = codeBlock->ownerExecutable(); > return DebuggerLocation(executable); > } > >diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp >index c2378554a1fca7e95721502dc8125ae1bd4ff3eb..d46834fc0e7b1d2a77618e19b3b2587aeb06ad59 100644 >--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp >+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp >@@ -1085,7 +1085,7 @@ class ByteCodeParser { > CodeBlock* m_profiledBlock; > InlineCallFrame* m_inlineCallFrame; > >- ScriptExecutable* executable() { return m_codeBlock->ownerScriptExecutable(); } >+ ScriptExecutable* executable() { return m_codeBlock->ownerExecutable(); } > > QueryableExitProfile m_exitProfile; > >@@ -1504,7 +1504,7 @@ unsigned ByteCodeParser::inliningCost(CallVariant callee, int argumentCountInclu > VERBOSE_LOG(" Might inline function: ", mightInlineFunctionFor(codeBlock, specializationKind), "\n"); > VERBOSE_LOG(" Might compile function: ", mightCompileFunctionFor(codeBlock, specializationKind), "\n"); > VERBOSE_LOG(" Is supported for inlining: ", isSupportedForInlining(codeBlock), "\n"); >- VERBOSE_LOG(" Is inlining candidate: ", codeBlock->ownerScriptExecutable()->isInliningCandidate(), "\n"); >+ VERBOSE_LOG(" Is inlining candidate: ", codeBlock->ownerExecutable()->isInliningCandidate(), "\n"); > if (!canInline(capabilityLevel)) { > VERBOSE_LOG(" Failing because the function is not inlineable.\n"); > return UINT_MAX; >@@ -7094,7 +7094,7 @@ void ByteCodeParser::parseCodeBlock() > " ", inlineCallFrame()->directCaller); > } > dataLog( >- ", isStrictMode = ", codeBlock->ownerScriptExecutable()->isStrictMode(), "\n"); >+ ", isStrictMode = ", codeBlock->ownerExecutable()->isStrictMode(), "\n"); > codeBlock->baselineVersion()->dumpBytecode(); > } > >diff --git a/Source/JavaScriptCore/dfg/DFGCapabilities.cpp b/Source/JavaScriptCore/dfg/DFGCapabilities.cpp >index 405336384266cfc66ee437ed3c5180c97daa5e00..7852103070f906360abc44847b8c85756b34b7b2 100644 >--- a/Source/JavaScriptCore/dfg/DFGCapabilities.cpp >+++ b/Source/JavaScriptCore/dfg/DFGCapabilities.cpp >@@ -44,32 +44,32 @@ bool isSupported() > > bool isSupportedForInlining(CodeBlock* codeBlock) > { >- return codeBlock->ownerScriptExecutable()->isInliningCandidate(); >+ return codeBlock->ownerExecutable()->isInliningCandidate(); > } > > bool mightCompileEval(CodeBlock* codeBlock) > { > return isSupported() > && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount() >- && codeBlock->ownerScriptExecutable()->isOkToOptimize(); >+ && codeBlock->ownerExecutable()->isOkToOptimize(); > } > bool mightCompileProgram(CodeBlock* codeBlock) > { > return isSupported() > && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount() >- && codeBlock->ownerScriptExecutable()->isOkToOptimize(); >+ && codeBlock->ownerExecutable()->isOkToOptimize(); > } > bool mightCompileFunctionForCall(CodeBlock* codeBlock) > { > return isSupported() > && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount() >- && codeBlock->ownerScriptExecutable()->isOkToOptimize(); >+ && codeBlock->ownerExecutable()->isOkToOptimize(); > } > bool mightCompileFunctionForConstruct(CodeBlock* codeBlock) > { > return isSupported() > && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount() >- && codeBlock->ownerScriptExecutable()->isOkToOptimize(); >+ && codeBlock->ownerExecutable()->isOkToOptimize(); > } > > bool mightInlineFunctionForCall(CodeBlock* codeBlock) >@@ -89,7 +89,7 @@ bool mightInlineFunctionForConstruct(CodeBlock* codeBlock) > } > bool canUseOSRExitFuzzing(CodeBlock* codeBlock) > { >- return codeBlock->ownerScriptExecutable()->canUseOSRExitFuzzing(); >+ return codeBlock->ownerExecutable()->canUseOSRExitFuzzing(); > } > > static bool verboseCapabilities() >diff --git a/Source/JavaScriptCore/dfg/DFGGraph.h b/Source/JavaScriptCore/dfg/DFGGraph.h >index 151f5736c7ac7073f1dedee8df6eb33e008ef4eb..b14e911875b52493e694a2702914703937b17a6e 100644 >--- a/Source/JavaScriptCore/dfg/DFGGraph.h >+++ b/Source/JavaScriptCore/dfg/DFGGraph.h >@@ -417,9 +417,9 @@ class Graph : public virtual Scannable { > ScriptExecutable* executableFor(InlineCallFrame* inlineCallFrame) > { > if (!inlineCallFrame) >- return m_codeBlock->ownerScriptExecutable(); >+ return m_codeBlock->ownerExecutable(); > >- return inlineCallFrame->baselineCodeBlock->ownerScriptExecutable(); >+ return inlineCallFrame->baselineCodeBlock->ownerExecutable(); > } > > ScriptExecutable* executableFor(const CodeOrigin& codeOrigin) >diff --git a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp >index fcbd53b82b5bbc42b591af71ebfd99e85f85375b..23444f43c7bd876ac2695453c23f2655bb942f0c 100644 >--- a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp >+++ b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp >@@ -484,7 +484,7 @@ void JITCompiler::compileFunction() > emitStoreCodeOrigin(CodeOrigin(0)); > if (maxFrameExtentForSlowPathCall) > addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister); >- m_speculative->callOperationWithCallFrameRollbackOnException(m_codeBlock->m_isConstructor ? operationConstructArityCheck : operationCallArityCheck, GPRInfo::regT0); >+ m_speculative->callOperationWithCallFrameRollbackOnException(m_codeBlock->isConstructor() ? operationConstructArityCheck : operationCallArityCheck, GPRInfo::regT0); > if (maxFrameExtentForSlowPathCall) > addPtr(TrustedImm32(maxFrameExtentForSlowPathCall), stackPointerRegister); > branchTest32(Zero, GPRInfo::returnValueGPR).linkTo(fromArityCheck, this); >diff --git a/Source/JavaScriptCore/dfg/DFGOSREntry.cpp b/Source/JavaScriptCore/dfg/DFGOSREntry.cpp >index 1fffb701604f51c092d936752f6426bea7165988..d1f69ab4ddba06c390d0aa585de7c5aefba79dd1 100644 >--- a/Source/JavaScriptCore/dfg/DFGOSREntry.cpp >+++ b/Source/JavaScriptCore/dfg/DFGOSREntry.cpp >@@ -113,7 +113,7 @@ void* prepareOSREntry(ExecState* exec, CodeBlock* codeBlock, unsigned bytecodeIn > sanitizeStackForVM(vm); > > if (bytecodeIndex) >- codeBlock->ownerScriptExecutable()->setDidTryToEnterInLoop(true); >+ codeBlock->ownerExecutable()->setDidTryToEnterInLoop(true); > > if (codeBlock->jitType() != JITCode::DFGJIT) { > RELEASE_ASSERT(codeBlock->jitType() == JITCode::FTLJIT); >@@ -313,7 +313,7 @@ void* prepareOSREntry(ExecState* exec, CodeBlock* codeBlock, unsigned bytecodeIn > > // 6) Copy our callee saves to buffer. > #if NUMBER_OF_CALLEE_SAVES_REGISTERS > 0 >- RegisterAtOffsetList* registerSaveLocations = codeBlock->calleeSaveRegisters(); >+ const RegisterAtOffsetList* registerSaveLocations = codeBlock->calleeSaveRegisters(); > RegisterAtOffsetList* allCalleeSaves = RegisterSet::vmCalleeSaveRegisterOffsets(); > RegisterSet dontSaveRegisters = RegisterSet(RegisterSet::stackRegisters(), RegisterSet::allFPRs()); > >diff --git a/Source/JavaScriptCore/dfg/DFGOSRExit.cpp b/Source/JavaScriptCore/dfg/DFGOSRExit.cpp >index 1aedef68704b2326e44c1ff0ced62bd002e4c156..0d6e6930ab1317f5be659dd6b9cab28ad1b09dc0 100644 >--- a/Source/JavaScriptCore/dfg/DFGOSRExit.cpp >+++ b/Source/JavaScriptCore/dfg/DFGOSRExit.cpp >@@ -80,7 +80,7 @@ static void restoreCalleeSavesFor(Context& context, CodeBlock* codeBlock) > { > ASSERT(codeBlock); > >- RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); >+ const RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); > RegisterSet dontRestoreRegisters = RegisterSet(RegisterSet::stackRegisters(), RegisterSet::allFPRs()); > unsigned registerCount = calleeSaves->size(); > >@@ -103,7 +103,7 @@ static void saveCalleeSavesFor(Context& context, CodeBlock* codeBlock) > auto& stack = context.stack(); > ASSERT(codeBlock); > >- RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); >+ const RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); > RegisterSet dontSaveRegisters = RegisterSet(RegisterSet::stackRegisters(), RegisterSet::allFPRs()); > unsigned registerCount = calleeSaves->size(); > >@@ -182,7 +182,7 @@ static void saveOrCopyCalleeSavesFor(Context& context, CodeBlock* codeBlock, Vir > Frame frame(context.fp(), context.stack()); > ASSERT(codeBlock); > >- RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); >+ const RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); > RegisterSet dontSaveRegisters = RegisterSet(RegisterSet::stackRegisters(), RegisterSet::allFPRs()); > unsigned registerCount = calleeSaves->size(); > >diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp b/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp >index c1ab8468a50cbc531e2bf93bb74b1156da2e9422..fd6fdb53e36ac54c7d842a41b54a780b93493a4b 100644 >--- a/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp >+++ b/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp >@@ -78,7 +78,7 @@ void handleExitCounts(CCallHelpers& jit, const OSRExitBase& exit) > jit.branchTest8( > AssemblyHelpers::NonZero, > AssemblyHelpers::AbsoluteAddress( >- inlineCallFrame->baselineCodeBlock->ownerScriptExecutable()->addressOfDidTryToEnterInLoop()))); >+ inlineCallFrame->baselineCodeBlock->ownerExecutable()->addressOfDidTryToEnterInLoop()))); > } > > jit.move( >diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp >index 22750b7997af9c9a6b0eea3a5acfced1458c7f2e..984fc0b961e500954d6df0c4a9d3a677749eaaff 100644 >--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp >+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp >@@ -3023,7 +3023,7 @@ extern "C" void JIT_OPERATION triggerReoptimizationNow(CodeBlock* codeBlock, Cod > > bool didTryToEnterIntoInlinedLoops = false; > for (InlineCallFrame* inlineCallFrame = exit->m_codeOrigin.inlineCallFrame; inlineCallFrame; inlineCallFrame = inlineCallFrame->directCaller.inlineCallFrame) { >- if (inlineCallFrame->baselineCodeBlock->ownerScriptExecutable()->didTryToEnterInLoop()) { >+ if (inlineCallFrame->baselineCodeBlock->ownerExecutable()->didTryToEnterInLoop()) { > didTryToEnterIntoInlinedLoops = true; > break; > } >diff --git a/Source/JavaScriptCore/dfg/DFGToFTLDeferredCompilationCallback.cpp b/Source/JavaScriptCore/dfg/DFGToFTLDeferredCompilationCallback.cpp >index 13b97390dbacb003c27d7e6561001ff56c43b67e..c67e7a0008c7e0394c8b8e7e929bc8b28dffbc91 100644 >--- a/Source/JavaScriptCore/dfg/DFGToFTLDeferredCompilationCallback.cpp >+++ b/Source/JavaScriptCore/dfg/DFGToFTLDeferredCompilationCallback.cpp >@@ -77,7 +77,7 @@ void ToFTLDeferredCompilationCallback::compilationDidComplete( > } > > if (result == CompilationSuccessful) >- codeBlock->ownerScriptExecutable()->installCode(codeBlock); >+ codeBlock->ownerExecutable()->installCode(codeBlock); > > profiledDFGCodeBlock->jitCode()->dfg()->setOptimizationThresholdBasedOnCompilationResult( > profiledDFGCodeBlock, result); >diff --git a/Source/JavaScriptCore/ftl/FTLCapabilities.cpp b/Source/JavaScriptCore/ftl/FTLCapabilities.cpp >index 1ff0c337da8c95ce94c56f8ebe3a9b6a4e4dab15..535721296925a9009042f111048a9986f8b7d220 100644 >--- a/Source/JavaScriptCore/ftl/FTLCapabilities.cpp >+++ b/Source/JavaScriptCore/ftl/FTLCapabilities.cpp >@@ -405,7 +405,7 @@ CapabilityLevel canCompile(Graph& graph) > return CannotCompile; > } > >- if (UNLIKELY(graph.m_codeBlock->ownerScriptExecutable()->neverFTLOptimize())) { >+ if (UNLIKELY(graph.m_codeBlock->ownerExecutable()->neverFTLOptimize())) { > if (verboseCapabilities()) > dataLog("FTL rejecting ", *graph.m_codeBlock, " because it is marked as never FTL compile.\n"); > return CannotCompile; >diff --git a/Source/JavaScriptCore/ftl/FTLLink.cpp b/Source/JavaScriptCore/ftl/FTLLink.cpp >index 3fca11e239f4fcfe29c25e9f4afa29d00509f65c..361c6ae94feb6123a5a6b09b29a4dac4088d3993 100644 >--- a/Source/JavaScriptCore/ftl/FTLLink.cpp >+++ b/Source/JavaScriptCore/ftl/FTLLink.cpp >@@ -171,7 +171,7 @@ void link(State& state) > state.allocationFailed = true; > return; > } >- linkBuffer->link(callArityCheck, FunctionPtr<OperationPtrTag>(codeBlock->m_isConstructor ? operationConstructArityCheck : operationCallArityCheck)); >+ linkBuffer->link(callArityCheck, FunctionPtr<OperationPtrTag>(codeBlock->isConstructor() ? operationConstructArityCheck : operationCallArityCheck)); > linkBuffer->link(callLookupExceptionHandlerFromCallerFrame, FunctionPtr<OperationPtrTag>(lookupExceptionHandlerFromCallerFrame)); > linkBuffer->link(callArityFixup, FunctionPtr<JITThunkPtrTag>(vm.getCTIStub(arityFixupGenerator).code())); > linkBuffer->link(mainPathJumps, state.generatedFunction); >diff --git a/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp b/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp >index 8adffa0af386f9f56f8970ba94a4c3bbdf66eb40..218ecc79fa2db1d93c509cb26ad8c92afc3be3c1 100644 >--- a/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp >+++ b/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp >@@ -419,7 +419,7 @@ static void compileStub( > jit.checkStackPointerAlignment(); > > RegisterSet allFTLCalleeSaves = RegisterSet::ftlCalleeSaveRegisters(); >- RegisterAtOffsetList* baselineCalleeSaves = baselineCodeBlock->calleeSaveRegisters(); >+ const RegisterAtOffsetList* baselineCalleeSaves = baselineCodeBlock->calleeSaveRegisters(); > RegisterAtOffsetList* vmCalleeSaves = RegisterSet::vmCalleeSaveRegisterOffsets(); > RegisterSet vmCalleeSavesToSkip = RegisterSet::stackRegisters(); > if (exit.isExceptionHandler()) { >@@ -434,7 +434,7 @@ static void compileStub( > continue; > } > unsigned unwindIndex = codeBlock->calleeSaveRegisters()->indexOf(reg); >- RegisterAtOffset* baselineRegisterOffset = baselineCalleeSaves->find(reg); >+ const RegisterAtOffset* baselineRegisterOffset = baselineCalleeSaves->find(reg); > RegisterAtOffset* vmCalleeSave = nullptr; > if (exit.isExceptionHandler()) > vmCalleeSave = vmCalleeSaves->find(reg); >diff --git a/Source/JavaScriptCore/interpreter/CallFrame.cpp b/Source/JavaScriptCore/interpreter/CallFrame.cpp >index 4542396680456974c805a2286846c63f947ae1f5..256a33b5d613bf42e82c3b693ccc6a31e13cb2b7 100644 >--- a/Source/JavaScriptCore/interpreter/CallFrame.cpp >+++ b/Source/JavaScriptCore/interpreter/CallFrame.cpp >@@ -253,14 +253,14 @@ SourceOrigin CallFrame::callerSourceOrigin() > // In the above case, the eval function will be interpreted as the indirect call to eval inside forEach function. > // At that time, the generated eval code should have the source origin to the original caller of the forEach function > // instead of the source origin of the forEach function. >- if (static_cast<FunctionExecutable*>(visitor->codeBlock()->ownerScriptExecutable())->isBuiltinFunction()) >+ if (static_cast<FunctionExecutable*>(visitor->codeBlock()->ownerExecutable())->isBuiltinFunction()) > return StackVisitor::Status::Continue; > FALLTHROUGH; > > case StackVisitor::Frame::CodeType::Eval: > case StackVisitor::Frame::CodeType::Module: > case StackVisitor::Frame::CodeType::Global: >- sourceOrigin = visitor->codeBlock()->ownerScriptExecutable()->sourceOrigin(); >+ sourceOrigin = visitor->codeBlock()->ownerExecutable()->sourceOrigin(); > return StackVisitor::Status::Done; > > case StackVisitor::Frame::CodeType::Native: >diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp >index 06221fd69dbd6b60d43b9b80c1426e7694d73c4d..1a662eaef66523da88e48e3ac87b27bb4d727820 100644 >--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp >+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp >@@ -160,7 +160,7 @@ JSValue eval(CallFrame* callFrame) > > VariableEnvironment variablesUnderTDZ; > JSScope::collectClosureVariablesUnderTDZ(callerScopeChain, variablesUnderTDZ); >- eval = DirectEvalExecutable::create(callFrame, makeSource(programSource, callerCodeBlock->source()->sourceOrigin()), callerCodeBlock->isStrictMode(), derivedContextType, isArrowFunctionContext, evalContextType, &variablesUnderTDZ); >+ eval = DirectEvalExecutable::create(callFrame, makeSource(programSource, callerCodeBlock->source().provider()->sourceOrigin()), callerCodeBlock->isStrictMode(), derivedContextType, isArrowFunctionContext, evalContextType, &variablesUnderTDZ); > EXCEPTION_ASSERT(!!scope.exception() == !eval); > if (!eval) > return jsUndefined(); >@@ -564,7 +564,7 @@ class UnwindFunctor { > void copyCalleeSavesToEntryFrameCalleeSavesBuffer(StackVisitor& visitor) const > { > #if !ENABLE(C_LOOP) && NUMBER_OF_CALLEE_SAVES_REGISTERS > 0 >- RegisterAtOffsetList* currentCalleeSaves = visitor->calleeSaveRegisters(); >+ const RegisterAtOffsetList* currentCalleeSaves = visitor->calleeSaveRegisters(); > > if (!currentCalleeSaves) > return; >diff --git a/Source/JavaScriptCore/interpreter/StackVisitor.cpp b/Source/JavaScriptCore/interpreter/StackVisitor.cpp >index 2aa3f3000aead830c2202e380f38785cdd852911..4d1c7928bf42fcff938afde22ea64e54fbcb9a37 100644 >--- a/Source/JavaScriptCore/interpreter/StackVisitor.cpp >+++ b/Source/JavaScriptCore/interpreter/StackVisitor.cpp >@@ -252,7 +252,7 @@ StackVisitor::Frame::CodeType StackVisitor::Frame::codeType() const > return CodeType::Global; > } > >-RegisterAtOffsetList* StackVisitor::Frame::calleeSaveRegisters() >+const RegisterAtOffsetList* StackVisitor::Frame::calleeSaveRegisters() > { > if (isInlinedFrame()) > return nullptr; >@@ -317,7 +317,7 @@ String StackVisitor::Frame::sourceURL() const > case CodeType::Module: > case CodeType::Function: > case CodeType::Global: { >- String sourceURL = codeBlock()->ownerScriptExecutable()->sourceURL(); >+ String sourceURL = codeBlock()->ownerExecutable()->sourceURL(); > if (!sourceURL.isEmpty()) > traceLine = sourceURL.impl(); > break; >@@ -358,7 +358,7 @@ String StackVisitor::Frame::toString() const > intptr_t StackVisitor::Frame::sourceID() > { > if (CodeBlock* codeBlock = this->codeBlock()) >- return codeBlock->ownerScriptExecutable()->sourceID(); >+ return codeBlock->ownerExecutable()->sourceID(); > return noSourceID; > } > >@@ -403,10 +403,10 @@ void StackVisitor::Frame::computeLineAndColumn(unsigned& line, unsigned& column) > unsigned divotColumn = 0; > retrieveExpressionInfo(divot, unusedStartOffset, unusedEndOffset, divotLine, divotColumn); > >- line = divotLine + codeBlock->ownerScriptExecutable()->firstLine(); >+ line = divotLine + codeBlock->ownerExecutable()->firstLine(); > column = divotColumn + (divotLine ? 1 : codeBlock->firstLineColumnOffset()); > >- if (Optional<int> overrideLineNumber = codeBlock->ownerScriptExecutable()->overrideLineNumber(*codeBlock->vm())) >+ if (Optional<int> overrideLineNumber = codeBlock->ownerExecutable()->overrideLineNumber(*codeBlock->vm())) > line = overrideLineNumber.value(); > } > >diff --git a/Source/JavaScriptCore/interpreter/StackVisitor.h b/Source/JavaScriptCore/interpreter/StackVisitor.h >index fa45a3939270a4596c6addf3b9b7d93527d386c8..7b0031410237ec90ec92ddfd863aaf588278047a 100644 >--- a/Source/JavaScriptCore/interpreter/StackVisitor.h >+++ b/Source/JavaScriptCore/interpreter/StackVisitor.h >@@ -94,7 +94,7 @@ class StackVisitor { > bool hasLineAndColumnInfo() const; > JS_EXPORT_PRIVATE void computeLineAndColumn(unsigned& line, unsigned& column) const; > >- RegisterAtOffsetList* calleeSaveRegisters(); >+ const RegisterAtOffsetList* calleeSaveRegisters(); > > ClonedArguments* createArguments(); > CallFrame* callFrame() const { return m_callFrame; } >diff --git a/Source/JavaScriptCore/jit/AssemblyHelpers.h b/Source/JavaScriptCore/jit/AssemblyHelpers.h >index 4b90f3aacbd22198cf33bd64d7e8ac82322e5423..16e36204b9ce22780780d859b80dde55a23f5be3 100644 >--- a/Source/JavaScriptCore/jit/AssemblyHelpers.h >+++ b/Source/JavaScriptCore/jit/AssemblyHelpers.h >@@ -261,7 +261,7 @@ class AssemblyHelpers : public MacroAssembler { > { > ASSERT(codeBlock); > >- RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); >+ const RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); > RegisterSet dontSaveRegisters = RegisterSet(RegisterSet::stackRegisters(), RegisterSet::allFPRs()); > unsigned registerCount = calleeSaves->size(); > >@@ -279,7 +279,7 @@ class AssemblyHelpers : public MacroAssembler { > { > ASSERT(codeBlock); > >- RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); >+ const RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); > RegisterSet dontSaveRegisters = RegisterSet(RegisterSet::stackRegisters(), RegisterSet::allFPRs()); > unsigned registerCount = calleeSaves->size(); > >@@ -313,7 +313,7 @@ class AssemblyHelpers : public MacroAssembler { > { > ASSERT(codeBlock); > >- RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); >+ const RegisterAtOffsetList* calleeSaves = codeBlock->calleeSaveRegisters(); > RegisterSet dontRestoreRegisters = RegisterSet(RegisterSet::stackRegisters(), RegisterSet::allFPRs()); > unsigned registerCount = calleeSaves->size(); > >@@ -409,7 +409,7 @@ class AssemblyHelpers : public MacroAssembler { > addPtr(TrustedImm32(EntryFrame::calleeSaveRegistersBufferOffset()), temp1); > > RegisterAtOffsetList* allCalleeSaves = RegisterSet::vmCalleeSaveRegisterOffsets(); >- RegisterAtOffsetList* currentCalleeSaves = codeBlock()->calleeSaveRegisters(); >+ const RegisterAtOffsetList* currentCalleeSaves = codeBlock()->calleeSaveRegisters(); > RegisterSet dontCopyRegisters = RegisterSet::stackRegisters(); > unsigned registerCount = allCalleeSaves->size(); > >diff --git a/Source/JavaScriptCore/jit/CallFrameShuffleData.cpp b/Source/JavaScriptCore/jit/CallFrameShuffleData.cpp >index 567202c15369d82024b7101cabb0ecba02547a3a..68e9c9c9b590bde2f6d59a23b32899bc5a2afae4 100644 >--- a/Source/JavaScriptCore/jit/CallFrameShuffleData.cpp >+++ b/Source/JavaScriptCore/jit/CallFrameShuffleData.cpp >@@ -38,7 +38,7 @@ namespace JSC { > void CallFrameShuffleData::setupCalleeSaveRegisters(CodeBlock* codeBlock) > { > RegisterSet calleeSaveRegisters { RegisterSet::vmCalleeSaveRegisters() }; >- RegisterAtOffsetList* registerSaveLocations = codeBlock->calleeSaveRegisters(); >+ const RegisterAtOffsetList* registerSaveLocations = codeBlock->calleeSaveRegisters(); > > for (size_t i = 0; i < registerSaveLocations->size(); ++i) { > RegisterAtOffset entry { registerSaveLocations->at(i) }; >diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp >index 5d6e07773dcbef5272d57151115a3d4dcfd168a2..da2c2b152a75af381036c6ad7187d7450d345d58 100644 >--- a/Source/JavaScriptCore/jit/JIT.cpp >+++ b/Source/JavaScriptCore/jit/JIT.cpp >@@ -687,7 +687,7 @@ void JIT::compileWithoutLinking(JITCompilationEffort effort) > for (int argument = 0; argument < m_codeBlock->numParameters(); ++argument) { > // If this is a constructor, then we want to put in a dummy profiling site (to > // keep things consistent) but we don't actually want to record the dummy value. >- if (m_codeBlock->m_isConstructor && !argument) >+ if (m_codeBlock->isConstructor() && !argument) > continue; > int offset = CallFrame::argumentOffsetIncludingThis(argument) * static_cast<int>(sizeof(Register)); > #if USE(JSVALUE64) >@@ -748,7 +748,7 @@ void JIT::compileWithoutLinking(JITCompilationEffort effort) > > if (maxFrameExtentForSlowPathCall) > addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister); >- callOperationWithCallFrameRollbackOnException(m_codeBlock->m_isConstructor ? operationConstructArityCheck : operationCallArityCheck); >+ callOperationWithCallFrameRollbackOnException(m_codeBlock->isConstructor() ? operationConstructArityCheck : operationCallArityCheck); > if (maxFrameExtentForSlowPathCall) > addPtr(TrustedImm32(maxFrameExtentForSlowPathCall), stackPointerRegister); > branchTest32(Zero, returnValueGPR).linkTo(beginLabel, this); >diff --git a/Source/JavaScriptCore/jit/JITToDFGDeferredCompilationCallback.cpp b/Source/JavaScriptCore/jit/JITToDFGDeferredCompilationCallback.cpp >index 471af9b287e370543823c9a09d3e56cedf4ee1b5..d9fb76af19d501547221d927ebf32beaa8adc922 100644 >--- a/Source/JavaScriptCore/jit/JITToDFGDeferredCompilationCallback.cpp >+++ b/Source/JavaScriptCore/jit/JITToDFGDeferredCompilationCallback.cpp >@@ -63,7 +63,7 @@ void JITToDFGDeferredCompilationCallback::compilationDidComplete( > dataLog("Optimizing compilation of ", *codeBlock, " result: ", result, "\n"); > > if (result == CompilationSuccessful) >- codeBlock->ownerScriptExecutable()->installCode(codeBlock); >+ codeBlock->ownerExecutable()->installCode(codeBlock); > > codeBlock->alternative()->setOptimizationThresholdBasedOnCompilationResult(result); > >diff --git a/Source/JavaScriptCore/jit/JITWorklist.cpp b/Source/JavaScriptCore/jit/JITWorklist.cpp >index bb2114c8e03894c07f59a07124fd5ff8ed7b699f..4c6ef4fb5780a5a0738a18208839a5cba0913642 100644 >--- a/Source/JavaScriptCore/jit/JITWorklist.cpp >+++ b/Source/JavaScriptCore/jit/JITWorklist.cpp >@@ -65,7 +65,7 @@ class JITWorklist::Plan : public ThreadSafeRefCounted<JITWorklist::Plan> { > case CompilationSuccessful: > if (Options::verboseOSR()) > dataLogF(" JIT compilation successful.\n"); >- m_codeBlock->ownerScriptExecutable()->installCode(m_codeBlock); >+ m_codeBlock->ownerExecutable()->installCode(m_codeBlock); > m_codeBlock->jitSoon(); > return; > default: >@@ -309,7 +309,7 @@ void JITWorklist::compileNow(CodeBlock* codeBlock, unsigned loopOSREntryBytecode > > // OK, just compile it. > JIT::compile(vm, codeBlock, JITCompilationMustSucceed, loopOSREntryBytecodeOffset); >- codeBlock->ownerScriptExecutable()->installCode(codeBlock); >+ codeBlock->ownerExecutable()->installCode(codeBlock); > } > > void JITWorklist::finalizePlans(Plans& myPlans) >diff --git a/Source/JavaScriptCore/jit/RegisterAtOffsetList.cpp b/Source/JavaScriptCore/jit/RegisterAtOffsetList.cpp >index 49252fc2300b7f2b3d86f53b8ee8c47ea7075238..eb1f28378c3ce5436c5c97ed8da24c066a5756d7 100644 >--- a/Source/JavaScriptCore/jit/RegisterAtOffsetList.cpp >+++ b/Source/JavaScriptCore/jit/RegisterAtOffsetList.cpp >@@ -66,6 +66,16 @@ unsigned RegisterAtOffsetList::indexOf(Reg reg) const > return UINT_MAX; > } > >+const RegisterAtOffsetList& RegisterAtOffsetList::llintBaselineCalleeSaveRegisters() >+{ >+ static std::once_flag onceKey; >+ static LazyNeverDestroyed<RegisterAtOffsetList> result; >+ std::call_once(onceKey, [] { >+ result.construct(RegisterSet::llintBaselineCalleeSaveRegisters()); >+ }); >+ return result.get(); >+} >+ > } // namespace JSC > > #endif // ENABLE(ASSEMBLER) >diff --git a/Source/JavaScriptCore/jit/RegisterAtOffsetList.h b/Source/JavaScriptCore/jit/RegisterAtOffsetList.h >index 5e3a3cb2ce0293411957f6899339d677f4a9f455..173cf949866cc0961c40574f2c2f999d4e4dd610 100644 >--- a/Source/JavaScriptCore/jit/RegisterAtOffsetList.h >+++ b/Source/JavaScriptCore/jit/RegisterAtOffsetList.h >@@ -52,6 +52,11 @@ class RegisterAtOffsetList { > return m_registers.size(); > } > >+ const RegisterAtOffset& at(size_t index) const >+ { >+ return m_registers.at(index); >+ } >+ > RegisterAtOffset& at(size_t index) > { > return m_registers.at(index); >@@ -63,6 +68,8 @@ class RegisterAtOffsetList { > Vector<RegisterAtOffset>::const_iterator begin() const { return m_registers.begin(); } > Vector<RegisterAtOffset>::const_iterator end() const { return m_registers.end(); } > >+ static const RegisterAtOffsetList& llintBaselineCalleeSaveRegisters(); // Registers and Offsets saved and used by the LLInt. >+ > private: > Vector<RegisterAtOffset> m_registers; > }; >diff --git a/Source/JavaScriptCore/runtime/ErrorInstance.cpp b/Source/JavaScriptCore/runtime/ErrorInstance.cpp >index 76faae8a3d00c4a4474a724be1e7f837f2cc5210..50ca997b23223ee461958b9dd86820bb5ab946ba 100644 >--- a/Source/JavaScriptCore/runtime/ErrorInstance.cpp >+++ b/Source/JavaScriptCore/runtime/ErrorInstance.cpp >@@ -76,7 +76,7 @@ static void appendSourceToError(CallFrame* callFrame, ErrorInstance* exception, > int expressionStart = divotPoint - startOffset; > int expressionStop = divotPoint + endOffset; > >- StringView sourceString = codeBlock->source()->source(); >+ StringView sourceString = codeBlock->source().provider()->source(); > if (!expressionStop || expressionStart > static_cast<int>(sourceString.length())) > return; > >@@ -87,7 +87,7 @@ static void appendSourceToError(CallFrame* callFrame, ErrorInstance* exception, > > String message = asString(jsMessage)->value(callFrame); > if (expressionStart < expressionStop) >- message = appender(message, codeBlock->source()->getRange(expressionStart, expressionStop).toString(), type, ErrorInstance::FoundExactSource); >+ message = appender(message, codeBlock->source().provider()->getRange(expressionStart, expressionStop).toString(), type, ErrorInstance::FoundExactSource); > else { > // No range information, so give a few characters of context. > int dataLength = sourceString.length(); >@@ -103,7 +103,7 @@ static void appendSourceToError(CallFrame* callFrame, ErrorInstance* exception, > stop++; > while (stop > expressionStart && isStrWhiteSpace(sourceString[stop - 1])) > stop--; >- message = appender(message, codeBlock->source()->getRange(start, stop).toString(), type, ErrorInstance::FoundApproximateSource); >+ message = appender(message, codeBlock->source().provider()->getRange(start, stop).toString(), type, ErrorInstance::FoundApproximateSource); > } > exception->putDirect(*vm, vm->propertyNames->message, jsString(vm, message)); > >diff --git a/Source/JavaScriptCore/runtime/ScriptExecutable.cpp b/Source/JavaScriptCore/runtime/ScriptExecutable.cpp >index b882b98afb0548d7bc29e4beb5964fa01a8084ea..115b178ce2bcf3ff5938207a0faf3c57d517b8b1 100644 >--- a/Source/JavaScriptCore/runtime/ScriptExecutable.cpp >+++ b/Source/JavaScriptCore/runtime/ScriptExecutable.cpp >@@ -269,8 +269,7 @@ CodeBlock* ScriptExecutable::newCodeBlockFor( > RELEASE_ASSERT(!executable->m_evalCodeBlock); > RELEASE_ASSERT(!function); > auto codeBlock = EvalCodeBlock::create(vm, >- executable, executable->m_unlinkedEvalCodeBlock.get(), scope, >- executable->source().provider()); >+ executable, executable->m_unlinkedEvalCodeBlock.get(), scope); > EXCEPTION_ASSERT(throwScope.exception() || codeBlock); > if (!codeBlock) { > exception = throwException( >@@ -287,8 +286,7 @@ CodeBlock* ScriptExecutable::newCodeBlockFor( > RELEASE_ASSERT(!executable->m_programCodeBlock); > RELEASE_ASSERT(!function); > auto codeBlock = ProgramCodeBlock::create(vm, >- executable, executable->m_unlinkedProgramCodeBlock.get(), scope, >- executable->source().provider(), startColumn()); >+ executable, executable->m_unlinkedProgramCodeBlock.get(), scope); > EXCEPTION_ASSERT(throwScope.exception() || codeBlock); > if (!codeBlock) { > exception = throwException( >@@ -305,8 +303,7 @@ CodeBlock* ScriptExecutable::newCodeBlockFor( > RELEASE_ASSERT(!executable->m_moduleProgramCodeBlock); > RELEASE_ASSERT(!function); > auto codeBlock = ModuleProgramCodeBlock::create(vm, >- executable, executable->m_unlinkedModuleProgramCodeBlock.get(), scope, >- executable->source().provider(), startColumn()); >+ executable, executable->m_unlinkedModuleProgramCodeBlock.get(), scope); > EXCEPTION_ASSERT(throwScope.exception() || codeBlock); > if (!codeBlock) { > exception = throwException( >@@ -338,8 +335,7 @@ CodeBlock* ScriptExecutable::newCodeBlockFor( > return nullptr; > } > >- RELEASE_AND_RETURN(throwScope, FunctionCodeBlock::create(vm, executable, unlinkedCodeBlock, scope, >- source().provider(), source().startOffset(), startColumn())); >+ RELEASE_AND_RETURN(throwScope, FunctionCodeBlock::create(vm, executable, unlinkedCodeBlock, scope)); > } > > CodeBlock* ScriptExecutable::newReplacementCodeBlockFor( >diff --git a/Source/JavaScriptCore/runtime/StackFrame.cpp b/Source/JavaScriptCore/runtime/StackFrame.cpp >index dd29f2a98f6133962da1e6e06d49f1822fdced5d..94b7dc48f89557e547b7e14456da7fb62ccf4f89 100644 >--- a/Source/JavaScriptCore/runtime/StackFrame.cpp >+++ b/Source/JavaScriptCore/runtime/StackFrame.cpp >@@ -55,7 +55,7 @@ intptr_t StackFrame::sourceID() const > { > if (!m_codeBlock) > return noSourceID; >- return m_codeBlock->ownerScriptExecutable()->sourceID(); >+ return m_codeBlock->ownerExecutable()->sourceID(); > } > > String StackFrame::sourceURL() const >@@ -67,7 +67,7 @@ String StackFrame::sourceURL() const > return "[native code]"_s; > } > >- String sourceURL = m_codeBlock->ownerScriptExecutable()->sourceURL(); >+ String sourceURL = m_codeBlock->ownerExecutable()->sourceURL(); > if (!sourceURL.isNull()) > return sourceURL; > return emptyString(); >@@ -113,7 +113,7 @@ void StackFrame::computeLineAndColumn(unsigned& line, unsigned& column) const > int unusedEndOffset = 0; > m_codeBlock->expressionRangeForBytecodeOffset(m_bytecodeOffset, divot, unusedStartOffset, unusedEndOffset, line, column); > >- ScriptExecutable* executable = m_codeBlock->ownerScriptExecutable(); >+ ScriptExecutable* executable = m_codeBlock->ownerExecutable(); > if (Optional<int> overrideLineNumber = executable->overrideLineNumber(*m_codeBlock->vm())) > line = overrideLineNumber.value(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194419
:
361469
|
361477
|
361482