8299795: Relativize locals in interpreter frames
Reviewed-by: coleenp, rehn, pchilanomate, mdoerr, fyang
This commit is contained in:
parent
11aadc9d98
commit
f307e8c667
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -150,6 +150,7 @@ inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, co
|
||||
|
||||
// at(frame::interpreter_frame_last_sp_offset) can be NULL at safepoint preempts
|
||||
*hf.addr_at(frame::interpreter_frame_last_sp_offset) = hf.unextended_sp() - hf.fp();
|
||||
// This line can be changed into an assert when we have fixed the "frame padding problem", see JDK-8300197
|
||||
*hf.addr_at(frame::interpreter_frame_locals_offset) = frame::sender_sp_offset + f.interpreter_frame_method()->max_locals() - 1;
|
||||
|
||||
relativize_one(vfp, hfp, frame::interpreter_frame_initial_sp_offset); // == block_top == block_bottom
|
||||
@ -232,12 +233,12 @@ template<typename FKind> frame ThawBase::new_stack_frame(const frame& hf, frame&
|
||||
assert(frame_sp == unextended_sp, "");
|
||||
caller.set_sp(fp + frame::sender_sp_offset);
|
||||
frame f(frame_sp, frame_sp, fp, hf.pc());
|
||||
// it's set again later in set_interpreter_frame_bottom, but we need to set the locals now so that
|
||||
// we could call ContinuationHelper::InterpretedFrame::frame_bottom
|
||||
// we need to set the locals so that the caller of new_stack_frame() can call
|
||||
// ContinuationHelper::InterpretedFrame::frame_bottom
|
||||
intptr_t offset = *hf.addr_at(frame::interpreter_frame_locals_offset);
|
||||
assert((int)offset == frame::sender_sp_offset + locals - 1, "");
|
||||
// derelativize locals
|
||||
*(intptr_t**)f.addr_at(frame::interpreter_frame_locals_offset) = fp + padding + offset;
|
||||
// set relativized locals
|
||||
*f.addr_at(frame::interpreter_frame_locals_offset) = padding + offset;
|
||||
assert((intptr_t)f.fp() % frame::frame_alignment == 0, "");
|
||||
return f;
|
||||
} else {
|
||||
@ -300,7 +301,9 @@ inline void ThawBase::derelativize_interpreted_frame_metadata(const frame& hf, c
|
||||
}
|
||||
|
||||
inline void ThawBase::set_interpreter_frame_bottom(const frame& f, intptr_t* bottom) {
|
||||
*(intptr_t**)f.addr_at(frame::interpreter_frame_locals_offset) = bottom - 1;
|
||||
// set relativized locals
|
||||
// this line can be changed into an assert when we have fixed the "frame padding problem", see JDK-8300197
|
||||
*f.addr_at(frame::interpreter_frame_locals_offset) = (bottom - 1) - f.fp();
|
||||
}
|
||||
|
||||
#endif // CPU_AARCH64_CONTINUATIONFREEZETHAW_AARCH64_INLINE_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -68,7 +68,6 @@ inline void ContinuationHelper::push_pd(const frame& f) {
|
||||
*(intptr_t**)(f.sp() - frame::sender_sp_offset) = f.fp();
|
||||
}
|
||||
|
||||
|
||||
inline void ContinuationHelper::set_anchor_to_entry_pd(JavaFrameAnchor* anchor, ContinuationEntry* entry) {
|
||||
anchor->set_last_Java_fp(entry->entry_fp());
|
||||
}
|
||||
@ -131,7 +130,7 @@ inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f,
|
||||
}
|
||||
|
||||
inline intptr_t* ContinuationHelper::InterpretedFrame::frame_bottom(const frame& f) { // exclusive; this will not be copied with the frame
|
||||
return (intptr_t*)f.at(frame::interpreter_frame_locals_offset) + 1; // exclusive, so we add 1 word
|
||||
return (intptr_t*)f.at_relative(frame::interpreter_frame_locals_offset) + 1; // exclusive, so we add 1 word
|
||||
}
|
||||
|
||||
inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f, int callee_argsize, bool callee_interpreted) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -314,7 +314,16 @@ intptr_t* frame::entry_frame_argument_at(int offset) const {
|
||||
return &unextended_sp()[index];
|
||||
}
|
||||
|
||||
// locals
|
||||
|
||||
void frame::interpreter_frame_set_locals(intptr_t* locs) {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
// set relativized locals
|
||||
ptr_at_put(interpreter_frame_locals_offset, (intptr_t) (locs - fp()));
|
||||
}
|
||||
|
||||
// sender_sp
|
||||
|
||||
intptr_t* frame::interpreter_frame_sender_sp() const {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
return (intptr_t*) at(interpreter_frame_sender_sp_offset);
|
||||
@ -526,7 +535,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
|
||||
// validate locals
|
||||
|
||||
address locals = (address) *interpreter_frame_locals_addr();
|
||||
address locals = (address)interpreter_frame_locals();
|
||||
return thread->is_in_stack_range_incl(locals, (address)fp());
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -257,8 +257,9 @@ inline address frame::sender_pc() const { return pauth_strip_point
|
||||
|
||||
inline intptr_t* frame::sender_sp() const { return addr_at( sender_sp_offset); }
|
||||
|
||||
inline intptr_t** frame::interpreter_frame_locals_addr() const {
|
||||
return (intptr_t**)addr_at(interpreter_frame_locals_offset);
|
||||
inline intptr_t* frame::interpreter_frame_locals() const {
|
||||
intptr_t n = *addr_at(interpreter_frame_locals_offset);
|
||||
return &fp()[n]; // return relativized locals
|
||||
}
|
||||
|
||||
inline intptr_t* frame::interpreter_frame_last_sp() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -76,6 +76,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
|
||||
void restore_locals() {
|
||||
ldr(rlocals, Address(rfp, frame::interpreter_frame_locals_offset * wordSize));
|
||||
lea(rlocals, Address(rfp, rlocals, Address::lsl(3)));
|
||||
}
|
||||
|
||||
void restore_constant_pool_cache() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -811,15 +811,18 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
|
||||
__ stp(zr, rmethod, Address(sp, 6 * wordSize)); // save Method* (no mdp)
|
||||
}
|
||||
|
||||
__ ldr(rcpool, Address(rmethod, Method::const_offset()));
|
||||
__ ldr(rcpool, Address(rcpool, ConstMethod::constants_offset()));
|
||||
__ ldr(rcpool, Address(rcpool, ConstantPool::cache_offset_in_bytes()));
|
||||
__ stp(rlocals, rcpool, Address(sp, 2 * wordSize));
|
||||
|
||||
__ protect_return_address();
|
||||
__ stp(rfp, lr, Address(sp, 10 * wordSize));
|
||||
__ lea(rfp, Address(sp, 10 * wordSize));
|
||||
|
||||
__ ldr(rcpool, Address(rmethod, Method::const_offset()));
|
||||
__ ldr(rcpool, Address(rcpool, ConstMethod::constants_offset()));
|
||||
__ ldr(rcpool, Address(rcpool, ConstantPool::cache_offset_in_bytes()));
|
||||
__ sub(rscratch1, rlocals, rfp);
|
||||
__ lsr(rscratch1, rscratch1, Interpreter::logStackElementSize); // rscratch1 = rlocals - fp();
|
||||
// Store relativized rlocals, see frame::interpreter_frame_locals().
|
||||
__ stp(rscratch1, rcpool, Address(sp, 2 * wordSize));
|
||||
|
||||
// set sender sp
|
||||
// leave last_sp as null
|
||||
__ stp(zr, r19_sender_sp, Address(sp, 8 * wordSize));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -252,7 +252,16 @@ intptr_t* frame::entry_frame_argument_at(int offset) const {
|
||||
return &unextended_sp()[index];
|
||||
}
|
||||
|
||||
// locals
|
||||
|
||||
void frame::interpreter_frame_set_locals(intptr_t* locs) {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
// set relativized locals
|
||||
ptr_at_put(interpreter_frame_locals_offset, (intptr_t) (locs - fp()));
|
||||
}
|
||||
|
||||
// sender_sp
|
||||
|
||||
intptr_t* frame::interpreter_frame_sender_sp() const {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
return (intptr_t*) at(interpreter_frame_sender_sp_offset);
|
||||
@ -436,7 +445,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
|
||||
// validate locals
|
||||
|
||||
address locals = (address) *interpreter_frame_locals_addr();
|
||||
address locals = (address)interpreter_frame_locals();
|
||||
return thread->is_in_stack_range_incl(locals, (address)fp());
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -122,8 +122,9 @@ inline address frame::sender_pc() const { return *sender_pc_addr(); }
|
||||
|
||||
inline intptr_t* frame::sender_sp() const { return addr_at(sender_sp_offset); }
|
||||
|
||||
inline intptr_t** frame::interpreter_frame_locals_addr() const {
|
||||
return (intptr_t**)addr_at(interpreter_frame_locals_offset);
|
||||
inline intptr_t* frame::interpreter_frame_locals() const {
|
||||
intptr_t n = *addr_at(interpreter_frame_locals_offset);
|
||||
return &fp()[n]; // return relativized locals
|
||||
}
|
||||
|
||||
inline intptr_t* frame::interpreter_frame_last_sp() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,7 +33,6 @@
|
||||
|
||||
// This file specializes the assembler with interpreter-specific macros
|
||||
|
||||
|
||||
class InterpreterMacroAssembler: public MacroAssembler {
|
||||
|
||||
public:
|
||||
@ -73,7 +72,10 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
|
||||
void save_bcp() { str(Rbcp, Address(FP, frame::interpreter_frame_bcp_offset * wordSize)); }
|
||||
void restore_bcp() { ldr(Rbcp, Address(FP, frame::interpreter_frame_bcp_offset * wordSize)); }
|
||||
void restore_locals() { ldr(Rlocals, Address(FP, frame::interpreter_frame_locals_offset * wordSize)); }
|
||||
void restore_locals() {
|
||||
ldr(Rlocals, Address(FP, frame::interpreter_frame_locals_offset * wordSize));
|
||||
add(Rlocals, FP, AsmOperand(Rlocals, lsl, LogBytesPerWord));
|
||||
}
|
||||
void restore_method() { ldr(Rmethod, Address(FP, frame::interpreter_frame_method_offset * wordSize)); }
|
||||
void restore_dispatch();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -654,7 +654,9 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
|
||||
__ ldr(Rtemp, Address(Rtemp, ConstMethod::constants_offset()));
|
||||
__ ldr(Rtemp, Address(Rtemp, ConstantPool::cache_offset_in_bytes()));
|
||||
__ push(Rtemp); // set constant pool cache
|
||||
__ push(Rlocals); // set locals pointer
|
||||
__ sub(Rtemp, Rlocals, FP);
|
||||
__ logical_shift_right(Rtemp, Rtemp, Interpreter::logStackElementSize); // Rtemp = Rlocals - fp();
|
||||
__ push(Rtemp); // set relativized Rlocals, see frame::interpreter_frame_locals()
|
||||
__ push(Rbcp); // set bcp
|
||||
__ push(R0); // reserve word for pointer to expression stack bottom
|
||||
__ str(SP, Address(SP, 0)); // set expression stack bottom
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -85,6 +85,7 @@ inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, co
|
||||
|
||||
// There is alignment padding between vfp and f's locals array in the original
|
||||
// frame, therefore we cannot use it to relativize the locals pointer.
|
||||
// This line can be changed into an assert when we have fixed the "frame padding problem", see JDK-8300197
|
||||
*hf.addr_at(ijava_idx(locals)) = frame::metadata_words + f.interpreter_frame_method()->max_locals() - 1;
|
||||
relativize_one(vfp, hfp, ijava_idx(monitors));
|
||||
relativize_one(vfp, hfp, ijava_idx(esp));
|
||||
@ -504,11 +505,12 @@ template<typename FKind> frame ThawBase::new_stack_frame(const frame& hf, frame&
|
||||
assert(frame_sp + frame::metadata_words_at_top == esp+1, " frame_sp=" PTR_FORMAT " esp=" PTR_FORMAT, p2i(frame_sp), p2i(esp));
|
||||
caller.set_sp(fp);
|
||||
frame f(frame_sp, hf.pc(), frame_sp, fp);
|
||||
// it's set again later in set_interpreter_frame_bottom, but we need to set the locals now so that
|
||||
// we could call ContinuationHelper::InterpretedFrame::frame_bottom
|
||||
// we need to set the locals so that the caller of new_stack_frame() can call
|
||||
// ContinuationHelper::InterpretedFrame::frame_bottom
|
||||
intptr_t offset = *hf.addr_at(ijava_idx(locals)) + padding;
|
||||
assert((int)offset == hf.interpreter_frame_method()->max_locals() + frame::metadata_words_at_top + padding - 1, "");
|
||||
*(intptr_t**)f.addr_at(ijava_idx(locals)) = fp + offset;
|
||||
// set relativized locals
|
||||
*f.addr_at(ijava_idx(locals)) = offset;
|
||||
|
||||
return f;
|
||||
} else {
|
||||
@ -548,7 +550,9 @@ inline void ThawBase::derelativize_interpreted_frame_metadata(const frame& hf, c
|
||||
}
|
||||
|
||||
inline void ThawBase::set_interpreter_frame_bottom(const frame& f, intptr_t* bottom) {
|
||||
*(intptr_t**)f.addr_at(ijava_idx(locals)) = bottom - 1;
|
||||
// set relativized locals
|
||||
// This line can be changed into an assert when we have fixed the "frame padding problem", see JDK-8300197
|
||||
*f.addr_at(ijava_idx(locals)) = (bottom - 1) - f.fp();
|
||||
}
|
||||
|
||||
inline void ThawBase::patch_pd(frame& f, const frame& caller) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -170,7 +170,7 @@ inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f,
|
||||
}
|
||||
|
||||
inline intptr_t* ContinuationHelper::InterpretedFrame::frame_bottom(const frame& f) {
|
||||
return (intptr_t*)f.at(ijava_idx(locals)) + 1; // exclusive (will not be copied), so we add 1 word
|
||||
return (intptr_t*)f.at_relative(ijava_idx(locals)) + 1; // exclusive (will not be copied), so we add 1 word
|
||||
}
|
||||
|
||||
inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f, int callee_argsize_incl_metadata, bool callee_interpreted) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2022 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -230,6 +230,16 @@ frame frame::sender_for_interpreter_frame(RegisterMap *map) const {
|
||||
return frame(sender_sp(), sender_pc, unextended_sp);
|
||||
}
|
||||
|
||||
// locals
|
||||
|
||||
void frame::interpreter_frame_set_locals(intptr_t* locs) {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
// set relativized locals
|
||||
*addr_at(ijava_idx(locals)) = (intptr_t) (locs - fp());
|
||||
}
|
||||
|
||||
// sender_sp
|
||||
|
||||
intptr_t* frame::interpreter_frame_sender_sp() const {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
return (intptr_t*)at(ijava_idx(sender_sp));
|
||||
@ -322,7 +332,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
|
||||
// validate locals
|
||||
|
||||
address locals = (address) *interpreter_frame_locals_addr();
|
||||
address locals = (address)interpreter_frame_locals();
|
||||
return thread->is_in_stack_range_incl(locals, (address)fp());
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -187,8 +187,9 @@ inline frame::ijava_state* frame::get_ijava_state() const {
|
||||
return (ijava_state*) ((uintptr_t)fp() - ijava_state_size);
|
||||
}
|
||||
|
||||
inline intptr_t** frame::interpreter_frame_locals_addr() const {
|
||||
return (intptr_t**)addr_at(ijava_idx(locals));
|
||||
inline intptr_t* frame::interpreter_frame_locals() const {
|
||||
intptr_t n = *addr_at(ijava_idx(locals));
|
||||
return &fp()[n]; // return relativized locals
|
||||
}
|
||||
|
||||
inline intptr_t* frame::interpreter_frame_bcp_addr() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2022 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -2170,7 +2170,7 @@ void InterpreterMacroAssembler::save_interpreter_state(Register scratch) {
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::restore_interpreter_state(Register scratch, bool bcp_and_mdx_only, bool restore_top_frame_sp) {
|
||||
ld(scratch, 0, R1_SP);
|
||||
ld_ptr(scratch, _abi0(callers_sp), R1_SP); // Load frame pointer.
|
||||
if (restore_top_frame_sp) {
|
||||
// After thawing the top frame of a continuation we reach here with frame::abi_minframe.
|
||||
// therefore we have to restore top_frame_sp before the assertion below.
|
||||
@ -2189,6 +2189,8 @@ void InterpreterMacroAssembler::restore_interpreter_state(Register scratch, bool
|
||||
// Following ones are stack addresses and don't require reload.
|
||||
ld(R15_esp, _ijava_state_neg(esp), scratch);
|
||||
ld(R18_locals, _ijava_state_neg(locals), scratch);
|
||||
sldi(R18_locals, R18_locals, Interpreter::logStackElementSize);
|
||||
add(R18_locals, R18_locals, scratch);
|
||||
ld(R26_monitor, _ijava_state_neg(monitors), scratch);
|
||||
}
|
||||
#ifdef ASSERT
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2022 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -1030,7 +1030,10 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist
|
||||
// Store values.
|
||||
__ std(R19_method, _ijava_state_neg(method), R1_SP);
|
||||
__ std(Rmirror, _ijava_state_neg(mirror), R1_SP);
|
||||
__ std(R18_locals, _ijava_state_neg(locals), R1_SP);
|
||||
__ sub(R12_scratch2, R18_locals, R1_SP);
|
||||
__ srdi(R12_scratch2, R12_scratch2, Interpreter::logStackElementSize);
|
||||
// Store relativized R18_locals, see frame::interpreter_frame_locals().
|
||||
__ std(R12_scratch2, _ijava_state_neg(locals), R1_SP);
|
||||
__ std(R27_constPoolCache, _ijava_state_neg(cpoolCache), R1_SP);
|
||||
|
||||
// Note: esp, bcp, monitor, mdx live in registers. Hence, the correct version can only
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -149,6 +149,7 @@ inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, co
|
||||
|
||||
// at(frame::interpreter_frame_last_sp_offset) can be NULL at safepoint preempts
|
||||
*hf.addr_at(frame::interpreter_frame_last_sp_offset) = hf.unextended_sp() - hf.fp();
|
||||
// this line can be changed into an assert when we have fixed the "frame padding problem", see JDK-8300197
|
||||
*hf.addr_at(frame::interpreter_frame_locals_offset) = frame::sender_sp_offset + f.interpreter_frame_method()->max_locals() - 1;
|
||||
|
||||
relativize_one(vfp, hfp, frame::interpreter_frame_initial_sp_offset); // == block_top == block_bottom
|
||||
@ -235,12 +236,12 @@ template<typename FKind> frame ThawBase::new_stack_frame(const frame& hf, frame&
|
||||
assert(frame_sp == unextended_sp, "");
|
||||
caller.set_sp(fp + frame::sender_sp_offset);
|
||||
frame f(frame_sp, frame_sp, fp, hf.pc());
|
||||
// it's set again later in set_interpreter_frame_bottom, but we need to set the locals now so that
|
||||
// we could call ContinuationHelper::InterpretedFrame::frame_bottom
|
||||
// we need to set the locals so that the caller of new_stack_frame() can call
|
||||
// ContinuationHelper::InterpretedFrame::frame_bottom
|
||||
intptr_t offset = *hf.addr_at(frame::interpreter_frame_locals_offset);
|
||||
assert((int)offset == frame::sender_sp_offset + locals - 1, "");
|
||||
// derelativize locals
|
||||
*(intptr_t**)f.addr_at(frame::interpreter_frame_locals_offset) = fp + padding + offset;
|
||||
// set relativized locals
|
||||
*f.addr_at(frame::interpreter_frame_locals_offset) = padding + offset;
|
||||
assert((intptr_t)f.fp() % frame::frame_alignment == 0, "");
|
||||
return f;
|
||||
} else {
|
||||
@ -303,7 +304,9 @@ inline void ThawBase::derelativize_interpreted_frame_metadata(const frame& hf, c
|
||||
}
|
||||
|
||||
inline void ThawBase::set_interpreter_frame_bottom(const frame& f, intptr_t* bottom) {
|
||||
*(intptr_t**)f.addr_at(frame::interpreter_frame_locals_offset) = bottom - 1;
|
||||
// set relativized locals
|
||||
// This line can be changed into an assert when we have fixed the "frame padding problem", see JDK-8300197
|
||||
*f.addr_at(frame::interpreter_frame_locals_offset) = (bottom - 1) - f.fp();
|
||||
}
|
||||
|
||||
#endif // CPU_RISCV_CONTINUATIONFREEZETHAW_RISCV_INLINE_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -130,7 +130,7 @@ inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f,
|
||||
}
|
||||
|
||||
inline intptr_t* ContinuationHelper::InterpretedFrame::frame_bottom(const frame& f) { // exclusive; this will not be copied with the frame
|
||||
return (intptr_t*)f.at(frame::interpreter_frame_locals_offset) + 1; // exclusive, so we add 1 word
|
||||
return (intptr_t*)f.at_relative(frame::interpreter_frame_locals_offset) + 1; // exclusive, so we add 1 word
|
||||
}
|
||||
|
||||
inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f, int callee_argsize, bool callee_interpreted) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@ -290,7 +290,16 @@ intptr_t* frame::entry_frame_argument_at(int offset) const {
|
||||
return &unextended_sp()[index];
|
||||
}
|
||||
|
||||
// locals
|
||||
|
||||
void frame::interpreter_frame_set_locals(intptr_t* locs) {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
// set relativized locals
|
||||
ptr_at_put(interpreter_frame_locals_offset, (intptr_t) (locs - fp()));
|
||||
}
|
||||
|
||||
// sender_sp
|
||||
|
||||
intptr_t* frame::interpreter_frame_sender_sp() const {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
return (intptr_t*) at(interpreter_frame_sender_sp_offset);
|
||||
@ -498,7 +507,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
|
||||
// validate locals
|
||||
if (m->max_locals() > 0) {
|
||||
address locals = (address) *interpreter_frame_locals_addr();
|
||||
address locals = (address)interpreter_frame_locals();
|
||||
if (!thread->is_in_stack_range_incl(locals, (address)fp())) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@ -248,8 +248,9 @@ inline address* frame::sender_pc_addr() const { return (address*) addr_at(re
|
||||
inline address frame::sender_pc() const { return *sender_pc_addr(); }
|
||||
inline intptr_t* frame::sender_sp() const { return addr_at(sender_sp_offset); }
|
||||
|
||||
inline intptr_t** frame::interpreter_frame_locals_addr() const {
|
||||
return (intptr_t**)addr_at(interpreter_frame_locals_offset);
|
||||
inline intptr_t* frame::interpreter_frame_locals() const {
|
||||
intptr_t n = *addr_at(interpreter_frame_locals_offset);
|
||||
return &fp()[n]; // return relativized locals
|
||||
}
|
||||
|
||||
inline intptr_t* frame::interpreter_frame_last_sp() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@ -75,6 +75,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
|
||||
void restore_locals() {
|
||||
ld(xlocals, Address(fp, frame::interpreter_frame_locals_offset * wordSize));
|
||||
shadd(xlocals, xlocals, fp, t0, LogBytesPerWord);
|
||||
}
|
||||
|
||||
void restore_constant_pool_cache() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@ -746,15 +746,18 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
|
||||
__ sd(xmethod, Address(sp, 7 * wordSize));
|
||||
__ sd(ProfileInterpreter ? t0 : zr, Address(sp, 6 * wordSize));
|
||||
|
||||
__ sd(ra, Address(sp, 11 * wordSize));
|
||||
__ sd(fp, Address(sp, 10 * wordSize));
|
||||
__ la(fp, Address(sp, 12 * wordSize)); // include ra & fp
|
||||
|
||||
__ ld(xcpool, Address(xmethod, Method::const_offset()));
|
||||
__ ld(xcpool, Address(xcpool, ConstMethod::constants_offset()));
|
||||
__ ld(xcpool, Address(xcpool, ConstantPool::cache_offset_in_bytes()));
|
||||
__ sd(xcpool, Address(sp, 3 * wordSize));
|
||||
__ sd(xlocals, Address(sp, 2 * wordSize));
|
||||
|
||||
__ sd(ra, Address(sp, 11 * wordSize));
|
||||
__ sd(fp, Address(sp, 10 * wordSize));
|
||||
__ la(fp, Address(sp, 12 * wordSize)); // include ra & fp
|
||||
__ sub(t0, xlocals, fp);
|
||||
__ srli(t0, t0, Interpreter::logStackElementSize); // t0 = xlocals - fp();
|
||||
// Store relativized xlocals, see frame::interpreter_frame_locals().
|
||||
__ sd(t0, Address(sp, 2 * wordSize));
|
||||
|
||||
// set sender sp
|
||||
// leave last_sp as null
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2022 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -182,6 +182,13 @@ bool frame::is_interpreted_frame() const {
|
||||
return Interpreter::contains(pc());
|
||||
}
|
||||
|
||||
// locals
|
||||
|
||||
void frame::interpreter_frame_set_locals(intptr_t* locs) {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
ijava_state_unchecked()->locals = (uint64_t)locs;
|
||||
}
|
||||
|
||||
// sender_sp
|
||||
|
||||
intptr_t* frame::interpreter_frame_sender_sp() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -179,8 +179,8 @@ inline intptr_t* frame::link_or_null() const {
|
||||
return link();
|
||||
}
|
||||
|
||||
inline intptr_t** frame::interpreter_frame_locals_addr() const {
|
||||
return (intptr_t**) &(ijava_state()->locals);
|
||||
inline intptr_t* frame::interpreter_frame_locals() const {
|
||||
return (intptr_t*) (ijava_state()->locals);
|
||||
}
|
||||
|
||||
inline intptr_t* frame::interpreter_frame_bcp_addr() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -140,12 +140,11 @@ inline void FreezeBase::relativize_interpreted_frame_metadata(const frame& f, co
|
||||
|| (f.unextended_sp() == f.sp()), "");
|
||||
assert(f.fp() > (intptr_t*)f.at(frame::interpreter_frame_initial_sp_offset), "");
|
||||
|
||||
// We compute the locals as below rather than relativize the value in the frame because then we can use the same
|
||||
// code on AArch64, which has an added complication (see this method in continuation_aarch64.inline.hpp)
|
||||
|
||||
// at(frame::interpreter_frame_last_sp_offset) can be NULL at safepoint preempts
|
||||
*hf.addr_at(frame::interpreter_frame_last_sp_offset) = hf.unextended_sp() - hf.fp();
|
||||
*hf.addr_at(frame::interpreter_frame_locals_offset) = frame::sender_sp_offset + f.interpreter_frame_method()->max_locals() - 1;
|
||||
|
||||
// Make sure that locals is already relativized.
|
||||
assert((*hf.addr_at(frame::interpreter_frame_locals_offset) == frame::sender_sp_offset + f.interpreter_frame_method()->max_locals() - 1), "");
|
||||
|
||||
relativize_one(vfp, hfp, frame::interpreter_frame_initial_sp_offset); // == block_top == block_bottom
|
||||
|
||||
@ -222,12 +221,12 @@ template<typename FKind> frame ThawBase::new_stack_frame(const frame& hf, frame&
|
||||
assert(frame_sp == unextended_sp, "");
|
||||
caller.set_sp(fp + frame::sender_sp_offset);
|
||||
frame f(frame_sp, frame_sp, fp, hf.pc());
|
||||
// it's set again later in set_interpreter_frame_bottom, but we need to set the locals now so that
|
||||
// we could call ContinuationHelper::InterpretedFrame::frame_bottom
|
||||
// we need to set the locals so that the caller of new_stack_frame() can call
|
||||
// ContinuationHelper::InterpretedFrame::frame_bottom
|
||||
intptr_t offset = *hf.addr_at(frame::interpreter_frame_locals_offset);
|
||||
assert((int)offset == frame::sender_sp_offset + locals - 1, "");
|
||||
// derelativize locals
|
||||
*(intptr_t**)f.addr_at(frame::interpreter_frame_locals_offset) = fp + offset;
|
||||
// set relativized locals
|
||||
*f.addr_at(frame::interpreter_frame_locals_offset) = offset;
|
||||
return f;
|
||||
} else {
|
||||
int fsize = FKind::size(hf);
|
||||
@ -287,6 +286,7 @@ inline void ThawBase::derelativize_interpreted_frame_metadata(const frame& hf, c
|
||||
}
|
||||
|
||||
inline void ThawBase::set_interpreter_frame_bottom(const frame& f, intptr_t* bottom) {
|
||||
*(intptr_t**)f.addr_at(frame::interpreter_frame_locals_offset) = bottom - 1;
|
||||
// Nothing to do. Just make sure the relativized locals is already set.
|
||||
assert((*f.addr_at(frame::interpreter_frame_locals_offset) == (bottom - 1) - f.fp()), "");
|
||||
}
|
||||
#endif // CPU_X86_CONTINUATIONFREEZE_THAW_X86_INLINE_HPP
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -130,7 +130,7 @@ inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f,
|
||||
}
|
||||
|
||||
inline intptr_t* ContinuationHelper::InterpretedFrame::frame_bottom(const frame& f) { // exclusive; this will not be copied with the frame
|
||||
return (intptr_t*)f.at(frame::interpreter_frame_locals_offset) + 1; // exclusive, so we add 1 word
|
||||
return (intptr_t*)f.at_relative(frame::interpreter_frame_locals_offset) + 1; // exclusive, so we add 1 word
|
||||
}
|
||||
|
||||
inline intptr_t* ContinuationHelper::InterpretedFrame::frame_top(const frame& f, int callee_argsize, bool callee_interpreted) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -308,6 +308,14 @@ intptr_t* frame::entry_frame_argument_at(int offset) const {
|
||||
return &unextended_sp()[index];
|
||||
}
|
||||
|
||||
// locals
|
||||
|
||||
void frame::interpreter_frame_set_locals(intptr_t* locs) {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
// set relativized locals
|
||||
ptr_at_put(interpreter_frame_locals_offset, (intptr_t) (locs - fp()));
|
||||
}
|
||||
|
||||
// sender_sp
|
||||
|
||||
intptr_t* frame::interpreter_frame_sender_sp() const {
|
||||
@ -512,7 +520,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
|
||||
|
||||
// validate locals
|
||||
|
||||
address locals = (address) *interpreter_frame_locals_addr();
|
||||
address locals = (address)interpreter_frame_locals();
|
||||
return thread->is_in_stack_range_incl(locals, (address)fp());
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -41,6 +41,7 @@
|
||||
// [pointer to locals ] = locals() locals_offset
|
||||
// [constant pool cache ] = cache() cache_offset
|
||||
// [methodData ] = mdp() mdx_offset
|
||||
// [klass of method ] = mirror() mirror_offset
|
||||
// [Method* ] = method() method_offset
|
||||
// [last sp ] = last_sp() last_sp_offset
|
||||
// [old stack pointer ] (sender_sp) sender_sp_offset
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -245,8 +245,9 @@ inline address frame::sender_pc() const { return *sender_pc_addr(); }
|
||||
|
||||
inline intptr_t* frame::sender_sp() const { return addr_at(sender_sp_offset); }
|
||||
|
||||
inline intptr_t** frame::interpreter_frame_locals_addr() const {
|
||||
return (intptr_t**)addr_at(interpreter_frame_locals_offset);
|
||||
inline intptr_t* frame::interpreter_frame_locals() const {
|
||||
intptr_t n = *addr_at(interpreter_frame_locals_offset);
|
||||
return &fp()[n]; // return relativized locals
|
||||
}
|
||||
|
||||
inline intptr_t* frame::interpreter_frame_last_sp() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -75,6 +75,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
|
||||
void restore_locals() {
|
||||
movptr(_locals_register, Address(rbp, frame::interpreter_frame_locals_offset * wordSize));
|
||||
lea(_locals_register, Address(rbp, _locals_register, Address::times_ptr));
|
||||
}
|
||||
|
||||
// Helpers for runtime call arguments/results
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -644,7 +644,12 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
|
||||
__ movptr(rdx, Address(rdx, ConstMethod::constants_offset()));
|
||||
__ movptr(rdx, Address(rdx, ConstantPool::cache_offset_in_bytes()));
|
||||
__ push(rdx); // set constant pool cache
|
||||
__ push(rlocals); // set locals pointer
|
||||
|
||||
__ movptr(rax, rlocals);
|
||||
__ subptr(rax, rbp);
|
||||
__ shrptr(rax, Interpreter::logStackElementSize); // rax = rlocals - fp();
|
||||
__ push(rax); // set relativized rlocals, see frame::interpreter_frame_locals()
|
||||
|
||||
if (native_call) {
|
||||
__ push(0); // no bcp
|
||||
} else {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2021, Red Hat, Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -156,7 +156,7 @@ bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
|
||||
}
|
||||
|
||||
// validate locals
|
||||
address locals = (address) *interpreter_frame_locals_addr();
|
||||
address locals = (address)interpreter_frame_locals();
|
||||
if (!thread->is_in_stack_range_incl(locals, (address)fp())) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -99,8 +99,8 @@ inline interpreterState frame::get_interpreterState() const {
|
||||
return zero_interpreterframe()->interpreter_state();
|
||||
}
|
||||
|
||||
inline intptr_t** frame::interpreter_frame_locals_addr() const {
|
||||
return &(get_interpreterState()->_locals);
|
||||
inline intptr_t* frame::interpreter_frame_locals() const {
|
||||
return get_interpreterState()->_locals;
|
||||
}
|
||||
|
||||
inline intptr_t* frame::interpreter_frame_bcp_addr() const {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -390,11 +390,6 @@ frame frame::real_sender(RegisterMap* map) const {
|
||||
// Interpreter frames
|
||||
|
||||
|
||||
void frame::interpreter_frame_set_locals(intptr_t* locs) {
|
||||
assert(is_interpreted_frame(), "Not an interpreted frame");
|
||||
*interpreter_frame_locals_addr() = locs;
|
||||
}
|
||||
|
||||
Method* frame::interpreter_frame_method() const {
|
||||
assert(is_interpreted_frame(), "interpreted frame expected");
|
||||
Method* m = *interpreter_frame_method_addr();
|
||||
@ -464,8 +459,7 @@ BasicObjectLock* frame::previous_monitor_in_interpreter_frame(BasicObjectLock* c
|
||||
|
||||
intptr_t* frame::interpreter_frame_local_at(int index) const {
|
||||
const int n = Interpreter::local_offset_in_bytes(index)/wordSize;
|
||||
intptr_t* first = _on_heap ? fp() + (intptr_t)*interpreter_frame_locals_addr()
|
||||
: *interpreter_frame_locals_addr();
|
||||
intptr_t* first = interpreter_frame_locals();
|
||||
return &(first[n]);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -293,9 +293,9 @@ class frame {
|
||||
// Interpreter frames:
|
||||
|
||||
private:
|
||||
intptr_t** interpreter_frame_locals_addr() const;
|
||||
intptr_t* interpreter_frame_bcp_addr() const;
|
||||
intptr_t* interpreter_frame_mdp_addr() const;
|
||||
intptr_t* interpreter_frame_locals() const;
|
||||
intptr_t* interpreter_frame_bcp_addr() const;
|
||||
intptr_t* interpreter_frame_mdp_addr() const;
|
||||
|
||||
public:
|
||||
// Locals
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -276,7 +276,7 @@ public abstract class Frame implements Cloneable {
|
||||
public abstract Address addressOfInterpreterFrameLocals();
|
||||
|
||||
public Address addressOfInterpreterFrameLocal(int slot) {
|
||||
return addressOfInterpreterFrameLocals().getAddressAt(0).addOffsetTo(-slot * VM.getVM().getAddressSize());
|
||||
return addressOfInterpreterFrameLocals().addOffsetTo(-slot * VM.getVM().getAddressSize());
|
||||
}
|
||||
|
||||
// FIXME: not yet implementable
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, Red Hat Inc.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -473,7 +473,8 @@ public class AARCH64Frame extends Frame {
|
||||
public Address getSenderSP() { return addressOfStackSlot(SENDER_SP_OFFSET); }
|
||||
|
||||
public Address addressOfInterpreterFrameLocals() {
|
||||
return addressOfStackSlot(INTERPRETER_FRAME_LOCALS_OFFSET);
|
||||
long n = addressOfStackSlot(INTERPRETER_FRAME_LOCALS_OFFSET).getCIntegerAt(0, VM.getVM().getAddressSize(), false);
|
||||
return getFP().addOffsetTo(n * VM.getVM().getAddressSize());
|
||||
}
|
||||
|
||||
private Address addressOfInterpreterFrameBCX() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -385,7 +385,8 @@ public class PPC64Frame extends Frame {
|
||||
|
||||
public Address getSenderSP() { return getFP(); }
|
||||
public Address addressOfInterpreterFrameLocals() {
|
||||
return addressOfStackSlot(INTERPRETER_FRAME_LOCALS_OFFSET);
|
||||
long n = addressOfStackSlot(INTERPRETER_FRAME_LOCALS_OFFSET).getCIntegerAt(0, VM.getVM().getAddressSize(), false);
|
||||
return getFP().addOffsetTo(n * VM.getVM().getAddressSize());
|
||||
}
|
||||
|
||||
private Address addressOfInterpreterFrameBCX() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, Red Hat Inc.
|
||||
* Copyright (c) 2021, 2022, Huawei Technologies Co., Ltd. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@ -448,7 +448,8 @@ public class RISCV64Frame extends Frame {
|
||||
public Address getSenderSP() { return addressOfStackSlot(SENDER_SP_OFFSET); }
|
||||
|
||||
public Address addressOfInterpreterFrameLocals() {
|
||||
return addressOfStackSlot(INTERPRETER_FRAME_LOCALS_OFFSET);
|
||||
long n = addressOfStackSlot(INTERPRETER_FRAME_LOCALS_OFFSET).getCIntegerAt(0, VM.getVM().getAddressSize(), false);
|
||||
return getFP().addOffsetTo(n * VM.getVM().getAddressSize());
|
||||
}
|
||||
|
||||
private Address addressOfInterpreterFrameBCX() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -433,7 +433,8 @@ public class X86Frame extends Frame {
|
||||
public Address getSenderSP() { return addressOfStackSlot(SENDER_SP_OFFSET); }
|
||||
|
||||
public Address addressOfInterpreterFrameLocals() {
|
||||
return addressOfStackSlot(INTERPRETER_FRAME_LOCALS_OFFSET);
|
||||
long n = addressOfStackSlot(INTERPRETER_FRAME_LOCALS_OFFSET).getCIntegerAt(0, VM.getVM().getAddressSize(), false);
|
||||
return getFP().addOffsetTo(n * VM.getVM().getAddressSize());
|
||||
}
|
||||
|
||||
private Address addressOfInterpreterFrameBCX() {
|
||||
|
Loading…
Reference in New Issue
Block a user