Skip to content

Commit

Permalink
Review Martin
Browse files Browse the repository at this point in the history
  • Loading branch information
reinrich committed Jan 11, 2024
1 parent 5852ea3 commit 05fa480
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/frame_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ intptr_t *frame::initial_deoptimization_info() {
#ifndef PRODUCT
// This is a generic constructor which is only used by pns() in debug.cpp.
// fp is dropped and gets determined by backlink.
frame::frame(void* sp, void* fp, void* pc) : frame((intptr_t*)sp, (address)pc, kind::code_blob) {}
frame::frame(void* sp, void* fp, void* pc) : frame((intptr_t*)sp, (address)pc, kind::unknown) {}
#endif

BasicObjectLock* frame::interpreter_frame_monitor_end() const {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/frame_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
inline common_abi* callers_abi() const { return (common_abi*) _fp; }

enum class kind {
native, // The frame's pc is not necessarily in the CodeCache.
unknown, // The frame's pc is not necessarily in the CodeCache.
// CodeCache::find_blob_fast(void* pc) can yield wrong results in this case and must not be used.
code_blob, // The frame's pc is known to be in the CodeCache but it is likely not in an nmethod.
// CodeCache::find_blob_fast() will be correct but not faster in this case.
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/ppc/frame_ppc.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ inline void frame::setup(kind knd) {
assert(_pc != nullptr, "must have PC");
}

if (_cb == nullptr ) {
_cb = knd == kind::nmethod ? CodeCache::find_blob_fast(_pc) : CodeCache::find_blob(_pc);
if (_cb == nullptr) {
_cb = (knd == kind::nmethod) ? CodeCache::find_blob_fast(_pc) : CodeCache::find_blob(_pc);
}

if (_unextended_sp == nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ void MacroAssembler::post_call_nop() {
return;
}
// We use CMPI/CMPLI instructions to encode post call nops.
// We set bit 9 to distinguish post call nops from real CMPI/CMPI instructions
// Refer to NativePostCallNop for details.
relocate(post_call_nop_Relocation::spec());
InlineSkippedInstructionsCounter skipCounter(this);
Assembler::emit_int32(Assembler::CMPLI_OPCODE | Assembler::opp_u_field(1, 9, 9));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/nativeInst_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ class NativePostCallNop: public NativeInstruction {
// |0 0 1 0 1|DATA HI| 1| DATA LO |
// | |4 bits | | 22 bits |
//
// Bit 9 is alwys 1 for PCNs to distinguish them from CMPI/CMPLI
// Bit 9 is always 1 for PCNs to distinguish them from regular CMPI/CMPLI
//
// Using both, CMPLI (opcode 10 = 0b001010) and CMPI (opcode 11 = 0b001011) for
// PCNs allows using bit 5 from the opcode to encode DATA HI.
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/aix_ppc/javaThread_aix_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
}

// pc could refer to a native address outside the code cache even though the thread isInJava.
frame ret_frame((intptr_t*)uc->uc_mcontext.jmp_context.gpr[1/*REG_SP*/], pc, frame::kind::native);
frame ret_frame((intptr_t*)uc->uc_mcontext.jmp_context.gpr[1/*REG_SP*/], pc, frame::kind::unknown);

if (ret_frame.fp() == nullptr) {
// The found frame does not have a valid frame pointer.
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
// Avoid crash during crash if pc broken.
if (epc) {
frame fr(sp, epc, frame::kind::native);
frame fr(sp, epc, frame::kind::unknown);
return fr;
}
frame fr(sp);
Expand All @@ -137,21 +137,21 @@ frame os::fetch_compiled_frame_from_context(const void* ucVoid) {
const ucontext_t* uc = (const ucontext_t*)ucVoid;
intptr_t* sp = os::Aix::ucontext_get_sp(uc);
address lr = ucontext_get_lr(uc);
return frame(sp, lr, frame::kind::native);
return frame(sp, lr, frame::kind::unknown);
}

frame os::get_sender_for_C_frame(frame* fr) {
if (*fr->sp() == (intptr_t) nullptr) {
// fr is the last C frame
return frame();
}
return frame(fr->sender_sp(), fr->sender_pc(), frame::kind::native);
return frame(fr->sender_sp(), fr->sender_pc(), frame::kind::unknown);
}


frame os::current_frame() {
intptr_t* csp = *(intptr_t**) __builtin_frame_address(0);
frame topframe(csp, CAST_FROM_FN_PTR(address, os::current_frame), frame::kind::native);
frame topframe(csp, CAST_FROM_FN_PTR(address, os::current_frame), frame::kind::unknown);
return os::get_sender_for_C_frame(&topframe);
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os_cpu/linux_ppc/javaThread_linux_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
}

// pc could refer to a native address outside the code cache even though the thread isInJava.
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/], pc, frame::kind::native);
frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/], pc, frame::kind::unknown);

if (ret_frame.fp() == nullptr) {
// The found frame does not have a valid frame pointer.
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,28 +156,28 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
intptr_t* sp;
intptr_t* fp;
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
return frame(sp, epc, frame::kind::native);
return frame(sp, epc, frame::kind::unknown);
}

frame os::fetch_compiled_frame_from_context(const void* ucVoid) {
const ucontext_t* uc = (const ucontext_t*)ucVoid;
intptr_t* sp = os::Linux::ucontext_get_sp(uc);
address lr = ucontext_get_lr(uc);
return frame(sp, lr, frame::kind::native);
return frame(sp, lr, frame::kind::unknown);
}

frame os::get_sender_for_C_frame(frame* fr) {
if (*fr->sp() == 0) {
// fr is the last C frame
return frame();
}
return frame(fr->sender_sp(), fr->sender_pc(), frame::kind::native);
return frame(fr->sender_sp(), fr->sender_pc(), frame::kind::unknown);
}


frame os::current_frame() {
intptr_t* csp = *(intptr_t**) __builtin_frame_address(0);
frame topframe(csp, CAST_FROM_FN_PTR(address, os::current_frame), frame::kind::native);
frame topframe(csp, CAST_FROM_FN_PTR(address, os::current_frame), frame::kind::unknown);
return os::get_sender_for_C_frame(&topframe);
}

Expand Down

0 comments on commit 05fa480

Please sign in to comment.