Mercurial > hg > graal-compiler
comparison src/share/vm/graal/graalCodeInstaller.cpp @ 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 | b5dc2403c1e7 |
children | 43d5ae1051f7 |
comparison
equal
deleted
inserted
replaced
5103:276e14614531 | 5104:9ec2917fd0de |
---|---|
177 tty->print("%i", type); | 177 tty->print("%i", type); |
178 } else if (value->is_a(CiVirtualObject::klass())) { | 178 } else if (value->is_a(CiVirtualObject::klass())) { |
179 oop type = CiVirtualObject::type(value); | 179 oop type = CiVirtualObject::type(value); |
180 int id = CiVirtualObject::id(value); | 180 int id = CiVirtualObject::id(value); |
181 klassOop klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type)); | 181 klassOop klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type)); |
182 bool isLongArray = klass == Universe::longArrayKlassObj(); | |
182 | 183 |
183 for (jint i = 0; i < objects->length(); i++) { | 184 for (jint i = 0; i < objects->length(); i++) { |
184 ObjectValue* obj = (ObjectValue*) objects->at(i); | 185 ObjectValue* obj = (ObjectValue*) objects->at(i); |
185 if (obj->id() == id) { | 186 if (obj->id() == id) { |
186 return obj; | 187 return obj; |
196 | 197 |
197 for (jint i = 0; i < values->length(); i++) { | 198 for (jint i = 0; i < values->length(); i++) { |
198 ScopeValue* cur_second = NULL; | 199 ScopeValue* cur_second = NULL; |
199 ScopeValue* value = get_hotspot_value(((oop*) values->base(T_OBJECT))[i], total_frame_size, objects, cur_second); | 200 ScopeValue* value = get_hotspot_value(((oop*) values->base(T_OBJECT))[i], total_frame_size, objects, cur_second); |
200 | 201 |
202 if (isLongArray && cur_second == NULL) { | |
203 // we're trying to put ints into a long array... this isn't really valid, but it's used for some optimizations. | |
204 // add an int 0 constant | |
205 #ifdef BIG_ENDIAN | |
206 cur_second = value; | |
207 value = new ConstantIntValue(0); | |
208 #else | |
209 cur_second = new ConstantIntValue(0); | |
210 #endif | |
211 } | |
212 | |
201 if (cur_second != NULL) { | 213 if (cur_second != NULL) { |
202 sv->field_values()->append(cur_second); | 214 sv->field_values()->append(cur_second); |
203 } | 215 } |
204 sv->field_values()->append(value); | 216 sv->field_values()->append(value); |
205 } | 217 } |