42 virtual void check_and_handle_popframe(Register java_thread); |
42 virtual void check_and_handle_popframe(Register java_thread); |
43 virtual void check_and_handle_earlyret(Register java_thread); |
43 virtual void check_and_handle_earlyret(Register java_thread); |
44 |
44 |
45 // base routine for all dispatches |
45 // base routine for all dispatches |
46 void dispatch_base(TosState state, address* table, bool verifyoop = true); |
46 void dispatch_base(TosState state, address* table, bool verifyoop = true); |
|
47 #endif // CC_INTERP |
47 |
48 |
48 public: |
49 public: |
49 InterpreterMacroAssembler(CodeBuffer* code) |
50 InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {} |
50 : MacroAssembler(code) |
|
51 {} |
|
52 |
51 |
53 void load_earlyret_value(TosState state); |
52 void load_earlyret_value(TosState state); |
54 |
53 |
|
54 #ifdef CC_INTERP |
|
55 void save_bcp() { /* not needed in c++ interpreter and harmless */ } |
|
56 void restore_bcp() { /* not needed in c++ interpreter and harmless */ } |
|
57 |
|
58 // Helpers for runtime call arguments/results |
|
59 void get_method(Register reg); |
|
60 |
|
61 #else |
|
62 |
55 // Interpreter-specific registers |
63 // Interpreter-specific registers |
56 void save_bcp() |
64 void save_bcp() { |
57 { |
65 movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), r13); |
58 movq(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), r13); |
66 } |
59 } |
67 |
60 |
68 void restore_bcp() { |
61 void restore_bcp() |
69 movptr(r13, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); |
62 { |
70 } |
63 movq(r13, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); |
71 |
64 } |
72 void restore_locals() { |
65 |
73 movptr(r14, Address(rbp, frame::interpreter_frame_locals_offset * wordSize)); |
66 void restore_locals() |
|
67 { |
|
68 movq(r14, Address(rbp, frame::interpreter_frame_locals_offset * wordSize)); |
|
69 } |
74 } |
70 |
75 |
71 // Helpers for runtime call arguments/results |
76 // Helpers for runtime call arguments/results |
72 void get_method(Register reg) |
77 void get_method(Register reg) { |
73 { |
78 movptr(reg, Address(rbp, frame::interpreter_frame_method_offset * wordSize)); |
74 movq(reg, Address(rbp, frame::interpreter_frame_method_offset * wordSize)); |
79 } |
75 } |
80 |
76 |
81 void get_constant_pool(Register reg) { |
77 void get_constant_pool(Register reg) |
|
78 { |
|
79 get_method(reg); |
82 get_method(reg); |
80 movq(reg, Address(reg, methodOopDesc::constants_offset())); |
83 movptr(reg, Address(reg, methodOopDesc::constants_offset())); |
81 } |
84 } |
82 |
85 |
83 void get_constant_pool_cache(Register reg) |
86 void get_constant_pool_cache(Register reg) { |
84 { |
|
85 get_constant_pool(reg); |
87 get_constant_pool(reg); |
86 movq(reg, Address(reg, constantPoolOopDesc::cache_offset_in_bytes())); |
88 movptr(reg, Address(reg, constantPoolOopDesc::cache_offset_in_bytes())); |
87 } |
89 } |
88 |
90 |
89 void get_cpool_and_tags(Register cpool, Register tags) |
91 void get_cpool_and_tags(Register cpool, Register tags) { |
90 { |
|
91 get_constant_pool(cpool); |
92 get_constant_pool(cpool); |
92 movq(tags, Address(cpool, constantPoolOopDesc::tags_offset_in_bytes())); |
93 movptr(tags, Address(cpool, constantPoolOopDesc::tags_offset_in_bytes())); |
93 } |
94 } |
94 |
95 |
95 void get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset); |
96 void get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset); |
96 void get_cache_and_index_at_bcp(Register cache, Register index, |
97 void get_cache_and_index_at_bcp(Register cache, Register index, |
97 int bcp_offset); |
98 int bcp_offset); |
98 void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, |
99 void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, |
99 int bcp_offset); |
100 int bcp_offset); |
|
101 |
100 |
102 |
101 void pop_ptr(Register r = rax); |
103 void pop_ptr(Register r = rax); |
102 void pop_i(Register r = rax); |
104 void pop_i(Register r = rax); |
103 void pop_l(Register r = rax); |
105 void pop_l(Register r = rax); |
104 void pop_f(XMMRegister r = xmm0); |
106 void pop_f(XMMRegister r = xmm0); |
107 void push_i(Register r = rax); |
109 void push_i(Register r = rax); |
108 void push_l(Register r = rax); |
110 void push_l(Register r = rax); |
109 void push_f(XMMRegister r = xmm0); |
111 void push_f(XMMRegister r = xmm0); |
110 void push_d(XMMRegister r = xmm0); |
112 void push_d(XMMRegister r = xmm0); |
111 |
113 |
|
114 void pop(Register r ) { ((MacroAssembler*)this)->pop(r); } |
|
115 |
|
116 void push(Register r ) { ((MacroAssembler*)this)->push(r); } |
|
117 void push(int32_t imm ) { ((MacroAssembler*)this)->push(imm); } |
|
118 |
112 void pop(TosState state); // transition vtos -> state |
119 void pop(TosState state); // transition vtos -> state |
113 void push(TosState state); // transition state -> vtos |
120 void push(TosState state); // transition state -> vtos |
114 |
121 |
115 // Tagged stack support, pop and push both tag and value. |
122 // Tagged stack support, pop and push both tag and value. |
116 void pop_ptr(Register r, Register tag); |
123 void pop_ptr(Register r, Register tag); |
117 void push_ptr(Register r, Register tag); |
124 void push_ptr(Register r, Register tag); |
|
125 #endif // CC_INTERP |
118 |
126 |
119 DEBUG_ONLY(void verify_stack_tag(frame::Tag t);) |
127 DEBUG_ONLY(void verify_stack_tag(frame::Tag t);) |
|
128 |
|
129 #ifndef CC_INTERP |
120 |
130 |
121 // Tagged stack helpers for swap and dup |
131 // Tagged stack helpers for swap and dup |
122 void load_ptr_and_tag(int n, Register val, Register tag); |
132 void load_ptr_and_tag(int n, Register val, Register tag); |
123 void store_ptr_and_tag(int n, Register val, Register tag); |
133 void store_ptr_and_tag(int n, Register val, Register tag); |
124 |
134 |
131 #ifdef ASSERT |
141 #ifdef ASSERT |
132 void verify_local_tag(frame::Tag tag, int n); |
142 void verify_local_tag(frame::Tag tag, int n); |
133 void verify_local_tag(frame::Tag tag, Register idx); |
143 void verify_local_tag(frame::Tag tag, Register idx); |
134 #endif // ASSERT |
144 #endif // ASSERT |
135 |
145 |
|
146 |
136 void empty_expression_stack() |
147 void empty_expression_stack() |
137 { |
148 { |
138 movq(rsp, Address(rbp, frame::interpreter_frame_monitor_block_top_offset * |
149 movptr(rsp, Address(rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize)); |
139 wordSize)); |
|
140 // NULL last_sp until next java call |
150 // NULL last_sp until next java call |
141 movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); |
151 movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); |
142 } |
152 } |
143 |
153 |
144 // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls |
154 // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls |
145 void super_call_VM_leaf(address entry_point); |
155 void super_call_VM_leaf(address entry_point); |
146 void super_call_VM_leaf(address entry_point, Register arg_1); |
156 void super_call_VM_leaf(address entry_point, Register arg_1); |
183 // and installing an exception. |
193 // and installing an exception. |
184 void remove_activation(TosState state, Register ret_addr, |
194 void remove_activation(TosState state, Register ret_addr, |
185 bool throw_monitor_exception = true, |
195 bool throw_monitor_exception = true, |
186 bool install_monitor_exception = true, |
196 bool install_monitor_exception = true, |
187 bool notify_jvmdi = true); |
197 bool notify_jvmdi = true); |
|
198 #endif // CC_INTERP |
188 |
199 |
189 // Object locking |
200 // Object locking |
190 void lock_object (Register lock_reg); |
201 void lock_object (Register lock_reg); |
191 void unlock_object(Register lock_reg); |
202 void unlock_object(Register lock_reg); |
|
203 |
|
204 #ifndef CC_INTERP |
192 |
205 |
193 // Interpreter profiling operations |
206 // Interpreter profiling operations |
194 void set_method_data_pointer_for_bcp(); |
207 void set_method_data_pointer_for_bcp(); |
195 void test_method_data_pointer(Register mdp, Label& zero_continue); |
208 void test_method_data_pointer(Register mdp, Label& zero_continue); |
196 void verify_method_data_pointer(); |
209 void verify_method_data_pointer(); |
235 // only if +VerifyOops && state == atos |
248 // only if +VerifyOops && state == atos |
236 void verify_oop(Register reg, TosState state = atos); |
249 void verify_oop(Register reg, TosState state = atos); |
237 // only if +VerifyFPU && (state == ftos || state == dtos) |
250 // only if +VerifyFPU && (state == ftos || state == dtos) |
238 void verify_FPU(int stack_depth, TosState state = ftos); |
251 void verify_FPU(int stack_depth, TosState state = ftos); |
239 |
252 |
|
253 #endif // !CC_INTERP |
|
254 |
240 typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode; |
255 typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode; |
241 |
256 |
242 // support for jvmti/dtrace |
257 // support for jvmti/dtrace |
243 void notify_method_entry(); |
258 void notify_method_entry(); |
244 void notify_method_exit(TosState state, NotifyMethodExitMode mode); |
259 void notify_method_exit(TosState state, NotifyMethodExitMode mode); |