comparison src/share/vm/graal/graalRuntime.cpp @ 7145:6c46172c04bf

consolidated new_type_array and new_object_array stubs into one as there no difference between them
author Doug Simon <doug.simon@oracle.com>
date Fri, 07 Dec 2012 18:26:26 +0100
parents 1baf7f1e3f23
children 5d0bb7d52783 2ae3e26b7e9a
comparison
equal deleted inserted replaced
7144:ae69cd8c08a9 7145:6c46172c04bf
242 // allocate instance and return via TLS 242 // allocate instance and return via TLS
243 oop obj = h->allocate_instance(CHECK); 243 oop obj = h->allocate_instance(CHECK);
244 thread->set_vm_result(obj); 244 thread->set_vm_result(obj);
245 JRT_END 245 JRT_END
246 246
247 247 JRT_ENTRY(void, GraalRuntime::new_array(JavaThread* thread, Klass* array_klass, jint length))
248 JRT_ENTRY(void, GraalRuntime::new_type_array(JavaThread* thread, Klass* klass, jint length))
249 // Note: no handle for klass needed since they are not used
250 // anymore after new_typeArray() and no GC can happen before.
251 // (This may have to change if this code changes!)
252 assert(klass->is_klass(), "not a class");
253 BasicType elt_type = TypeArrayKlass::cast(klass)->element_type();
254 oop obj = oopFactory::new_typeArray(elt_type, length, CHECK);
255 thread->set_vm_result(obj);
256 // This is pretty rare but this runtime patch is stressful to deoptimization
257 // if we deoptimize here so force a deopt to stress the path.
258 if (DeoptimizeALot) {
259 deopt_caller();
260 }
261
262 JRT_END
263
264
265 JRT_ENTRY(void, GraalRuntime::new_object_array(JavaThread* thread, Klass* array_klass, jint length))
266 // Note: no handle for klass needed since they are not used 248 // Note: no handle for klass needed since they are not used
267 // anymore after new_objArray() and no GC can happen before. 249 // anymore after new_objArray() and no GC can happen before.
268 // (This may have to change if this code changes!) 250 // (This may have to change if this code changes!)
269 assert(array_klass->is_klass(), "not a class"); 251 assert(array_klass->is_klass(), "not a class");
270 Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass(); 252 oop obj;
271 objArrayOop obj = oopFactory::new_objArray(elem_klass, length, CHECK); 253 if (array_klass->oop_is_typeArray()) {
254 BasicType elt_type = TypeArrayKlass::cast(array_klass)->element_type();
255 obj = oopFactory::new_typeArray(elt_type, length, CHECK);
256 } else {
257 Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass();
258 obj = oopFactory::new_objArray(elem_klass, length, CHECK);
259 }
272 thread->set_vm_result(obj); 260 thread->set_vm_result(obj);
273 // This is pretty rare but this runtime patch is stressful to deoptimization 261 // This is pretty rare but this runtime patch is stressful to deoptimization
274 // if we deoptimize here so force a deopt to stress the path. 262 // if we deoptimize here so force a deopt to stress the path.
275 if (DeoptimizeALot) { 263 if (DeoptimizeALot) {
276 deopt_caller(); 264 deopt_caller();