changeset 2223:c1d2626ae66c

Alright?
author Gary Benson <gbenson@redhat.com>
date Wed, 16 Feb 2011 14:20:21 +0000
parents cf905f6ef379
children cd4291a0068f
files src/cpu/zero/vm/cppInterpreter_zero.cpp
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp	Wed Feb 16 14:05:03 2011 +0000
+++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp	Wed Feb 16 14:20:21 2011 +0000
@@ -610,11 +610,13 @@
   return 0;
 }
 
-#define VMSLOTS_SLOT(offset)    ((intptr_t*)&vmslot0[-(offset)])
-#define VMSLOTS_OBJECT(offset)  ((oop)vmslot0[-(offset)])
+#define VMSLOTS_SLOT(offset)    ((intptr_t*)&vmslot0[(offset)])
+#define VMSLOTS_OBJECT(offset)  ((oop)vmslot0[(offset)])
 
-#define SET_VMSLOTS_OBJECT(value, offset) \
-  (*((oop *)&vmslot0[-(offset)]) = (value))
+#define SET_VMSLOTS_SLOT(value, offset) \
+  (*(intptr_t*)&vmslot0[(offset)] = *(intptr_t *)(value))
+#define SET_VMSLOTS_OBJECT(value, offset)       \
+  (*((oop *)&vmslot0[(offset)]) = (value))
 
 int CppInterpreter::method_handle_entry(methodOop method,
                                         intptr_t UNUSED, TRAPS) {
@@ -634,7 +636,7 @@
   intptr_t *vmslot0 = stack->sp();
 
   // The MethodHandle is in the slot after the arguments
-  oop method_handle = VMSLOTS_OBJECT(-1);
+  oop method_handle = VMSLOTS_OBJECT(vmslots);
 
   // Compare the method type against that of the receiver
   oop mhtype = java_dyn_MethodHandle::type(method_handle);
@@ -680,16 +682,14 @@
         if (HAS_PENDING_EXCEPTION)
           break;
         stack->alloc(arg_slots * wordSize);
+        vmslots += arg_slots; // XXX
+        intptr_t *vmslot0 = stack->sp();
 
-        for (int i = -1; i < vmslots; i++)
-          tty->print_cr("a) VMSLOTS_OBJECT(%d) = %p", i, VMSLOTS_OBJECT(i));
-        
         // Shuffle everything up
         int arg_slot = sun_dyn_BoundMethodHandle::vmargslot(method_handle);
-        for (int i = vmslots - 1; i >= arg_slot; i--) {
-          Unimplemented();
-        }
-        vmslots += arg_slots;
+        tty->cr();
+        for (int i = 0; i < arg_slot; i++)
+          SET_VMSLOTS_SLOT(VMSLOTS_SLOT(i + 1), i);
 
         // Store bound argument into new stack slot
         oop arg = sun_dyn_BoundMethodHandle::argument(method_handle);