107 anchor->set_last_Java_fp(fp);
108 }
109
110 #ifdef ASSERT
111 inline bool ContinuationHelper::Frame::assert_frame_laid_out(frame f) {
112 intptr_t* sp = f.sp();
113 address pc = ContinuationHelper::return_address_at(
114 sp - frame::sender_sp_ret_address_offset());
115 intptr_t* fp = *(intptr_t**)(sp - frame::sender_sp_offset);
116 assert(f.raw_pc() == pc, "f.ra_pc: " INTPTR_FORMAT " actual: " INTPTR_FORMAT, p2i(f.raw_pc()), p2i(pc));
117 assert(f.fp() == fp, "f.fp: " INTPTR_FORMAT " actual: " INTPTR_FORMAT, p2i(f.fp()), p2i(fp));
118 return f.raw_pc() == pc && f.fp() == fp;
119 }
120 #endif
121
122 inline intptr_t** ContinuationHelper::Frame::callee_link_address(const frame& f) {
123 return (intptr_t**)(f.sp() - frame::sender_sp_offset);
124 }
125
126 inline address* ContinuationHelper::Frame::return_pc_address(const frame& f) {
127 return (address*)(f.real_fp() - 1);
128 }
129
130 inline address* ContinuationHelper::InterpretedFrame::return_pc_address(const frame& f) {
131 return (address*)(f.fp() + frame::return_addr_offset);
132 }
133
134 inline void ContinuationHelper::InterpretedFrame::patch_sender_sp(frame& f, const frame& caller) {
135 intptr_t* sp = caller.unextended_sp();
136 assert(f.is_interpreted_frame(), "");
137 intptr_t* la = f.addr_at(frame::interpreter_frame_sender_sp_offset);
138 *la = f.is_heap_frame() ? (intptr_t)(sp - f.fp()) : (intptr_t)sp;
139 }
140
141 inline address ContinuationHelper::Frame::real_pc(const frame& f) {
142 // Always used in assertions. Just strip it.
143 address* pc_addr = &(((address*) f.sp())[-1]);
144 return pauth_strip_pointer(*pc_addr);
145 }
146
147 inline void ContinuationHelper::Frame::patch_pc(const frame& f, address pc) {
|
107 anchor->set_last_Java_fp(fp);
108 }
109
110 #ifdef ASSERT
111 inline bool ContinuationHelper::Frame::assert_frame_laid_out(frame f) {
112 intptr_t* sp = f.sp();
113 address pc = ContinuationHelper::return_address_at(
114 sp - frame::sender_sp_ret_address_offset());
115 intptr_t* fp = *(intptr_t**)(sp - frame::sender_sp_offset);
116 assert(f.raw_pc() == pc, "f.ra_pc: " INTPTR_FORMAT " actual: " INTPTR_FORMAT, p2i(f.raw_pc()), p2i(pc));
117 assert(f.fp() == fp, "f.fp: " INTPTR_FORMAT " actual: " INTPTR_FORMAT, p2i(f.fp()), p2i(fp));
118 return f.raw_pc() == pc && f.fp() == fp;
119 }
120 #endif
121
122 inline intptr_t** ContinuationHelper::Frame::callee_link_address(const frame& f) {
123 return (intptr_t**)(f.sp() - frame::sender_sp_offset);
124 }
125
126 inline address* ContinuationHelper::Frame::return_pc_address(const frame& f) {
127 frame::CompiledFramePointers cfp = f.compiled_frame_details();
128 return cfp.sender_pc_addr;
129 }
130
131 inline address* ContinuationHelper::InterpretedFrame::return_pc_address(const frame& f) {
132 return (address*)(f.fp() + frame::return_addr_offset);
133 }
134
135 inline void ContinuationHelper::InterpretedFrame::patch_sender_sp(frame& f, const frame& caller) {
136 intptr_t* sp = caller.unextended_sp();
137 assert(f.is_interpreted_frame(), "");
138 intptr_t* la = f.addr_at(frame::interpreter_frame_sender_sp_offset);
139 *la = f.is_heap_frame() ? (intptr_t)(sp - f.fp()) : (intptr_t)sp;
140 }
141
142 inline address ContinuationHelper::Frame::real_pc(const frame& f) {
143 // Always used in assertions. Just strip it.
144 address* pc_addr = &(((address*) f.sp())[-1]);
145 return pauth_strip_pointer(*pc_addr);
146 }
147
148 inline void ContinuationHelper::Frame::patch_pc(const frame& f, address pc) {
|