45 void check_ThreadShadow() {
46 const ByteSize offset1 = byte_offset_of(ThreadShadow, _pending_exception);
47 const ByteSize offset2 = Thread::pending_exception_offset();
48 if (offset1 != offset2) fatal("ThreadShadow::_pending_exception is not positioned correctly");
49 }
50
51
52 void ThreadShadow::set_pending_exception(oop exception, const char* file, int line) {
53 assert(exception != NULL && oopDesc::is_oop(exception), "invalid exception oop");
54 _pending_exception = exception;
55 _exception_file = file;
56 _exception_line = line;
57 }
58
59 void ThreadShadow::clear_pending_exception() {
60 LogTarget(Debug, exceptions) lt;
61 if (_pending_exception != NULL && lt.is_enabled()) {
62 ResourceMark rm;
63 LogStream ls(lt);
64 ls.print("Thread::clear_pending_exception: cleared exception:");
65 _pending_exception->print_on(&ls);
66 }
67 _pending_exception = NULL;
68 _exception_file = NULL;
69 _exception_line = 0;
70 }
71 // Implementation of Exceptions
72
73 bool Exceptions::special_exception(Thread* thread, const char* file, int line, Handle h_exception) {
74 // bootstrapping check
75 if (!Universe::is_fully_initialized()) {
76 vm_exit_during_initialization(h_exception);
77 ShouldNotReachHere();
78 }
79
80 #ifdef ASSERT
81 // Check for trying to throw stack overflow before initialization is complete
82 // to prevent infinite recursion trying to initialize stack overflow without
83 // adequate stack space.
84 // This can happen with stress testing a large value of StackShadowPages
85 if (h_exception()->klass() == SystemDictionary::StackOverflowError_klass()) {
|
45 void check_ThreadShadow() {
46 const ByteSize offset1 = byte_offset_of(ThreadShadow, _pending_exception);
47 const ByteSize offset2 = Thread::pending_exception_offset();
48 if (offset1 != offset2) fatal("ThreadShadow::_pending_exception is not positioned correctly");
49 }
50
51
52 void ThreadShadow::set_pending_exception(oop exception, const char* file, int line) {
53 assert(exception != NULL && oopDesc::is_oop(exception), "invalid exception oop");
54 _pending_exception = exception;
55 _exception_file = file;
56 _exception_line = line;
57 }
58
59 void ThreadShadow::clear_pending_exception() {
60 LogTarget(Debug, exceptions) lt;
61 if (_pending_exception != NULL && lt.is_enabled()) {
62 ResourceMark rm;
63 LogStream ls(lt);
64 ls.print("Thread::clear_pending_exception: cleared exception:");
65 oopDesc::print_on(&ls, _pending_exception);
66 }
67 _pending_exception = NULL;
68 _exception_file = NULL;
69 _exception_line = 0;
70 }
71 // Implementation of Exceptions
72
73 bool Exceptions::special_exception(Thread* thread, const char* file, int line, Handle h_exception) {
74 // bootstrapping check
75 if (!Universe::is_fully_initialized()) {
76 vm_exit_during_initialization(h_exception);
77 ShouldNotReachHere();
78 }
79
80 #ifdef ASSERT
81 // Check for trying to throw stack overflow before initialization is complete
82 // to prevent infinite recursion trying to initialize stack overflow without
83 // adequate stack space.
84 // This can happen with stress testing a large value of StackShadowPages
85 if (h_exception()->klass() == SystemDictionary::StackOverflowError_klass()) {
|