Title: [277370] trunk/Source/_javascript_Core
Revision
277370
Author
[email protected]
Date
2021-05-12 08:48:26 -0700 (Wed, 12 May 2021)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (277369 => 277370)


--- trunk/Source/_javascript_Core/ChangeLog	2021-05-12 14:51:31 UTC (rev 277369)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-05-12 15:48:26 UTC (rev 277370)
@@ -1,3 +1,37 @@
+2021-05-12  Mark Lam  <[email protected]>
+
+        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.
+
 2021-05-11  Geoffrey Garen  <[email protected]>
 
         ConservativeRoots triggers page demand on Speedometer

Modified: trunk/Source/_javascript_Core/jit/JIT.cpp (277369 => 277370)


--- trunk/Source/_javascript_Core/jit/JIT.cpp	2021-05-12 14:51:31 UTC (rev 277369)
+++ trunk/Source/_javascript_Core/jit/JIT.cpp	2021-05-12 15:48:26 UTC (rev 277370)
@@ -252,11 +252,6 @@
 
         m_pcToCodeOriginMapBuilder.appendItem(label(), CodeOrigin(m_bytecodeIndex));
 
-#if ENABLE(OPCODE_SAMPLING)
-        if (m_bytecodeIndex > 0) // Avoid the overhead of sampling op_enter twice.
-            sampleInstruction(currentInstruction);
-#endif
-
         m_labels[m_bytecodeIndex.offset()] = label();
 
         if (JITInternal::verbose)
@@ -747,11 +742,6 @@
 
     Label beginLabel(this);
 
-    sampleCodeBlock(m_codeBlock);
-#if ENABLE(OPCODE_SAMPLING)
-    sampleInstruction(m_codeBlock->instructions().begin());
-#endif
-
     int frameTopOffset = stackPointerOffsetFor(m_codeBlock) * sizeof(Register);
     unsigned maxFrameSize = -frameTopOffset;
     addPtr(TrustedImm32(frameTopOffset), callFrameRegister, regT1);

Modified: trunk/Source/_javascript_Core/jit/JIT.h (277369 => 277370)


--- trunk/Source/_javascript_Core/jit/JIT.h	2021-05-12 14:51:31 UTC (rev 277369)
+++ trunk/Source/_javascript_Core/jit/JIT.h	2021-05-12 15:48:26 UTC (rev 277370)
@@ -937,16 +937,6 @@
         void emitCount(AbstractSamplingCounter&, int32_t = 1);
 #endif
 
-#if ENABLE(OPCODE_SAMPLING)
-        void sampleInstruction(const Instruction*, bool = false);
-#endif
-
-#if ENABLE(CODEBLOCK_SAMPLING)
-        void sampleCodeBlock(CodeBlock*);
-#else
-        void sampleCodeBlock(CodeBlock*) {}
-#endif
-
 #if ENABLE(DFG_JIT)
         bool canBeOptimized() { return m_canBeOptimized; }
         bool canBeOptimizedOrInlined() { return m_canBeOptimizedOrInlined; }

Modified: trunk/Source/_javascript_Core/jit/JITCall.cpp (277369 => 277370)


--- trunk/Source/_javascript_Core/jit/JITCall.cpp	2021-05-12 14:51:31 UTC (rev 277369)
+++ trunk/Source/_javascript_Core/jit/JITCall.cpp	2021-05-12 15:48:26 UTC (rev 277370)
@@ -138,8 +138,6 @@
 
     addSlowCase(branchIfEmpty(regT0));
 
-    sampleCodeBlock(m_codeBlock);
-    
     emitPutCallResult(bytecode);
 
     return true;
@@ -162,8 +160,6 @@
     addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
     checkStackPointerAlignment();
 
-    sampleCodeBlock(m_codeBlock);
-    
     emitPutCallResult(bytecode);
 }
 
@@ -258,8 +254,6 @@
     addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
     checkStackPointerAlignment();
 
-    sampleCodeBlock(m_codeBlock);
-    
     emitPutCallResult(bytecode);
 }
 
@@ -288,8 +282,6 @@
     addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
     checkStackPointerAlignment();
 
-    sampleCodeBlock(m_codeBlock);
-    
     auto bytecode = instruction->as<Op>();
     emitPutCallResult(bytecode);
 }

Modified: trunk/Source/_javascript_Core/jit/JITCall32_64.cpp (277369 => 277370)


--- trunk/Source/_javascript_Core/jit/JITCall32_64.cpp	2021-05-12 14:51:31 UTC (rev 277369)
+++ trunk/Source/_javascript_Core/jit/JITCall32_64.cpp	2021-05-12 15:48:26 UTC (rev 277370)
@@ -239,8 +239,6 @@
 
     addSlowCase(branchIfEmpty(regT1));
 
-    sampleCodeBlock(m_codeBlock);
-    
     emitPutCallResult(bytecode);
 
     return true;
@@ -264,8 +262,6 @@
     addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
     checkStackPointerAlignment();
 
-    sampleCodeBlock(m_codeBlock);
-    
     emitPutCallResult(bytecode);
 }
 
@@ -333,7 +329,6 @@
     addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
     checkStackPointerAlignment();
 
-    sampleCodeBlock(m_codeBlock);
     emitPutCallResult(bytecode);
 }
 
@@ -365,8 +360,6 @@
     addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
     checkStackPointerAlignment();
 
-    sampleCodeBlock(m_codeBlock);
-
     auto bytecode = instruction->as<Op>();
     emitPutCallResult(bytecode);
 }

Modified: trunk/Source/_javascript_Core/jit/JITInlines.h (277369 => 277370)


