54 assert(FKind::is_instance(f), "");
55 if (FKind::interpreted) {
56 return frame(f.sender_sp(), f.sender_pc(), f.interpreter_frame_sender_sp());
57 }
58
59 intptr_t* sender_sp = f.sender_sp();
60 address sender_pc = f.sender_pc();
61 assert(sender_sp != f.sp(), "must have changed");
62
63 int slot = 0;
64 CodeBlob* sender_cb = CodeCache::find_blob_and_oopmap(sender_pc, slot);
65 return sender_cb != nullptr
66 ? frame(sender_sp, sender_sp, nullptr, sender_pc, sender_cb, slot == -1 ? nullptr : sender_cb->oop_map_for_slot(slot, sender_pc))
67 : frame(sender_sp, sender_pc, sender_sp);
68 }
69
70 void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) {
71 // nothing to do
72 }
73
74 inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, const frame& hf) {
75 intptr_t* vfp = f.fp();
76 intptr_t* hfp = hf.fp();
77 assert(f.fp() > (intptr_t*)f.interpreter_frame_esp(), "");
78
79 // There is alignment padding between vfp and f's locals array in the original
80 // frame, because we freeze the padding (see recurse_freeze_interpreted_frame)
81 // in order to keep the same relativized locals pointer, we don't need to change it here.
82
83 // Make sure that monitors is already relativized.
84 assert(hf.at_absolute(ijava_idx(monitors)) <= -(frame::ijava_state_size / wordSize), "");
85
86 // Make sure that esp is already relativized.
87 assert(hf.at_absolute(ijava_idx(esp)) <= hf.at_absolute(ijava_idx(monitors)), "");
88
89 // top_frame_sp is already relativized
90
91 // hfp == hf.sp() + (f.fp() - f.sp()) is not true on ppc because the stack frame has room for
92 // the maximal expression stack and the expression stack in the heap frame is trimmed.
93 assert(hf.fp() == hf.interpreter_frame_esp() + (f.fp() - f.interpreter_frame_esp()), "");
526 }
527 }
528
529 inline intptr_t* ThawBase::align(const frame& hf, intptr_t* frame_sp, frame& caller, bool bottom) {
530 // Unused. Alignment is done directly in new_stack_frame() / finish_thaw().
531 return nullptr;
532 }
533
534 inline void ThawBase::derelativize_interpreted_frame_metadata(const frame& hf, const frame& f) {
535 intptr_t* vfp = f.fp();
536
537 // Make sure that monitors is still relativized.
538 assert(f.at_absolute(ijava_idx(monitors)) <= -(frame::ijava_state_size / wordSize), "");
539
540 // Make sure that esp is still relativized.
541 assert(f.at_absolute(ijava_idx(esp)) <= f.at_absolute(ijava_idx(monitors)), "");
542
543 // Keep top_frame_sp relativized.
544 }
545
546 inline void ThawBase::patch_pd(frame& f, const frame& caller) {
547 patch_callee_link(caller, caller.fp());
548 // Prevent assertion if f gets deoptimized right away before it's fully initialized
549 f.mark_not_fully_initialized();
550 }
551
552 //
553 // Interpreter Calling Procedure on PPC
554 //
555 // Caller Resized Caller before the Call New Callee Frame
556 //
557 // - SP/FP are 16 byte aligned. - The unused part of the expression stack - The caller's original SP is passed as
558 // Padding is added as necessary. is removed sender SP (in R21_sender_SP) also by
559 // - SP is _not_ used as esp - Slots for the callee's nonparameter locals compiled callers. It is saved in the
560 // (expression stack pointer) are added. ijava_state::sender_sp slot and
561 // - Has reserved slots for the - The large ABI is replaced with a minimal restored when returning.
562 // maximal expression stack ABI. This removes a c2i extension if there
563 // - Has a larger ABI section on - The original SP was saved in is one.
564 // top that is required to call ijava_state::top_frame_sp slot. - ijava_state::sender_sp will be set
565 // C++ code From there it is restored as SP _after_ as the caller's unextended sp when
566 // returning from a call. This reverts the iterating stack frames
567 // resizing described above. It is also (see frame::unextended_sp() and
568 // required to undo potential i2c extensions frame::sender_for_interpreter_frame())
569 // if the calle should be compiled.
570 // - Note that unextended SP < SP
571 // is possible on ppc.
|
54 assert(FKind::is_instance(f), "");
55 if (FKind::interpreted) {
56 return frame(f.sender_sp(), f.sender_pc(), f.interpreter_frame_sender_sp());
57 }
58
59 intptr_t* sender_sp = f.sender_sp();
60 address sender_pc = f.sender_pc();
61 assert(sender_sp != f.sp(), "must have changed");
62
63 int slot = 0;
64 CodeBlob* sender_cb = CodeCache::find_blob_and_oopmap(sender_pc, slot);
65 return sender_cb != nullptr
66 ? frame(sender_sp, sender_sp, nullptr, sender_pc, sender_cb, slot == -1 ? nullptr : sender_cb->oop_map_for_slot(slot, sender_pc))
67 : frame(sender_sp, sender_pc, sender_sp);
68 }
69
70 void FreezeBase::adjust_interpreted_frame_unextended_sp(frame& f) {
71 // nothing to do
72 }
73
74 inline void FreezeBase::prepare_freeze_interpreted_top_frame(const frame& f) {
75 Unimplemented();
76 }
77
78 inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, const frame& hf) {
79 intptr_t* vfp = f.fp();
80 intptr_t* hfp = hf.fp();
81 assert(f.fp() > (intptr_t*)f.interpreter_frame_esp(), "");
82
83 // There is alignment padding between vfp and f's locals array in the original
84 // frame, because we freeze the padding (see recurse_freeze_interpreted_frame)
85 // in order to keep the same relativized locals pointer, we don't need to change it here.
86
87 // Make sure that monitors is already relativized.
88 assert(hf.at_absolute(ijava_idx(monitors)) <= -(frame::ijava_state_size / wordSize), "");
89
90 // Make sure that esp is already relativized.
91 assert(hf.at_absolute(ijava_idx(esp)) <= hf.at_absolute(ijava_idx(monitors)), "");
92
93 // top_frame_sp is already relativized
94
95 // hfp == hf.sp() + (f.fp() - f.sp()) is not true on ppc because the stack frame has room for
96 // the maximal expression stack and the expression stack in the heap frame is trimmed.
97 assert(hf.fp() == hf.interpreter_frame_esp() + (f.fp() - f.interpreter_frame_esp()), "");
530 }
531 }
532
533 inline intptr_t* ThawBase::align(const frame& hf, intptr_t* frame_sp, frame& caller, bool bottom) {
534 // Unused. Alignment is done directly in new_stack_frame() / finish_thaw().
535 return nullptr;
536 }
537
538 inline void ThawBase::derelativize_interpreted_frame_metadata(const frame& hf, const frame& f) {
539 intptr_t* vfp = f.fp();
540
541 // Make sure that monitors is still relativized.
542 assert(f.at_absolute(ijava_idx(monitors)) <= -(frame::ijava_state_size / wordSize), "");
543
544 // Make sure that esp is still relativized.
545 assert(f.at_absolute(ijava_idx(esp)) <= f.at_absolute(ijava_idx(monitors)), "");
546
547 // Keep top_frame_sp relativized.
548 }
549
550 inline intptr_t* ThawBase::push_preempt_rerun_adapter(frame top, bool is_interpreted_frame) {
551 Unimplemented();
552 return nullptr;
553 }
554
555 inline intptr_t* ThawBase::push_preempt_monitorenter_redo(stackChunkOop chunk) {
556 Unimplemented();
557 return nullptr;
558 }
559
560 inline void ThawBase::patch_pd(frame& f, const frame& caller) {
561 patch_callee_link(caller, caller.fp());
562 // Prevent assertion if f gets deoptimized right away before it's fully initialized
563 f.mark_not_fully_initialized();
564 }
565
566 inline void ThawBase::patch_pd(frame& f, intptr_t* caller_sp) {
567 Unimplemented();
568 }
569
570 //
571 // Interpreter Calling Procedure on PPC
572 //
573 // Caller Resized Caller before the Call New Callee Frame
574 //
575 // - SP/FP are 16 byte aligned. - The unused part of the expression stack - The caller's original SP is passed as
576 // Padding is added as necessary. is removed sender SP (in R21_sender_SP) also by
577 // - SP is _not_ used as esp - Slots for the callee's nonparameter locals compiled callers. It is saved in the
578 // (expression stack pointer) are added. ijava_state::sender_sp slot and
579 // - Has reserved slots for the - The large ABI is replaced with a minimal restored when returning.
580 // maximal expression stack ABI. This removes a c2i extension if there
581 // - Has a larger ABI section on - The original SP was saved in is one.
582 // top that is required to call ijava_state::top_frame_sp slot. - ijava_state::sender_sp will be set
583 // C++ code From there it is restored as SP _after_ as the caller's unextended sp when
584 // returning from a call. This reverts the iterating stack frames
585 // resizing described above. It is also (see frame::unextended_sp() and
586 // required to undo potential i2c extensions frame::sender_for_interpreter_frame())
587 // if the calle should be compiled.
588 // - Note that unextended SP < SP
589 // is possible on ppc.
|