[masm] Cleanup: Use load64/store64 masm interface
authorSimon Hausmann <simon.hausmann@digia.com>
Mon, 22 Oct 2012 09:37:03 +0000 (11:37 +0200)
committerLars Knoll <lars.knoll@digia.com>
Mon, 22 Oct 2012 11:18:38 +0000 (13:18 +0200)
The API allows us to distinguish between loading/storing a 64-bit value
or a pointer and we should make use of that to make the code more readable
and to be able to run on x32 in the future.

Change-Id: Id2e1d8af566486540a1f6d086fb8db91f0fed6f8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
qv4isel_masm_p.h

index 7d0b81a..b0e4158 100644 (file)
@@ -255,16 +255,18 @@ private:
         addPtr(TrustedImm32(ptr.offset), ptr.base, dest);
     }
 
+#ifdef VALUE_FITS_IN_REGISTER
     void loadArgument(IR::Temp* temp, RegisterID dest)
     {
         if (!temp) {
             VM::Value undefined = VM::Value::undefinedValue();
-            move(TrustedImmPtr((const void *)undefined.val), dest);
+            move(TrustedImm64(undefined.val), dest);
         } else {
             Pointer addr = loadTempAddress(dest, temp);
-            loadPtr(addr, dest);
+            load64(addr, dest);
         }
     }
+#endif
 
     void loadArgument(VM::String* string, RegisterID dest)
     {
@@ -283,7 +285,7 @@ private:
         if (temp) {
             Pointer addr = loadTempAddress(ScratchRegister2, temp);
 #ifdef VALUE_FITS_IN_REGISTER
-            storePtr(src, addr);
+            store64(src, addr);
 #else
             // If the value doesn't fit into a register, then the
             // register contains the address to where the argument
@@ -296,7 +298,7 @@ private:
 #ifdef VALUE_FITS_IN_REGISTER
     void storeArgument(RegisterID src, const Pointer &dest)
     {
-        storePtr(src, dest);
+        store64(src, dest);
     }
 #endif
 
@@ -526,7 +528,7 @@ private:
     void storeValue(VM::Value value, Address destination)
     {
 #ifdef VALUE_FITS_IN_REGISTER
-        storePtr(TrustedImmPtr((void *)value.val), destination);
+        store64(TrustedImm64(value.val), destination);
 #else
         store32(TrustedImm32(value.int_32), destination);
         destination.offset += 4;