< prev index next >

src/hotspot/share/jvmci/jvmciRuntime.cpp

Print this page




 925       THREAD->set_pending_exception(exception(), exception_file, exception_line);
 926     }
 927   }
 928 }
 929 
 930 
 931 void JVMCIRuntime::exit_on_pending_exception(JVMCIEnv* JVMCIENV, const char* message) {
 932   JavaThread* THREAD = JavaThread::current();
 933 
 934   static volatile int report_error = 0;
 935   if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) {
 936     // Only report an error once
 937     tty->print_raw_cr(message);
 938     if (JVMCIENV != NULL) {
 939       JVMCIENV->describe_pending_exception(true);
 940     } else {
 941       describe_pending_hotspot_exception(THREAD, true);
 942     }
 943   } else {
 944     // Allow error reporting thread to print the stack trace.
 945     os::sleep(THREAD, 200);
 946   }
 947 
 948   before_exit(THREAD);
 949   vm_exit(-1);
 950 }
 951 
 952 // ------------------------------------------------------------------
 953 // Note: the logic of this method should mirror the logic of
 954 // constantPoolOopDesc::verify_constant_pool_resolve.
 955 bool JVMCIRuntime::check_klass_accessibility(Klass* accessing_klass, Klass* resolved_klass) {
 956   if (accessing_klass->is_objArray_klass()) {
 957     accessing_klass = ObjArrayKlass::cast(accessing_klass)->bottom_klass();
 958   }
 959   if (!accessing_klass->is_instance_klass()) {
 960     return true;
 961   }
 962 
 963   if (resolved_klass->is_objArray_klass()) {
 964     // Find the element klass, if this is an array.
 965     resolved_klass = ObjArrayKlass::cast(resolved_klass)->bottom_klass();




 925       THREAD->set_pending_exception(exception(), exception_file, exception_line);
 926     }
 927   }
 928 }
 929 
 930 
 931 void JVMCIRuntime::exit_on_pending_exception(JVMCIEnv* JVMCIENV, const char* message) {
 932   JavaThread* THREAD = JavaThread::current();
 933 
 934   static volatile int report_error = 0;
 935   if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) {
 936     // Only report an error once
 937     tty->print_raw_cr(message);
 938     if (JVMCIENV != NULL) {
 939       JVMCIENV->describe_pending_exception(true);
 940     } else {
 941       describe_pending_hotspot_exception(THREAD, true);
 942     }
 943   } else {
 944     // Allow error reporting thread to print the stack trace.
 945     THREAD->sleep(200);
 946   }
 947 
 948   before_exit(THREAD);
 949   vm_exit(-1);
 950 }
 951 
 952 // ------------------------------------------------------------------
 953 // Note: the logic of this method should mirror the logic of
 954 // constantPoolOopDesc::verify_constant_pool_resolve.
 955 bool JVMCIRuntime::check_klass_accessibility(Klass* accessing_klass, Klass* resolved_klass) {
 956   if (accessing_klass->is_objArray_klass()) {
 957     accessing_klass = ObjArrayKlass::cast(accessing_klass)->bottom_klass();
 958   }
 959   if (!accessing_klass->is_instance_klass()) {
 960     return true;
 961   }
 962 
 963   if (resolved_klass->is_objArray_klass()) {
 964     // Find the element klass, if this is an array.
 965     resolved_klass = ObjArrayKlass::cast(resolved_klass)->bottom_klass();


< prev index next >