⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 277370 in webkit


Ignore:
Timestamp:
May 12, 2021, 8:48:26 AM (5 years ago)
Author:
mark.lam@apple.com
Message:

Remove dead code around ENABLE(OPCODE_SAMPLING) and ENABLE(CODEBLOCK_SAMPLING).
https://bugs.webkit.org/show_bug.cgi?id=225699

Reviewed by Tadeu Zagallo.

This code revolves around an Interpreter::sampler() method which returns a
SamplingTool*. Neither the Interpreter method nor the SamplingTool class exists
anymore.

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::compileWithoutLinking):

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

(JSC::JIT::compileCallEval):
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileCallEval):
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITInlines.h:

(JSC::JIT::sampleInstruction): Deleted.
(JSC::JIT::sampleCodeBlock): Deleted.

  • jit/JITOperations.cpp:
  • jit/SlowPathCall.h:

(JSC::JITSlowPathCall::call):

  • runtime/ScriptExecutable.h:

(JSC::ScriptExecutable::finishCreation): Deleted.

Location:
trunk/Source/JavaScriptCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r277346 r277370  
     12021-05-12  Mark Lam  <mark.lam@apple.com>
     2
     3        Remove dead code around ENABLE(OPCODE_SAMPLING) and ENABLE(CODEBLOCK_SAMPLING).
     4        https://bugs.webkit.org/show_bug.cgi?id=225699
     5
     6        Reviewed by Tadeu Zagallo.
     7
     8        This code revolves around an Interpreter::sampler() method which returns a
     9        SamplingTool*.  Neither the Interpreter method nor the SamplingTool class exists
     10        anymore.
     11
     12        * jit/JIT.cpp:
     13        (JSC::JIT::privateCompileMainPass):
     14        (JSC::JIT::compileWithoutLinking):
     15        * jit/JIT.h:
     16        * jit/JITCall.cpp:
     17        (JSC::JIT::compileCallEval):
     18        (JSC::JIT::compileCallEvalSlowCase):
     19        (JSC::JIT::compileOpCall):
     20        (JSC::JIT::compileOpCallSlowCase):
     21        * jit/JITCall32_64.cpp:
     22        (JSC::JIT::compileCallEval):
     23        (JSC::JIT::compileCallEvalSlowCase):
     24        (JSC::JIT::compileOpCall):
     25        (JSC::JIT::compileOpCallSlowCase):
     26        * jit/JITInlines.h:
     27        (JSC::JIT::sampleInstruction): Deleted.
     28        (JSC::JIT::sampleCodeBlock): Deleted.
     29        * jit/JITOperations.cpp:
     30        * jit/SlowPathCall.h:
     31        (JSC::JITSlowPathCall::call):
     32        * runtime/ScriptExecutable.h:
     33        (JSC::ScriptExecutable::finishCreation): Deleted.
     34
    1352021-05-11  Geoffrey Garen  <ggaren@apple.com>
    236
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r277312 r277370  
    252252
    253253        m_pcToCodeOriginMapBuilder.appendItem(label(), CodeOrigin(m_bytecodeIndex));
    254 
    255 #if ENABLE(OPCODE_SAMPLING)
    256         if (m_bytecodeIndex > 0) // Avoid the overhead of sampling op_enter twice.
    257             sampleInstruction(currentInstruction);
    258 #endif
    259254
    260255        m_labels[m_bytecodeIndex.offset()] = label();
     
    748743    Label beginLabel(this);
    749744
    750     sampleCodeBlock(m_codeBlock);
    751 #if ENABLE(OPCODE_SAMPLING)
    752     sampleInstruction(m_codeBlock->instructions().begin());
    753 #endif
    754 
    755745    int frameTopOffset = stackPointerOffsetFor(m_codeBlock) * sizeof(Register);
    756746    unsigned maxFrameSize = -frameTopOffset;
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r277312 r277370  
    938938#endif
    939939
    940 #if ENABLE(OPCODE_SAMPLING)
    941         void sampleInstruction(const Instruction*, bool = false);
    942 #endif
    943 
    944 #if ENABLE(CODEBLOCK_SAMPLING)
    945         void sampleCodeBlock(CodeBlock*);
    946 #else
    947         void sampleCodeBlock(CodeBlock*) {}
    948 #endif
    949 
    950940#if ENABLE(DFG_JIT)
    951941        bool canBeOptimized() { return m_canBeOptimized; }
  • trunk/Source/JavaScriptCore/jit/JITCall.cpp

    r270711 r277370  
    139139    addSlowCase(branchIfEmpty(regT0));
    140140
    141     sampleCodeBlock(m_codeBlock);
    142    
    143141    emitPutCallResult(bytecode);
    144142
     
    163161    checkStackPointerAlignment();
    164162
    165     sampleCodeBlock(m_codeBlock);
    166    
    167163    emitPutCallResult(bytecode);
    168164}
     
    259255    checkStackPointerAlignment();
    260256
    261     sampleCodeBlock(m_codeBlock);
    262    
    263257    emitPutCallResult(bytecode);
    264258}
     
    289283    checkStackPointerAlignment();
    290284
    291     sampleCodeBlock(m_codeBlock);
    292    
    293285    auto bytecode = instruction->as<Op>();
    294286    emitPutCallResult(bytecode);
  • trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp

    r270711 r277370  
    240240    addSlowCase(branchIfEmpty(regT1));
    241241
    242     sampleCodeBlock(m_codeBlock);
    243    
    244242    emitPutCallResult(bytecode);
    245243
     
    265263    checkStackPointerAlignment();
    266264
    267     sampleCodeBlock(m_codeBlock);
    268    
    269265    emitPutCallResult(bytecode);
    270266}
     
    334330    checkStackPointerAlignment();
    335331
    336     sampleCodeBlock(m_codeBlock);
    337332    emitPutCallResult(bytecode);
    338333}
     
    365360    addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
    366361    checkStackPointerAlignment();
    367 
    368     sampleCodeBlock(m_codeBlock);
    369362
    370363    auto bytecode = instruction->as<Op>();
  • trunk/Source/JavaScriptCore/jit/JITInlines.h

    r277312 r277370  
    272272#endif
    273273
    274 #if ENABLE(OPCODE_SAMPLING)
    275 #if CPU(X86_64)
    276 ALWAYS_INLINE void JIT::sampleInstruction(const Instruction* instruction, bool inHostFunction)
    277 {
    278     move(TrustedImmPtr(m_interpreter->sampler()->sampleSlot()), X86Registers::ecx);
    279     storePtr(TrustedImmPtr(m_interpreter->sampler()->encodeSample(instruction, inHostFunction)), X86Registers::ecx);
    280 }
    281 #else
    282 ALWAYS_INLINE void JIT::sampleInstruction(const Instruction* instruction, bool inHostFunction)
    283 {
    284     storePtr(TrustedImmPtr(m_interpreter->sampler()->encodeSample(instruction, inHostFunction)), m_interpreter->sampler()->sampleSlot());
    285 }
    286 #endif
    287 #endif
    288 
    289 #if ENABLE(CODEBLOCK_SAMPLING)
    290 #if CPU(X86_64)
    291 ALWAYS_INLINE void JIT::sampleCodeBlock(CodeBlock* codeBlock)
    292 {
    293     move(TrustedImmPtr(m_interpreter->sampler()->codeBlockSlot()), X86Registers::ecx);
    294     storePtr(TrustedImmPtr(codeBlock), X86Registers::ecx);
    295 }
    296 #else
    297 ALWAYS_INLINE void JIT::sampleCodeBlock(CodeBlock* codeBlock)
    298 {
    299     storePtr(TrustedImmPtr(codeBlock), m_interpreter->sampler()->codeBlockSlot());
    300 }
    301 #endif
    302 #endif
    303 
    304274ALWAYS_INLINE bool JIT::isOperandConstantChar(VirtualRegister src)
    305275{
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r277068 r277370  
    9191// sometimes gives us a signed pointer, and sometimes does not.
    9292#define OUR_RETURN_ADDRESS removeCodePtrTag(__builtin_return_address(0))
    93 #endif
    94 
    95 #if ENABLE(OPCODE_SAMPLING)
    96 #define CTI_SAMPLER vm.interpreter->sampler()
    97 #else
    98 #define CTI_SAMPLER 0
    9993#endif
    10094
  • trunk/Source/JavaScriptCore/jit/SlowPathCall.h

    r268077 r277370  
    4545    JIT::Call call()
    4646    {
    47 #if ENABLE(OPCODE_SAMPLING)
    48         if (m_jit->m_bytecodeOffset != std::numeric_limits<unsigned>::max())
    49             m_jit->sampleInstruction(&m_jit->m_codeBlock->instructions()[m_jit->m_bytecodeOffset], true);
    50 #endif
    5147        m_jit->updateTopCallFrame();
    5248#if CPU(X86_64) && OS(WINDOWS)
     
    6763        static_assert(JIT::regT1 == GPRInfo::returnValueGPR2);
    6864#endif
    69 
    70 #if ENABLE(OPCODE_SAMPLING)
    71         if (m_jit->m_bytecodeOffset != std::numeric_limits<unsigned>::max())
    72             m_jit->sampleInstruction(&m_jit->m_codeBlock->instructions()[m_jit->m_bytecodeOffset], false);
    73 #endif
    7465       
    7566        m_jit->exceptionCheck();
  • trunk/Source/JavaScriptCore/runtime/ScriptExecutable.h

    r273931 r277370  
    131131    ScriptExecutable(Structure*, VM&, const SourceCode&, bool isInStrictContext, DerivedContextType, bool isInArrowFunctionContext, bool isInsideOrdinaryFunction, EvalContextType, Intrinsic);
    132132
    133     void finishCreation(VM& vm)
    134     {
    135         Base::finishCreation(vm);
    136 
    137 #if ENABLE(CODEBLOCK_SAMPLING)
    138         if (SamplingTool* sampler = vm.interpreter->sampler())
    139             sampler->notifyOfScope(vm, this);
    140 #endif
    141     }
    142 
    143133    void recordParse(CodeFeatures features, bool hasCapturedVariables)
    144134    {
Note: See TracChangeset for help on using the changeset viewer.