Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/sharedRuntime.cpp @ 22298:c28cb37b2e1d
Rename JVMCI to INCLUDE_JVMCI.
author | twisti |
---|---|
date | Wed, 22 Jul 2015 08:56:03 -0700 |
parents | be896a1983c0 |
children | 7eda81bed2f3 |
comparison
equal
deleted
inserted
replaced
22297:571202729bbf | 22298:c28cb37b2e1d |
---|---|
109 _ic_miss_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method_ic_miss), "ic_miss_stub"); | 109 _ic_miss_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method_ic_miss), "ic_miss_stub"); |
110 _resolve_opt_virtual_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_opt_virtual_call_C), "resolve_opt_virtual_call"); | 110 _resolve_opt_virtual_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_opt_virtual_call_C), "resolve_opt_virtual_call"); |
111 _resolve_virtual_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_virtual_call_C), "resolve_virtual_call"); | 111 _resolve_virtual_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_virtual_call_C), "resolve_virtual_call"); |
112 _resolve_static_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_static_call_C), "resolve_static_call"); | 112 _resolve_static_call_blob = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_static_call_C), "resolve_static_call"); |
113 | 113 |
114 #if defined(COMPILER2) || defined(JVMCI) | 114 #if defined(COMPILER2) || INCLUDE_JVMCI |
115 // Vectors are generated only by C2 and JVMCI. | 115 // Vectors are generated only by C2 and JVMCI. |
116 bool support_wide = is_wide_vector(MaxVectorSize); | 116 bool support_wide = is_wide_vector(MaxVectorSize); |
117 if (support_wide) { | 117 if (support_wide) { |
118 _polling_page_vectors_safepoint_handler_blob = generate_handler_blob(CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception), POLL_AT_VECTOR_LOOP); | 118 _polling_page_vectors_safepoint_handler_blob = generate_handler_blob(CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception), POLL_AT_VECTOR_LOOP); |
119 } | 119 } |
486 assert(thread->frames_to_pop_failed_realloc() == 0 || Interpreter::contains(return_address), "missed frames to pop?"); | 486 assert(thread->frames_to_pop_failed_realloc() == 0 || Interpreter::contains(return_address), "missed frames to pop?"); |
487 | 487 |
488 // Reset method handle flag. | 488 // Reset method handle flag. |
489 thread->set_is_method_handle_return(false); | 489 thread->set_is_method_handle_return(false); |
490 | 490 |
491 #ifdef JVMCI | 491 #if INCLUDE_JVMCI |
492 // JVMCI's ExceptionHandlerStub expects the thread local exception PC to be clear | 492 // JVMCI's ExceptionHandlerStub expects the thread local exception PC to be clear |
493 // and other exception handler continuations do not read it | 493 // and other exception handler continuations do not read it |
494 thread->set_exception_pc(NULL); | 494 thread->set_exception_pc(NULL); |
495 #endif | 495 #endif |
496 | 496 |
648 address SharedRuntime::compute_compiled_exc_handler(nmethod* nm, address ret_pc, Handle& exception, | 648 address SharedRuntime::compute_compiled_exc_handler(nmethod* nm, address ret_pc, Handle& exception, |
649 bool force_unwind, bool top_frame_only) { | 649 bool force_unwind, bool top_frame_only) { |
650 assert(nm != NULL, "must exist"); | 650 assert(nm != NULL, "must exist"); |
651 ResourceMark rm; | 651 ResourceMark rm; |
652 | 652 |
653 #ifdef JVMCI | 653 #if INCLUDE_JVMCI |
654 if (nm->is_compiled_by_jvmci()) { | 654 if (nm->is_compiled_by_jvmci()) { |
655 // lookup exception handler for this pc | 655 // lookup exception handler for this pc |
656 int catch_pco = ret_pc - nm->code_begin(); | 656 int catch_pco = ret_pc - nm->code_begin(); |
657 ExceptionHandlerTable table(nm); | 657 ExceptionHandlerTable table(nm); |
658 HandlerTableEntry *t = table.entry_for(catch_pco, -1, 0); | 658 HandlerTableEntry *t = table.entry_for(catch_pco, -1, 0); |
793 java_lang_Throwable::fill_in_stack_trace(exception); | 793 java_lang_Throwable::fill_in_stack_trace(exception); |
794 } | 794 } |
795 throw_and_post_jvmti_exception(thread, exception); | 795 throw_and_post_jvmti_exception(thread, exception); |
796 JRT_END | 796 JRT_END |
797 | 797 |
798 #ifdef JVMCI | 798 #if INCLUDE_JVMCI |
799 address SharedRuntime::deoptimize_for_implicit_exception(JavaThread* thread, address pc, nmethod* nm, int deopt_reason) { | 799 address SharedRuntime::deoptimize_for_implicit_exception(JavaThread* thread, address pc, nmethod* nm, int deopt_reason) { |
800 assert(deopt_reason > Deoptimization::Reason_none && deopt_reason < Deoptimization::Reason_LIMIT, "invalid deopt reason"); | 800 assert(deopt_reason > Deoptimization::Reason_none && deopt_reason < Deoptimization::Reason_LIMIT, "invalid deopt reason"); |
801 thread->set_jvmci_implicit_exception_pc(pc); | 801 thread->set_jvmci_implicit_exception_pc(pc); |
802 thread->set_pending_deoptimization(Deoptimization::make_trap_request((Deoptimization::DeoptReason)deopt_reason, Deoptimization::Action_reinterpret)); | 802 thread->set_pending_deoptimization(Deoptimization::make_trap_request((Deoptimization::DeoptReason)deopt_reason, Deoptimization::Action_reinterpret)); |
803 return (SharedRuntime::deopt_blob()->implicit_exception_uncommon_trap()); | 803 return (SharedRuntime::deopt_blob()->implicit_exception_uncommon_trap()); |
899 } | 899 } |
900 | 900 |
901 #ifndef PRODUCT | 901 #ifndef PRODUCT |
902 _implicit_null_throws++; | 902 _implicit_null_throws++; |
903 #endif | 903 #endif |
904 #ifdef JVMCI | 904 #if INCLUDE_JVMCI |
905 if (nm->is_compiled_by_jvmci() && nm->pc_desc_at(pc) != NULL) { | 905 if (nm->is_compiled_by_jvmci() && nm->pc_desc_at(pc) != NULL) { |
906 // If there's no PcDesc then we'll die way down inside of | 906 // If there's no PcDesc then we'll die way down inside of |
907 // deopt instead of just getting normal error reporting, | 907 // deopt instead of just getting normal error reporting, |
908 // so only go there if it will succeed. | 908 // so only go there if it will succeed. |
909 return deoptimize_for_implicit_exception(thread, pc, nm, Deoptimization::Reason_null_check); | 909 return deoptimize_for_implicit_exception(thread, pc, nm, Deoptimization::Reason_null_check); |
910 } else { | 910 } else { |
911 #endif | 911 #endif |
912 target_pc = nm->continuation_for_implicit_exception(pc); | 912 target_pc = nm->continuation_for_implicit_exception(pc); |
913 #ifdef JVMCI | 913 #if INCLUDE_JVMCI |
914 } | 914 } |
915 #endif | 915 #endif |
916 // If there's an unexpected fault, target_pc might be NULL, | 916 // If there's an unexpected fault, target_pc might be NULL, |
917 // in which case we want to fall through into the normal | 917 // in which case we want to fall through into the normal |
918 // error handling code. | 918 // error handling code. |
926 nmethod* nm = CodeCache::find_nmethod(pc); | 926 nmethod* nm = CodeCache::find_nmethod(pc); |
927 guarantee(nm != NULL, "must have containing nmethod for implicit division-by-zero exceptions"); | 927 guarantee(nm != NULL, "must have containing nmethod for implicit division-by-zero exceptions"); |
928 #ifndef PRODUCT | 928 #ifndef PRODUCT |
929 _implicit_div0_throws++; | 929 _implicit_div0_throws++; |
930 #endif | 930 #endif |
931 #ifdef JVMCI | 931 #if INCLUDE_JVMCI |
932 if (nm->is_compiled_by_jvmci() && nm->pc_desc_at(pc) != NULL) { | 932 if (nm->is_compiled_by_jvmci() && nm->pc_desc_at(pc) != NULL) { |
933 return deoptimize_for_implicit_exception(thread, pc, nm, Deoptimization::Reason_div0_check); | 933 return deoptimize_for_implicit_exception(thread, pc, nm, Deoptimization::Reason_div0_check); |
934 } else { | 934 } else { |
935 #endif | 935 #endif |
936 target_pc = nm->continuation_for_implicit_exception(pc); | 936 target_pc = nm->continuation_for_implicit_exception(pc); |
937 #ifdef JVMCI | 937 #if INCLUDE_JVMCI |
938 } | 938 } |
939 #endif | 939 #endif |
940 // If there's an unexpected fault, target_pc might be NULL, | 940 // If there's an unexpected fault, target_pc might be NULL, |
941 // in which case we want to fall through into the normal | 941 // in which case we want to fall through into the normal |
942 // error handling code. | 942 // error handling code. |
1011 os::yield_all(attempts); | 1011 os::yield_all(attempts); |
1012 JRT_END | 1012 JRT_END |
1013 | 1013 |
1014 | 1014 |
1015 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj)) | 1015 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj)) |
1016 #ifdef JVMCI | 1016 #if INCLUDE_JVMCI |
1017 if (!obj->klass()->has_finalizer()) { | 1017 if (!obj->klass()->has_finalizer()) { |
1018 return; | 1018 return; |
1019 } | 1019 } |
1020 #endif | 1020 #endif |
1021 assert(obj->is_oop(), "must be a valid oop"); | 1021 assert(obj->is_oop(), "must be a valid oop"); |