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