30 #include "logging/logStream.hpp"
31 #include "memory/resourceArea.hpp"
32 #include "oops/oop.inline.hpp"
33 #include "runtime/init.hpp"
34 #include "runtime/java.hpp"
35 #include "runtime/javaCalls.hpp"
36 #include "runtime/thread.inline.hpp"
37 #include "runtime/threadCritical.hpp"
38 #include "utilities/events.hpp"
39 #include "utilities/exceptions.hpp"
40
41 // Implementation of ThreadShadow
42 void check_ThreadShadow() {
43 const ByteSize offset1 = byte_offset_of(ThreadShadow, _pending_exception);
44 const ByteSize offset2 = Thread::pending_exception_offset();
45 if (offset1 != offset2) fatal("ThreadShadow::_pending_exception is not positioned correctly");
46 }
47
48
49 void ThreadShadow::set_pending_exception(oop exception, const char* file, int line) {
50 assert(exception != NULL && exception->is_oop(), "invalid exception oop");
51 _pending_exception = exception;
52 _exception_file = file;
53 _exception_line = line;
54 }
55
56 void ThreadShadow::clear_pending_exception() {
57 LogTarget(Debug, exceptions) lt;
58 if (_pending_exception != NULL && lt.is_enabled()) {
59 ResourceMark rm;
60 LogStream ls(lt);
61 ls.print("Thread::clear_pending_exception: cleared exception:");
62 _pending_exception->print_on(&ls);
63 }
64 _pending_exception = NULL;
65 _exception_file = NULL;
66 _exception_line = 0;
67 }
68 // Implementation of Exceptions
69
70 bool Exceptions::special_exception(Thread* thread, const char* file, int line, Handle h_exception) {
|
30 #include "logging/logStream.hpp"
31 #include "memory/resourceArea.hpp"
32 #include "oops/oop.inline.hpp"
33 #include "runtime/init.hpp"
34 #include "runtime/java.hpp"
35 #include "runtime/javaCalls.hpp"
36 #include "runtime/thread.inline.hpp"
37 #include "runtime/threadCritical.hpp"
38 #include "utilities/events.hpp"
39 #include "utilities/exceptions.hpp"
40
41 // Implementation of ThreadShadow
42 void check_ThreadShadow() {
43 const ByteSize offset1 = byte_offset_of(ThreadShadow, _pending_exception);
44 const ByteSize offset2 = Thread::pending_exception_offset();
45 if (offset1 != offset2) fatal("ThreadShadow::_pending_exception is not positioned correctly");
46 }
47
48
49 void ThreadShadow::set_pending_exception(oop exception, const char* file, int line) {
50 assert(exception != NULL && oopDesc::is_oop(exception), "invalid exception oop");
51 _pending_exception = exception;
52 _exception_file = file;
53 _exception_line = line;
54 }
55
56 void ThreadShadow::clear_pending_exception() {
57 LogTarget(Debug, exceptions) lt;
58 if (_pending_exception != NULL && lt.is_enabled()) {
59 ResourceMark rm;
60 LogStream ls(lt);
61 ls.print("Thread::clear_pending_exception: cleared exception:");
62 _pending_exception->print_on(&ls);
63 }
64 _pending_exception = NULL;
65 _exception_file = NULL;
66 _exception_line = 0;
67 }
68 // Implementation of Exceptions
69
70 bool Exceptions::special_exception(Thread* thread, const char* file, int line, Handle h_exception) {
|