Mercurial > hg > graal-compiler
comparison src/share/vm/utilities/exceptions.hpp @ 8337:37977d1dcedc
Transmit deoptimization reason in thread local.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 18 Mar 2013 00:20:07 +0100 |
parents | 6b6cbd8b8914 |
children | 6b0fd0964b87 |
comparison
equal
deleted
inserted
replaced
8336:38be33a1c28d | 8337:37977d1dcedc |
---|---|
59 | 59 |
60 class ThreadShadow: public CHeapObj<mtThread> { | 60 class ThreadShadow: public CHeapObj<mtThread> { |
61 friend class VMStructs; | 61 friend class VMStructs; |
62 | 62 |
63 protected: | 63 protected: |
64 int _pending_deoptimization; | |
64 bool _pending_monitorenter; | 65 bool _pending_monitorenter; |
65 oop _pending_exception; // Thread has gc actions. | 66 oop _pending_exception; // Thread has gc actions. |
66 const char* _exception_file; // file information for exception (debugging only) | 67 const char* _exception_file; // file information for exception (debugging only) |
67 int _exception_line; // line information for exception (debugging only) | 68 int _exception_line; // line information for exception (debugging only) |
68 friend void check_ThreadShadow(); // checks _pending_exception offset | 69 friend void check_ThreadShadow(); // checks _pending_exception offset |
75 // notice that Thread has a vtable but ThreadShadow does not. | 76 // notice that Thread has a vtable but ThreadShadow does not. |
76 virtual void unused_initial_virtual() { } | 77 virtual void unused_initial_virtual() { } |
77 | 78 |
78 public: | 79 public: |
79 oop pending_exception() const { return _pending_exception; } | 80 oop pending_exception() const { return _pending_exception; } |
81 int pending_deoptimization() const { return _pending_deoptimization; } | |
80 bool has_pending_exception() const { return _pending_exception != NULL; } | 82 bool has_pending_exception() const { return _pending_exception != NULL; } |
81 const char* exception_file() const { return _exception_file; } | 83 const char* exception_file() const { return _exception_file; } |
82 int exception_line() const { return _exception_line; } | 84 int exception_line() const { return _exception_line; } |
83 bool has_pending_monitorenter() const { return _pending_monitorenter; } | 85 bool has_pending_monitorenter() const { return _pending_monitorenter; } |
84 | 86 |
85 // Code generation support | 87 // Code generation support |
88 static ByteSize pending_deoptimization_offset() { return byte_offset_of(ThreadShadow, _pending_deoptimization); } | |
86 static ByteSize pending_exception_offset() { return byte_offset_of(ThreadShadow, _pending_exception); } | 89 static ByteSize pending_exception_offset() { return byte_offset_of(ThreadShadow, _pending_exception); } |
87 static ByteSize pending_monitorenter_offset() { return byte_offset_of(ThreadShadow, _pending_monitorenter); } | 90 static ByteSize pending_monitorenter_offset() { return byte_offset_of(ThreadShadow, _pending_monitorenter); } |
88 | 91 |
89 bool set_pending_monitorenter(bool b) { return _pending_monitorenter = b; } | 92 void set_pending_monitorenter(bool b) { _pending_monitorenter = b; } |
93 void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; } | |
90 | 94 |
91 // use THROW whenever possible! | 95 // use THROW whenever possible! |
92 void set_pending_exception(oop exception, const char* file, int line); | 96 void set_pending_exception(oop exception, const char* file, int line); |
93 | 97 |
94 // use CLEAR_PENDING_EXCEPTION whenever possible! | 98 // use CLEAR_PENDING_EXCEPTION whenever possible! |
95 void clear_pending_exception(); | 99 void clear_pending_exception(); |
96 | 100 |
97 ThreadShadow() : _pending_exception(NULL), | 101 ThreadShadow() : _pending_exception(NULL), |
98 _exception_file(NULL), _exception_line(0), _pending_monitorenter(false) {} | 102 _exception_file(NULL), _exception_line(0), _pending_monitorenter(false), _pending_deoptimization(-1) {} |
99 }; | 103 }; |
100 | 104 |
101 | 105 |
102 // Exceptions is a helper class that encapsulates all operations | 106 // Exceptions is a helper class that encapsulates all operations |
103 // that require access to the thread interface and which are | 107 // that require access to the thread interface and which are |