Title: [151658] branches/dfgFourthTier/Source/_javascript_Core
Revision
151658
Author
[email protected]
Date
2013-06-17 16:50:11 -0700 (Mon, 17 Jun 2013)

Log Message

FTL: Add another temp register regT4 to JSInterfaceJIT
https://bugs.webkit.org/show_bug.cgi?id=117719

Reviewed by Geoffrey Garen.

Made the dedicated bucketCounterRegister to be regT4 and then used regT4 wherever
bucketCounterRegister had been used.  Since it is masked whenever it is used and
we are looking for some randomness in the register anyway, we can use it without
any issues.

* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* jit/JIT.h:
(JSC::JIT::emitValueProfilingSite):
* jit/JITCall.cpp:
(JSC::JIT::emitPutCallResult):
* jit/JITCall32_64.cpp:
(JSC::JIT::emitPutCallResult):
* jit/JITInlines.h:
(JSC::JIT::emitValueProfilingSite):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_to_this):
(JSC::JIT::emit_op_get_callee):
(JSC::JIT::emit_op_get_argument_by_val):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_get_callee):
(JSC::JIT::emit_op_to_this):
(JSC::JIT::emit_op_get_argument_by_val):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
* jit/JITStubCall.h:
(JSC::JITStubCall::callWithValueProfiling):
* jit/JSInterfaceJIT.h:
(JSInterfaceJIT):

Modified Paths

Diff

