changeset 5104:9ec2917fd0de

Allow ints to be put into a virtual long array.
author Andreas Woess <andreas.woess@jku.at>
date Tue, 20 Mar 2012 17:13:57 +0100
parents 276e14614531
children 3d0556d10a2b
files src/share/vm/graal/graalCodeInstaller.cpp
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Tue Mar 20 14:43:09 2012 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Tue Mar 20 17:13:57 2012 +0100
@@ -179,6 +179,7 @@
     oop type = CiVirtualObject::type(value);
     int id = CiVirtualObject::id(value);
     klassOop klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type));
+    bool isLongArray = klass == Universe::longArrayKlassObj();
 
     for (jint i = 0; i < objects->length(); i++) {
       ObjectValue* obj = (ObjectValue*) objects->at(i);
@@ -198,6 +199,17 @@
       ScopeValue* cur_second = NULL;
       ScopeValue* value = get_hotspot_value(((oop*) values->base(T_OBJECT))[i], total_frame_size, objects, cur_second);
       
+      if (isLongArray && cur_second == NULL) {
+        // we're trying to put ints into a long array... this isn't really valid, but it's used for some optimizations.
+        // add an int 0 constant
+#ifdef BIG_ENDIAN
+        cur_second = value;
+        value = new ConstantIntValue(0);
+#else
+        cur_second = new ConstantIntValue(0);
+#endif
+      }
+
       if (cur_second != NULL) {
         sv->field_values()->append(cur_second);
       }