Title: [114192] trunk/Source/_javascript_Core
Revision
114192
Author
barraclo...@apple.com
Date
2012-04-13 18:20:33 -0700 (Fri, 13 Apr 2012)

Log Message

Don't rely on fixed offsets to patch calls
https://bugs.webkit.org/show_bug.cgi?id=83966

Rubber stamped by Oliver Hunt.

These aren't being used anywhere!

* jit/JIT.h:
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileOpCall):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (114191 => 114192)


--- trunk/Source/_javascript_Core/ChangeLog	2012-04-14 00:42:00 UTC (rev 114191)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-04-14 01:20:33 UTC (rev 114192)
@@ -1,3 +1,18 @@
+2012-04-13  Gavin Barraclough  <barraclo...@apple.com>
+
+        Don't rely on fixed offsets to patch calls
+        https://bugs.webkit.org/show_bug.cgi?id=83966
+
+        Rubber stamped by Oliver Hunt.
+
+        These aren't being used anywhere!
+
+        * jit/JIT.h:
+        * jit/JITCall.cpp:
+        (JSC::JIT::compileOpCall):
+        * jit/JITCall32_64.cpp:
+        (JSC::JIT::compileOpCall):
+
 2012-04-13  Hojong Han  <hojong....@samsung.com>
 
         Array.prototype.toString and Array.prototype.toLocaleString should be generic

Modified: trunk/Source/_javascript_Core/jit/JIT.h (114191 => 114192)


--- trunk/Source/_javascript_Core/jit/JIT.h	2012-04-14 00:42:00 UTC (rev 114191)
+++ trunk/Source/_javascript_Core/jit/JIT.h	2012-04-14 01:20:33 UTC (rev 114192)
@@ -479,11 +479,7 @@
         void emitSub32Constant(unsigned dst, unsigned op, int32_t constant, ResultType opType);
         void emitBinaryDoubleOp(OpcodeID, unsigned dst, unsigned op1, unsigned op2, OperandTypes, JumpList& notInt32Op1, JumpList& notInt32Op2, bool op1IsInRegisters = true, bool op2IsInRegisters = true);
 
-#if CPU(X86)
-        static const int patchOffsetOpCallCompareToJump = 6;
-#elif CPU(ARM_TRADITIONAL)
-        static const int patchOffsetOpCallCompareToJump = 12;
-
+#if CPU(ARM_TRADITIONAL)
         // sequenceOpCall
         static const int sequenceOpCallInstructionSpace = 12;
         static const int sequenceOpCallConstantSpace = 2;
@@ -499,14 +495,6 @@
         // sequencePutById
         static const int sequencePutByIdInstructionSpace = 36;
         static const int sequencePutByIdConstantSpace = 4;
-#elif CPU(ARM_THUMB2)
-        static const int patchOffsetOpCallCompareToJump = 16;
-#elif CPU(MIPS)
-#if WTF_MIPS_ISA(1)
-        static const int patchOffsetOpCallCompareToJump = 32;
-#else // WTF_MIPS_ISA(1)
-        static const int patchOffsetOpCallCompareToJump = 32;
-#endif
 #elif CPU(SH4)
         // sequenceOpCall
         static const int sequenceOpCallInstructionSpace = 12;
@@ -523,10 +511,6 @@
         // sequencePutById
         static const int sequencePutByIdInstructionSpace = 36;
         static const int sequencePutByIdConstantSpace = 5;
-
-        static const int patchOffsetOpCallCompareToJump = 4;
-#else
-#error "JSVALUE32_64 not supported on this platform."
 #endif
 
 #else // USE(JSVALUE32_64)
@@ -569,10 +553,6 @@
         void compileGetDirectOffset(RegisterID base, RegisterID result, RegisterID offset, RegisterID scratch);
         void compilePutDirectOffset(RegisterID base, RegisterID value, size_t cachedOffset);
 
-#if CPU(X86_64)
-        static const int patchOffsetOpCallCompareToJump = 9;
-#endif
-
 #endif // USE(JSVALUE32_64)
 
 #if (defined(ASSEMBLER_HAS_CONSTANT_POOL) && ASSEMBLER_HAS_CONSTANT_POOL)

Modified: trunk/Source/_javascript_Core/jit/JITCall.cpp (114191 => 114192)


--- trunk/Source/_javascript_Core/jit/JITCall.cpp	2012-04-14 00:42:00 UTC (rev 114191)
+++ trunk/Source/_javascript_Core/jit/JITCall.cpp	2012-04-14 01:20:33 UTC (rev 114192)
@@ -180,7 +180,6 @@
     END_UNINTERRUPTED_SEQUENCE(sequenceOpCall);
     addSlowCase(slowCase);
 
-    ASSERT_JIT_OFFSET(differenceBetween(addressOfLinkedFunctionCheck, slowCase), patchOffsetOpCallCompareToJump);
     ASSERT(m_callStructureStubCompilationInfo.size() == callLinkInfoIndex);
     m_callStructureStubCompilationInfo.append(StructureStubCompilationInfo());
     m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathBegin = addressOfLinkedFunctionCheck;

Modified: trunk/Source/_javascript_Core/jit/JITCall32_64.cpp (114191 => 114192)


--- trunk/Source/_javascript_Core/jit/JITCall32_64.cpp	2012-04-14 00:42:00 UTC (rev 114191)
+++ trunk/Source/_javascript_Core/jit/JITCall32_64.cpp	2012-04-14 01:20:33 UTC (rev 114192)
@@ -264,7 +264,6 @@
     addSlowCase(slowCase);
     addSlowCase(branch32(NotEqual, regT1, TrustedImm32(JSValue::CellTag)));
 
-    ASSERT_JIT_OFFSET(differenceBetween(addressOfLinkedFunctionCheck, slowCase), patchOffsetOpCallCompareToJump);
     ASSERT(m_callStructureStubCompilationInfo.size() == callLinkInfoIndex);
     m_callStructureStubCompilationInfo.append(StructureStubCompilationInfo());
     m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathBegin = addressOfLinkedFunctionCheck;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to