Skip to content
  • mhahnenberg@apple.com's avatar
    op_get_callee shouldn't use value profiling · 5f2e70b5
    mhahnenberg@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=121821
    
    Reviewed by Filip Pizlo.
    
    Source/JavaScriptCore: 
    
    Currently it's one of the two opcodes that uses m_singletonValue, which is unnecessary. 
    Our current plan is to remove m_singletonValue so that GenGC can have a simpler story 
    for handling CodeBlocks/FunctionExecutables during nursery collections.
    
    Instead of using a ValueProfile op_get_callee now has a simple inline cache of the most 
    recent JSFunction that we saw.
    
    * bytecode/CodeBlock.cpp:
    (JSC::CodeBlock::CodeBlock):
    (JSC::CodeBlock::finalizeUnconditionally):
    * bytecompiler/BytecodeGenerator.cpp:
    (JSC::BytecodeGenerator::emitCreateThis):
    * dfg/DFGByteCodeParser.cpp:
    (JSC::DFG::ByteCodeParser::parseBlock):
    * jit/JIT.cpp:
    (JSC::JIT::privateCompileSlowCases):
    * jit/JIT.h:
    * jit/JITOpcodes.cpp:
    (JSC::JIT::emit_op_get_callee):
    (JSC::JIT::emitSlow_op_get_callee):
    * jit/JITOpcodes32_64.cpp:
    (JSC::JIT::emit_op_get_callee):
    (JSC::JIT::emitSlow_op_get_callee):
    * llint/LowLevelInterpreter32_64.asm:
    * llint/LowLevelInterpreter64.asm:
    * runtime/CommonSlowPaths.cpp:
    (JSC::SLOW_PATH_DECL):
    * runtime/CommonSlowPaths.h:
    
    LayoutTests: 
    
    Added two tests to make sure we didn't regress the performance of op_get_callee.
    
    * js/regress/get_callee_monomorphic-expected.txt: Added.
    * js/regress/get_callee_monomorphic.html: Added.
    * js/regress/get_callee_polymorphic-expected.txt: Added.
    * js/regress/get_callee_polymorphic.html: Added.
    * js/regress/script-tests/get_callee_monomorphic.js: Added.
    * js/regress/script-tests/get_callee_polymorphic.js: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    5f2e70b5