141
142 void get_constant_pool(Register reg) {
143 get_const(reg);
144 ldr(reg, Address(reg, in_bytes(ConstMethod::constants_offset())));
145 }
146
147 void get_constant_pool_cache(Register reg) {
148 get_constant_pool(reg);
149 ldr(reg, Address(reg, ConstantPool::cache_offset()));
150 }
151
152 void get_cpool_and_tags(Register cpool, Register tags) {
153 get_constant_pool(cpool);
154 ldr(tags, Address(cpool, ConstantPool::tags_offset()));
155 }
156
157 void get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset);
158 void get_cache_index_at_bcp(Register index, int bcp_offset, size_t index_size = sizeof(u2));
159 void get_method_counters(Register method, Register mcs, Label& skip);
160
161 // load cpool->resolved_references(index);
162 void load_resolved_reference_at_index(Register result, Register index, Register tmp = r5);
163
164 // load cpool->resolved_klass_at(index);
165 void load_resolved_klass_at_offset(Register cpool, Register index, Register klass, Register temp);
166
167 void pop_ptr(Register r = r0);
168 void pop_i(Register r = r0);
169 void pop_l(Register r = r0);
170 void pop_f(FloatRegister r = v0);
171 void pop_d(FloatRegister r = v0);
172 void push_ptr(Register r = r0);
173 void push_i(Register r = r0);
174 void push_l(Register r = r0);
175 void push_f(FloatRegister r = v0);
176 void push_d(FloatRegister r = v0);
177
178 void pop(Register r ) { ((MacroAssembler*)this)->pop(r); }
179
180 void push(Register r ) { ((MacroAssembler*)this)->push(r); }
185 void pop(RegSet regs, Register stack) { ((MacroAssembler*)this)->pop(regs, stack); }
186 void push(RegSet regs, Register stack) { ((MacroAssembler*)this)->push(regs, stack); }
187
188 void empty_expression_stack() {
189 ldr(rscratch1, Address(rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize));
190 lea(esp, Address(rfp, rscratch1, Address::lsl(LogBytesPerWord)));
191 // null last_sp until next java call
192 str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
193 }
194
195 // Helpers for swap and dup
196 void load_ptr(int n, Register val);
197 void store_ptr(int n, Register val);
198
199 // Load float value from 'address'. The value is loaded onto the FPU register v0.
200 void load_float(Address src);
201 void load_double(Address src);
202
203 // Generate a subtype check: branch to ok_is_subtype if sub_klass is
204 // a subtype of super_klass.
205 void gen_subtype_check( Register sub_klass, Label &ok_is_subtype );
206
207 // Dispatching
208 void dispatch_prolog(TosState state, int step = 0);
209 void dispatch_epilog(TosState state, int step = 0);
210 // dispatch via rscratch1
211 void dispatch_only(TosState state, bool generate_poll = false);
212 // dispatch normal table via rscratch1 (assume rscratch1 is loaded already)
213 void dispatch_only_normal(TosState state);
214 void dispatch_only_noverify(TosState state);
215 // load rscratch1 from [rbcp + step] and dispatch via rscratch1
216 void dispatch_next(TosState state, int step = 0, bool generate_poll = false);
217 // load rscratch1 from [esi] and dispatch via rscratch1 and table
218 void dispatch_via (TosState state, address* table);
219
220 // jump to an invoked target
221 void prepare_to_jump_from_interpreted();
222 void jump_from_interpreted(Register method, Register temp);
223
224
225 // Returning from interpreted functions
265 void increment_mdp_data_at(Register mdp_in, Register index, int constant);
266 void increment_mask_and_jump(Address counter_addr,
267 int increment, Address mask,
268 Register scratch, Register scratch2,
269 bool preloaded, Condition cond,
270 Label* where);
271 void set_mdp_flag_at(Register mdp_in, int flag_constant);
272 void test_mdp_data_at(Register mdp_in, int offset, Register value,
273 Register test_value_out,
274 Label& not_equal_continue);
275
276 void update_mdp_by_offset(Register mdp_in, int offset_of_offset);
277 void update_mdp_by_offset(Register mdp_in, Register reg, int offset_of_disp);
278 void update_mdp_by_constant(Register mdp_in, int constant);
279 void update_mdp_for_ret(Register return_bci);
280
281 // narrow int return value
282 void narrow(Register result);
283
284 void profile_taken_branch(Register mdp);
285 void profile_not_taken_branch(Register mdp);
286 void profile_call(Register mdp);
287 void profile_final_call(Register mdp);
288 void profile_virtual_call(Register receiver, Register mdp,
289 bool receiver_can_be_null = false);
290 void profile_ret(Register return_bci, Register mdp);
291 void profile_null_seen(Register mdp);
292 void profile_typecheck(Register mdp, Register klass);
293 void profile_typecheck_failed(Register mdp);
294 void profile_switch_default(Register mdp);
295 void profile_switch_case(Register index_in_scratch, Register mdp,
296 Register scratch2);
297
298 void profile_obj_type(Register obj, const Address& mdo_addr);
299 void profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual);
300 void profile_return_type(Register mdp, Register ret, Register tmp);
301 void profile_parameters_type(Register mdp, Register tmp1, Register tmp2);
302
303 // Debugging
304 // only if +VerifyOops && state == atos
305 #define interp_verify_oop(reg, state) _interp_verify_oop(reg, state, __FILE__, __LINE__);
306 void _interp_verify_oop(Register reg, TosState state, const char* file, int line);
307
308 typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
309
310 // support for jvmti/dtrace
311 void notify_method_entry();
312 void notify_method_exit(TosState state, NotifyMethodExitMode mode);
313
314 JFR_ONLY(void enter_jfr_critical_section();)
315 JFR_ONLY(void leave_jfr_critical_section();)
316
|
141
142 void get_constant_pool(Register reg) {
143 get_const(reg);
144 ldr(reg, Address(reg, in_bytes(ConstMethod::constants_offset())));
145 }
146
147 void get_constant_pool_cache(Register reg) {
148 get_constant_pool(reg);
149 ldr(reg, Address(reg, ConstantPool::cache_offset()));
150 }
151
152 void get_cpool_and_tags(Register cpool, Register tags) {
153 get_constant_pool(cpool);
154 ldr(tags, Address(cpool, ConstantPool::tags_offset()));
155 }
156
157 void get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset);
158 void get_cache_index_at_bcp(Register index, int bcp_offset, size_t index_size = sizeof(u2));
159 void get_method_counters(Register method, Register mcs, Label& skip);
160
161 // Kills t1 and t2, perserves klass, return allocation in new_obj
162 void allocate_instance(Register klass, Register new_obj,
163 Register t1, Register t2,
164 bool clear_fields, Label& alloc_failed);
165
166 // Allocate instance in "obj" and read in the content of the inline field
167 // NOTES:
168 // - input holder object via "obj", which must be r0,
169 // will return new instance via the same reg
170 void read_flat_field(Register entry, Register obj);
171
172 void write_flat_field(Register entry, Register field_offset,
173 Register tmp1, Register tmp2,
174 Register obj);
175
176 // Allocate value buffer in "obj" and read in flat element at the given index
177 // NOTES:
178 // - Return via "obj" must be r0
179 // - kills all given regs
180 void read_flat_element(Register array, Register index,
181 Register t1, Register t2,
182 Register obj = r0);
183
184 // load cpool->resolved_references(index);
185 void load_resolved_reference_at_index(Register result, Register index, Register tmp = r5);
186
187 // load cpool->resolved_klass_at(index);
188 void load_resolved_klass_at_offset(Register cpool, Register index, Register klass, Register temp);
189
190 void pop_ptr(Register r = r0);
191 void pop_i(Register r = r0);
192 void pop_l(Register r = r0);
193 void pop_f(FloatRegister r = v0);
194 void pop_d(FloatRegister r = v0);
195 void push_ptr(Register r = r0);
196 void push_i(Register r = r0);
197 void push_l(Register r = r0);
198 void push_f(FloatRegister r = v0);
199 void push_d(FloatRegister r = v0);
200
201 void pop(Register r ) { ((MacroAssembler*)this)->pop(r); }
202
203 void push(Register r ) { ((MacroAssembler*)this)->push(r); }
208 void pop(RegSet regs, Register stack) { ((MacroAssembler*)this)->pop(regs, stack); }
209 void push(RegSet regs, Register stack) { ((MacroAssembler*)this)->push(regs, stack); }
210
211 void empty_expression_stack() {
212 ldr(rscratch1, Address(rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize));
213 lea(esp, Address(rfp, rscratch1, Address::lsl(LogBytesPerWord)));
214 // null last_sp until next java call
215 str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
216 }
217
218 // Helpers for swap and dup
219 void load_ptr(int n, Register val);
220 void store_ptr(int n, Register val);
221
222 // Load float value from 'address'. The value is loaded onto the FPU register v0.
223 void load_float(Address src);
224 void load_double(Address src);
225
226 // Generate a subtype check: branch to ok_is_subtype if sub_klass is
227 // a subtype of super_klass.
228 void gen_subtype_check( Register sub_klass, Label &ok_is_subtype, bool profile = true);
229
230 // Dispatching
231 void dispatch_prolog(TosState state, int step = 0);
232 void dispatch_epilog(TosState state, int step = 0);
233 // dispatch via rscratch1
234 void dispatch_only(TosState state, bool generate_poll = false);
235 // dispatch normal table via rscratch1 (assume rscratch1 is loaded already)
236 void dispatch_only_normal(TosState state);
237 void dispatch_only_noverify(TosState state);
238 // load rscratch1 from [rbcp + step] and dispatch via rscratch1
239 void dispatch_next(TosState state, int step = 0, bool generate_poll = false);
240 // load rscratch1 from [esi] and dispatch via rscratch1 and table
241 void dispatch_via (TosState state, address* table);
242
243 // jump to an invoked target
244 void prepare_to_jump_from_interpreted();
245 void jump_from_interpreted(Register method, Register temp);
246
247
248 // Returning from interpreted functions
288 void increment_mdp_data_at(Register mdp_in, Register index, int constant);
289 void increment_mask_and_jump(Address counter_addr,
290 int increment, Address mask,
291 Register scratch, Register scratch2,
292 bool preloaded, Condition cond,
293 Label* where);
294 void set_mdp_flag_at(Register mdp_in, int flag_constant);
295 void test_mdp_data_at(Register mdp_in, int offset, Register value,
296 Register test_value_out,
297 Label& not_equal_continue);
298
299 void update_mdp_by_offset(Register mdp_in, int offset_of_offset);
300 void update_mdp_by_offset(Register mdp_in, Register reg, int offset_of_disp);
301 void update_mdp_by_constant(Register mdp_in, int constant);
302 void update_mdp_for_ret(Register return_bci);
303
304 // narrow int return value
305 void narrow(Register result);
306
307 void profile_taken_branch(Register mdp);
308 void profile_not_taken_branch(Register mdp, bool acmp = false);
309 void profile_call(Register mdp);
310 void profile_final_call(Register mdp);
311 void profile_virtual_call(Register receiver, Register mdp,
312 bool receiver_can_be_null = false);
313 void profile_ret(Register return_bci, Register mdp);
314 void profile_null_seen(Register mdp);
315 void profile_typecheck(Register mdp, Register klass);
316 void profile_typecheck_failed(Register mdp);
317 void profile_switch_default(Register mdp);
318 void profile_switch_case(Register index_in_scratch, Register mdp,
319 Register scratch2);
320 template <class ArrayData> void profile_array_type(Register mdp, Register array, Register tmp);
321 void profile_multiple_element_types(Register mdp, Register element, Register tmp, Register tmp2);
322 void profile_element_type(Register mdp, Register element, Register tmp);
323 void profile_acmp(Register mdp, Register left, Register right, Register tmp);
324
325 void profile_obj_type(Register obj, const Address& mdo_addr);
326 void profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual);
327 void profile_return_type(Register mdp, Register ret, Register tmp);
328 void profile_parameters_type(Register mdp, Register tmp1, Register tmp2);
329
330 // Debugging
331 // only if +VerifyOops && state == atos
332 #define interp_verify_oop(reg, state) _interp_verify_oop(reg, state, __FILE__, __LINE__);
333 void _interp_verify_oop(Register reg, TosState state, const char* file, int line);
334
335 typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode;
336
337 // support for jvmti/dtrace
338 void notify_method_entry();
339 void notify_method_exit(TosState state, NotifyMethodExitMode mode);
340
341 JFR_ONLY(void enter_jfr_critical_section();)
342 JFR_ONLY(void leave_jfr_critical_section();)
343
|