changeset 523:ed1c211cf918

Summary: Additional datatype corrections Reviewed By: glewis - There is no movptr(Address, int32_t) function for x86/32 bit. Casting to int32_t for movptr on x86/32 should be avoided. Instead cast directly to intptr_t where needed. - Several places in the x86/32 code movl is directly used where movptr is the correct function. movptr on x86/32 ends up using movl but deals with the type variations without the need for additional casts. - Use NULL_WORD to assign a NULL value to intptr_t instead of (intptr_t) NULL
author truk@seraph.intricatesoftware.com
date Tue, 20 Jan 2009 15:26:41 -0500
parents b86ce5362022
children 641d6ebd862a
files src/cpu/x86/vm/interp_masm_x86_32.cpp src/cpu/x86/vm/interpreterRT_x86_32.cpp src/cpu/x86/vm/templateTable_x86_32.cpp
diffstat 3 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/x86/vm/interp_masm_x86_32.cpp	Sun Jan 18 21:42:26 2009 -0800
+++ b/src/cpu/x86/vm/interp_masm_x86_32.cpp	Tue Jan 20 15:26:41 2009 -0500
@@ -149,7 +149,7 @@
   // Clean up tos value in the thread object
   movl(tos_addr,  (int32_t) ilgl);
   movptr(val_addr,  NULL_WORD);
-  NOT_LP64(movl(val_addr1, (int32_t)NULL_WORD));
+  NOT_LP64(movptr(val_addr1, NULL_WORD));
 }
 
 
@@ -473,7 +473,7 @@
       movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n+1)), (intptr_t)frame::TagValue);
       movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), (intptr_t)frame::TagValue);
     } else {
-      movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), (int32_t)tag);
+      movptr(Address(rdi, Interpreter::local_tag_offset_in_bytes(n)), (intptr_t)tag);
     }
   }
 }
@@ -487,7 +487,7 @@
                     Interpreter::local_tag_offset_in_bytes(0)), (intptr_t)frame::TagValue);
     } else {
       movptr(Address(rdi, idx, Interpreter::stackElementScale(),
-                               Interpreter::local_tag_offset_in_bytes(0)), (int32_t)tag);
+                               Interpreter::local_tag_offset_in_bytes(0)), (intptr_t)tag);
     }
   }
 }
@@ -1319,7 +1319,7 @@
   int recvr_offset = in_bytes(VirtualCallData::receiver_offset(start_row));
   set_mdp_data_at(mdp, recvr_offset, receiver);
   int count_offset = in_bytes(VirtualCallData::receiver_count_offset(start_row));
-  movptr(reg2, (int32_t)DataLayout::counter_increment);
+  movptr(reg2, (intptr_t)DataLayout::counter_increment);
   set_mdp_data_at(mdp, count_offset, reg2);
   jmp(done);
 }
@@ -1458,7 +1458,7 @@
     test_method_data_pointer(mdp, profile_continue);
 
     // Build the base (index * per_case_size_in_bytes()) + case_array_offset_in_bytes()
-    movptr(reg2, (int32_t)in_bytes(MultiBranchData::per_case_size()));
+    movptr(reg2, (intptr_t)in_bytes(MultiBranchData::per_case_size()));
     // index is positive and so should have correct value if this code were
     // used on 64bits
     imulptr(index, reg2);
--- a/src/cpu/x86/vm/interpreterRT_x86_32.cpp	Sun Jan 18 21:42:26 2009 -0800
+++ b/src/cpu/x86/vm/interpreterRT_x86_32.cpp	Tue Jan 20 15:26:41 2009 -0500
@@ -110,7 +110,7 @@
   virtual void pass_object() {
     // pass address of from
     intptr_t from_addr = (intptr_t)(_from + Interpreter::local_offset_in_bytes(0));
-    *_to++ = (*(intptr_t*)from_addr == 0) ? (intptr_t) NULL : from_addr;
+    *_to++ = (*(intptr_t*)from_addr == 0) ? NULL_WORD : from_addr;
     debug_only(verify_tag(frame::TagReference));
     _from -= Interpreter::stackElementSize();
    }
--- a/src/cpu/x86/vm/templateTable_x86_32.cpp	Sun Jan 18 21:42:26 2009 -0800
+++ b/src/cpu/x86/vm/templateTable_x86_32.cpp	Tue Jan 20 15:26:41 2009 -0500
@@ -137,10 +137,10 @@
         // Do the actual store
         // noreg means NULL
         if (val == noreg) {
-          __ movl(Address(rdx, 0), (int32_t)NULL_WORD);
+          __ movptr(Address(rdx, 0), NULL_WORD);
           // No post barrier for NULL
         } else {
-          __ movl(Address(rdx, 0), val);
+          __ movptr(Address(rdx, 0), val);
           __ g1_write_barrier_post(rdx, rax, rcx, rbx, rsi);
         }
         __ restore_bcp();
@@ -152,9 +152,9 @@
     case BarrierSet::CardTableExtension:
       {
         if (val == noreg) {
-          __ movl(obj, (int32_t) NULL_WORD);
+          __ movptr(obj, NULL_WORD);
         } else {
-          __ movl(obj, val);
+          __ movptr(obj, val);
           // flatten object address if needed
           if (!precise || (obj.index() == noreg && obj.disp() == 0)) {
             __ store_check(obj.base());
@@ -168,9 +168,9 @@
     case BarrierSet::ModRef:
     case BarrierSet::Other:
       if (val == noreg) {
-        __ movl(obj, (int32_t) NULL_WORD);
+        __ movptr(obj, NULL_WORD);
       } else {
-        __ movl(obj, val);
+        __ movptr(obj, val);
       }
       break;
     default      :