< prev index next >

src/hotspot/share/c1/c1_Runtime1.cpp

Print this page




 688   char* message = SharedRuntime::generate_class_cast_message(
 689     thread, object->klass());
 690   SharedRuntime::throw_and_post_jvmti_exception(
 691     thread, vmSymbols::java_lang_ClassCastException(), message);
 692 JRT_END
 693 
 694 
 695 JRT_ENTRY(void, Runtime1::throw_incompatible_class_change_error(JavaThread* thread))
 696   NOT_PRODUCT(_throw_incompatible_class_change_error_count++;)
 697   ResourceMark rm(thread);
 698   SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_IncompatibleClassChangeError());
 699 JRT_END
 700 
 701 
 702 JRT_ENTRY_NO_ASYNC(void, Runtime1::monitorenter(JavaThread* thread, oopDesc* obj, BasicObjectLock* lock))
 703   NOT_PRODUCT(_monitorenter_slowcase_cnt++;)
 704   if (PrintBiasedLockingStatistics) {
 705     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
 706   }
 707   Handle h_obj(thread, obj);
 708   if (UseBiasedLocking) {
 709     // Retry fast entry if bias is revoked to avoid unnecessary inflation
 710     ObjectSynchronizer::fast_enter(h_obj, lock->lock(), true, CHECK);
 711   } else {
 712     if (UseFastLocking) {
 713       // When using fast locking, the compiled code has already tried the fast case
 714       assert(obj == lock->obj(), "must match");
 715       ObjectSynchronizer::slow_enter(h_obj, lock->lock(), THREAD);
 716     } else {
 717       lock->set_obj(obj);
 718       ObjectSynchronizer::fast_enter(h_obj, lock->lock(), false, THREAD);
 719     }
 720   }


 721 JRT_END
 722 
 723 
 724 JRT_LEAF(void, Runtime1::monitorexit(JavaThread* thread, BasicObjectLock* lock))
 725   NOT_PRODUCT(_monitorexit_slowcase_cnt++;)
 726   assert(thread == JavaThread::current(), "threads must correspond");
 727   assert(thread->last_Java_sp(), "last_Java_sp must be set");
 728   // monitorexit is non-blocking (leaf routine) => no exceptions can be thrown
 729   EXCEPTION_MARK;
 730 
 731   oop obj = lock->obj();
 732   assert(oopDesc::is_oop(obj), "must be NULL or an object");
 733   if (UseFastLocking) {
 734     // When using fast locking, the compiled code has already tried the fast case
 735     ObjectSynchronizer::slow_exit(obj, lock->lock(), THREAD);
 736   } else {
 737     ObjectSynchronizer::fast_exit(obj, lock->lock(), THREAD);
 738   }
 739 JRT_END
 740 
 741 // Cf. OptoRuntime::deoptimize_caller_frame
 742 JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread, jint trap_request))
 743   // Called from within the owner thread, so no need for safepoint
 744   RegisterMap reg_map(thread, false);
 745   frame stub_frame = thread->last_frame();
 746   assert(stub_frame.is_runtime_frame(), "Sanity check");
 747   frame caller_frame = stub_frame.sender(&reg_map);
 748   nmethod* nm = caller_frame.cb()->as_nmethod_or_null();
 749   assert(nm != NULL, "Sanity check");
 750   methodHandle method(thread, nm->method());
 751   assert(nm == CodeCache::find_nmethod(caller_frame.pc()), "Should be the same");
 752   Deoptimization::DeoptAction action = Deoptimization::trap_request_action(trap_request);
 753   Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(trap_request);
 754 
 755   if (action == Deoptimization::Action_make_not_entrant) {
 756     if (nm->make_not_entrant()) {
 757       if (reason == Deoptimization::Reason_tenured) {
 758         MethodData* trap_mdo = Deoptimization::get_method_data(thread, method, true /*create_if_missing*/);




 688   char* message = SharedRuntime::generate_class_cast_message(
 689     thread, object->klass());
 690   SharedRuntime::throw_and_post_jvmti_exception(
 691     thread, vmSymbols::java_lang_ClassCastException(), message);
 692 JRT_END
 693 
 694 
 695 JRT_ENTRY(void, Runtime1::throw_incompatible_class_change_error(JavaThread* thread))
 696   NOT_PRODUCT(_throw_incompatible_class_change_error_count++;)
 697   ResourceMark rm(thread);
 698   SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_IncompatibleClassChangeError());
 699 JRT_END
 700 
 701 
 702 JRT_ENTRY_NO_ASYNC(void, Runtime1::monitorenter(JavaThread* thread, oopDesc* obj, BasicObjectLock* lock))
 703   NOT_PRODUCT(_monitorenter_slowcase_cnt++;)
 704   if (PrintBiasedLockingStatistics) {
 705     Atomic::inc(BiasedLocking::slow_path_entry_count_addr());
 706   }
 707   Handle h_obj(thread, obj);
 708   if (!UseFastLocking) {








 709     lock->set_obj(obj);


 710   }
 711   assert(obj == lock->obj(), "must match");
 712   ObjectSynchronizer::enter(h_obj, lock->lock(), THREAD);
 713 JRT_END
 714 
 715 
 716 JRT_LEAF(void, Runtime1::monitorexit(JavaThread* thread, BasicObjectLock* lock))
 717   NOT_PRODUCT(_monitorexit_slowcase_cnt++;)
 718   assert(thread == JavaThread::current(), "threads must correspond");
 719   assert(thread->last_Java_sp(), "last_Java_sp must be set");
 720   // monitorexit is non-blocking (leaf routine) => no exceptions can be thrown
 721   EXCEPTION_MARK;
 722 
 723   oop obj = lock->obj();
 724   assert(oopDesc::is_oop(obj), "must be NULL or an object");
 725   ObjectSynchronizer::exit(obj, lock->lock(), THREAD);





 726 JRT_END
 727 
 728 // Cf. OptoRuntime::deoptimize_caller_frame
 729 JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread, jint trap_request))
 730   // Called from within the owner thread, so no need for safepoint
 731   RegisterMap reg_map(thread, false);
 732   frame stub_frame = thread->last_frame();
 733   assert(stub_frame.is_runtime_frame(), "Sanity check");
 734   frame caller_frame = stub_frame.sender(&reg_map);
 735   nmethod* nm = caller_frame.cb()->as_nmethod_or_null();
 736   assert(nm != NULL, "Sanity check");
 737   methodHandle method(thread, nm->method());
 738   assert(nm == CodeCache::find_nmethod(caller_frame.pc()), "Should be the same");
 739   Deoptimization::DeoptAction action = Deoptimization::trap_request_action(trap_request);
 740   Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(trap_request);
 741 
 742   if (action == Deoptimization::Action_make_not_entrant) {
 743     if (nm->make_not_entrant()) {
 744       if (reason == Deoptimization::Reason_tenured) {
 745         MethodData* trap_mdo = Deoptimization::get_method_data(thread, method, true /*create_if_missing*/);


< prev index next >