comparison src/share/vm/graal/graalRuntime.cpp @ 7221:2ae3e26b7e9a

Merge.
author Christian Haeubl <haeubl@ssw.jku.at>
date Tue, 11 Dec 2012 08:48:12 +0100
parents fcae6d960acd 6c46172c04bf
children 720925633b3a
comparison
equal deleted inserted replaced
7220:fcae6d960acd 7221:2ae3e26b7e9a
245 // allocate instance and return via TLS 245 // allocate instance and return via TLS
246 oop obj = h->allocate_instance(CHECK); 246 oop obj = h->allocate_instance(CHECK);
247 thread->set_vm_result(obj); 247 thread->set_vm_result(obj);
248 JRT_END 248 JRT_END
249 249
250 250 JRT_ENTRY(void, GraalRuntime::new_array(JavaThread* thread, Klass* array_klass, jint length))
251 JRT_ENTRY(void, GraalRuntime::new_type_array(JavaThread* thread, Klass* klass, jint length))
252 // Note: no handle for klass needed since they are not used
253 // anymore after new_typeArray() and no GC can happen before.
254 // (This may have to change if this code changes!)
255 assert(klass->is_klass(), "not a class");
256 BasicType elt_type = TypeArrayKlass::cast(klass)->element_type();
257 oop obj = oopFactory::new_typeArray(elt_type, length, CHECK);
258 thread->set_vm_result(obj);
259 // This is pretty rare but this runtime patch is stressful to deoptimization
260 // if we deoptimize here so force a deopt to stress the path.
261 if (DeoptimizeALot) {
262 deopt_caller();
263 }
264
265 JRT_END
266
267
268 JRT_ENTRY(void, GraalRuntime::new_object_array(JavaThread* thread, Klass* array_klass, jint length))
269 // Note: no handle for klass needed since they are not used 251 // Note: no handle for klass needed since they are not used
270 // anymore after new_objArray() and no GC can happen before. 252 // anymore after new_objArray() and no GC can happen before.
271 // (This may have to change if this code changes!) 253 // (This may have to change if this code changes!)
272 assert(array_klass->is_klass(), "not a class"); 254 assert(array_klass->is_klass(), "not a class");
273 Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass(); 255 oop obj;
274 objArrayOop obj = oopFactory::new_objArray(elem_klass, length, CHECK); 256 if (array_klass->oop_is_typeArray()) {
257 BasicType elt_type = TypeArrayKlass::cast(array_klass)->element_type();
258 obj = oopFactory::new_typeArray(elt_type, length, CHECK);
259 } else {
260 Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass();
261 obj = oopFactory::new_objArray(elem_klass, length, CHECK);
262 }
275 thread->set_vm_result(obj); 263 thread->set_vm_result(obj);
276 // This is pretty rare but this runtime patch is stressful to deoptimization 264 // This is pretty rare but this runtime patch is stressful to deoptimization
277 // if we deoptimize here so force a deopt to stress the path. 265 // if we deoptimize here so force a deopt to stress the path.
278 if (DeoptimizeALot) { 266 if (DeoptimizeALot) {
279 deopt_caller(); 267 deopt_caller();