863 default: ShouldNotReachHere();
864 }
865
866 assert(exception_kind == IMPLICIT_NULL || exception_kind == IMPLICIT_DIVIDE_BY_ZERO, "wrong implicit exception kind");
867
868 // for AbortVMOnException flag
869 NOT_PRODUCT(Exceptions::debug_check_abort("java.lang.NullPointerException"));
870 if (exception_kind == IMPLICIT_NULL) {
871 Events::log_exception(thread, "Implicit null exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, pc, target_pc);
872 } else {
873 Events::log_exception(thread, "Implicit division by zero exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, pc, target_pc);
874 }
875 return target_pc;
876 }
877
878 ShouldNotReachHere();
879 return NULL;
880 }
881
882
883 JNI_ENTRY(void, throw_unsatisfied_link_error(JNIEnv* env, ...))
884 {
885 THROW(vmSymbols::java_lang_UnsatisfiedLinkError());
886 }
887 JNI_END
888
889 JNI_ENTRY(void, throw_unsupported_operation_exception(JNIEnv* env, ...))
890 {
891 THROW(vmSymbols::java_lang_UnsupportedOperationException());
892 }
893 JNI_END
894
895 address SharedRuntime::native_method_throw_unsatisfied_link_error_entry() {
896 return CAST_FROM_FN_PTR(address, &throw_unsatisfied_link_error);
897 }
898
899 address SharedRuntime::native_method_throw_unsupported_operation_exception_entry() {
900 return CAST_FROM_FN_PTR(address, &throw_unsupported_operation_exception);
901 }
902
903
904 #ifndef PRODUCT
905 JRT_ENTRY(intptr_t, SharedRuntime::trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2))
906 const frame f = thread->last_frame();
907 assert(f.is_interpreted_frame(), "must be an interpreted frame");
908 #ifndef PRODUCT
909 methodHandle mh(THREAD, f.interpreter_frame_method());
910 BytecodeTracer::trace(mh, f.interpreter_frame_bcp(), tos, tos2);
911 #endif // !PRODUCT
912 return preserve_this_value;
913 JRT_END
914 #endif // !PRODUCT
915
916
917 JRT_ENTRY(void, SharedRuntime::yield_all(JavaThread* thread, int attempts))
918 os::yield_all(attempts);
919 JRT_END
920
921
922 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj))
|
863 default: ShouldNotReachHere();
864 }
865
866 assert(exception_kind == IMPLICIT_NULL || exception_kind == IMPLICIT_DIVIDE_BY_ZERO, "wrong implicit exception kind");
867
868 // for AbortVMOnException flag
869 NOT_PRODUCT(Exceptions::debug_check_abort("java.lang.NullPointerException"));
870 if (exception_kind == IMPLICIT_NULL) {
871 Events::log_exception(thread, "Implicit null exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, pc, target_pc);
872 } else {
873 Events::log_exception(thread, "Implicit division by zero exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, pc, target_pc);
874 }
875 return target_pc;
876 }
877
878 ShouldNotReachHere();
879 return NULL;
880 }
881
882
883 /**
884 * Throws an java/lang/UnsatisfiedLinkError. The address of this method is
885 * installed in the native function entry of all native Java methods before
886 * they get linked to their actual native methods.
887 *
888 * \note
889 * This method actually never gets called! The reason is because
890 * the interpreter's native entries call NativeLookup::lookup() which
891 * throws the exception when the lookup fails. The exception is then
892 * caught and forwarded on the return from NativeLookup::lookup() call
893 * before the call to the native function. This might change in the future.
894 */
895 JNI_ENTRY(void*, throw_unsatisfied_link_error(JNIEnv* env, ...))
896 {
897 // We return a bad value here to make sure that the exception is
898 // forwarded before we look at the return value.
899 THROW_(vmSymbols::java_lang_UnsatisfiedLinkError(), (void*)badJNIHandle);
900 }
901 JNI_END
902
903 address SharedRuntime::native_method_throw_unsatisfied_link_error_entry() {
904 return CAST_FROM_FN_PTR(address, &throw_unsatisfied_link_error);
905 }
906
907
908 #ifndef PRODUCT
909 JRT_ENTRY(intptr_t, SharedRuntime::trace_bytecode(JavaThread* thread, intptr_t preserve_this_value, intptr_t tos, intptr_t tos2))
910 const frame f = thread->last_frame();
911 assert(f.is_interpreted_frame(), "must be an interpreted frame");
912 #ifndef PRODUCT
913 methodHandle mh(THREAD, f.interpreter_frame_method());
914 BytecodeTracer::trace(mh, f.interpreter_frame_bcp(), tos, tos2);
915 #endif // !PRODUCT
916 return preserve_this_value;
917 JRT_END
918 #endif // !PRODUCT
919
920
921 JRT_ENTRY(void, SharedRuntime::yield_all(JavaThread* thread, int attempts))
922 os::yield_all(attempts);
923 JRT_END
924
925
926 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj))
|