< prev index next >

src/hotspot/cpu/riscv/c1_Runtime1_riscv.cpp

Print this page

 171 
 172 // Implementation of StubFrame
 173 
 174 class StubFrame: public StackObj {
 175  private:
 176   StubAssembler* _sasm;
 177   bool _return_state;
 178 
 179  public:
 180   StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments, return_state_t return_state=requires_return);
 181   void load_argument(int offset_in_words, Register reg);
 182 
 183   ~StubFrame();
 184 };;
 185 
 186 void StubAssembler::prologue(const char* name, bool must_gc_arguments) {
 187   set_info(name, must_gc_arguments);
 188   enter();
 189 }
 190 
 191 void StubAssembler::epilogue() {
 192   leave();
 193   ret();
 194 }
 195 
 196 #define __ _sasm->
 197 
 198 StubFrame::StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments, return_state_t return_state) {
 199   _sasm = sasm;
 200   _return_state = return_state;
 201   __ prologue(name, must_gc_arguments);
 202 }
 203 
 204 // load parameters that were stored with LIR_Assembler::store_parameter
 205 // Note: offsets for store_parameter and load_argument must match
 206 void StubFrame::load_argument(int offset_in_words, Register reg) {
 207   __ load_parameter(offset_in_words, reg);
 208 }
 209 
 210 
 211 StubFrame::~StubFrame() {

 340 void Runtime1::initialize_pd() {
 341   int i = 0;
 342   int sp_offset = 0;
 343   const int step = 2; // SP offsets are in halfwords
 344 
 345   // all float registers are saved explicitly
 346   for (i = 0; i < FrameMap::nof_fpu_regs; i++) {
 347     fpu_reg_save_offsets[i] = sp_offset;
 348     sp_offset += step;
 349   }
 350 
 351   // a slot reserved for stack 16-byte alignment, see MacroAssembler::push_reg
 352   sp_offset += step;
 353   // we save x5 ~ x31, except x0 ~ x4: loop starts from x5
 354   for (i = 5; i < FrameMap::nof_cpu_regs; i++) {
 355     cpu_reg_save_offsets[i] = sp_offset;
 356     sp_offset += step;
 357   }
 358 }
 359 





 360 // target: the entry point of the method that creates and posts the exception oop
 361 // has_argument: true if the exception needs arguments (passed in t0 and t1)
 362 
 363 OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) {
 364   // make a frame and preserve the caller's caller-save registers
 365   OopMap* oop_map = save_live_registers(sasm);
 366   assert_cond(oop_map != nullptr);
 367   int call_offset = 0;
 368   if (!has_argument) {
 369     call_offset = __ call_RT(noreg, noreg, target);
 370   } else {
 371     __ mv(c_rarg1, t0);
 372     __ mv(c_rarg2, t1);
 373     call_offset = __ call_RT(noreg, noreg, target);
 374   }
 375   OopMapSet* oop_maps = new OopMapSet();
 376   assert_cond(oop_maps != nullptr);
 377   oop_maps->add_gc_map(call_offset, oop_map);
 378 
 379   return oop_maps;

 171 
 172 // Implementation of StubFrame
 173 
 174 class StubFrame: public StackObj {
 175  private:
 176   StubAssembler* _sasm;
 177   bool _return_state;
 178 
 179  public:
 180   StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments, return_state_t return_state=requires_return);
 181   void load_argument(int offset_in_words, Register reg);
 182 
 183   ~StubFrame();
 184 };;
 185 
 186 void StubAssembler::prologue(const char* name, bool must_gc_arguments) {
 187   set_info(name, must_gc_arguments);
 188   enter();
 189 }
 190 
 191 void StubAssembler::epilogue(bool use_pop) {
 192   leave();
 193   ret();
 194 }
 195 
 196 #define __ _sasm->
 197 
 198 StubFrame::StubFrame(StubAssembler* sasm, const char* name, bool must_gc_arguments, return_state_t return_state) {
 199   _sasm = sasm;
 200   _return_state = return_state;
 201   __ prologue(name, must_gc_arguments);
 202 }
 203 
 204 // load parameters that were stored with LIR_Assembler::store_parameter
 205 // Note: offsets for store_parameter and load_argument must match
 206 void StubFrame::load_argument(int offset_in_words, Register reg) {
 207   __ load_parameter(offset_in_words, reg);
 208 }
 209 
 210 
 211 StubFrame::~StubFrame() {

 340 void Runtime1::initialize_pd() {
 341   int i = 0;
 342   int sp_offset = 0;
 343   const int step = 2; // SP offsets are in halfwords
 344 
 345   // all float registers are saved explicitly
 346   for (i = 0; i < FrameMap::nof_fpu_regs; i++) {
 347     fpu_reg_save_offsets[i] = sp_offset;
 348     sp_offset += step;
 349   }
 350 
 351   // a slot reserved for stack 16-byte alignment, see MacroAssembler::push_reg
 352   sp_offset += step;
 353   // we save x5 ~ x31, except x0 ~ x4: loop starts from x5
 354   for (i = 5; i < FrameMap::nof_cpu_regs; i++) {
 355     cpu_reg_save_offsets[i] = sp_offset;
 356     sp_offset += step;
 357   }
 358 }
 359 
 360 uint Runtime1::runtime_blob_current_thread_offset(frame f) {
 361   Unimplemented();
 362   return 0;
 363 }
 364 
 365 // target: the entry point of the method that creates and posts the exception oop
 366 // has_argument: true if the exception needs arguments (passed in t0 and t1)
 367 
 368 OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) {
 369   // make a frame and preserve the caller's caller-save registers
 370   OopMap* oop_map = save_live_registers(sasm);
 371   assert_cond(oop_map != nullptr);
 372   int call_offset = 0;
 373   if (!has_argument) {
 374     call_offset = __ call_RT(noreg, noreg, target);
 375   } else {
 376     __ mv(c_rarg1, t0);
 377     __ mv(c_rarg2, t1);
 378     call_offset = __ call_RT(noreg, noreg, target);
 379   }
 380   OopMapSet* oop_maps = new OopMapSet();
 381   assert_cond(oop_maps != nullptr);
 382   oop_maps->add_gc_map(call_offset, oop_map);
 383 
 384   return oop_maps;
< prev index next >