935 if (!clear) { 936 THREAD->set_pending_exception(exception(), exception_file, exception_line); 937 } 938 } 939 } 940 941 942 void JVMCIRuntime::exit_on_pending_exception(JVMCIEnv* JVMCIENV, const char* message) { 943 JavaThread* THREAD = JavaThread::current(); 944 945 static volatile int report_error = 0; 946 if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) { 947 // Only report an error once 948 tty->print_raw_cr(message); 949 if (JVMCIENV != NULL) { 950 JVMCIENV->describe_pending_exception(true); 951 } else { 952 describe_pending_hotspot_exception(THREAD, true); 953 } 954 } else { 955 // Allow error reporting thread to print the stack trace. Windows 956 // doesn't allow uninterruptible wait for JavaThreads 957 const bool interruptible = true; 958 os::sleep(THREAD, 200, interruptible); 959 } 960 961 before_exit(THREAD); 962 vm_exit(-1); 963 } 964 965 // ------------------------------------------------------------------ 966 // Note: the logic of this method should mirror the logic of 967 // constantPoolOopDesc::verify_constant_pool_resolve. 968 bool JVMCIRuntime::check_klass_accessibility(Klass* accessing_klass, Klass* resolved_klass) { 969 if (accessing_klass->is_objArray_klass()) { 970 accessing_klass = ObjArrayKlass::cast(accessing_klass)->bottom_klass(); 971 } 972 if (!accessing_klass->is_instance_klass()) { 973 return true; 974 } 975 976 if (resolved_klass->is_objArray_klass()) { 977 // Find the element klass, if this is an array. 978 resolved_klass = ObjArrayKlass::cast(resolved_klass)->bottom_klass(); | 935 if (!clear) { 936 THREAD->set_pending_exception(exception(), exception_file, exception_line); 937 } 938 } 939 } 940 941 942 void JVMCIRuntime::exit_on_pending_exception(JVMCIEnv* JVMCIENV, const char* message) { 943 JavaThread* THREAD = JavaThread::current(); 944 945 static volatile int report_error = 0; 946 if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) { 947 // Only report an error once 948 tty->print_raw_cr(message); 949 if (JVMCIENV != NULL) { 950 JVMCIENV->describe_pending_exception(true); 951 } else { 952 describe_pending_hotspot_exception(THREAD, true); 953 } 954 } else { 955 // Allow error reporting thread to print the stack trace. 956 os::sleep(THREAD, 200); 957 } 958 959 before_exit(THREAD); 960 vm_exit(-1); 961 } 962 963 // ------------------------------------------------------------------ 964 // Note: the logic of this method should mirror the logic of 965 // constantPoolOopDesc::verify_constant_pool_resolve. 966 bool JVMCIRuntime::check_klass_accessibility(Klass* accessing_klass, Klass* resolved_klass) { 967 if (accessing_klass->is_objArray_klass()) { 968 accessing_klass = ObjArrayKlass::cast(accessing_klass)->bottom_klass(); 969 } 970 if (!accessing_klass->is_instance_klass()) { 971 return true; 972 } 973 974 if (resolved_klass->is_objArray_klass()) { 975 // Find the element klass, if this is an array. 976 resolved_klass = ObjArrayKlass::cast(resolved_klass)->bottom_klass(); |