< prev index next >

src/hotspot/share/opto/runtime.cpp

Print this page
rev 50331 : 8198285: More consistent Access API for arraycopy
rev 50332 : [mq]: JDK-8203232-2.patch
rev 50333 : [mq]: JDK-8198285-3.patch


 376   jint dims[5];
 377   dims[0] = len1;
 378   dims[1] = len2;
 379   dims[2] = len3;
 380   dims[3] = len4;
 381   dims[4] = len5;
 382   Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
 383   oop obj = ArrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD);
 384   deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
 385   thread->set_vm_result(obj);
 386 JRT_END
 387 
 388 JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(Klass* elem_type, arrayOopDesc* dims, JavaThread *thread))
 389   assert(check_compiled_frame(thread), "incorrect caller");
 390   assert(elem_type->is_klass(), "not a class");
 391   assert(oop(dims)->is_typeArray(), "not an array");
 392 
 393   ResourceMark rm;
 394   jint len = dims->length();
 395   assert(len > 0, "Dimensions array should contain data");
 396   jint *j_dims = typeArrayOop(dims)->int_at_addr(0);
 397   jint *c_dims = NEW_RESOURCE_ARRAY(jint, len);
 398   Copy::conjoint_jints_atomic(j_dims, c_dims, len);

 399 
 400   Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
 401   oop obj = ArrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD);
 402   deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
 403   thread->set_vm_result(obj);
 404 JRT_END
 405 
 406 JRT_BLOCK_ENTRY(void, OptoRuntime::monitor_notify_C(oopDesc* obj, JavaThread *thread))
 407 
 408   // Very few notify/notifyAll operations find any threads on the waitset, so
 409   // the dominant fast-path is to simply return.
 410   // Relatedly, it's critical that notify/notifyAll be fast in order to
 411   // reduce lock hold times.
 412   if (!SafepointSynchronize::is_synchronizing()) {
 413     if (ObjectSynchronizer::quick_notify(obj, thread, false)) {
 414       return;
 415     }
 416   }
 417 
 418   // This is the case the fast-path above isn't provisioned to handle.




 376   jint dims[5];
 377   dims[0] = len1;
 378   dims[1] = len2;
 379   dims[2] = len3;
 380   dims[3] = len4;
 381   dims[4] = len5;
 382   Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
 383   oop obj = ArrayKlass::cast(elem_type)->multi_allocate(5, dims, THREAD);
 384   deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
 385   thread->set_vm_result(obj);
 386 JRT_END
 387 
 388 JRT_ENTRY(void, OptoRuntime::multianewarrayN_C(Klass* elem_type, arrayOopDesc* dims, JavaThread *thread))
 389   assert(check_compiled_frame(thread), "incorrect caller");
 390   assert(elem_type->is_klass(), "not a class");
 391   assert(oop(dims)->is_typeArray(), "not an array");
 392 
 393   ResourceMark rm;
 394   jint len = dims->length();
 395   assert(len > 0, "Dimensions array should contain data");

 396   jint *c_dims = NEW_RESOURCE_ARRAY(jint, len);
 397   ArrayAccess<>::arraycopy_to_native<>(dims, typeArrayOopDesc::element_offset<jint>(0),
 398                                        c_dims, len);
 399 
 400   Handle holder(THREAD, elem_type->klass_holder()); // keep the klass alive
 401   oop obj = ArrayKlass::cast(elem_type)->multi_allocate(len, c_dims, THREAD);
 402   deoptimize_caller_frame(thread, HAS_PENDING_EXCEPTION);
 403   thread->set_vm_result(obj);
 404 JRT_END
 405 
 406 JRT_BLOCK_ENTRY(void, OptoRuntime::monitor_notify_C(oopDesc* obj, JavaThread *thread))
 407 
 408   // Very few notify/notifyAll operations find any threads on the waitset, so
 409   // the dominant fast-path is to simply return.
 410   // Relatedly, it's critical that notify/notifyAll be fast in order to
 411   // reduce lock hold times.
 412   if (!SafepointSynchronize::is_synchronizing()) {
 413     if (ObjectSynchronizer::quick_notify(obj, thread, false)) {
 414       return;
 415     }
 416   }
 417 
 418   // This is the case the fast-path above isn't provisioned to handle.


< prev index next >