Title: [123735] trunk/Source/_javascript_Core
Revision
123735
Author
zherc...@webkit.org
Date
2012-07-26 05:29:10 -0700 (Thu, 26 Jul 2012)

Log Message

[Qt][ARM]ARMAssembler needs buildfix afert r123417
https://bugs.webkit.org/show_bug.cgi?id=92086

Reviewed by Csaba Osztrogonác.

The ARM implementation of this should be optimized code path
is covered by a non-optimized code path. This patch fixes this,
and adds a new function which returns with the offset range.

* assembler/ARMAssembler.h:
(JSC::ARMAssembler::readPointer):
(ARMAssembler):
(JSC::ARMAssembler::repatchInt32):
(JSC::ARMAssembler::repatchCompact):
* assembler/MacroAssemblerARM.h:
(MacroAssemblerARM):
(JSC::MacroAssemblerARM::isCompactPtrAlignedAddressOffset):
(JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (123734 => 123735)


--- trunk/Source/_javascript_Core/ChangeLog	2012-07-26 12:21:09 UTC (rev 123734)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-07-26 12:29:10 UTC (rev 123735)
@@ -1,3 +1,24 @@
+2012-07-26  Zoltan Herczeg  <zherc...@webkit.org>
+
+        [Qt][ARM]ARMAssembler needs buildfix afert r123417
+        https://bugs.webkit.org/show_bug.cgi?id=92086
+
+        Reviewed by Csaba Osztrogonác.
+
+        The ARM implementation of this should be optimized code path
+        is covered by a non-optimized code path. This patch fixes this,
+        and adds a new function which returns with the offset range.
+
+        * assembler/ARMAssembler.h:
+        (JSC::ARMAssembler::readPointer):
+        (ARMAssembler):
+        (JSC::ARMAssembler::repatchInt32):
+        (JSC::ARMAssembler::repatchCompact):
+        * assembler/MacroAssemblerARM.h:
+        (MacroAssemblerARM):
+        (JSC::MacroAssemblerARM::isCompactPtrAlignedAddressOffset):
+        (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
+
 2012-07-25  Mark Hahnenberg  <mhahnenb...@apple.com>
 
         Build fix for 32-bit after r123682

Modified: trunk/Source/_javascript_Core/assembler/ARMAssembler.h (123734 => 123735)


--- trunk/Source/_javascript_Core/assembler/ARMAssembler.h	2012-07-26 12:21:09 UTC (rev 123734)
+++ trunk/Source/_javascript_Core/assembler/ARMAssembler.h	2012-07-26 12:29:10 UTC (rev 123735)
@@ -817,11 +817,11 @@
         // Read pointers
         static void* readPointer(void* from)
         {
-            ARMWord* insn = reinterpret_cast<ARMWord*>(from);
-            ARMWord* addr = getLdrImmAddress(insn);
-            return *reinterpret_cast<void**>(addr);
+            ARMWord* instruction = reinterpret_cast<ARMWord*>(from);
+            ARMWord* address = getLdrImmAddress(instruction);
+            return *reinterpret_cast<void**>(address);
         }
-        
+
         // Patch pointers
 
         static void linkPointer(void* code, AssemblerLabel from, void* to)
@@ -829,14 +829,20 @@
             patchPointerInternal(reinterpret_cast<intptr_t>(code) + from.m_offset, to);
         }
 
-        static void repatchInt32(void* from, int32_t to)
+        static void repatchInt32(void* where, int32_t to)
         {
-            patchPointerInternal(reinterpret_cast<intptr_t>(from), reinterpret_cast<void*>(to));
+            patchPointerInternal(reinterpret_cast<intptr_t>(where), reinterpret_cast<void*>(to));
         }
-        
+
         static void repatchCompact(void* where, int32_t value)
         {
-            repatchInt32(where, value);
+            ARMWord* instruction = reinterpret_cast<ARMWord*>(where);
+            ASSERT((*instruction & 0x0f700000) == LoadUint32);
+            if (value >= 0)
+                *instruction = (*instruction & 0xff7ff000) | DT_UP | value;
+            else
+                *instruction = (*instruction & 0xff7ff000) | -value;
+            cacheFlush(instruction, sizeof(ARMWord));
         }
 
         static void repatchPointer(void* from, void* to)

Modified: trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h (123734 => 123735)


--- trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h	2012-07-26 12:21:09 UTC (rev 123734)
+++ trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h	2012-07-26 12:29:10 UTC (rev 123735)
@@ -41,7 +41,6 @@
     COMPILE_ASSERT(!(DoubleConditionBitSpecial & DoubleConditionMask), DoubleConditionBitSpecial_should_not_interfere_with_ARMAssembler_Condition_codes);
 public:
     typedef ARMRegisters::FPRegisterID FPRegisterID;
-    static const int MaximumCompactPtrAlignedAddressOffset = 0x7FFFFFFF;
 
     enum RelationalCondition {
         Equal = ARMAssembler::EQ,
@@ -408,11 +407,20 @@
         m_assembler.dtr_ur(ARMAssembler::LoadUint32, dest, address.base, ARMRegisters::S0);
         return dataLabel;
     }
-    
+
+    static bool isCompactPtrAlignedAddressOffset(ptrdiff_t value)
+    {
+        return value >= -4095 && value <= 4095;
+    }
+
     DataLabelCompact load32WithCompactAddressOffsetPatch(Address address, RegisterID dest)
     {
         DataLabelCompact dataLabel(this);
-        load32WithAddressOffsetPatch(address, dest);
+        ASSERT(isCompactPtrAlignedAddressOffset(address.offset));
+        if (address.offset >= 0)
+            m_assembler.dtr_u(ARMAssembler::LoadUint32, dest, address.base, address.offset);
+        else
+            m_assembler.dtr_d(ARMAssembler::LoadUint32, dest, address.base, address.offset);
         return dataLabel;
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to