WebKit Bugzilla
Attachment 368623 Details for
Bug 197304
: CodeBlock::m_instructionCount is wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
b-backup.diff (text/plain), 24.64 KB, created by
Saam Barati
on 2019-04-30 16:12:07 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Saam Barati
Created:
2019-04-30 16:12:07 PDT
Size:
24.64 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 244808) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,72 @@ >+2019-04-30 Saam barati <sbarati@apple.com> >+ >+ CodeBlock::m_instructionCount is wrong >+ https://bugs.webkit.org/show_bug.cgi?id=197304 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ What we were calling instructionCount() was wrong, as evidenced by >+ us using it incorrectly both in the sampling profiler and when we >+ dumped bytecode for a given CodeBlock. Prior to the bytecode rewrite, >+ instructionCount() was probably valid to do bounds checks against. >+ However, this is no longer the case. This patch renames what we called >+ instructionCount() to bytecodeCost(). It is now only used to make decisions >+ about inlining and tier up heuristics. I've also named options related to >+ this appropriately. >+ >+ This patch also introduces instructionsSize(). The result of this method >+ is valid to do bounds checks against. >+ >+ * bytecode/CodeBlock.cpp: >+ (JSC::CodeBlock::dumpAssumingJITType const): >+ (JSC::CodeBlock::CodeBlock): >+ (JSC::CodeBlock::finishCreation): >+ (JSC::CodeBlock::optimizationThresholdScalingFactor): >+ (JSC::CodeBlock::predictedMachineCodeSize): >+ * bytecode/CodeBlock.h: >+ (JSC::CodeBlock::instructionsSize const): >+ (JSC::CodeBlock::bytecodeCost const): >+ (JSC::CodeBlock::instructionCount const): Deleted. >+ * dfg/DFGByteCodeParser.cpp: >+ (JSC::DFG::ByteCodeParser::inliningCost): >+ (JSC::DFG::ByteCodeParser::getInliningBalance): >+ * dfg/DFGCapabilities.cpp: >+ (JSC::DFG::mightCompileEval): >+ (JSC::DFG::mightCompileProgram): >+ (JSC::DFG::mightCompileFunctionForCall): >+ (JSC::DFG::mightCompileFunctionForConstruct): >+ (JSC::DFG::mightInlineFunctionForCall): >+ (JSC::DFG::mightInlineFunctionForClosureCall): >+ (JSC::DFG::mightInlineFunctionForConstruct): >+ * dfg/DFGCapabilities.h: >+ (JSC::DFG::isSmallEnoughToInlineCodeInto): >+ * dfg/DFGDisassembler.cpp: >+ (JSC::DFG::Disassembler::dumpHeader): >+ * dfg/DFGDriver.cpp: >+ (JSC::DFG::compileImpl): >+ * dfg/DFGPlan.cpp: >+ (JSC::DFG::Plan::compileInThread): >+ * dfg/DFGTierUpCheckInjectionPhase.cpp: >+ (JSC::DFG::TierUpCheckInjectionPhase::run): >+ * ftl/FTLCapabilities.cpp: >+ (JSC::FTL::canCompile): >+ * ftl/FTLCompile.cpp: >+ (JSC::FTL::compile): >+ * ftl/FTLLink.cpp: >+ (JSC::FTL::link): >+ * jit/JIT.cpp: >+ (JSC::JIT::link): >+ * jit/JITDisassembler.cpp: >+ (JSC::JITDisassembler::dumpHeader): >+ * llint/LLIntSlowPaths.cpp: >+ (JSC::LLInt::shouldJIT): >+ * profiler/ProfilerBytecodes.cpp: >+ (JSC::Profiler::Bytecodes::Bytecodes): >+ * runtime/Options.h: >+ * runtime/SamplingProfiler.cpp: >+ (JSC::tryGetBytecodeIndex): >+ (JSC::SamplingProfiler::processUnverifiedStackTraces): >+ > 2019-04-30 Tadeu Zagallo <tzagallo@apple.com> > > TypeArrays should not store properties that are canonical numeric indices >Index: Source/JavaScriptCore/bytecode/CodeBlock.cpp >=================================================================== >--- Source/JavaScriptCore/bytecode/CodeBlock.cpp (revision 244785) >+++ Source/JavaScriptCore/bytecode/CodeBlock.cpp (working copy) >@@ -190,7 +190,7 @@ void CodeBlock::dumpAssumingJITType(Prin > > if (codeType() == FunctionCode) > out.print(specializationKind()); >- out.print(", ", instructionCount()); >+ out.print(", ", instructionsSize()); > if (this->jitType() == JITType::BaselineJIT && m_shouldAlwaysBeInlined) > out.print(" (ShouldAlwaysBeInlined)"); > if (ownerExecutable()->neverInline()) >@@ -298,7 +298,7 @@ CodeBlock::CodeBlock(VM* vm, Structure* > , m_hasDebuggerStatement(false) > , m_steppingMode(SteppingModeDisabled) > , m_numBreakpoints(0) >- , m_instructionCount(other.m_instructionCount) >+ , m_bytecodeCost(other.m_bytecodeCost) > , m_scopeRegister(other.m_scopeRegister) > , m_hash(other.m_hash) > , m_unlinkedCode(*other.vm(), this, other.m_unlinkedCode.get()) >@@ -524,7 +524,7 @@ bool CodeBlock::finishCreation(VM& vm, S > const InstructionStream& instructionStream = instructions(); > for (const auto& instruction : instructionStream) { > OpcodeID opcodeID = instruction->opcodeID(); >- m_instructionCount += opcodeLengths[opcodeID]; >+ m_bytecodeCost += opcodeLengths[opcodeID]; > switch (opcodeID) { > LINK(OpHasIndexedProperty, arrayProfile) > >@@ -2335,17 +2335,17 @@ double CodeBlock::optimizationThresholdS > const double c = 0.0; > const double d = 0.825914; > >- double instructionCount = this->instructionCount(); >+ double bytecodeCost = this->bytecodeCost(); > >- ASSERT(instructionCount); // Make sure this is called only after we have an instruction stream; otherwise it'll just return the value of d, which makes no sense. >+ ASSERT(bytecodeCost); // Make sure this is called only after we have an instruction stream; otherwise it'll just return the value of d, which makes no sense. > >- double result = d + a * sqrt(instructionCount + b) + c * instructionCount; >+ double result = d + a * sqrt(bytecodeCost + b) + c * bytecodeCost; > > result *= codeTypeThresholdMultiplier(); > > if (Options::verboseOSR()) { > dataLog( >- *this, ": instruction count is ", instructionCount, >+ *this, ": bytecode cost is ", bytecodeCost, > ", scaling execution counter by ", result, " * ", codeTypeThresholdMultiplier(), > "\n"); > } >@@ -2870,7 +2870,7 @@ size_t CodeBlock::predictedMachineCodeSi > if (multiplier < 0 || multiplier > 1000) > return 0; > >- double doubleResult = multiplier * instructionCount(); >+ double doubleResult = multiplier * bytecodeCost(); > > // Be even more paranoid: silently reject values that won't fit into a size_t. If > // the function is so huge that we can't even fit it into virtual memory then we >Index: Source/JavaScriptCore/bytecode/CodeBlock.h >=================================================================== >--- Source/JavaScriptCore/bytecode/CodeBlock.h (revision 244785) >+++ Source/JavaScriptCore/bytecode/CodeBlock.h (working copy) >@@ -384,7 +384,8 @@ public: > > size_t predictedMachineCodeSize(); > >- unsigned instructionCount() const { return m_instructionCount; } >+ unsigned instructionsSize() const { return instructions().size(); } >+ unsigned bytecodeCost() const { return m_bytecodeCost; } > > // Exactly equivalent to codeBlock->ownerExecutable()->newReplacementCodeBlockFor(codeBlock->specializationKind()) > CodeBlock* newReplacement(); >@@ -963,7 +964,7 @@ private: > unsigned m_numBreakpoints : 30; > }; > }; >- unsigned m_instructionCount { 0 }; >+ unsigned m_bytecodeCost { 0 }; > VirtualRegister m_scopeRegister; > mutable CodeBlockHash m_hash; > >Index: Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (revision 244785) >+++ Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (working copy) >@@ -1559,7 +1559,7 @@ unsigned ByteCodeParser::inliningCost(Ca > VERBOSE_LOG(" Inlining should be possible.\n"); > > // It might be possible to inline. >- return codeBlock->instructionCount(); >+ return codeBlock->bytecodeCost(); > } > > template<typename ChecksFunctor> >@@ -1904,11 +1904,11 @@ bool ByteCodeParser::handleVarargsInlini > > unsigned ByteCodeParser::getInliningBalance(const CallLinkStatus& callLinkStatus, CodeSpecializationKind specializationKind) > { >- unsigned inliningBalance = Options::maximumFunctionForCallInlineCandidateInstructionCount(); >+ unsigned inliningBalance = Options::maximumFunctionForCallInlineCandidateBytecodeCost(); > if (specializationKind == CodeForConstruct) >- inliningBalance = std::min(inliningBalance, Options::maximumFunctionForConstructInlineCandidateInstructionCount()); >+ inliningBalance = std::min(inliningBalance, Options::maximumFunctionForConstructInlineCandidateBytecoodeCost()); > if (callLinkStatus.isClosureCall()) >- inliningBalance = std::min(inliningBalance, Options::maximumFunctionForClosureCallInlineCandidateInstructionCount()); >+ inliningBalance = std::min(inliningBalance, Options::maximumFunctionForClosureCallInlineCandidateBytecodeCost()); > return inliningBalance; > } > >Index: Source/JavaScriptCore/dfg/DFGCapabilities.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGCapabilities.cpp (revision 244785) >+++ Source/JavaScriptCore/dfg/DFGCapabilities.cpp (working copy) >@@ -49,41 +49,41 @@ bool isSupportedForInlining(CodeBlock* c > bool mightCompileEval(CodeBlock* codeBlock) > { > return isSupported() >- && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount() >+ && codeBlock->bytecodeCost() <= Options::maximumOptimizationCandidateBytecodeCost() > && codeBlock->ownerExecutable()->isOkToOptimize(); > } > bool mightCompileProgram(CodeBlock* codeBlock) > { > return isSupported() >- && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount() >+ && codeBlock->bytecodeCost() <= Options::maximumOptimizationCandidateBytecodeCost() > && codeBlock->ownerExecutable()->isOkToOptimize(); > } > bool mightCompileFunctionForCall(CodeBlock* codeBlock) > { > return isSupported() >- && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount() >+ && codeBlock->bytecodeCost() <= Options::maximumOptimizationCandidateBytecodeCost() > && codeBlock->ownerExecutable()->isOkToOptimize(); > } > bool mightCompileFunctionForConstruct(CodeBlock* codeBlock) > { > return isSupported() >- && codeBlock->instructionCount() <= Options::maximumOptimizationCandidateInstructionCount() >+ && codeBlock->bytecodeCost() <= Options::maximumOptimizationCandidateBytecodeCost() > && codeBlock->ownerExecutable()->isOkToOptimize(); > } > > bool mightInlineFunctionForCall(CodeBlock* codeBlock) > { >- return codeBlock->instructionCount() <= Options::maximumFunctionForCallInlineCandidateInstructionCount() >+ return codeBlock->bytecodeCost() <= Options::maximumFunctionForCallInlineCandidateBytecodeCost() > && isSupportedForInlining(codeBlock); > } > bool mightInlineFunctionForClosureCall(CodeBlock* codeBlock) > { >- return codeBlock->instructionCount() <= Options::maximumFunctionForClosureCallInlineCandidateInstructionCount() >+ return codeBlock->bytecodeCost() <= Options::maximumFunctionForClosureCallInlineCandidateBytecodeCost() > && isSupportedForInlining(codeBlock); > } > bool mightInlineFunctionForConstruct(CodeBlock* codeBlock) > { >- return codeBlock->instructionCount() <= Options::maximumFunctionForConstructInlineCandidateInstructionCount() >+ return codeBlock->bytecodeCost() <= Options::maximumFunctionForConstructInlineCandidateBytecoodeCost() > && isSupportedForInlining(codeBlock); > } > bool canUseOSRExitFuzzing(CodeBlock* codeBlock) >Index: Source/JavaScriptCore/dfg/DFGCapabilities.h >=================================================================== >--- Source/JavaScriptCore/dfg/DFGCapabilities.h (revision 244785) >+++ Source/JavaScriptCore/dfg/DFGCapabilities.h (working copy) >@@ -166,7 +166,7 @@ inline CapabilityLevel inlineFunctionFor > > inline bool isSmallEnoughToInlineCodeInto(CodeBlock* codeBlock) > { >- return codeBlock->instructionCount() <= Options::maximumInliningCallerSize(); >+ return codeBlock->bytecodeCost() <= Options::maximumInliningCallerBytecodeCost(); > } > > } } // namespace JSC::DFG >Index: Source/JavaScriptCore/dfg/DFGDisassembler.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGDisassembler.cpp (revision 244785) >+++ Source/JavaScriptCore/dfg/DFGDisassembler.cpp (working copy) >@@ -74,7 +74,7 @@ void Disassembler::reportToProfiler(Prof > > void Disassembler::dumpHeader(PrintStream& out, LinkBuffer& linkBuffer) > { >- out.print("Generated DFG JIT code for ", CodeBlockWithJITType(m_graph.m_codeBlock, JITType::DFGJIT), ", instruction count = ", m_graph.m_codeBlock->instructionCount(), ":\n"); >+ out.print("Generated DFG JIT code for ", CodeBlockWithJITType(m_graph.m_codeBlock, JITType::DFGJIT), ", instruction count = ", m_graph.m_codeBlock->instructionsSize(), ":\n"); > out.print(" Optimized with execution counter = ", m_graph.m_profiledBlock->jitExecuteCounter(), "\n"); > out.print(" Code at [", RawPointer(linkBuffer.debugAddress()), ", ", RawPointer(static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.size()), "):\n"); > } >Index: Source/JavaScriptCore/dfg/DFGDriver.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGDriver.cpp (revision 244785) >+++ Source/JavaScriptCore/dfg/DFGDriver.cpp (working copy) >@@ -73,7 +73,7 @@ static CompilationResult compileImpl( > unsigned osrEntryBytecodeIndex, const Operands<Optional<JSValue>>& mustHandleValues, > Ref<DeferredCompilationCallback>&& callback) > { >- if (!Options::bytecodeRangeToDFGCompile().isInRange(codeBlock->instructionCount()) >+ if (!Options::bytecodeRangeToDFGCompile().isInRange(codeBlock->instructionsSize()) > || !ensureGlobalDFGWhitelist().contains(codeBlock)) > return CompilationFailed; > >@@ -85,7 +85,7 @@ static CompilationResult compileImpl( > ASSERT(!profiledDFGCodeBlock || profiledDFGCodeBlock->jitType() == JITType::DFGJIT); > > if (logCompilationChanges(mode)) >- dataLog("DFG(Driver) compiling ", *codeBlock, " with ", mode, ", number of instructions = ", codeBlock->instructionCount(), "\n"); >+ dataLog("DFG(Driver) compiling ", *codeBlock, " with ", mode, ", number of instructions = ", codeBlock->instructionsSize(), "\n"); > > // Make sure that any stubs that the DFG is going to use are initialized. We want to > // make sure that all JIT code generation does finalization on the main thread. >Index: Source/JavaScriptCore/dfg/DFGPlan.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGPlan.cpp (revision 244785) >+++ Source/JavaScriptCore/dfg/DFGPlan.cpp (working copy) >@@ -184,7 +184,7 @@ void Plan::compileInThread(ThreadData* t > CompilationScope compilationScope; > > if (logCompilationChanges(m_mode) || Options::logPhaseTimes()) >- dataLog("DFG(Plan) compiling ", *m_codeBlock, " with ", m_mode, ", number of instructions = ", m_codeBlock->instructionCount(), "\n"); >+ dataLog("DFG(Plan) compiling ", *m_codeBlock, " with ", m_mode, ", number of instructions = ", m_codeBlock->instructionsSize(), "\n"); > > CompilationPath path = compileInThreadImpl(); > >Index: Source/JavaScriptCore/dfg/DFGTierUpCheckInjectionPhase.cpp >=================================================================== >--- Source/JavaScriptCore/dfg/DFGTierUpCheckInjectionPhase.cpp (revision 244785) >+++ Source/JavaScriptCore/dfg/DFGTierUpCheckInjectionPhase.cpp (working copy) >@@ -69,7 +69,7 @@ public: > if (m_graph.m_profiledBlock->m_didFailFTLCompilation) > return false; > >- if (!Options::bytecodeRangeToFTLCompile().isInRange(m_graph.m_profiledBlock->instructionCount())) >+ if (!Options::bytecodeRangeToFTLCompile().isInRange(m_graph.m_profiledBlock->instructionsSize())) > return false; > > if (!ensureGlobalFTLWhitelist().contains(m_graph.m_profiledBlock)) >Index: Source/JavaScriptCore/ftl/FTLCapabilities.cpp >=================================================================== >--- Source/JavaScriptCore/ftl/FTLCapabilities.cpp (revision 244785) >+++ Source/JavaScriptCore/ftl/FTLCapabilities.cpp (working copy) >@@ -401,7 +401,7 @@ inline CapabilityLevel canCompile(Node* > > CapabilityLevel canCompile(Graph& graph) > { >- if (graph.m_codeBlock->instructionCount() > Options::maximumFTLCandidateInstructionCount()) { >+ if (graph.m_codeBlock->bytecodeCost() > Options::maximumFTLCandidateBytecodeCost()) { > if (verboseCapabilities()) > dataLog("FTL rejecting ", *graph.m_codeBlock, " because it's too big.\n"); > return CannotCompile; >Index: Source/JavaScriptCore/ftl/FTLCompile.cpp >=================================================================== >--- Source/JavaScriptCore/ftl/FTLCompile.cpp (revision 244785) >+++ Source/JavaScriptCore/ftl/FTLCompile.cpp (working copy) >@@ -168,7 +168,7 @@ void compile(State& state, Safepoint::Re > if (B3::Air::Disassembler* disassembler = state.proc->code().disassembler()) { > PrintStream& out = WTF::dataFile(); > >- out.print("Generated ", state.graph.m_plan.mode(), " code for ", CodeBlockWithJITType(state.graph.m_codeBlock, JITType::FTLJIT), ", instruction count = ", state.graph.m_codeBlock->instructionCount(), ":\n"); >+ out.print("Generated ", state.graph.m_plan.mode(), " code for ", CodeBlockWithJITType(state.graph.m_codeBlock, JITType::FTLJIT), ", instruction count = ", state.graph.m_codeBlock->instructionsSize(), ":\n"); > > LinkBuffer& linkBuffer = *state.finalizer->b3CodeLinkBuffer; > B3::Value* currentB3Value = nullptr; >Index: Source/JavaScriptCore/ftl/FTLLink.cpp >=================================================================== >--- Source/JavaScriptCore/ftl/FTLLink.cpp (revision 244785) >+++ Source/JavaScriptCore/ftl/FTLLink.cpp (working copy) >@@ -71,7 +71,7 @@ void link(State& state) > if (UNLIKELY(compilation)) { > compilation->addDescription( > Profiler::OriginStack(), >- toCString("Generated FTL JIT code for ", CodeBlockWithJITType(codeBlock, JITType::FTLJIT), ", instruction count = ", graph.m_codeBlock->instructionCount(), ":\n")); >+ toCString("Generated FTL JIT code for ", CodeBlockWithJITType(codeBlock, JITType::FTLJIT), ", instruction count = ", graph.m_codeBlock->instructionsSize(), ":\n")); > > graph.ensureSSADominators(); > graph.ensureSSANaturalLoops(); >Index: Source/JavaScriptCore/jit/JIT.cpp >=================================================================== >--- Source/JavaScriptCore/jit/JIT.cpp (revision 244785) >+++ Source/JavaScriptCore/jit/JIT.cpp (working copy) >@@ -907,7 +907,7 @@ CompilationResult JIT::link() > > m_vm->machineCodeBytesPerBytecodeWordForBaselineJIT->add( > static_cast<double>(result.size()) / >- static_cast<double>(m_codeBlock->instructionCount())); >+ static_cast<double>(m_codeBlock->bytecodeCost())); > > m_codeBlock->shrinkToFit(CodeBlock::LateShrink); > m_codeBlock->setJITCode( >Index: Source/JavaScriptCore/jit/JITDisassembler.cpp >=================================================================== >--- Source/JavaScriptCore/jit/JITDisassembler.cpp (revision 244785) >+++ Source/JavaScriptCore/jit/JITDisassembler.cpp (working copy) >@@ -89,7 +89,7 @@ void JITDisassembler::reportToProfiler(P > > void JITDisassembler::dumpHeader(PrintStream& out, LinkBuffer& linkBuffer) > { >- out.print("Generated Baseline JIT code for ", CodeBlockWithJITType(m_codeBlock, JITType::BaselineJIT), ", instruction count = ", m_codeBlock->instructionCount(), "\n"); >+ out.print("Generated Baseline JIT code for ", CodeBlockWithJITType(m_codeBlock, JITType::BaselineJIT), ", instruction count = ", m_codeBlock->instructionsSize(), "\n"); > out.print(" Source: ", m_codeBlock->sourceCodeOnOneLine(), "\n"); > out.print(" Code at [", RawPointer(linkBuffer.debugAddress()), ", ", RawPointer(static_cast<char*>(linkBuffer.debugAddress()) + linkBuffer.size()), "):\n"); > } >Index: Source/JavaScriptCore/llint/LLIntSlowPaths.cpp >=================================================================== >--- Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (revision 244785) >+++ Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (working copy) >@@ -357,7 +357,7 @@ static FunctionWhitelist& ensureGlobalJI > > inline bool shouldJIT(CodeBlock* codeBlock) > { >- if (!Options::bytecodeRangeToJITCompile().isInRange(codeBlock->instructionCount()) >+ if (!Options::bytecodeRangeToJITCompile().isInRange(codeBlock->instructionsSize()) > || !ensureGlobalJITWhitelist().contains(codeBlock)) > return false; > >Index: Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp >=================================================================== >--- Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp (revision 244785) >+++ Source/JavaScriptCore/profiler/ProfilerBytecodes.cpp (working copy) >@@ -40,7 +40,7 @@ Bytecodes::Bytecodes(size_t id, CodeBloc > , m_inferredName(codeBlock->inferredName()) > , m_sourceCode(codeBlock->sourceCodeForTools()) > , m_hash(codeBlock->hash()) >- , m_instructionCount(codeBlock->instructionCount()) >+ , m_instructionCount(codeBlock->instructionsSize()) > { > } > >Index: Source/JavaScriptCore/runtime/Options.h >=================================================================== >--- Source/JavaScriptCore/runtime/Options.h (revision 244785) >+++ Source/JavaScriptCore/runtime/Options.h (working copy) >@@ -300,13 +300,13 @@ constexpr bool enableWebAssemblyStreamin > \ > v(bool, breakOnThrow, false, Normal, nullptr) \ > \ >- v(unsigned, maximumOptimizationCandidateInstructionCount, 100000, Normal, nullptr) \ >+ v(unsigned, maximumOptimizationCandidateBytecodeCost, 100000, Normal, nullptr) \ > \ >- v(unsigned, maximumFunctionForCallInlineCandidateInstructionCount, 120, Normal, nullptr) \ >- v(unsigned, maximumFunctionForClosureCallInlineCandidateInstructionCount, 100, Normal, nullptr) \ >- v(unsigned, maximumFunctionForConstructInlineCandidateInstructionCount, 100, Normal, nullptr) \ >+ v(unsigned, maximumFunctionForCallInlineCandidateBytecodeCost, 120, Normal, nullptr) \ >+ v(unsigned, maximumFunctionForClosureCallInlineCandidateBytecodeCost, 100, Normal, nullptr) \ >+ v(unsigned, maximumFunctionForConstructInlineCandidateBytecoodeCost, 100, Normal, nullptr) \ > \ >- v(unsigned, maximumFTLCandidateInstructionCount, 20000, Normal, nullptr) \ >+ v(unsigned, maximumFTLCandidateBytecodeCost, 20000, Normal, nullptr) \ > \ > /* Depth of inline stack, so 1 = no inlining, 2 = one level, etc. */ \ > v(unsigned, maximumInliningDepth, 5, Normal, "maximum allowed inlining depth. Depth of 1 means no inlining") \ >@@ -314,7 +314,7 @@ constexpr bool enableWebAssemblyStreamin > \ > /* Maximum size of a caller for enabling inlining. This is purely to protect us */\ > /* from super long compiles that take a lot of memory. */\ >- v(unsigned, maximumInliningCallerSize, 10000, Normal, nullptr) \ >+ v(unsigned, maximumInliningCallerBytecodeCost, 10000, Normal, nullptr) \ > \ > v(unsigned, maximumVarargsForInlining, 100, Normal, nullptr) \ > \ >@@ -558,6 +558,12 @@ enum OptionEquivalence { > v(enableDollarVM, useDollarVM, SameOption) \ > v(enableWebAssembly, useWebAssembly, SameOption) \ > v(verboseDFGByteCodeParsing, verboseDFGBytecodeParsing, SameOption) \ >+ v(maximumOptimizationCandidateInstructionCount, maximumOptimizationCandidateBytecodeCost, SameOption) \ >+ v(maximumFunctionForCallInlineCandidateInstructionCount, maximumFunctionForCallInlineCandidateBytecodeCost, SameOption) \ >+ v(maximumFunctionForClosureCallInlineCandidateInstructionCount, maximumFunctionForClosureCallInlineCandidateBytecodeCost, SameOption) \ >+ v(maximumFunctionForConstructInlineCandidateInstructionCount, maximumFunctionForConstructInlineCandidateBytecoodeCost, SameOption) \ >+ v(maximumFTLCandidateInstructionCount, maximumFTLCandidateBytecodeCost, SameOption) \ >+ v(maximumInliningCallerSize, maximumInliningCallerBytecodeCost, SameOption) \ > > > class Options { >Index: Source/JavaScriptCore/runtime/SamplingProfiler.cpp >=================================================================== >--- Source/JavaScriptCore/runtime/SamplingProfiler.cpp (revision 244785) >+++ Source/JavaScriptCore/runtime/SamplingProfiler.cpp (working copy) >@@ -434,7 +434,7 @@ static ALWAYS_INLINE unsigned tryGetByte > > #if USE(JSVALUE64) > unsigned bytecodeIndex = llintPC; >- if (bytecodeIndex < codeBlock->instructionCount()) { >+ if (bytecodeIndex < codeBlock->instructionsSize()) { > isValid = true; > return bytecodeIndex; > } >@@ -465,7 +465,7 @@ void SamplingProfiler::processUnverified > stackTrace.timestamp = unprocessedStackTrace.timestamp; > > auto populateCodeLocation = [] (CodeBlock* codeBlock, unsigned bytecodeIndex, StackFrame::CodeLocation& location) { >- if (bytecodeIndex < codeBlock->instructionCount()) { >+ if (bytecodeIndex < codeBlock->instructionsSize()) { > int divot; > int startOffset; > int endOffset;
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
Flags:
ysuzuki
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197304
:
368605
| 368623