--- trunk/Source/_javascript_Core/jit/JITInlines.h	2021-05-12 14:51:31 UTC (rev 277369)
+++ trunk/Source/_javascript_Core/jit/JITInlines.h	2021-05-12 15:48:26 UTC (rev 277370)
@@ -271,36 +271,6 @@
 }
 #endif
 
-#if ENABLE(OPCODE_SAMPLING)
-#if CPU(X86_64)
-ALWAYS_INLINE void JIT::sampleInstruction(const Instruction* instruction, bool inHostFunction)
-{
-    move(TrustedImmPtr(m_interpreter->sampler()->sampleSlot()), X86Registers::ecx);
-    storePtr(TrustedImmPtr(m_interpreter->sampler()->encodeSample(instruction, inHostFunction)), X86Registers::ecx);
-}
-#else
-ALWAYS_INLINE void JIT::sampleInstruction(const Instruction* instruction, bool inHostFunction)
-{
-    storePtr(TrustedImmPtr(m_interpreter->sampler()->encodeSample(instruction, inHostFunction)), m_interpreter->sampler()->sampleSlot());
-}
-#endif
-#endif
-
-#if ENABLE(CODEBLOCK_SAMPLING)
-#if CPU(X86_64)
-ALWAYS_INLINE void JIT::sampleCodeBlock(CodeBlock* codeBlock)
-{
-    move(TrustedImmPtr(m_interpreter->sampler()->codeBlockSlot()), X86Registers::ecx);
-    storePtr(TrustedImmPtr(codeBlock), X86Registers::ecx);
-}
-#else
-ALWAYS_INLINE void JIT::sampleCodeBlock(CodeBlock* codeBlock)
-{
-    storePtr(TrustedImmPtr(codeBlock), m_interpreter->sampler()->codeBlockSlot());
-}
-#endif
-#endif
-
 ALWAYS_INLINE bool JIT::isOperandConstantChar(VirtualRegister src)
 {
     return src.isConstant() && getConstantOperand(src).isString() && asString(getConstantOperand(src).asCell())->length() == 1;

Modified: trunk/Source/_javascript_Core/jit/JITOperations.cpp (277369 => 277370)


--- trunk/Source/_javascript_Core/jit/JITOperations.cpp	2021-05-12 14:51:31 UTC (rev 277369)
+++ trunk/Source/_javascript_Core/jit/JITOperations.cpp	2021-05-12 15:48:26 UTC (rev 277370)
@@ -92,13 +92,7 @@
 #define OUR_RETURN_ADDRESS removeCodePtrTag(__builtin_return_address(0))
 #endif
 
-#if ENABLE(OPCODE_SAMPLING)
-#define CTI_SAMPLER vm.interpreter->sampler()
-#else
-#define CTI_SAMPLER 0
-#endif
 
-
 JSC_DEFINE_JIT_OPERATION(operationThrowStackOverflowError, void, (CodeBlock* codeBlock))
 {
     // We pass in our own code block, because the callframe hasn't been populated.

Modified: trunk/Source/_javascript_Core/jit/SlowPathCall.h (277369 => 277370)


--- trunk/Source/_javascript_Core/jit/SlowPathCall.h	2021-05-12 14:51:31 UTC (rev 277369)
+++ trunk/Source/_javascript_Core/jit/SlowPathCall.h	2021-05-12 15:48:26 UTC (rev 277370)
@@ -44,10 +44,6 @@
 
     JIT::Call call()
     {
-#if ENABLE(OPCODE_SAMPLING)
-        if (m_jit->m_bytecodeOffset != std::numeric_limits<unsigned>::max())
-            m_jit->sampleInstruction(&m_jit->m_codeBlock->instructions()[m_jit->m_bytecodeOffset], true);
-#endif
         m_jit->updateTopCallFrame();
 #if CPU(X86_64) && OS(WINDOWS)
         m_jit->addPtr(MacroAssembler::TrustedImm32(-16), MacroAssembler::stackPointerRegister);
@@ -66,11 +62,6 @@
         static_assert(JIT::regT0 == GPRInfo::returnValueGPR);
         static_assert(JIT::regT1 == GPRInfo::returnValueGPR2);
 #endif
-
-#if ENABLE(OPCODE_SAMPLING)
-        if (m_jit->m_bytecodeOffset != std::numeric_limits<unsigned>::max())
-            m_jit->sampleInstruction(&m_jit->m_codeBlock->instructions()[m_jit->m_bytecodeOffset], false);
-#endif
         
         m_jit->exceptionCheck();
         return call;

Modified: trunk/Source/_javascript_Core/runtime/ScriptExecutable.h (277369 => 277370)


--- trunk/Source/_javascript_Core/runtime/ScriptExecutable.h	2021-05-12 14:51:31 UTC (rev 277369)
+++ trunk/Source/_javascript_Core/runtime/ScriptExecutable.h	2021-05-12 15:48:26 UTC (rev 277370)
@@ -130,16 +130,6 @@
 protected:
     ScriptExecutable(Structure*, VM&, const SourceCode&, bool isInStrictContext, DerivedContextType, bool isInArrowFunctionContext, bool isInsideOrdinaryFunction, EvalContextType, Intrinsic);
 
-    void finishCreation(VM& vm)
-    {
-        Base::finishCreation(vm);
-
-#if ENABLE(CODEBLOCK_SAMPLING)
-        if (SamplingTool* sampler = vm.interpreter->sampler())
-            sampler->notifyOfScope(vm, this);
-#endif
-    }
-
     void recordParse(CodeFeatures features, bool hasCapturedVariables)
     {
         m_features = features;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to