Modified: branches/dfgFourthTier/Source/_javascript_Core/ChangeLog (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/ChangeLog	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/ChangeLog	2013-06-17 23:50:11 UTC (rev 151658)
@@ -1,3 +1,52 @@
+2013-06-17  Michael Saboff  <[email protected]>
+
+        FTL: Add another temp register regT4 to JSInterfaceJIT
+        https://bugs.webkit.org/show_bug.cgi?id=117719
+
+        Reviewed by Geoffrey Garen.
+
+        Made the dedicated bucketCounterRegister to be regT4 and then used regT4 wherever
+        bucketCounterRegister had been used.  Since it is masked whenever it is used and
+        we are looking for some randomness in the register anyway, we can use it without
+        any issues.
+
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompile):
+        * jit/JIT.h:
+        (JSC::JIT::emitValueProfilingSite):
+        * jit/JITCall.cpp:
+        (JSC::JIT::emitPutCallResult):
+        * jit/JITCall32_64.cpp:
+        (JSC::JIT::emitPutCallResult):
+        * jit/JITInlines.h:
+        (JSC::JIT::emitValueProfilingSite):
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_to_this):
+        (JSC::JIT::emit_op_get_callee):
+        (JSC::JIT::emit_op_get_argument_by_val):
+        * jit/JITOpcodes32_64.cpp:
+        (JSC::JIT::emit_op_get_callee):
+        (JSC::JIT::emit_op_to_this):
+        (JSC::JIT::emit_op_get_argument_by_val):
+        * jit/JITPropertyAccess.cpp:
+        (JSC::JIT::emit_op_get_by_val):
+        (JSC::JIT::emitSlow_op_get_by_val):
+        (JSC::JIT::emit_op_get_by_id):
+        (JSC::JIT::emitSlow_op_get_by_id):
+        (JSC::JIT::emit_op_get_from_scope):
+        (JSC::JIT::emitSlow_op_get_from_scope):
+        * jit/JITPropertyAccess32_64.cpp:
+        (JSC::JIT::emit_op_get_by_val):
+        (JSC::JIT::emitSlow_op_get_by_val):
+        (JSC::JIT::emit_op_get_by_id):
+        (JSC::JIT::emitSlow_op_get_by_id):
+        (JSC::JIT::emit_op_get_from_scope):
+        (JSC::JIT::emitSlow_op_get_from_scope):
+        * jit/JITStubCall.h:
+        (JSC::JITStubCall::callWithValueProfiling):
+        * jit/JSInterfaceJIT.h:
+        (JSInterfaceJIT):
+
 2013-06-17  Mark Lam  <[email protected]>
 
         Rolling r151456, r151420 back in with some fixes.

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JIT.cpp (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JIT.cpp	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JIT.cpp	2013-06-17 23:50:11 UTC (rev 151658)
@@ -616,7 +616,7 @@
                 load32(Address(callFrameRegister, offset + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0);
                 load32(Address(callFrameRegister, offset + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1);
 #endif
-                emitValueProfilingSite(m_codeBlock->valueProfileForArgument(argument));
+                emitValueProfilingSite(m_codeBlock->valueProfileForArgument(argument), regT4);
             }
         }
 #endif

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JIT.h (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JIT.h	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JIT.h	2013-06-17 23:50:11 UTC (rev 151658)
@@ -460,12 +460,12 @@
 #if ENABLE(VALUE_PROFILER)
         // This assumes that the value to profile is in regT0 and that regT3 is available for
         // scratch.
-        void emitValueProfilingSite(ValueProfile*);
-        void emitValueProfilingSite(unsigned bytecodeOffset);
-        void emitValueProfilingSite();
+        void emitValueProfilingSite(ValueProfile*, RegisterID);
+        void emitValueProfilingSite(unsigned bytecodeOffset, RegisterID);
+        void emitValueProfilingSite(RegisterID);
 #else
-        void emitValueProfilingSite(unsigned) { }
-        void emitValueProfilingSite() { }
+        void emitValueProfilingSite(unsigned, RegisterID) { }
+        void emitValueProfilingSite(RegisterID) { }
 #endif
         void emitArrayProfilingSite(RegisterID structureAndIndexingType, RegisterID scratch, ArrayProfile*);
         void emitArrayProfilingSiteForBytecodeIndex(RegisterID structureAndIndexingType, RegisterID scratch, unsigned bytecodeIndex);

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JITCall.cpp (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JITCall.cpp	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JITCall.cpp	2013-06-17 23:50:11 UTC (rev 151658)
@@ -54,7 +54,7 @@
 void JIT::emitPutCallResult(Instruction* instruction)
 {
     int dst = instruction[1].u.operand;
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitPutVirtualRegister(dst);
     if (canBeOptimizedOrInlined()) {
         // Make lastResultRegister tracking simpler in the DFG. This is needed because

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JITCall32_64.cpp (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JITCall32_64.cpp	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JITCall32_64.cpp	2013-06-17 23:50:11 UTC (rev 151658)
@@ -53,7 +53,7 @@
 void JIT::emitPutCallResult(Instruction* instruction)
 {
     int dst = instruction[1].u.operand;
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitStore(dst, regT1, regT0);
 }
 

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JITInlines.h (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JITInlines.h	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JITInlines.h	2013-06-17 23:50:11 UTC (rev 151658)
@@ -332,7 +332,7 @@
 }
 
 #if ENABLE(VALUE_PROFILER)
-inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile)
+inline void JIT::emitValueProfilingSite(ValueProfile* valueProfile, RegisterID bucketCounterRegister)
 {
     ASSERT(shouldEmitProfiling());
     ASSERT(valueProfile);
@@ -370,16 +370,16 @@
 #endif
 }
 
-inline void JIT::emitValueProfilingSite(unsigned bytecodeOffset)
+inline void JIT::emitValueProfilingSite(unsigned bytecodeOffset, RegisterID bucketCounterRegister)
 {
     if (!shouldEmitProfiling())
         return;
-    emitValueProfilingSite(m_codeBlock->valueProfileForBytecodeOffset(bytecodeOffset));
+    emitValueProfilingSite(m_codeBlock->valueProfileForBytecodeOffset(bytecodeOffset), bucketCounterRegister);
 }
 
-inline void JIT::emitValueProfilingSite()
+inline void JIT::emitValueProfilingSite(RegisterID bucketCounterRegister)
 {
-    emitValueProfilingSite(m_bytecodeOffset);
+    emitValueProfilingSite(m_bytecodeOffset, bucketCounterRegister);
 }
 #endif // ENABLE(VALUE_PROFILER)
 

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JITOpcodes.cpp (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JITOpcodes.cpp	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JITOpcodes.cpp	2013-06-17 23:50:11 UTC (rev 151658)
@@ -1017,7 +1017,7 @@
     emitJumpSlowCaseIfNotJSCell(regT1);
     loadPtr(Address(regT1, JSCell::structureOffset()), regT0);
     if (shouldEmitProfiling())
-        emitValueProfilingSite();
+        emitValueProfilingSite(regT4);
 
     addSlowCase(branch8(NotEqual, Address(regT0, Structure::typeInfoTypeOffset()), TrustedImm32(FinalObjectType)));
 }
@@ -1036,7 +1036,7 @@
 {
     unsigned result = currentInstruction[1].u.operand;
     emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitPutVirtualRegister(result);
 }
 
@@ -1123,7 +1123,7 @@
     neg32(regT1);
     signExtend32ToPtr(regT1, regT1);
     load64(BaseIndex(callFrameRegister, regT1, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))), regT0);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitPutVirtualRegister(dst, regT0);
 }
 

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JITOpcodes32_64.cpp (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JITOpcodes32_64.cpp	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JITOpcodes32_64.cpp	2013-06-17 23:50:11 UTC (rev 151658)
@@ -1143,7 +1143,7 @@
     int dst = currentInstruction[1].u.operand;
     emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0);
     move(TrustedImm32(JSValue::CellTag), regT1);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitStore(dst, regT1, regT0);
 }
 
@@ -1186,7 +1186,7 @@
     loadPtr(Address(regT2, JSCell::structureOffset()), regT0);
     if (shouldEmitProfiling()) {
         move(regT3, regT1);
-        emitValueProfilingSite();
+        emitValueProfilingSite(regT4);
     }
     addSlowCase(branch8(NotEqual, Address(regT0, Structure::typeInfoTypeOffset()), TrustedImm32(FinalObjectType)));
 }
