Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JSC] DFG should be able to compile-and-inline op_call_eval
https://bugs.webkit.org/show_bug.cgi?id=245043 Reviewed by Alexey Shvayka. We found that DFG capability check is consuming some time in Speedometer2.1. And this is wasteful since op_call_eval is the only bytecode which cannot be included in the inlined function in DFG. We originally had many bytecodes which cannot be compiled or inlined in DFG, and we continuously removed them. And this op_call_eval is the last one. In this patch, we make op_call_eval available in the inlined DFG function and we remove DFG capability level check function since any new bytecode must be supported in DFG from the beginning. op_call_eval was not inlinable before since it is relying on thisValue, caller CodeBlock, and scope value in the stack. But this is achieved by a hack. We should simplify it and support op_call_eval even in the inlined function. In this patch, 1. op_call_eval should have thisValue and scope VirtualRegister in the bytecode. And it should get them through that instead of getting them from CodeBlock implicitly. It also simplifies UseDef definition for op_call_eval. 2. DFG should get thisValue / scope in a normal way in CallEval instead of getting them from the stack. This removes a lot of Flush this / scope hacks in DFG. Since we no longer relying on stack's value with DFG's top-level CodeBlock, we can inline functions having op_call_eval. 3. Because of (2), DFG capability level check can always say CanCompileAndInline. We remove this costly checks. 4. We always use baseline CodeBlocks' DirectEvalCodeCache now, so we can hit the eval code cache more frequently. * Source/JavaScriptCore/bytecode/BytecodeList.rb: * Source/JavaScriptCore/bytecode/BytecodeUseDef.cpp: (JSC::computeUsesForBytecodeIndexImpl): * Source/JavaScriptCore/bytecode/BytecodeUseDef.h: (JSC::computeUsesForBytecodeIndex): * Source/JavaScriptCore/bytecode/DirectEvalCodeCache.cpp: (JSC::DirectEvalCodeCache::setSlow): * Source/JavaScriptCore/bytecode/DirectEvalCodeCache.h: (JSC::DirectEvalCodeCache::CacheKey::CacheKey): (JSC::DirectEvalCodeCache::CacheKey::hash const): (JSC::DirectEvalCodeCache::CacheKey::operator== const): (JSC::DirectEvalCodeCache::tryGet): (JSC::DirectEvalCodeCache::set): * Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitCall): * Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::setArgument): (JSC::DFG::ByteCodeParser::addCallWithoutSettingResult): (JSC::DFG::ByteCodeParser::addCall): (JSC::DFG::ByteCodeParser::parseBlock): * Source/JavaScriptCore/dfg/DFGCapabilities.cpp: (JSC::DFG::capabilityLevel): Deleted. * Source/JavaScriptCore/dfg/DFGCapabilities.h: (JSC::DFG::canUseOSRExitFuzzing): (JSC::DFG::evalCapabilityLevel): (JSC::DFG::programCapabilityLevel): (JSC::DFG::functionForCallCapabilityLevel): (JSC::DFG::functionForConstructCapabilityLevel): (JSC::DFG::inlineFunctionForCallCapabilityLevel): (JSC::DFG::inlineFunctionForClosureCallCapabilityLevel): (JSC::DFG::inlineFunctionForConstructCapabilityLevel): (JSC::DFG::capabilityLevel): Deleted. * Source/JavaScriptCore/dfg/DFGClobberize.h: (JSC::DFG::clobberize): * Source/JavaScriptCore/dfg/DFGGraph.h: * Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::emitCall): * Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::emitCall): * Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq): * Source/JavaScriptCore/interpreter/Interpreter.cpp: (JSC::eval): * Source/JavaScriptCore/interpreter/Interpreter.h: * Source/JavaScriptCore/jit/BaselineJITRegisters.h: * Source/JavaScriptCore/jit/JITCall.cpp: (JSC::JIT::compileCallEval): * Source/JavaScriptCore/jit/JITOperations.cpp: (JSC::JSC_DEFINE_JIT_OPERATION): * Source/JavaScriptCore/jit/JITOperations.h: * Source/JavaScriptCore/llint/LLIntSlowPaths.cpp: (JSC::LLInt::commonCallEval): Canonical link: https://commits.webkit.org/254367@main
- Loading branch information
1 parent
d4d2f95
commit fd6ff6b
Showing
50 changed files
with
259 additions
and
509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.