< prev index next >

src/hotspot/cpu/riscv/c1_MacroAssembler_riscv.cpp

Print this page

226   // Align-up to word boundary, because we clear the 4 bytes potentially
227   // following the length field in initialize_header().
228   int base_offset = align_up(base_offset_in_bytes, BytesPerWord);
229 
230   // clear rest of allocated space
231   const Register len_zero = len;
232   if (zero_array) {
233     initialize_body(obj, arr_size, base_offset, len_zero);
234   }
235 
236   membar(MacroAssembler::StoreStore);
237 
238   if (CURRENT_ENV->dtrace_alloc_probes()) {
239     assert(obj == x10, "must be");
240     far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_dtrace_object_alloc_id)));
241   }
242 
243   verify_oop(obj);
244 }
245 
246 void C1_MacroAssembler::build_frame(int framesize, int bang_size_in_bytes) {



247   assert(bang_size_in_bytes >= framesize, "stack bang size incorrect");
248   // Make sure there is enough stack space for this method's activation.
249   // Note that we do this before creating a frame.
250   generate_stack_overflow_check(bang_size_in_bytes);
251   MacroAssembler::build_frame(framesize);
252 
253   // Insert nmethod entry barrier into frame.
254   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
255   bs->nmethod_entry_barrier(this, nullptr /* slow_path */, nullptr /* continuation */, nullptr /* guard */);
256 }
257 
258 void C1_MacroAssembler::remove_frame(int framesize) {
259   MacroAssembler::remove_frame(framesize);
260 }
261 
262 
263 void C1_MacroAssembler::verified_entry(bool breakAtEntry) {
264   // If we have to make this method not-entrant we'll overwrite its
265   // first instruction with a jump. For this action to be legal we
266   // must ensure that this first instruction is a J, JAL or NOP.
267   // Make it a NOP.
268   IncompressibleScope scope(this); // keep the nop as 4 bytes for patching.
269   assert_alignment(pc());
270   nop();  // 4 bytes
271 }
272 
273 void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) {
274   //  fp + -2: link
275   //     + -1: return address
276   //     +  0: argument with offset 0
277   //     +  1: argument with offset 1
278   //     +  2: ...
279   ld(reg, Address(fp, offset_in_words * BytesPerWord));
280 }
281 
282 #ifndef PRODUCT

356     assert(cmpFlag == lir_cond_equal || cmpFlag == lir_cond_notEqual, "Should be equal or notEqual");
357     if (cmpFlag == lir_cond_equal) {
358       beq(op1, op2, label, is_far);
359     } else {
360       bne(op1, op2, label, is_far);
361     }
362   } else {
363     assert(cmpFlag >= 0 && cmpFlag < (int)(sizeof(c1_cond_branch) / sizeof(c1_cond_branch[0])),
364            "invalid c1 conditional branch index");
365     (this->*c1_cond_branch[cmpFlag])(op1, op2, label, is_far);
366   }
367 }
368 
369 void C1_MacroAssembler::c1_float_cmp_branch(int cmpFlag, FloatRegister op1, FloatRegister op2, Label& label,
370                                             bool is_far, bool is_unordered) {
371   assert(cmpFlag >= 0 &&
372          cmpFlag < (int)(sizeof(c1_float_cond_branch) / sizeof(c1_float_cond_branch[0])),
373          "invalid c1 float conditional branch index");
374   (this->*c1_float_cond_branch[cmpFlag])(op1, op2, label, is_far, is_unordered);
375 }






226   // Align-up to word boundary, because we clear the 4 bytes potentially
227   // following the length field in initialize_header().
228   int base_offset = align_up(base_offset_in_bytes, BytesPerWord);
229 
230   // clear rest of allocated space
231   const Register len_zero = len;
232   if (zero_array) {
233     initialize_body(obj, arr_size, base_offset, len_zero);
234   }
235 
236   membar(MacroAssembler::StoreStore);
237 
238   if (CURRENT_ENV->dtrace_alloc_probes()) {
239     assert(obj == x10, "must be");
240     far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_dtrace_object_alloc_id)));
241   }
242 
243   verify_oop(obj);
244 }
245 
246 void C1_MacroAssembler::build_frame(int framesize, int bang_size_in_bytes,
247                                     int sp_offset_for_orig_pc,
248                                     bool needs_stack_repair, bool has_scalarized_args,
249                                     Label* verified_inline_entry_label) {
250   assert(bang_size_in_bytes >= framesize, "stack bang size incorrect");
251   // Make sure there is enough stack space for this method's activation.
252   // Note that we do this before creating a frame.
253   generate_stack_overflow_check(bang_size_in_bytes);
254   MacroAssembler::build_frame(framesize);
255 
256   // Insert nmethod entry barrier into frame.
257   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
258   bs->nmethod_entry_barrier(this, nullptr /* slow_path */, nullptr /* continuation */, nullptr /* guard */);
259 }
260 





261 void C1_MacroAssembler::verified_entry(bool breakAtEntry) {
262   // If we have to make this method not-entrant we'll overwrite its
263   // first instruction with a jump. For this action to be legal we
264   // must ensure that this first instruction is a J, JAL or NOP.
265   // Make it a NOP.
266   IncompressibleScope scope(this); // keep the nop as 4 bytes for patching.
267   assert_alignment(pc());
268   nop();  // 4 bytes
269 }
270 
271 void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) {
272   //  fp + -2: link
273   //     + -1: return address
274   //     +  0: argument with offset 0
275   //     +  1: argument with offset 1
276   //     +  2: ...
277   ld(reg, Address(fp, offset_in_words * BytesPerWord));
278 }
279 
280 #ifndef PRODUCT

354     assert(cmpFlag == lir_cond_equal || cmpFlag == lir_cond_notEqual, "Should be equal or notEqual");
355     if (cmpFlag == lir_cond_equal) {
356       beq(op1, op2, label, is_far);
357     } else {
358       bne(op1, op2, label, is_far);
359     }
360   } else {
361     assert(cmpFlag >= 0 && cmpFlag < (int)(sizeof(c1_cond_branch) / sizeof(c1_cond_branch[0])),
362            "invalid c1 conditional branch index");
363     (this->*c1_cond_branch[cmpFlag])(op1, op2, label, is_far);
364   }
365 }
366 
367 void C1_MacroAssembler::c1_float_cmp_branch(int cmpFlag, FloatRegister op1, FloatRegister op2, Label& label,
368                                             bool is_far, bool is_unordered) {
369   assert(cmpFlag >= 0 &&
370          cmpFlag < (int)(sizeof(c1_float_cond_branch) / sizeof(c1_float_cond_branch[0])),
371          "invalid c1 float conditional branch index");
372   (this->*c1_float_cond_branch[cmpFlag])(op1, op2, label, is_far, is_unordered);
373 }
374 
375 int C1_MacroAssembler::scalarized_entry(const CompiledEntrySignature* ces, int frame_size_in_bytes, int bang_size_in_bytes, int sp_offset_for_orig_pc, Label& verified_inline_entry_label, bool is_inline_ro_entry) {
376   Unimplemented();
377 }
378 
< prev index next >