@@ -1254,7 +1254,7 @@
     neg32(regT2);
     loadPtr(BaseIndex(callFrameRegister, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload) + CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))), regT0);
     loadPtr(BaseIndex(callFrameRegister, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag) + CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))), regT1);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitStore(dst, regT1, regT0);
 }
 

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JITPropertyAccess.cpp (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JITPropertyAccess.cpp	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JITPropertyAccess.cpp	2013-06-17 23:50:11 UTC (rev 151658)
@@ -149,7 +149,7 @@
     resultOK.link(this);
 #endif
 
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitPutVirtualRegister(dst);
     
     m_byValCompilationInfo.append(ByValCompilationInfo(m_bytecodeOffset, badType, mode, done));
@@ -239,7 +239,7 @@
     m_byValCompilationInfo[m_byValInstructionIndex].returnAddress = call;
     m_byValInstructionIndex++;
 
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
 }
 
 void JIT::compileGetDirectOffset(RegisterID base, RegisterID result, RegisterID offset, RegisterID scratch, FinalObjectMode finalObjectMode)
@@ -522,7 +522,7 @@
 
     emitGetVirtualRegister(baseVReg, regT0);
     compileGetByIdHotPath(baseVReg, ident);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitPutVirtualRegister(resultVReg);
 }
 
@@ -565,7 +565,7 @@
     Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
 
     compileGetByIdSlowCase(resultVReg, baseVReg, ident, iter);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
 }
 
 void JIT::compileGetByIdSlowCase(int resultVReg, int baseVReg, Identifier* ident, Vector<SlowCaseEntry>::iterator& iter)
@@ -1322,7 +1322,7 @@
         break;
     }
     emitPutVirtualRegister(dst);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
 }
 
 void JIT::emitSlow_op_get_from_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
@@ -1338,7 +1338,7 @@
     JITStubCall stubCall(this, cti_op_get_from_scope);
     stubCall.addArgument(TrustedImmPtr(currentInstruction));
     stubCall.call(dst);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
 }
 
 void JIT::emitPutGlobalProperty(uintptr_t* operandSlot, unsigned value)

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp	2013-06-17 23:50:11 UTC (rev 151658)
@@ -181,7 +181,7 @@
     resultOK.link(this);
 #endif
 
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitStore(dst, regT1, regT0);
     map(m_bytecodeOffset + OPCODE_LENGTH(op_get_by_val), dst, regT1, regT0);
     
@@ -278,7 +278,7 @@
     m_byValCompilationInfo[m_byValInstructionIndex].returnAddress = call;
     m_byValInstructionIndex++;
 
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
 }
 
 void JIT::emit_op_put_by_val(Instruction* currentInstruction)
@@ -465,7 +465,7 @@
     emitLoad(base, regT1, regT0);
     emitJumpSlowCaseIfNotJSCell(base, regT1);
     compileGetByIdHotPath(ident);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitStore(dst, regT1, regT0);
     map(m_bytecodeOffset + OPCODE_LENGTH(op_get_by_id), dst, regT1, regT0);
 }
@@ -508,7 +508,7 @@
     int ident = currentInstruction[3].u.operand;
     
     compileGetByIdSlowCase(dst, base, &(m_codeBlock->identifier(ident)), iter);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
 }
 
 void JIT::compileGetByIdSlowCase(int dst, int base, Identifier* ident, Vector<SlowCaseEntry>::iterator& iter)
@@ -1366,7 +1366,7 @@
         addSlowCase(jump());
         break;
     }
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
     emitStore(dst, regT1, regT0);
     map(m_bytecodeOffset + OPCODE_LENGTH(op_get_from_scope), dst, regT1, regT0);
 }
@@ -1384,7 +1384,7 @@
     JITStubCall stubCall(this, cti_op_get_from_scope);
     stubCall.addArgument(TrustedImmPtr(currentInstruction));
     stubCall.call(dst);
