380 jint dims[5];
381 dims[0] = len1;
382 dims[1] = len2;
383 dims[2] = len3;
384 dims[3] = len4;
385 dims[4] = len5;
386 Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
387 oop obj = ArrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD);
388 deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
389 thread->set_vm_result(obj);
390 JRT_END
391
392 JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(Klass* elem_type, arrayOopDesc* dims, JavaThread *thread))
393 assert(check_compiled_frame(thread), "incorrect caller");
394 assert(elem_type->is_klass(), "not a class");
395 assert(oop(dims)->is_typeArray(), "not an array");
396
397 ResourceMark rm;
398 jint len = dims->length();
399 assert(len > 0, "Dimensions array should contain data");
400 jint *j_dims = typeArrayOop(dims)->int_at_addr(0);
401 jint *c_dims = NEW_RESOURCE_ARRAY(jint, len);
402 Copy::conjoint_jints_atomic(j_dims, c_dims, len);
403
404 Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
405 oop obj = ArrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD);
406 deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
407 thread->set_vm_result(obj);
408 JRT_END
409
410 JRT_BLOCK_ENTRY(void, OptoRuntime::monitor_notify_C(oopDesc* obj, JavaThread *thread))
411
412 // Very few notify/notifyAll operations find any threads on the waitset, so
413 // the dominant fast-path is to simply return.
414 // Relatedly, it's critical that notify/notifyAll be fast in order to
415 // reduce lock hold times.
416 if (!SafepointSynchronize::is_synchronizing()) {
417 if (ObjectSynchronizer::quick_notify(obj, thread, false)) {
418 return;
419 }
420 }
421
422 // This is the case the fast-path above isn't provisioned to handle.
|
380 jint dims[5];
381 dims[0] = len1;
382 dims[1] = len2;
383 dims[2] = len3;
384 dims[3] = len4;
385 dims[4] = len5;
386 Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
387 oop obj = ArrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD);
388 deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
389 thread->set_vm_result(obj);
390 JRT_END
391
392 JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(Klass* elem_type, arrayOopDesc* dims, JavaThread *thread))
393 assert(check_compiled_frame(thread), "incorrect caller");
394 assert(elem_type->is_klass(), "not a class");
395 assert(oop(dims)->is_typeArray(), "not an array");
396
397 ResourceMark rm;
398 jint len = dims->length();
399 assert(len > 0, "Dimensions array should contain data");
400 jint *c_dims = NEW_RESOURCE_ARRAY(jint, len);
401 HeapAccess<>::arraycopy<jint>(dims, typeArrayOopDesc::element_offset<jint>(0), NULL,
402 NULL, 0, c_dims, len);
403
404 Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
405 oop obj = ArrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD);
406 deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
407 thread->set_vm_result(obj);
408 JRT_END
409
410 JRT_BLOCK_ENTRY(void, OptoRuntime::monitor_notify_C(oopDesc* obj, JavaThread *thread))
411
412 // Very few notify/notifyAll operations find any threads on the waitset, so
413 // the dominant fast-path is to simply return.
414 // Relatedly, it's critical that notify/notifyAll be fast in order to
415 // reduce lock hold times.
416 if (!SafepointSynchronize::is_synchronizing()) {
417 if (ObjectSynchronizer::quick_notify(obj, thread, false)) {
418 return;
419 }
420 }
421
422 // This is the case the fast-path above isn't provisioned to handle.
|