< prev index next >

src/hotspot/cpu/riscv/continuationHelper_riscv.inline.hpp

Print this page

114 inline address* ContinuationHelper::Frame::return_pc_address(const frame& f) {
115   return (address*)(f.real_fp() - 1);
116 }
117 
118 inline address* ContinuationHelper::InterpretedFrame::return_pc_address(const frame& f) {
119   return (address*)(f.fp() + frame::return_addr_offset);
120 }
121 
122 inline void ContinuationHelper::InterpretedFrame::patch_sender_sp(frame& f, const frame& caller) {
123   intptr_t* sp = caller.unextended_sp();
124   assert(f.is_interpreted_frame(), "");
125   intptr_t* la = f.addr_at(frame::interpreter_frame_sender_sp_offset);
126   *la = f.is_heap_frame() ? (intptr_t)(sp - f.fp()) : (intptr_t)sp;
127 }
128 
129 inline address ContinuationHelper::Frame::real_pc(const frame& f) {
130   address* pc_addr = &(((address*) f.sp())[-1]);
131   return *pc_addr;
132 }
133 
134 inline void ContinuationHelper::Frame::patch_pc(const frame& f, address pc) {
135   address* pc_addr = &(((address*) f.sp())[-1]);
136   *pc_addr = pc;
137 }
138 
139 inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f, InterpreterOopMap* mask) { // inclusive; this will be copied with the frame
140   // interpreter_frame_last_sp_offset, points to unextended_sp includes arguments in the frame
141   // interpreter_frame_initial_sp_offset excludes expression stack slots
142   int expression_stack_sz = expression_stack_size(f, mask);
143   intptr_t* res = (intptr_t*)f.at_relative(frame::interpreter_frame_initial_sp_offset) - expression_stack_sz;
144   assert(res == (intptr_t*)f.interpreter_frame_monitor_end() - expression_stack_sz, "");
145   assert(res >= f.unextended_sp(),
146     "res: " INTPTR_FORMAT " initial_sp: " INTPTR_FORMAT " last_sp: " INTPTR_FORMAT " unextended_sp: " INTPTR_FORMAT " expression_stack_size: %d",
147     p2i(res), p2i(f.addr_at(frame::interpreter_frame_initial_sp_offset)), f.at_relative_or_null(frame::interpreter_frame_last_sp_offset),
148     p2i(f.unextended_sp()), expression_stack_sz);
149   return res;
150 }
151 
152 inline intptr_t* ContinuationHelper::InterpretedFrame::frame_bottom(const frame& f) { // exclusive; this will not be copied with the frame
153   return (intptr_t*)f.at_relative(frame::interpreter_frame_locals_offset) + 1; // exclusive, so we add 1 word
154 }

114 inline address* ContinuationHelper::Frame::return_pc_address(const frame& f) {
115   return (address*)(f.real_fp() - 1);
116 }
117 
118 inline address* ContinuationHelper::InterpretedFrame::return_pc_address(const frame& f) {
119   return (address*)(f.fp() + frame::return_addr_offset);
120 }
121 
122 inline void ContinuationHelper::InterpretedFrame::patch_sender_sp(frame& f, const frame& caller) {
123   intptr_t* sp = caller.unextended_sp();
124   assert(f.is_interpreted_frame(), "");
125   intptr_t* la = f.addr_at(frame::interpreter_frame_sender_sp_offset);
126   *la = f.is_heap_frame() ? (intptr_t)(sp - f.fp()) : (intptr_t)sp;
127 }
128 
129 inline address ContinuationHelper::Frame::real_pc(const frame& f) {
130   address* pc_addr = &(((address*) f.sp())[-1]);
131   return *pc_addr;
132 }
133 
134 inline void ContinuationHelper::Frame::patch_pc(const frame& f, address pc, bool callee_augmented) {
135   address* pc_addr = &(((address*) f.sp())[-1]);
136   *pc_addr = pc;
137 }
138 
139 inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f, InterpreterOopMap* mask) { // inclusive; this will be copied with the frame
140   // interpreter_frame_last_sp_offset, points to unextended_sp includes arguments in the frame
141   // interpreter_frame_initial_sp_offset excludes expression stack slots
142   int expression_stack_sz = expression_stack_size(f, mask);
143   intptr_t* res = (intptr_t*)f.at_relative(frame::interpreter_frame_initial_sp_offset) - expression_stack_sz;
144   assert(res == (intptr_t*)f.interpreter_frame_monitor_end() - expression_stack_sz, "");
145   assert(res >= f.unextended_sp(),
146     "res: " INTPTR_FORMAT " initial_sp: " INTPTR_FORMAT " last_sp: " INTPTR_FORMAT " unextended_sp: " INTPTR_FORMAT " expression_stack_size: %d",
147     p2i(res), p2i(f.addr_at(frame::interpreter_frame_initial_sp_offset)), f.at_relative_or_null(frame::interpreter_frame_last_sp_offset),
148     p2i(f.unextended_sp()), expression_stack_sz);
149   return res;
150 }
151 
152 inline intptr_t* ContinuationHelper::InterpretedFrame::frame_bottom(const frame& f) { // exclusive; this will not be copied with the frame
153   return (intptr_t*)f.at_relative(frame::interpreter_frame_locals_offset) + 1; // exclusive, so we add 1 word
154 }
< prev index next >