-    emitValueProfilingSite();
+    emitValueProfilingSite(regT4);
 }
 
 void JIT::emitPutGlobalProperty(uintptr_t* operandSlot, unsigned value)

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JITStubCall.h (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JITStubCall.h	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JITStubCall.h	2013-06-17 23:50:11 UTC (rev 151658)
@@ -248,7 +248,7 @@
             ASSERT(JIT::returnValueRegister == JIT::regT0);
             if (m_returnType == Cell)
                 m_jit->move(JIT::TrustedImm32(JSValue::CellTag), JIT::regT1);
-            m_jit->emitValueProfilingSite();
+            m_jit->emitValueProfilingSite(JIT::regT4);
             if (m_returnType == Value)
                 m_jit->emitStore(dst, JIT::regT1, JIT::regT0);
             else
@@ -269,7 +269,7 @@
             ASSERT(m_returnType == Value || m_returnType == Cell);
             JIT::Call call = this->call();
             ASSERT(JIT::returnValueRegister == JIT::regT0);
-            m_jit->emitValueProfilingSite();
+            m_jit->emitValueProfilingSite(JIT::regT4);
             m_jit->emitPutVirtualRegister(dst);
             return call;
         }

Modified: branches/dfgFourthTier/Source/_javascript_Core/jit/JSInterfaceJIT.h (151657 => 151658)


--- branches/dfgFourthTier/Source/_javascript_Core/jit/JSInterfaceJIT.h	2013-06-17 22:42:36 UTC (rev 151657)
+++ branches/dfgFourthTier/Source/_javascript_Core/jit/JSInterfaceJIT.h	2013-06-17 23:50:11 UTC (rev 151658)
@@ -65,10 +65,6 @@
         static const RegisterID secondArgumentRegister = X86Registers::edx;
 #endif
 
-#if ENABLE(VALUE_PROFILER)
-        static const RegisterID bucketCounterRegister = X86Registers::r10;
-#endif
-
         static const RegisterID callFrameRegister = X86Registers::r13;
         static const RegisterID tagTypeNumberRegister = X86Registers::r14;
         static const RegisterID tagMaskRegister = X86Registers::r15;
@@ -77,6 +73,7 @@
         static const RegisterID regT1 = X86Registers::edx;
         static const RegisterID regT2 = X86Registers::ecx;
         static const RegisterID regT3 = X86Registers::ebx;
+        static const RegisterID regT4 = X86Registers::r10;
 
         static const FPRegisterID fpRegT0 = X86Registers::xmm0;
         static const FPRegisterID fpRegT1 = X86Registers::xmm1;
@@ -92,13 +89,13 @@
         static const RegisterID firstArgumentRegister = X86Registers::ecx;
         static const RegisterID secondArgumentRegister = X86Registers::edx;
         
-        static const RegisterID bucketCounterRegister = X86Registers::esi;
         static const RegisterID callFrameRegister = X86Registers::edi;
         
         static const RegisterID regT0 = X86Registers::eax;
         static const RegisterID regT1 = X86Registers::edx;
         static const RegisterID regT2 = X86Registers::ecx;
         static const RegisterID regT3 = X86Registers::ebx;
+        static const RegisterID regT4 = X86Registers::esi;
         
         static const FPRegisterID fpRegT0 = X86Registers::xmm0;
         static const FPRegisterID fpRegT1 = X86Registers::xmm1;
@@ -111,13 +108,13 @@
         static const RegisterID secondArgumentRegister = ARMRegisters::r1;
 
 #if ENABLE(VALUE_PROFILER)
-        static const RegisterID bucketCounterRegister = ARMRegisters::r7;
 #endif
 
         static const RegisterID regT0 = ARMRegisters::r0;
         static const RegisterID regT1 = ARMRegisters::r1;
         static const RegisterID regT2 = ARMRegisters::r2;
         static const RegisterID regT3 = ARMRegisters::r4;
+        static const RegisterID regT4 = ARMRegisters::r7;
 
         // Update ctiTrampoline in JITStubs.cpp if these values are changed!
         static const RegisterID callFrameRegister = ARMRegisters::r5;
@@ -132,10 +129,6 @@
         static const RegisterID firstArgumentRegister = MIPSRegisters::a0;
         static const RegisterID secondArgumentRegister = MIPSRegisters::a1;
         
-#if ENABLE(VALUE_PROFILER)
-        static const RegisterID bucketCounterRegister = MIPSRegisters::s3;
-#endif
-
         // regT0 must be v0 for returning a 32-bit value.
         static const RegisterID regT0 = MIPSRegisters::v0;
         
@@ -147,6 +140,8 @@
         // regT3 must be saved in the callee, so use an S register.
         static const RegisterID regT3 = MIPSRegisters::s2;
         
+        static const RegisterID regT4 = MIPSRegisters::s3;
+
         static const RegisterID callFrameRegister = MIPSRegisters::s0;
         
         static const FPRegisterID fpRegT0 = MIPSRegisters::f4;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to