Skip to content

Commit

Permalink
8289925: Shared code shouldn't reference the platform specific method…
Browse files Browse the repository at this point in the history
… frame::interpreter_frame_last_sp()

Reviewed-by: eosterlund, dlong
  • Loading branch information
reinrich committed Oct 5, 2022
1 parent bd90c4c commit ee6c391
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 26 deletions.
2 changes: 0 additions & 2 deletions src/hotspot/cpu/ppc/frame_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,6 @@
inline void interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp);
inline void interpreter_frame_set_sender_sp(intptr_t* sender_sp);

inline intptr_t* interpreter_frame_last_sp() const;

template <typename RegisterMapT>
static void update_map_with_saved_link(RegisterMapT* map, intptr_t** link_addr);

Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/cpu/ppc/frame_ppc.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,6 @@ inline void frame::interpreted_frame_oop_map(InterpreterOopMap* mask) const {
Unimplemented();
}

inline intptr_t* frame::interpreter_frame_last_sp() const {
Unimplemented();
return NULL;
}

inline int frame::sender_sp_ret_address_offset() {
Unimplemented();
return 0;
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/cpu/s390/frame_s390.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,6 @@
address* sender_pc_addr(void) const;

public:
inline intptr_t* interpreter_frame_last_sp() const;

template <typename RegisterMapT>
static void update_map_with_saved_link(RegisterMapT* map, intptr_t** link_addr);

Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/cpu/s390/frame_s390.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,6 @@ inline void frame::interpreted_frame_oop_map(InterpreterOopMap* mask) const {
Unimplemented();
}

inline intptr_t* frame::interpreter_frame_last_sp() const {
Unimplemented();
return NULL;
}

inline int frame::sender_sp_ret_address_offset() {
Unimplemented();
return 0;
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/cpu/zero/frame_zero.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@

inline address* sender_pc_addr() const;

inline intptr_t* interpreter_frame_last_sp() const;

template <typename RegisterMapT>
static void update_map_with_saved_link(RegisterMapT* map, intptr_t** link_addr);

Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/cpu/zero/frame_zero.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ inline void frame::interpreted_frame_oop_map(InterpreterOopMap* mask) const {
Unimplemented();
}

inline intptr_t* frame::interpreter_frame_last_sp() const {
Unimplemented();
return NULL;
}

inline int frame::sender_sp_ret_address_offset() {
Unimplemented();
return 0;
Expand Down
14 changes: 9 additions & 5 deletions src/hotspot/share/runtime/continuation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,17 @@ bool Continuation::is_continuation_entry_frame(const frame& f, const RegisterMap
return m != nullptr && m->intrinsic_id() == vmIntrinsics::_Continuation_enter;
}

// The parameter `sp` should be the actual sp and not the unextended sp because at
// least on PPC64 unextended_sp < sp is possible as interpreted frames are trimmed
// to the actual size of the expression stack before calls. The problem there is
// that even unextended_sp < entry_sp < sp is possible for an interpreted frame.
static inline bool is_sp_in_continuation(const ContinuationEntry* entry, intptr_t* const sp) {
// entry_sp() returns the unextended_sp which is always greater or equal to the actual sp
return entry->entry_sp() > sp;
}

bool Continuation::is_frame_in_continuation(const ContinuationEntry* entry, const frame& f) {
return is_sp_in_continuation(entry, f.unextended_sp());
return is_sp_in_continuation(entry, f.sp());
}

ContinuationEntry* Continuation::get_continuation_entry_for_sp(JavaThread* thread, intptr_t* const sp) {
Expand All @@ -160,7 +165,7 @@ ContinuationEntry* Continuation::get_continuation_entry_for_entry_frame(JavaThre
}

bool Continuation::is_frame_in_continuation(JavaThread* thread, const frame& f) {
return f.is_heap_frame() || (get_continuation_entry_for_sp(thread, f.unextended_sp()) != nullptr);
return f.is_heap_frame() || (get_continuation_entry_for_sp(thread, f.sp()) != nullptr);
}

static frame continuation_top_frame(const ContinuationWrapper& cont, RegisterMap* map) {
Expand Down Expand Up @@ -296,9 +301,8 @@ bool Continuation::unpin(JavaThread* current) {

frame Continuation::continuation_bottom_sender(JavaThread* thread, const frame& callee, intptr_t* sender_sp) {
assert (thread != nullptr, "");
ContinuationEntry* ce = get_continuation_entry_for_sp(thread,
callee.is_interpreted_frame() ? callee.interpreter_frame_last_sp() : callee.unextended_sp());
assert(ce != nullptr, "callee.unextended_sp(): " INTPTR_FORMAT, p2i(callee.unextended_sp()));
ContinuationEntry* ce = get_continuation_entry_for_sp(thread, callee.sp());
assert(ce != nullptr, "callee.sp(): " INTPTR_FORMAT, p2i(callee.sp()));

log_develop_debug(continuations)("continuation_bottom_sender: [" JLONG_FORMAT "] [%d] callee: " INTPTR_FORMAT
" sender_sp: " INTPTR_FORMAT,
Expand Down

1 comment on commit ee6c391

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.