Mercurial > hg > graal-compiler
comparison src/share/vm/c1/c1_Runtime1.cpp @ 4974:ab906cea36f7
First round of minimizing diff vs OpenJDK.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 27 Feb 2012 15:15:59 +0100 |
parents | 33df1aeaebbf |
children | 532be189cf09 |
comparison
equal
deleted
inserted
replaced
4973:5d154704b04c | 4974:ab906cea36f7 |
---|---|
199 case g1_pre_barrier_slow_id: | 199 case g1_pre_barrier_slow_id: |
200 case g1_post_barrier_slow_id: | 200 case g1_post_barrier_slow_id: |
201 case slow_subtype_check_id: | 201 case slow_subtype_check_id: |
202 case fpu2long_stub_id: | 202 case fpu2long_stub_id: |
203 case unwind_exception_id: | 203 case unwind_exception_id: |
204 #ifdef GRAAL | |
204 case graal_verify_pointer_id: | 205 case graal_verify_pointer_id: |
205 case graal_unwind_exception_call_id: | 206 case graal_unwind_exception_call_id: |
206 case graal_slow_subtype_check_id: | 207 case graal_slow_subtype_check_id: |
207 case graal_arithmetic_frem_id: | 208 case graal_arithmetic_frem_id: |
208 case graal_arithmetic_drem_id: | 209 case graal_arithmetic_drem_id: |
209 case graal_set_deopt_info_id: | 210 case graal_set_deopt_info_id: |
211 #endif | |
210 #ifndef TIERED | 212 #ifndef TIERED |
211 case counter_overflow_id: // Not generated outside the tiered world | 213 case counter_overflow_id: // Not generated outside the tiered world |
212 #endif | 214 #endif |
213 #ifdef SPARC | 215 #if defined(SPARC) || defined(PPC) |
214 case handle_exception_nofpu_id: // Unused on sparc | 216 case handle_exception_nofpu_id: // Unused on sparc |
215 #endif | 217 #endif |
216 break; | 218 break; |
217 | 219 |
218 // All other stubs should have oopmaps | 220 // All other stubs should have oopmaps |
589 // Enter VM mode by calling the helper | 591 // Enter VM mode by calling the helper |
590 ResetNoHandleMark rnhm; | 592 ResetNoHandleMark rnhm; |
591 continuation = exception_handler_for_pc_helper(thread, exception, pc, nm); | 593 continuation = exception_handler_for_pc_helper(thread, exception, pc, nm); |
592 } | 594 } |
593 // Back in JAVA, use no oops DON'T safepoint | 595 // Back in JAVA, use no oops DON'T safepoint |
596 | |
594 // Now check to see if the nmethod we were called from is now deoptimized. | 597 // Now check to see if the nmethod we were called from is now deoptimized. |
595 // If so we must return to the deopt blob and deoptimize the nmethod | 598 // If so we must return to the deopt blob and deoptimize the nmethod |
596 if (nm != NULL && caller_is_deopted()) { | 599 if (nm != NULL && caller_is_deopted()) { |
597 continuation = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); | 600 continuation = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); |
598 } | 601 } |
644 NOT_PRODUCT(_throw_incompatible_class_change_error_count++;) | 647 NOT_PRODUCT(_throw_incompatible_class_change_error_count++;) |
645 ResourceMark rm(thread); | 648 ResourceMark rm(thread); |
646 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_IncompatibleClassChangeError()); | 649 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_IncompatibleClassChangeError()); |
647 JRT_END | 650 JRT_END |
648 | 651 |
649 | 652 #ifdef GRAAL |
650 JRT_ENTRY_NO_ASYNC(void, Runtime1::graal_monitorenter(JavaThread* thread, oopDesc* obj, BasicLock* lock)) | 653 JRT_ENTRY_NO_ASYNC(void, Runtime1::graal_monitorenter(JavaThread* thread, oopDesc* obj, BasicLock* lock)) |
651 NOT_PRODUCT(_monitorenter_slowcase_cnt++;) | 654 NOT_PRODUCT(_monitorenter_slowcase_cnt++;) |
652 #ifdef ASSERT | 655 #ifdef ASSERT |
653 if (TraceGraal >= 3) { | 656 if (TraceGraal >= 3) { |
654 tty->print_cr("entered locking slow case with obj=" INTPTR_FORMAT " and lock= " INTPTR_FORMAT, obj, lock); | 657 tty->print_cr("entered locking slow case with obj=" INTPTR_FORMAT " and lock= " INTPTR_FORMAT, obj, lock); |
705 } else { | 708 } else { |
706 ObjectSynchronizer::fast_exit(obj, lock, THREAD); | 709 ObjectSynchronizer::fast_exit(obj, lock, THREAD); |
707 } | 710 } |
708 JRT_END | 711 JRT_END |
709 | 712 |
713 #endif | |
714 | |
710 | 715 |
711 JRT_ENTRY_NO_ASYNC(void, Runtime1::monitorenter(JavaThread* thread, oopDesc* obj, BasicObjectLock* lock)) | 716 JRT_ENTRY_NO_ASYNC(void, Runtime1::monitorenter(JavaThread* thread, oopDesc* obj, BasicObjectLock* lock)) |
712 NOT_PRODUCT(_monitorenter_slowcase_cnt++;) | 717 NOT_PRODUCT(_monitorenter_slowcase_cnt++;) |
713 #ifdef ASSERT | |
714 if (TraceGraal >= 3) { | |
715 tty->print_cr("entered locking slow case with obj=" INTPTR_FORMAT " and lock= " INTPTR_FORMAT, obj, lock); | |
716 } | |
717 if (PrintBiasedLockingStatistics) { | 718 if (PrintBiasedLockingStatistics) { |
718 Atomic::inc(BiasedLocking::slow_path_entry_count_addr()); | 719 Atomic::inc(BiasedLocking::slow_path_entry_count_addr()); |
719 } | 720 } |
720 #endif | |
721 Handle h_obj(thread, obj); | 721 Handle h_obj(thread, obj); |
722 assert(h_obj()->is_oop(), "must be NULL or an object"); | 722 assert(h_obj()->is_oop(), "must be NULL or an object"); |
723 if (UseBiasedLocking) { | 723 if (UseBiasedLocking) { |
724 if (UseFastLocking) { | |
725 assert(obj == lock->obj(), "must match"); | |
726 } else { | |
727 lock->set_obj(obj); | |
728 } | |
729 // Retry fast entry if bias is revoked to avoid unnecessary inflation | 724 // Retry fast entry if bias is revoked to avoid unnecessary inflation |
730 ObjectSynchronizer::fast_enter(h_obj, lock->lock(), true, CHECK); | 725 ObjectSynchronizer::fast_enter(h_obj, lock->lock(), true, CHECK); |
731 } else { | 726 } else { |
732 if (UseFastLocking) { | 727 if (UseFastLocking) { |
733 // When using fast locking, the compiled code has already tried the fast case | 728 // When using fast locking, the compiled code has already tried the fast case |
736 } else { | 731 } else { |
737 lock->set_obj(obj); | 732 lock->set_obj(obj); |
738 ObjectSynchronizer::fast_enter(h_obj, lock->lock(), false, THREAD); | 733 ObjectSynchronizer::fast_enter(h_obj, lock->lock(), false, THREAD); |
739 } | 734 } |
740 } | 735 } |
741 #ifdef ASSERT | |
742 if (TraceGraal >= 3) { | |
743 tty->print_cr("exiting locking lock state: obj=" INTPTR_FORMAT, lock->obj()); | |
744 lock->lock()->print_on(tty); | |
745 tty->print_cr(""); | |
746 tty->print_cr("done"); | |
747 } | |
748 #endif | |
749 JRT_END | 736 JRT_END |
750 | 737 |
751 | 738 |
752 JRT_LEAF(void, Runtime1::monitorexit(JavaThread* thread, BasicObjectLock* lock)) | 739 JRT_LEAF(void, Runtime1::monitorexit(JavaThread* thread, BasicObjectLock* lock)) |
753 NOT_PRODUCT(_monitorexit_slowcase_cnt++;) | 740 NOT_PRODUCT(_monitorexit_slowcase_cnt++;) |