358 vmassert(jfa->last_Java_pc() != NULL, "not walkable");
359 frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());
360 return fr;
361 }
362
363 //------------------------------------------------------------------------------
364 // frame::verify_deopt_original_pc
365 //
366 // Verifies the calculated original PC of a deoptimization PC for the
367 // given unextended SP.
368 #ifdef ASSERT
369 void frame::verify_deopt_original_pc(CompiledMethod* nm, intptr_t* unextended_sp) {
370 frame fr;
371
372 // This is ugly but it's better than to change {get,set}_original_pc
373 // to take an SP value as argument. And it's only a debugging
374 // method anyway.
375 fr._unextended_sp = unextended_sp;
376
377 address original_pc = nm->get_original_pc(&fr);
378 assert(nm->insts_contains(original_pc), "original PC must be in nmethod");
379 }
380 #endif
381
382 //------------------------------------------------------------------------------
383 // frame::adjust_unextended_sp
384 void frame::adjust_unextended_sp() {
385 // On aarch64, sites calling method handle intrinsics and lambda forms are treated
386 // as any other call site. Therefore, no special action is needed when we are
387 // returning to any of these call sites.
388
389 if (_cb != NULL) {
390 CompiledMethod* sender_cm = _cb->as_compiled_method_or_null();
391 if (sender_cm != NULL) {
392 // If the sender PC is a deoptimization point, get the original PC.
393 if (sender_cm->is_deopt_entry(_pc) ||
394 sender_cm->is_deopt_mh_entry(_pc)) {
395 DEBUG_ONLY(verify_deopt_original_pc(sender_cm, _unextended_sp));
396 }
397 }
398 }
|
358 vmassert(jfa->last_Java_pc() != NULL, "not walkable");
359 frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());
360 return fr;
361 }
362
363 //------------------------------------------------------------------------------
364 // frame::verify_deopt_original_pc
365 //
366 // Verifies the calculated original PC of a deoptimization PC for the
367 // given unextended SP.
368 #ifdef ASSERT
369 void frame::verify_deopt_original_pc(CompiledMethod* nm, intptr_t* unextended_sp) {
370 frame fr;
371
372 // This is ugly but it's better than to change {get,set}_original_pc
373 // to take an SP value as argument. And it's only a debugging
374 // method anyway.
375 fr._unextended_sp = unextended_sp;
376
377 address original_pc = nm->get_original_pc(&fr);
378 assert(nm->insts_contains_inclusive(original_pc),
379 "original PC must be in the main code section of the the compiled method (or must be immediately following it)");
380 }
381 #endif
382
383 //------------------------------------------------------------------------------
384 // frame::adjust_unextended_sp
385 void frame::adjust_unextended_sp() {
386 // On aarch64, sites calling method handle intrinsics and lambda forms are treated
387 // as any other call site. Therefore, no special action is needed when we are
388 // returning to any of these call sites.
389
390 if (_cb != NULL) {
391 CompiledMethod* sender_cm = _cb->as_compiled_method_or_null();
392 if (sender_cm != NULL) {
393 // If the sender PC is a deoptimization point, get the original PC.
394 if (sender_cm->is_deopt_entry(_pc) ||
395 sender_cm->is_deopt_mh_entry(_pc)) {
396 DEBUG_ONLY(verify_deopt_original_pc(sender_cm, _unextended_sp));
397 }
398 }
399 }
|