64 |
64 |
65 |
65 |
66 typedef class BytecodeInterpreter* interpreterState; |
66 typedef class BytecodeInterpreter* interpreterState; |
67 |
67 |
68 struct call_message { |
68 struct call_message { |
69 class Method* _callee; /* method to call during call_method request */ |
69 class Method* _callee; // method to call during call_method request |
70 address _callee_entry_point; /* address to jump to for call_method request */ |
70 address _callee_entry_point; // address to jump to for call_method request |
71 int _bcp_advance; /* size of the invoke bytecode operation */ |
71 int _bcp_advance; // size of the invoke bytecode operation |
72 }; |
72 }; |
73 |
73 |
74 struct osr_message { |
74 struct osr_message { |
75 address _osr_buf; /* the osr buffer */ |
75 address _osr_buf; // the osr buffer |
76 address _osr_entry; /* the entry to the osr method */ |
76 address _osr_entry; // the entry to the osr method |
77 }; |
77 }; |
78 |
78 |
79 struct osr_result { |
79 struct osr_result { |
80 nmethod* nm; /* osr nmethod */ |
80 nmethod* nm; // osr nmethod |
81 address return_addr; /* osr blob return address */ |
81 address return_addr; // osr blob return address |
82 }; |
82 }; |
83 |
83 |
84 // Result returned to frame manager |
84 // Result returned to frame manager |
85 union frame_manager_message { |
85 union frame_manager_message { |
86 call_message _to_call; /* describes callee */ |
86 call_message _to_call; // describes callee |
87 Bytecodes::Code _return_kind; /* i_return, a_return, ... */ |
87 osr_message _osr; // describes the osr |
88 osr_message _osr; /* describes the osr */ |
88 osr_result _osr_result; // result of OSR request |
89 osr_result _osr_result; /* result of OSR request */ |
|
90 }; |
89 }; |
91 |
90 |
92 class BytecodeInterpreter : StackObj { |
91 class BytecodeInterpreter : StackObj { |
93 friend class SharedRuntime; |
92 friend class SharedRuntime; |
94 friend class AbstractInterpreterGenerator; |
93 friend class AbstractInterpreterGenerator; |
113 call_method, // request for new frame from interpreter, manager responds with method_entry |
112 call_method, // request for new frame from interpreter, manager responds with method_entry |
114 return_from_method, // request from interpreter to unwind, manager responds with method_continue |
113 return_from_method, // request from interpreter to unwind, manager responds with method_continue |
115 more_monitors, // need a new monitor |
114 more_monitors, // need a new monitor |
116 throwing_exception, // unwind stack and rethrow |
115 throwing_exception, // unwind stack and rethrow |
117 popping_frame, // unwind call and retry call |
116 popping_frame, // unwind call and retry call |
118 do_osr // request this invocation be OSR's |
117 do_osr, // request this invocation be OSR's |
|
118 early_return // early return as commanded by jvmti |
119 }; |
119 }; |
120 |
120 |
121 private: |
121 private: |
122 JavaThread* _thread; // the vm's java thread pointer |
122 JavaThread* _thread; // the vm's java thread pointer |
123 address _bcp; // instruction pointer |
123 address _bcp; // instruction pointer |
214 inline void set_osr_buf(address buf) { _result._osr._osr_buf = buf; } |
214 inline void set_osr_buf(address buf) { _result._osr._osr_buf = buf; } |
215 inline void set_osr_entry(address entry) { _result._osr._osr_entry = entry; } |
215 inline void set_osr_entry(address entry) { _result._osr._osr_entry = entry; } |
216 inline int bcp_advance() { return _result._to_call._bcp_advance; } |
216 inline int bcp_advance() { return _result._to_call._bcp_advance; } |
217 inline void set_bcp_advance(int count) { _result._to_call._bcp_advance = count; } |
217 inline void set_bcp_advance(int count) { _result._to_call._bcp_advance = count; } |
218 |
218 |
219 inline void set_return_kind(Bytecodes::Code kind) { _result._return_kind = kind; } |
|
220 |
|
221 inline interpreterState prev() { return _prev_link; } |
219 inline interpreterState prev() { return _prev_link; } |
222 |
220 |
223 inline intptr_t* stack() { return _stack; } |
221 inline intptr_t* stack() { return _stack; } |
224 inline void set_stack(intptr_t* new_stack) { _stack = new_stack; } |
222 inline void set_stack(intptr_t* new_stack) { _stack = new_stack; } |
225 |
223 |