Changeset 180917 in webkit


Ignore:
Timestamp:
Mar 2, 2015, 8:05:05 PM (10 years ago)
Author:
fpizlo@apple.com
Message:

Remove op_get_callee, it's unused
https://bugs.webkit.org/show_bug.cgi?id=142206

Reviewed by Andreas Kling.

It's a bit of a shame that we stopped using this opcode since it gives us same-callee
profiling. But, if we were to add this functionality back in, we would almost certainly do
it by adding a JSFunction allocation watchpoint on FunctionExecutable.

  • bytecode/BytecodeList.json:
  • bytecode/BytecodeUseDef.h:

(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::finalizeUnconditionally):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGCapabilities.cpp:

(JSC::DFG::capabilityLevel):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):

  • jit/JIT.h:
  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_get_callee): Deleted.
(JSC::JIT::emitSlow_op_get_callee): Deleted.

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_get_callee): Deleted.
(JSC::JIT::emitSlow_op_get_callee): Deleted.

  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL): Deleted.

Location:
trunk/Source/JavaScriptCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r180913 r180917  
     12015-03-02  Filip Pizlo  <fpizlo@apple.com>
     2
     3        Remove op_get_callee, it's unused
     4        https://bugs.webkit.org/show_bug.cgi?id=142206
     5
     6        Reviewed by Andreas Kling.
     7       
     8        It's a bit of a shame that we stopped using this opcode since it gives us same-callee
     9        profiling. But, if we were to add this functionality back in, we would almost certainly do
     10        it by adding a JSFunction allocation watchpoint on FunctionExecutable.
     11
     12        * bytecode/BytecodeList.json:
     13        * bytecode/BytecodeUseDef.h:
     14        (JSC::computeUsesForBytecodeOffset):
     15        (JSC::computeDefsForBytecodeOffset):
     16        * bytecode/CodeBlock.cpp:
     17        (JSC::CodeBlock::dumpBytecode):
     18        (JSC::CodeBlock::finalizeUnconditionally):
     19        * dfg/DFGByteCodeParser.cpp:
     20        (JSC::DFG::ByteCodeParser::parseBlock):
     21        * dfg/DFGCapabilities.cpp:
     22        (JSC::DFG::capabilityLevel):
     23        * jit/JIT.cpp:
     24        (JSC::JIT::privateCompileMainPass):
     25        (JSC::JIT::privateCompileSlowCases):
     26        * jit/JIT.h:
     27        * jit/JITOpcodes.cpp:
     28        (JSC::JIT::emit_op_get_callee): Deleted.
     29        (JSC::JIT::emitSlow_op_get_callee): Deleted.
     30        * jit/JITOpcodes32_64.cpp:
     31        (JSC::JIT::emit_op_get_callee): Deleted.
     32        (JSC::JIT::emitSlow_op_get_callee): Deleted.
     33        * llint/LowLevelInterpreter32_64.asm:
     34        * llint/LowLevelInterpreter64.asm:
     35        * runtime/CommonSlowPaths.cpp:
     36        (JSC::SLOW_PATH_DECL): Deleted.
     37
    1382015-03-02  Joseph Pecoraro  <pecoraro@apple.com>
    239
  • trunk/Source/JavaScriptCore/bytecode/BytecodeList.json

    r180587 r180917  
    1111            { "name" : "op_create_arguments", "length" : 3 },
    1212            { "name" : "op_create_this", "length" : 4 },
    13             { "name" : "op_get_callee", "length" : 3 },
    1413            { "name" : "op_to_this", "length" : 4 },
    1514            { "name" : "op_new_object", "length" : 4 },
  • trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h

    r180595 r180917  
    5050    case op_new_object:
    5151    case op_init_lazy_reg:
    52     case op_get_callee:
    5352    case op_enter:
    5453    case op_catch:
     
    366365    case op_new_object:
    367366    case op_to_this:
    368     case op_get_callee:
    369367    case op_init_lazy_reg:
    370368    case op_get_scope:
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r180875 r180917  
    773773            break;
    774774        }
    775         case op_get_callee: {
    776             int r0 = (++it)->u.operand;
    777             printLocationOpAndRegisterOperand(out, exec, location, it, "get_callee", r0);
    778             ++it;
    779             break;
    780         }
    781775        case op_create_this: {
    782776            int r0 = (++it)->u.operand;
     
    25662560                curInstruction[3].u.toThisStatus = merge(
    25672561                    curInstruction[3].u.toThisStatus, ToThisClearedByGC);
    2568                 break;
    2569             case op_get_callee:
    2570                 if (!curInstruction[2].u.jsCell || Heap::isMarked(curInstruction[2].u.jsCell.get()))
    2571                     break;
    2572                 if (Options::verboseOSR())
    2573                     dataLogF("Clearing LLInt get callee with function %p.\n", curInstruction[2].u.jsCell.get());
    2574                 curInstruction[2].u.jsCell.clear();
    25752562                break;
    25762563            case op_resolve_scope: {
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r180813 r180917  
    26912691        }
    26922692           
    2693         case op_get_callee: {
    2694             JSCell* cachedFunction = currentInstruction[2].u.jsCell.get();
    2695             if (!cachedFunction
    2696                 || m_inlineStackTop->m_profiledBlock->couldTakeSlowCase(m_currentIndex)
    2697                 || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCell)) {
    2698                 set(VirtualRegister(currentInstruction[1].u.operand), get(VirtualRegister(JSStack::Callee)));
    2699             } else {
    2700                 FrozenValue* frozen = m_graph.freeze(cachedFunction);
    2701                 ASSERT(cachedFunction->inherits(JSFunction::info()));
    2702                 Node* actualCallee = get(VirtualRegister(JSStack::Callee));
    2703                 addToGraph(CheckCell, OpInfo(frozen), actualCallee);
    2704                 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(JSConstant, OpInfo(frozen)));
    2705             }
    2706             NEXT_OPCODE(op_get_callee);
    2707         }
    2708 
    27092693        // === Bitwise operations ===
    27102694
  • trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp

    r180587 r180917  
    104104    case op_to_this:
    105105    case op_create_this:
    106     case op_get_callee:
    107106    case op_bitand:
    108107    case op_bitor:
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r180587 r180917  
    200200        DEFINE_OP(op_catch)
    201201        DEFINE_OP(op_construct)
    202         DEFINE_OP(op_get_callee)
    203202        DEFINE_OP(op_create_this)
    204203        DEFINE_OP(op_to_this)
     
    380379        DEFINE_SLOWCASE_OP(op_div)
    381380        DEFINE_SLOWCASE_OP(op_eq)
    382         DEFINE_SLOWCASE_OP(op_get_callee)
    383381        case op_get_by_id_out_of_line:
    384382        case op_get_array_length:
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r180587 r180917  
    467467        void emit_op_catch(Instruction*);
    468468        void emit_op_construct(Instruction*);
    469         void emit_op_get_callee(Instruction*);
    470469        void emit_op_create_this(Instruction*);
    471470        void emit_op_to_this(Instruction*);
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r180897 r180917  
    730730}
    731731
    732 void JIT::emit_op_get_callee(Instruction* currentInstruction)
    733 {
    734     int result = currentInstruction[1].u.operand;
    735     WriteBarrierBase<JSCell>* cachedFunction = &currentInstruction[2].u.jsCell;
    736     emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0);
    737 
    738     loadPtr(cachedFunction, regT2);
    739     addSlowCase(branchPtr(NotEqual, regT0, regT2));
    740 
    741     emitPutVirtualRegister(result);
    742 }
    743 
    744 void JIT::emitSlow_op_get_callee(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    745 {
    746     linkSlowCase(iter);
    747 
    748     JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_callee);
    749     slowPathCall.call();
    750 }
    751 
    752732void JIT::emit_op_create_this(Instruction* currentInstruction)
    753733{
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r180897 r180917  
    948948}
    949949
    950 void JIT::emit_op_get_callee(Instruction* currentInstruction)
    951 {
    952     int result = currentInstruction[1].u.operand;
    953     WriteBarrierBase<JSCell>* cachedFunction = &currentInstruction[2].u.jsCell;
    954     emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0);
    955 
    956     loadPtr(cachedFunction, regT2);
    957     addSlowCase(branchPtr(NotEqual, regT0, regT2));
    958 
    959     move(TrustedImm32(JSValue::CellTag), regT1);
    960     emitStore(result, regT1, regT0);
    961 }
    962 
    963 void JIT::emitSlow_op_get_callee(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    964 {
    965     linkSlowCase(iter);
    966 
    967     JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_callee);
    968     slowPathCall.call();
    969 }
    970 
    971950void JIT::emit_op_create_this(Instruction* currentInstruction)
    972951{
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm

    r180587 r180917  
    772772    dispatch(4)
    773773
    774 
    775 _llint_op_get_callee:
    776     traceExecution()
    777     loadi 4[PC], t0
    778     loadp PayloadOffset + Callee[cfr], t1
    779     loadpFromInstruction(2, t2)
    780     bpneq t1, t2, .opGetCalleeSlow
    781     storei CellTag, TagOffset[cfr, t0, 8]
    782     storei t1, PayloadOffset[cfr, t0, 8]
    783     dispatch(3)
    784 
    785 .opGetCalleeSlow:
    786     callSlowPath(_slow_path_get_callee)
    787     dispatch(3)
    788774
    789775_llint_op_to_this:
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm

    r180587 r180917  
    656656    dispatch(4)
    657657
    658 
    659 _llint_op_get_callee:
    660     traceExecution()
    661     loadisFromInstruction(1, t0)
    662     loadp Callee[cfr], t1
    663     loadpFromInstruction(2, t2)
    664     bpneq t1, t2, .opGetCalleeSlow
    665     storep t1, [cfr, t0, 8]
    666     dispatch(3)
    667 
    668 .opGetCalleeSlow:
    669     callSlowPath(_slow_path_get_callee)
    670     dispatch(3)
    671658
    672659_llint_op_to_this:
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp

    r180587 r180917  
    211211}
    212212
    213 SLOW_PATH_DECL(slow_path_get_callee)
    214 {
    215     BEGIN();
    216     JSFunction* callee = jsCast<JSFunction*>(exec->callee());
    217     pc[2].u.jsCell.set(exec->vm(), exec->codeBlock()->ownerExecutable(), callee);
    218     RETURN(callee);
    219 }
    220 
    221213SLOW_PATH_DECL(slow_path_create_arguments)
    222214{
Note: See TracChangeset for help on using the changeset viewer.