215 // Must be native-compiled frame. Since sender will try and use fp to find 216 // linkages it must be safe 217 218 if (!fp_safe) { 219 return false; 220 } 221 222 // Will the pc we fetch be non-zero (which we'll find at the oldest frame) 223 224 if ( (address) this->fp()[return_addr_offset] == NULL) return false; 225 226 227 // could try and do some more potential verification of native frame if we could think of some... 228 229 return true; 230 231 } 232 233 234 void frame::patch_pc(Thread* thread, address pc) { 235 if (TracePcPatching) { 236 tty->print_cr("patch_pc at address" INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "] ", 237 &((address *)sp())[-1], ((address *)sp())[-1], pc); 238 } 239 ((address *)sp())[-1] = pc; 240 _cb = CodeCache::find_blob(pc); 241 address original_pc = nmethod::get_deopt_original_pc(this); 242 if (original_pc != NULL) { 243 assert(original_pc == _pc, "expected original PC to be stored before patching"); 244 _deopt_state = is_deoptimized; 245 // leave _pc as is 246 } else { 247 _deopt_state = not_deoptimized; 248 _pc = pc; 249 } 250 } 251 252 bool frame::is_interpreted_frame() const { 253 return Interpreter::contains(pc()); 254 } 255 256 int frame::frame_size(RegisterMap* map) const { 257 frame sender = this->sender(map); 258 return sender.sp() - sp(); 259 } | 215 // Must be native-compiled frame. Since sender will try and use fp to find 216 // linkages it must be safe 217 218 if (!fp_safe) { 219 return false; 220 } 221 222 // Will the pc we fetch be non-zero (which we'll find at the oldest frame) 223 224 if ( (address) this->fp()[return_addr_offset] == NULL) return false; 225 226 227 // could try and do some more potential verification of native frame if we could think of some... 228 229 return true; 230 231 } 232 233 234 void frame::patch_pc(Thread* thread, address pc) { 235 address* pc_addr = &(((address*) sp())[-1]); 236 if (TracePcPatching) { 237 tty->print_cr("patch_pc at address " INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "] ", 238 pc_addr, *pc_addr, pc); 239 } 240 assert(_pc == *pc_addr, err_msg("must be: " INTPTR_FORMAT " == " INTPTR_FORMAT, _pc, *pc_addr)); 241 *pc_addr = pc; 242 _cb = CodeCache::find_blob(pc); 243 address original_pc = nmethod::get_deopt_original_pc(this); 244 if (original_pc != NULL) { 245 assert(original_pc == _pc, "expected original PC to be stored before patching"); 246 _deopt_state = is_deoptimized; 247 // leave _pc as is 248 } else { 249 _deopt_state = not_deoptimized; 250 _pc = pc; 251 } 252 } 253 254 bool frame::is_interpreted_frame() const { 255 return Interpreter::contains(pc()); 256 } 257 258 int frame::frame_size(RegisterMap* map) const { 259 frame sender = this->sender(map); 260 return sender.sp() - sp(); 261 } |