Bug 683413 - [INFER] jit-test/tests/v8-v5/check-earley-boyer.js failed on sparc. r=bhackett.
authorLeon Sha <leon.sha@oracle.com>
Thu, 01 Sep 2011 08:24:41 +0800
changeset 76572 88ff00bac63e385517a5b515b14237d41b88b884
parent 76164 b61af4d7dc7ca8c1ba5138876f969e36819a333f
child 76573 554045e04d89379e1dabe2c884986d9ec74c35ac
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersbhackett
bugs683413
milestone9.0a1
Bug 683413 - [INFER] jit-test/tests/v8-v5/check-earley-boyer.js failed on sparc. r=bhackett.
js/src/assembler/assembler/SparcAssembler.h
--- a/js/src/assembler/assembler/SparcAssembler.h
+++ b/js/src/assembler/assembler/SparcAssembler.h
@@ -1111,29 +1111,34 @@ namespace JSC {
             ASSERT(from.m_offset != -1);
             void *where = (void *)((intptr_t)code + from.m_offset);
             relinkJump(where, to);
         }
 
         static void relinkCall(void* from, void* to)
         {
             js::JaegerSpew(js::JSpew_Insns,
-                           ISPFX "##linkCall ((from=%p)) ((to=%p))\n",
+                           ISPFX "##relinkCall ((from=%p)) ((to=%p))\n",
                            from, to);
 
-            int disp = ((int)to - (int)from)/4;
-            *(uint32_t *)((int)from) &= 0x40000000;
-            *(uint32_t *)((int)from) |= disp & 0x3fffffff;
-            ExecutableAllocator::cacheFlush(from, 4);
+            void * where= (void *)((intptr_t)from - 20);
+            patchPointerInternal(where, (int)to);
+            ExecutableAllocator::cacheFlush(where, 8);
         }
 
         static void linkCall(void* code, JmpSrc where, void* to)
         {
             void *from = (void *)((intptr_t)code + where.m_offset);
-            relinkCall(from, to);
+            js::JaegerSpew(js::JSpew_Insns,
+                           ISPFX "##linkCall ((from=%p)) ((to=%p))\n",
+                           from, to);
+            int disp = ((int)to - (int)from)/4;
+            *(uint32_t *)((int)from) &= 0x40000000;
+            *(uint32_t *)((int)from) |= disp & 0x3fffffff;
+            ExecutableAllocator::cacheFlush(from, 4);
         }
 
         static void linkPointer(void* code, JmpDst where, void* value)
         {
             js::JaegerSpew(js::JSpew_Insns,
                            ISPFX "##linkPointer     ((%p + %#x)) points to ((%p))\n",
                            code, where.m_offset, value);