Ignore:
Timestamp:
Sep 24, 2013, 5:37:57 PM (12 years ago)
Author:
[email protected]
Message:

op_get_callee shouldn't use value profiling
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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r156374 r156376  
    879879{
    880880    int result = currentInstruction[1].u.operand;
     881    WriteBarrierBase<JSCell>* cachedFunction = &currentInstruction[2].u.jsCell;
    881882    emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0);
    882     emitValueProfilingSite(regT4);
     883
     884    loadPtr(cachedFunction, regT2);
     885    addSlowCase(branchPtr(NotEqual, regT0, regT2));
     886
    883887    emitPutVirtualRegister(result);
     888}
     889
     890void JIT::emitSlow_op_get_callee(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
     891{
     892    linkSlowCase(iter);
     893
     894    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_callee);
     895    slowPathCall.call();
     896    emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
    884897}
    885898
Note: See TracChangeset for help on using the changeset viewer.