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