Skip to content

Commit 15097b6

Browse files
committed
patch_caller_links
1 parent 4ff669c commit 15097b6

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/hotspot/cpu/s390/continuationFreezeThaw_s390.inline.hpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,22 @@ inline intptr_t* ThawBase::push_cleanup_continuation() {
276276

277277
template <typename ConfigT>
278278
inline void Thaw<ConfigT>::patch_caller_links(intptr_t* sp, intptr_t* bottom) {
279-
Unimplemented();
279+
for (intptr_t* callers_sp; sp < bottom; sp = callers_sp) {
280+
address pc = (address)((frame::z_java_abi*) sp)->return_pc;
281+
assert(pc != nullptr, "");
282+
// see ThawBase::patch_return() which gets called just before
283+
bool is_entry_frame = pc == StubRoutines::cont_returnBarrier() || pc == _cont.entryPC();
284+
if (is_entry_frame) {
285+
callers_sp = _cont.entryFP();
286+
} else {
287+
assert(!Interpreter::contains(pc), "sp:" PTR_FORMAT " pc:" PTR_FORMAT, p2i(sp), p2i(pc));
288+
// TODO: 8290965: PPC64: Implement post-call NOPs
289+
CodeBlob* cb = CodeCache::find_blob(pc);
290+
callers_sp = sp + cb->frame_size();
291+
}
292+
// set the back link
293+
((frame::z_java_abi*) sp)->callers_sp = (intptr_t) callers_sp;
294+
}
280295
}
281296

282297
inline void ThawBase::prefetch_chunk_pd(void* start, int size) {

0 commit comments

Comments
 (0)