8331733: [PPC64] saving and restoring CR is not needed at most places
Reviewed-by: mdoerr, amitkumar
This commit is contained in:
parent
6968770b1e
commit
40b2fbd820
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2023 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2024 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2020, 2024, 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
|
||||
@ -187,7 +187,7 @@ void DowncallLinker::StubGenerator::generate() {
|
||||
_oop_maps = _needs_transition ? new OopMapSet() : nullptr;
|
||||
address start = __ pc();
|
||||
|
||||
__ save_LR_CR(tmp); // Save in old frame.
|
||||
__ save_LR(tmp); // Save in old frame.
|
||||
__ mr(callerSP, R1_SP); // preset (used to access caller frame argument slots)
|
||||
__ push_frame(allocated_frame_size, tmp);
|
||||
|
||||
@ -302,7 +302,7 @@ void DowncallLinker::StubGenerator::generate() {
|
||||
}
|
||||
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(tmp);
|
||||
__ restore_LR(tmp);
|
||||
__ blr();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2023 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2024 SAP SE. 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
|
||||
@ -67,7 +67,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm
|
||||
__ cmpdi(CCR0, R0, 0);
|
||||
__ beq(CCR0, filtered);
|
||||
|
||||
__ save_LR_CR(R0);
|
||||
__ save_LR(R0);
|
||||
__ push_frame(frame_size, R0);
|
||||
int slot_nr = 0;
|
||||
__ std(from, frame_size - (++slot_nr) * wordSize, R1_SP);
|
||||
@ -89,7 +89,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm
|
||||
if (preserve1 != noreg) { __ ld(preserve1, frame_size - (++slot_nr) * wordSize, R1_SP); }
|
||||
if (preserve2 != noreg) { __ ld(preserve2, frame_size - (++slot_nr) * wordSize, R1_SP); }
|
||||
__ addi(R1_SP, R1_SP, frame_size); // pop_frame()
|
||||
__ restore_LR_CR(R0);
|
||||
__ restore_LR(R0);
|
||||
|
||||
__ bind(filtered);
|
||||
}
|
||||
@ -100,13 +100,13 @@ void G1BarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* mas
|
||||
int spill_slots = (preserve != noreg) ? 1 : 0;
|
||||
const int frame_size = align_up(frame::native_abi_reg_args_size + spill_slots * BytesPerWord, frame::alignment_in_bytes);
|
||||
|
||||
__ save_LR_CR(R0);
|
||||
__ save_LR(R0);
|
||||
__ push_frame(frame_size, R0);
|
||||
if (preserve != noreg) { __ std(preserve, frame_size - 1 * wordSize, R1_SP); }
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_array_post_entry), addr, count);
|
||||
if (preserve != noreg) { __ ld(preserve, frame_size - 1 * wordSize, R1_SP); }
|
||||
__ addi(R1_SP, R1_SP, frame_size); // pop_frame();
|
||||
__ restore_LR_CR(R0);
|
||||
__ restore_LR(R0);
|
||||
}
|
||||
|
||||
void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, DecoratorSet decorators,
|
||||
@ -206,7 +206,7 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator
|
||||
__ save_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers);
|
||||
}
|
||||
|
||||
__ save_LR_CR(tmp1);
|
||||
__ save_LR(tmp1);
|
||||
__ push_frame_reg_args(nbytes_save, tmp2);
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, Decorator
|
||||
|
||||
if (needs_frame) {
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(tmp1);
|
||||
__ restore_LR(tmp1);
|
||||
|
||||
if (preserve_gp_registers) {
|
||||
__ restore_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2012, 2021 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2018, 2024, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2012, 2024 SAP SE. 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,7 +150,7 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, Dec
|
||||
__ std(dst, -BytesPerWord * ++highest_preserve_register_index, R1_SP);
|
||||
__ std(count, -BytesPerWord * ++highest_preserve_register_index, R1_SP);
|
||||
|
||||
__ save_LR_CR(R11_tmp);
|
||||
__ save_LR(R11_tmp);
|
||||
__ push_frame_reg_args(-BytesPerWord * highest_preserve_register_index,
|
||||
R11_tmp);
|
||||
}
|
||||
@ -169,7 +169,7 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, Dec
|
||||
// Restore to-be-preserved registers.
|
||||
{
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R11_tmp);
|
||||
__ restore_LR(R11_tmp);
|
||||
|
||||
__ ld(count, -BytesPerWord * highest_preserve_register_index--, R1_SP);
|
||||
__ ld(dst, -BytesPerWord * highest_preserve_register_index--, R1_SP);
|
||||
@ -304,7 +304,7 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_impl(MacroAssembler *masm
|
||||
__ save_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers);
|
||||
}
|
||||
|
||||
__ save_LR_CR(tmp1);
|
||||
__ save_LR(tmp1);
|
||||
__ push_frame_reg_args(nbytes_save, tmp2);
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_impl(MacroAssembler *masm
|
||||
|
||||
if (needs_frame) {
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(tmp1);
|
||||
__ restore_LR(tmp1);
|
||||
|
||||
if (preserve_gp_registers) {
|
||||
__ restore_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers);
|
||||
@ -477,7 +477,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_impl(
|
||||
__ save_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers);
|
||||
}
|
||||
|
||||
__ save_LR_CR(tmp1);
|
||||
__ save_LR(tmp1);
|
||||
__ push_frame_reg_args(nbytes_save, tmp1);
|
||||
}
|
||||
|
||||
@ -517,7 +517,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_impl(
|
||||
|
||||
if (needs_frame) {
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(tmp1);
|
||||
__ restore_LR(tmp1);
|
||||
|
||||
if (preserve_gp_registers) {
|
||||
__ restore_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers);
|
||||
@ -916,7 +916,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss
|
||||
// Save to-be-preserved registers.
|
||||
const int nbytes_save = (MacroAssembler::num_volatile_regs + caller_stack_slots) * BytesPerWord;
|
||||
__ save_volatile_gprs(R1_SP, -nbytes_save);
|
||||
__ save_LR_CR(R11_tmp1);
|
||||
__ save_LR(R11_tmp1);
|
||||
__ push_frame_reg_args(nbytes_save, R11_tmp1);
|
||||
|
||||
// Invoke runtime.
|
||||
@ -924,7 +924,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss
|
||||
|
||||
// Restore to-be-preserved registers.
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R11_tmp1);
|
||||
__ restore_LR(R11_tmp1);
|
||||
__ restore_volatile_gprs(R1_SP, -nbytes_save);
|
||||
|
||||
__ bind(skip_barrier);
|
||||
@ -989,7 +989,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_load_reference_barrier_runtime_s
|
||||
}
|
||||
assert(jrt_address != nullptr, "load reference barrier runtime routine cannot be found");
|
||||
|
||||
__ save_LR_CR(R11_tmp);
|
||||
__ save_LR(R11_tmp);
|
||||
__ push_frame_reg_args(nbytes_save, R11_tmp);
|
||||
|
||||
// Invoke runtime. Arguments are already stored in the corresponding registers.
|
||||
@ -997,7 +997,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_load_reference_barrier_runtime_s
|
||||
|
||||
// Restore to-be-preserved registers.
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R11_tmp);
|
||||
__ restore_LR(R11_tmp);
|
||||
__ restore_volatile_gprs(R1_SP, -nbytes_save, true, false); // Skip 'R3_RET' register.
|
||||
|
||||
__ blr();
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2022 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2024 SAP SE. 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
|
||||
@ -116,7 +116,7 @@ void XBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators
|
||||
__ save_volatile_gprs(R1_SP, -nbytes_save, preserve_fp_registers, preserve_R3);
|
||||
}
|
||||
|
||||
__ save_LR_CR(tmp1);
|
||||
__ save_LR(tmp1);
|
||||
__ push_frame_reg_args(nbytes_save, tmp1);
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ void XBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators
|
||||
Register result = R3_RET;
|
||||
if (needs_frame) {
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(tmp1);
|
||||
__ restore_LR(tmp1);
|
||||
|
||||
if (preserve_R3) {
|
||||
__ mr(R0, R3_RET);
|
||||
@ -220,7 +220,7 @@ void XBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, DecoratorSet
|
||||
__ std(dst, -BytesPerWord * ++nbytes_save, R1_SP);
|
||||
__ std(count, -BytesPerWord * ++nbytes_save, R1_SP);
|
||||
|
||||
__ save_LR_CR(tmp_R11);
|
||||
__ save_LR(tmp_R11);
|
||||
__ push_frame_reg_args(nbytes_save, tmp_R11);
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ void XBarrierSetAssembler::arraycopy_prologue(MacroAssembler *masm, DecoratorSet
|
||||
__ call_VM_leaf(XBarrierSetRuntime::load_barrier_on_oop_array_addr());
|
||||
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(tmp_R11);
|
||||
__ restore_LR(tmp_R11);
|
||||
|
||||
{
|
||||
__ ld(count, -BytesPerWord * nbytes_save--, R1_SP);
|
||||
@ -357,7 +357,7 @@ void XBarrierSetAssembler::generate_c1_load_barrier_runtime_stub(StubAssembler*
|
||||
const int nbytes_save = (MacroAssembler::num_volatile_regs + stack_parameters) * BytesPerWord;
|
||||
|
||||
__ save_volatile_gprs(R1_SP, -nbytes_save);
|
||||
__ save_LR_CR(R0);
|
||||
__ save_LR(R0);
|
||||
|
||||
// Load arguments back again from the stack.
|
||||
__ ld(R3_ARG1, (intptr_t) -1 * BytesPerWord, R1_SP); // ref
|
||||
@ -371,7 +371,7 @@ void XBarrierSetAssembler::generate_c1_load_barrier_runtime_stub(StubAssembler*
|
||||
__ mr(R0, R3_RET);
|
||||
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R3_RET);
|
||||
__ restore_LR(R3_RET);
|
||||
__ restore_volatile_gprs(R1_SP, -nbytes_save);
|
||||
|
||||
__ blr();
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2024 SAP SE. 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
|
||||
@ -73,7 +73,7 @@ class ZRuntimeCallSpill {
|
||||
__ save_volatile_gprs(R1_SP, -_nbytes_save, _preserve_fp_registers, preserve_R3);
|
||||
}
|
||||
|
||||
__ save_LR_CR(R0);
|
||||
__ save_LR(R0);
|
||||
__ push_frame_reg_args(_nbytes_save, R0);
|
||||
}
|
||||
}
|
||||
@ -84,7 +84,7 @@ class ZRuntimeCallSpill {
|
||||
Register result = R3_RET;
|
||||
if (_needs_frame) {
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R0);
|
||||
__ restore_LR(R0);
|
||||
|
||||
if (_preserve_gp_registers) {
|
||||
bool restore_R3 = _result != R3_ARG1;
|
||||
@ -785,7 +785,7 @@ void ZBarrierSetAssembler::generate_c1_load_barrier_runtime_stub(StubAssembler*
|
||||
const int nbytes_save = (MacroAssembler::num_volatile_regs + stack_parameters) * BytesPerWord;
|
||||
|
||||
__ save_volatile_gprs(R1_SP, -nbytes_save);
|
||||
__ save_LR_CR(R0);
|
||||
__ save_LR(R0);
|
||||
|
||||
// Load arguments back again from the stack.
|
||||
__ ld(R3_ARG1, -1 * BytesPerWord, R1_SP); // ref
|
||||
@ -799,7 +799,7 @@ void ZBarrierSetAssembler::generate_c1_load_barrier_runtime_stub(StubAssembler*
|
||||
__ mr(R0, R3_RET);
|
||||
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R3_RET);
|
||||
__ restore_LR(R3_RET);
|
||||
__ restore_volatile_gprs(R1_SP, -nbytes_save);
|
||||
|
||||
__ blr();
|
||||
@ -815,7 +815,7 @@ void ZBarrierSetAssembler::generate_c1_store_barrier_runtime_stub(StubAssembler*
|
||||
__ save_volatile_gprs(R1_SP, -nbytes_save);
|
||||
__ mr(R3_ARG1, R0); // store address
|
||||
|
||||
__ save_LR_CR(R0);
|
||||
__ save_LR(R0);
|
||||
__ push_frame_reg_args(nbytes_save, R0);
|
||||
|
||||
if (self_healing) {
|
||||
@ -825,7 +825,7 @@ void ZBarrierSetAssembler::generate_c1_store_barrier_runtime_stub(StubAssembler*
|
||||
}
|
||||
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R3_RET);
|
||||
__ restore_LR(R3_RET);
|
||||
__ restore_volatile_gprs(R1_SP, -nbytes_save);
|
||||
|
||||
__ blr();
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2012, 2024 SAP SE. 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
|
||||
@ -895,18 +895,26 @@ void MacroAssembler::restore_volatile_gprs(Register src, int offset, bool includ
|
||||
}
|
||||
}
|
||||
|
||||
void MacroAssembler::save_LR(Register tmp) {
|
||||
mflr(tmp);
|
||||
std(tmp, _abi0(lr), R1_SP);
|
||||
}
|
||||
|
||||
void MacroAssembler::restore_LR(Register tmp) {
|
||||
assert(tmp != R1_SP, "must be distinct");
|
||||
ld(tmp, _abi0(lr), R1_SP);
|
||||
mtlr(tmp);
|
||||
}
|
||||
|
||||
void MacroAssembler::save_LR_CR(Register tmp) {
|
||||
mfcr(tmp);
|
||||
std(tmp, _abi0(cr), R1_SP);
|
||||
mflr(tmp);
|
||||
std(tmp, _abi0(lr), R1_SP);
|
||||
save_LR(tmp);
|
||||
// Tmp must contain lr on exit! (see return_addr and prolog in ppc64.ad)
|
||||
}
|
||||
|
||||
void MacroAssembler::restore_LR_CR(Register tmp) {
|
||||
assert(tmp != R1_SP, "must be distinct");
|
||||
ld(tmp, _abi0(lr), R1_SP);
|
||||
mtlr(tmp);
|
||||
restore_LR(tmp);
|
||||
ld(tmp, _abi0(cr), R1_SP);
|
||||
mtcr(tmp);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2012, 2024 SAP SE. 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
|
||||
@ -298,7 +298,9 @@ class MacroAssembler: public Assembler {
|
||||
bool include_fp_regs = true, bool include_R3_RET_reg = true);
|
||||
void restore_volatile_gprs(Register src_base, int offset,
|
||||
bool include_fp_regs = true, bool include_R3_RET_reg = true);
|
||||
void save_LR_CR( Register tmp); // tmp contains LR on return.
|
||||
void save_LR(Register tmp);
|
||||
void restore_LR(Register tmp);
|
||||
void save_LR_CR(Register tmp); // tmp contains LR on return.
|
||||
void restore_LR_CR(Register tmp);
|
||||
|
||||
// Get current PC using bl-next-instruction trick.
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2024 SAP SE. 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
|
||||
@ -581,7 +581,7 @@ void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adapt
|
||||
const Register tmp = R11; // Will be preserved.
|
||||
const int nbytes_save = MacroAssembler::num_volatile_regs * 8;
|
||||
__ save_volatile_gprs(R1_SP, -nbytes_save); // except R0
|
||||
__ save_LR_CR(tmp); // save in old frame
|
||||
__ save_LR(tmp); // save in old frame
|
||||
|
||||
__ mr(R5_ARG3, R1_SP); // saved_sp
|
||||
__ push_frame_reg_args(nbytes_save, tmp);
|
||||
@ -592,7 +592,7 @@ void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adapt
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, trace_method_handle_stub));
|
||||
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(tmp);
|
||||
__ restore_LR(tmp);
|
||||
__ restore_volatile_gprs(R1_SP, -nbytes_save); // except R0
|
||||
|
||||
BLOCK_COMMENT("} trace_method_handle");
|
||||
|
@ -290,9 +290,7 @@ OopMap* RegisterSaver::push_frame_reg_args_and_save_live_registers(MacroAssemble
|
||||
__ std(R30, frame_size_in_bytes - 2*reg_size - vsregstosave_num * vs_reg_size, R1_SP);
|
||||
|
||||
// save the flags
|
||||
// Do the save_LR_CR by hand and adjust the return pc if requested.
|
||||
__ mfcr(R30);
|
||||
__ std(R30, frame_size_in_bytes + _abi0(cr), R1_SP);
|
||||
// Do the save_LR by hand and adjust the return pc if requested.
|
||||
switch (return_pc_location) {
|
||||
case return_pc_is_lr: __ mflr(R31); break;
|
||||
case return_pc_is_pre_saved: assert(return_pc_adjustment == 0, "unsupported"); break;
|
||||
@ -436,9 +434,6 @@ void RegisterSaver::restore_live_registers_and_pop_frame(MacroAssembler* masm,
|
||||
__ ld(R31, frame_size_in_bytes + _abi0(lr), R1_SP);
|
||||
__ mtlr(R31);
|
||||
|
||||
__ ld(R31, frame_size_in_bytes + _abi0(cr), R1_SP);
|
||||
__ mtcr(R31);
|
||||
|
||||
// restore scratch register's value
|
||||
__ ld(R31, frame_size_in_bytes - reg_size - vsregstosave_num * vs_reg_size, R1_SP);
|
||||
|
||||
@ -2241,7 +2236,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||
__ bind(L_skip_barrier);
|
||||
}
|
||||
|
||||
__ save_LR_CR(r_temp_1);
|
||||
__ save_LR(r_temp_1);
|
||||
__ generate_stack_overflow_check(frame_size_in_bytes); // Check before creating frame.
|
||||
__ mr(r_callers_sp, R1_SP); // Remember frame pointer.
|
||||
__ push_frame(frame_size_in_bytes, r_temp_1); // Push the c2n adapter's frame.
|
||||
@ -2694,7 +2689,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R11);
|
||||
__ restore_LR(R11);
|
||||
__ blr();
|
||||
|
||||
|
||||
@ -2706,7 +2701,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
|
||||
__ bind(handle_pending_exception);
|
||||
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R11);
|
||||
__ restore_LR(R11);
|
||||
__ b64_patchable((address)StubRoutines::forward_exception_entry(),
|
||||
relocInfo::runtime_call_type);
|
||||
|
||||
@ -3064,7 +3059,7 @@ void SharedRuntime::generate_deopt_blob() {
|
||||
|
||||
// Pop the unpack frame.
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R0);
|
||||
__ restore_LR(R0);
|
||||
|
||||
// stack: (top interpreter frame, ..., optional interpreter frame,
|
||||
// optional c2i, caller of deoptee, ...).
|
||||
@ -3111,7 +3106,7 @@ void SharedRuntime::generate_uncommon_trap_blob() {
|
||||
// vframe array and return the `UnrollBlock' information.
|
||||
|
||||
// Save LR to compiled frame.
|
||||
__ save_LR_CR(R11_scratch1);
|
||||
__ save_LR(R11_scratch1);
|
||||
|
||||
// Push an "uncommon_trap" frame.
|
||||
__ push_frame_reg_args(0, R11_scratch1);
|
||||
@ -3201,7 +3196,7 @@ void SharedRuntime::generate_uncommon_trap_blob() {
|
||||
// Pop the `unpack frame'.
|
||||
__ pop_frame();
|
||||
// Restore LR from top interpreter frame.
|
||||
__ restore_LR_CR(R11_scratch1);
|
||||
__ restore_LR(R11_scratch1);
|
||||
|
||||
// stack: (top interpreter frame, ..., optional interpreter frame,
|
||||
// optional c2i, caller of deoptee, ...).
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2023 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2012, 2024 SAP SE. 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
|
||||
@ -469,7 +469,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
}
|
||||
|
||||
// Save LR/CR and copy exception pc (LR) into R4_ARG2.
|
||||
__ save_LR_CR(R4_ARG2);
|
||||
__ save_LR(R4_ARG2);
|
||||
__ push_frame_reg_args(0, R0);
|
||||
// Find exception handler.
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address,
|
||||
@ -479,7 +479,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// Copy handler's address.
|
||||
__ mtctr(R3_RET);
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R0);
|
||||
__ restore_LR(R0);
|
||||
|
||||
// Set up the arguments for the exception handler:
|
||||
// - R3_ARG1: exception oop
|
||||
@ -550,7 +550,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
address start = __ pc();
|
||||
|
||||
__ save_LR_CR(R11_scratch1);
|
||||
__ save_LR(R11_scratch1);
|
||||
|
||||
// Push a frame.
|
||||
__ push_frame_reg_args(0, R11_scratch1);
|
||||
@ -604,7 +604,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// Pop frame.
|
||||
__ pop_frame();
|
||||
|
||||
__ restore_LR_CR(R11_scratch1);
|
||||
__ restore_LR(R11_scratch1);
|
||||
|
||||
__ load_const(R11_scratch1, StubRoutines::forward_exception_entry());
|
||||
__ mtctr(R11_scratch1);
|
||||
@ -3571,14 +3571,14 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// and pass that one instead.
|
||||
__ addi(R3_ARG1, R1_SP, _abi0(lr));
|
||||
|
||||
__ save_LR_CR(R0);
|
||||
__ save_LR(R0);
|
||||
__ push_frame_reg_args(nbytes_save, R0);
|
||||
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSetNMethod::nmethod_stub_entry_barrier));
|
||||
__ mr(R0, R3_RET);
|
||||
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R3_RET /* used as tmp register */);
|
||||
__ restore_LR(R3_RET /* used as tmp register */);
|
||||
__ restore_volatile_gprs(R1_SP, -nbytes_save, true);
|
||||
|
||||
__ cmpdi(CCR0, R0, 0);
|
||||
@ -3597,7 +3597,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// Restore link register. Required as the 'wrong method stub' needs the caller's frame
|
||||
// to properly deoptimize this method (e.g. by re-resolving the call site for compiled methods).
|
||||
// This method's prologue is aborted.
|
||||
__ restore_LR_CR(R0);
|
||||
__ restore_LR(R0);
|
||||
|
||||
__ bctr();
|
||||
return stub_address;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023 SAP SE. All rights reserved.
|
||||
* Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2024 SAP SE. 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
|
||||
@ -121,7 +121,7 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
|
||||
|
||||
address entry = __ function_entry();
|
||||
|
||||
__ save_LR_CR(R0);
|
||||
__ save_LR(R0);
|
||||
__ save_nonvolatile_gprs(R1_SP, _spill_nonvolatiles_neg(r14));
|
||||
// We use target_sp for storing arguments in the C frame.
|
||||
__ mr(target_sp, R1_SP);
|
||||
@ -311,7 +311,7 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() {
|
||||
|
||||
__ pop_frame();
|
||||
__ restore_nonvolatile_gprs(R1_SP, _spill_nonvolatiles_neg(r14));
|
||||
__ restore_LR_CR(R0);
|
||||
__ restore_LR(R0);
|
||||
|
||||
__ blr();
|
||||
|
||||
@ -441,7 +441,7 @@ address TemplateInterpreterGenerator::generate_abstract_entry(void) {
|
||||
__ set_top_ijava_frame_at_SP_as_last_Java_frame(R1_SP, R12_scratch2/*tmp*/);
|
||||
|
||||
// Push a new C frame and save LR.
|
||||
__ save_LR_CR(R0);
|
||||
__ save_LR(R0);
|
||||
__ push_frame_reg_args(0, R11_scratch1);
|
||||
|
||||
// This is not a leaf but we have a JavaFrameAnchor now and we will
|
||||
@ -451,7 +451,7 @@ address TemplateInterpreterGenerator::generate_abstract_entry(void) {
|
||||
|
||||
// Pop the C frame and restore LR.
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R0);
|
||||
__ restore_LR(R0);
|
||||
|
||||
// Reset JavaFrameAnchor from call_VM_leaf above.
|
||||
__ reset_last_Java_frame();
|
||||
@ -1126,14 +1126,14 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
|
||||
//__ call_c_and_return_to_caller(R12_scratch2);
|
||||
|
||||
// Push a new C frame and save LR.
|
||||
__ save_LR_CR(R0);
|
||||
__ save_LR(R0);
|
||||
__ push_frame_reg_args(0, R11_scratch1);
|
||||
|
||||
__ call_VM_leaf(runtime_entry);
|
||||
|
||||
// Pop the C frame and restore LR.
|
||||
__ pop_frame();
|
||||
__ restore_LR_CR(R0);
|
||||
__ restore_LR(R0);
|
||||
}
|
||||
|
||||
// Restore caller sp for c2i case (from compiled) and for resized sender frame (from interpreted).
|
||||
|
Loading…
Reference in New Issue
Block a user