< prev index next >

src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp

Print this page

320     // For compiled frames the back link is actually redundant. It gets computed
321     // as unextended_sp + frame_size.
322 
323     // Note the difference on x86_64: the link is not made relative if the caller
324     // is a compiled frame because there rbp is used as a non-volatile register by
325     // c1/c2 so it could be a computed value local to the caller.
326 
327     // See also:
328     // - FreezeBase::set_top_frame_metadata_pd
329     // - StackChunkFrameStream<frame_kind>::fp()
330     // - UseContinuationFastPath: compiled frames are copied in a batch w/o patching the back link.
331     //   The backlinks are restored when thawing (see Thaw<ConfigT>::patch_caller_links())
332     patch_callee_link(hf, (intptr_t*)badAddress);
333   }
334 #endif
335 }
336 
337 inline void FreezeBase::patch_pd_unused(intptr_t* sp) {
338 }
339 







340 //////// Thaw
341 
342 // Fast path
343 
344 inline void ThawBase::prefetch_chunk_pd(void* start, int size) {
345   size <<= LogBytesPerWord;
346   Prefetch::read(start, size);
347   Prefetch::read(start, size - 64);
348 }
349 
350 // Set back chain links of fast thawed frames such that *sp == callers_sp.
351 // See https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#STACK
352 template <typename ConfigT>
353 inline void Thaw<ConfigT>::patch_caller_links(intptr_t* sp, intptr_t* bottom) {
354   for (intptr_t* callers_sp; sp < bottom; sp = callers_sp) {
355     address pc = (address)((frame::java_abi*) sp)->lr;
356     assert(pc != nullptr, "");
357     // see ThawBase::patch_return() which gets called just before
358     bool is_entry_frame = pc == StubRoutines::cont_returnBarrier() || pc == _cont.entryPC();
359     if (is_entry_frame) {

549 
550   // Make sure that esp is still relativized.
551   assert(f.at_absolute(ijava_idx(esp)) <= f.at_absolute(ijava_idx(monitors)), "");
552 
553   // Keep top_frame_sp relativized.
554 }
555 
556 inline intptr_t* ThawBase::push_cleanup_continuation() {
557   frame enterSpecial = new_entry_frame();
558   frame::common_abi* enterSpecial_abi = (frame::common_abi*)enterSpecial.sp();
559 
560   enterSpecial_abi->lr = (intptr_t)ContinuationEntry::cleanup_pc();
561 
562   log_develop_trace(continuations, preempt)("push_cleanup_continuation enterSpecial sp: " INTPTR_FORMAT " cleanup pc: " INTPTR_FORMAT,
563                                             p2i(enterSpecial_abi),
564                                             p2i(ContinuationEntry::cleanup_pc()));
565 
566   return enterSpecial.sp();
567 }
568 





569 inline void ThawBase::patch_pd(frame& f, const frame& caller) {
570   patch_callee_link(caller, caller.fp());
571   // Prevent assertion if f gets deoptimized right away before it's fully initialized
572   f.mark_not_fully_initialized();
573 }
574 
575 inline void ThawBase::patch_pd(frame& f, intptr_t* caller_sp) {
576   assert(f.own_abi()->callers_sp == (uint64_t)caller_sp, "should have been fixed by patch_caller_links");
577 }
578 
579 //
580 // Interpreter Calling Procedure on PPC
581 //
582 // Caller                                   Resized Caller before the Call                New Callee Frame
583 //
584 //   - SP/FP are 16 byte aligned.           - The unused part of the expression stack     - The caller's original SP is passed as
585 //     Padding is added as necessary.         is removed                                    sender SP (in R21_sender_SP) also by
586 //   - SP is _not_ used as esp              - Slots for the callee's nonparameter locals    compiled callers. It is saved in the
587 //     (expression stack pointer)             are added.                                    ijava_state::sender_sp slot and
588 //   - Has reserved slots for the           - The large ABI is replaced with a minimal      restored when returning.

320     // For compiled frames the back link is actually redundant. It gets computed
321     // as unextended_sp + frame_size.
322 
323     // Note the difference on x86_64: the link is not made relative if the caller
324     // is a compiled frame because there rbp is used as a non-volatile register by
325     // c1/c2 so it could be a computed value local to the caller.
326 
327     // See also:
328     // - FreezeBase::set_top_frame_metadata_pd
329     // - StackChunkFrameStream<frame_kind>::fp()
330     // - UseContinuationFastPath: compiled frames are copied in a batch w/o patching the back link.
331     //   The backlinks are restored when thawing (see Thaw<ConfigT>::patch_caller_links())
332     patch_callee_link(hf, (intptr_t*)badAddress);
333   }
334 #endif
335 }
336 
337 inline void FreezeBase::patch_pd_unused(intptr_t* sp) {
338 }
339 
340 inline intptr_t* AnchorMark::anchor_mark_set_pd() {
341   return _top_frame.sp();
342 }
343 
344 inline void AnchorMark::anchor_mark_clear_pd() {
345 }
346 
347 //////// Thaw
348 
349 // Fast path
350 
351 inline void ThawBase::prefetch_chunk_pd(void* start, int size) {
352   size <<= LogBytesPerWord;
353   Prefetch::read(start, size);
354   Prefetch::read(start, size - 64);
355 }
356 
357 // Set back chain links of fast thawed frames such that *sp == callers_sp.
358 // See https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#STACK
359 template <typename ConfigT>
360 inline void Thaw<ConfigT>::patch_caller_links(intptr_t* sp, intptr_t* bottom) {
361   for (intptr_t* callers_sp; sp < bottom; sp = callers_sp) {
362     address pc = (address)((frame::java_abi*) sp)->lr;
363     assert(pc != nullptr, "");
364     // see ThawBase::patch_return() which gets called just before
365     bool is_entry_frame = pc == StubRoutines::cont_returnBarrier() || pc == _cont.entryPC();
366     if (is_entry_frame) {

556 
557   // Make sure that esp is still relativized.
558   assert(f.at_absolute(ijava_idx(esp)) <= f.at_absolute(ijava_idx(monitors)), "");
559 
560   // Keep top_frame_sp relativized.
561 }
562 
563 inline intptr_t* ThawBase::push_cleanup_continuation() {
564   frame enterSpecial = new_entry_frame();
565   frame::common_abi* enterSpecial_abi = (frame::common_abi*)enterSpecial.sp();
566 
567   enterSpecial_abi->lr = (intptr_t)ContinuationEntry::cleanup_pc();
568 
569   log_develop_trace(continuations, preempt)("push_cleanup_continuation enterSpecial sp: " INTPTR_FORMAT " cleanup pc: " INTPTR_FORMAT,
570                                             p2i(enterSpecial_abi),
571                                             p2i(ContinuationEntry::cleanup_pc()));
572 
573   return enterSpecial.sp();
574 }
575 
576 inline intptr_t* ThawBase::push_preempt_adapter() {
577   Unimplemented();
578   return nullptr;
579 }
580 
581 inline void ThawBase::patch_pd(frame& f, const frame& caller) {
582   patch_callee_link(caller, caller.fp());
583   // Prevent assertion if f gets deoptimized right away before it's fully initialized
584   f.mark_not_fully_initialized();
585 }
586 
587 inline void ThawBase::patch_pd(frame& f, intptr_t* caller_sp) {
588   assert(f.own_abi()->callers_sp == (uint64_t)caller_sp, "should have been fixed by patch_caller_links");
589 }
590 
591 //
592 // Interpreter Calling Procedure on PPC
593 //
594 // Caller                                   Resized Caller before the Call                New Callee Frame
595 //
596 //   - SP/FP are 16 byte aligned.           - The unused part of the expression stack     - The caller's original SP is passed as
597 //     Padding is added as necessary.         is removed                                    sender SP (in R21_sender_SP) also by
598 //   - SP is _not_ used as esp              - Slots for the callee's nonparameter locals    compiled callers. It is saved in the
599 //     (expression stack pointer)             are added.                                    ijava_state::sender_sp slot and
600 //   - Has reserved slots for the           - The large ABI is replaced with a minimal      restored when returning.
< prev index next >