From f8d7c5a5cf5e0e2ebfd1af9c494e3b45ee32a3ae Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Tue, 24 Nov 2020 10:59:54 +0000 Subject: [PATCH] 8256922: ppc, ppcle build broken after JDK-8254231 Reviewed-by: shade, lucy, mdoerr --- src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp | 2 +- src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp | 2 +- src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp | 24 ++++++------ src/hotspot/cpu/ppc/foreign_globals_ppc.cpp | 38 +++++++++++++++++++ src/hotspot/cpu/ppc/foreign_globals_ppc.hpp | 31 +++++++++++++++ src/hotspot/cpu/ppc/frame_ppc.hpp | 2 +- .../ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp | 8 ++-- src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp | 4 +- src/hotspot/cpu/ppc/interpreterRT_ppc.cpp | 2 +- src/hotspot/cpu/ppc/macroAssembler_ppc.cpp | 14 +++---- src/hotspot/cpu/ppc/ppc.ad | 11 ++++-- src/hotspot/cpu/ppc/runtime_ppc.cpp | 2 +- src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp | 34 ++++++++++------- src/hotspot/cpu/ppc/stubGenerator_ppc.cpp | 6 +-- .../ppc/templateInterpreterGenerator_ppc.cpp | 16 ++++---- .../cpu/ppc/universalNativeInvoker_ppc.cpp | 32 ++++++++++++++++ .../cpu/ppc/universalUpcallHandle_ppc.cpp | 32 ++++++++++++++++ src/hotspot/cpu/ppc/vmreg_ppc.cpp | 6 ++- 18 files changed, 208 insertions(+), 58 deletions(-) create mode 100644 src/hotspot/cpu/ppc/foreign_globals_ppc.cpp create mode 100644 src/hotspot/cpu/ppc/foreign_globals_ppc.hpp create mode 100644 src/hotspot/cpu/ppc/universalNativeInvoker_ppc.cpp create mode 100644 src/hotspot/cpu/ppc/universalUpcallHandle_ppc.cpp diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp index 25785572914..fcac32f2208 100644 --- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp @@ -1339,7 +1339,7 @@ void LIR_Assembler::return_op(LIR_Opr result, C1SafepointPollStub* code_stub) { __ ld(polling_page, in_bytes(Thread::polling_page_offset()), R16_thread); // Restore return pc relative to callers' sp. - __ ld(return_pc, _abi(lr), R1_SP); + __ ld(return_pc, _abi0(lr), R1_SP); // Move return pc to LR. __ mtlr(return_pc); diff --git a/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp index fd8973f9816..4d1dc267fac 100644 --- a/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp @@ -79,7 +79,7 @@ void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_by assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect"); generate_stack_overflow_check(bang_size_in_bytes); - std(return_pc, _abi(lr), R1_SP); // SP->lr = return_pc + std(return_pc, _abi0(lr), R1_SP); // SP->lr = return_pc push_frame(frame_size_in_bytes, R0); // SP -= frame_size_in_bytes } diff --git a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp index 94b53b010aa..ca622126cfc 100644 --- a/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp +++ b/src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp @@ -92,7 +92,7 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, if (frame_size() == no_frame_size) { ShouldNotReachHere(); // We always have a frame size. //pop_frame(); // pop the stub frame - //ld(R0, _abi(lr), R1_SP); + //ld(R0, _abi0(lr), R1_SP); //mtlr(R0); //load_const_optimized(R0, StubRoutines::forward_exception_entry()); //mtctr(R0); @@ -185,7 +185,7 @@ static OopMap* save_live_registers(StubAssembler* sasm, bool save_fpu_registers ret_pc = R0; __ mflr(ret_pc); } - __ std(ret_pc, _abi(lr), R1_SP); // C code needs pc in C1 method. + __ std(ret_pc, _abi0(lr), R1_SP); // C code needs pc in C1 method. __ push_frame(frame_size_in_bytes + stack_preserve, R0); // Record volatile registers as callee-save values in an OopMap so @@ -233,7 +233,7 @@ static void restore_live_registers(StubAssembler* sasm, Register result1, Regist } __ pop_frame(); - __ ld(R0, _abi(lr), R1_SP); + __ ld(R0, _abi0(lr), R1_SP); __ mtlr(R0); } @@ -485,7 +485,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ bclr(Assembler::bcondCRbiIs1, Assembler::bi0(CCR0, Assembler::equal), Assembler::bhintbhBCLRisReturn); __ mflr(R0); - __ std(R0, _abi(lr), R1_SP); + __ std(R0, _abi0(lr), R1_SP); __ push_frame(frame::abi_reg_args_size, R0); // Empty dummy frame (no callee-save regs). sasm->set_frame_size(frame::abi_reg_args_size / BytesPerWord); OopMap* oop_map = new OopMap(frame::abi_reg_args_size / sizeof(jint), 0); @@ -495,7 +495,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { oop_maps->add_gc_map(call_offset, oop_map); __ pop_frame(); - __ ld(R0, _abi(lr), R1_SP); + __ ld(R0, _abi0(lr), R1_SP); __ mtlr(R0); __ blr(); } @@ -554,11 +554,11 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ ld(Rcaller_sp, 0, R1_SP); __ push_frame_reg_args(0, R0); // dummy frame for C call __ mr(Rexception_save, Rexception); // save over C call - __ ld(Rexception_pc, _abi(lr), Rcaller_sp); // return pc + __ ld(Rexception_pc, _abi0(lr), Rcaller_sp); // return pc __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), R16_thread, Rexception_pc); __ verify_not_null_oop(Rexception_save); __ mtctr(R3_RET); - __ ld(Rexception_pc, _abi(lr), Rcaller_sp); // return pc + __ ld(Rexception_pc, _abi0(lr), Rcaller_sp); // return pc __ mr(R1_SP, Rcaller_sp); // Pop both frames at once. __ mr(Rexception, Rexception_save); // restore __ mtlr(Rexception_pc); @@ -730,7 +730,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { { __ set_info("unimplemented entry", dont_gc_arguments); __ mflr(R0); - __ std(R0, _abi(lr), R1_SP); + __ std(R0, _abi0(lr), R1_SP); __ push_frame(frame::abi_reg_args_size, R0); // empty dummy frame sasm->set_frame_size(frame::abi_reg_args_size / BytesPerWord); OopMap* oop_map = new OopMap(frame::abi_reg_args_size / sizeof(jint), 0); @@ -766,12 +766,12 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { // exception handler. oop_map = generate_oop_map(sasm, true); // Transfer the pending exception to the exception_oop. - // Also load the PC which is typically at SP + frame_size_in_bytes + _abi(lr), + // Also load the PC which is typically at SP + frame_size_in_bytes +_abi0(lr), // but we support additional slots in the frame for parameter passing. __ ld(Rexception_pc, 0, R1_SP); __ ld(Rexception, in_bytes(JavaThread::pending_exception_offset()), R16_thread); __ li(R0, 0); - __ ld(Rexception_pc, _abi(lr), Rexception_pc); + __ ld(Rexception_pc, _abi0(lr), Rexception_pc); __ std(R0, in_bytes(JavaThread::pending_exception_offset()), R16_thread); break; case handle_exception_nofpu_id: @@ -783,7 +783,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { // At this point all registers except exception oop and exception pc are dead. oop_map = new OopMap(frame_size_in_bytes / sizeof(jint), 0); sasm->set_frame_size(frame_size_in_bytes / BytesPerWord); - __ std(Rexception_pc, _abi(lr), R1_SP); + __ std(Rexception_pc, _abi0(lr), R1_SP); __ push_frame(frame_size_in_bytes, R0); break; default: ShouldNotReachHere(); @@ -826,7 +826,7 @@ OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { break; case handle_exception_from_callee_id: { __ pop_frame(); - __ ld(Rexception_pc, _abi(lr), R1_SP); + __ ld(Rexception_pc, _abi0(lr), R1_SP); __ mtlr(Rexception_pc); __ bctr(); break; diff --git a/src/hotspot/cpu/ppc/foreign_globals_ppc.cpp b/src/hotspot/cpu/ppc/foreign_globals_ppc.cpp new file mode 100644 index 00000000000..a3995cbd29f --- /dev/null +++ b/src/hotspot/cpu/ppc/foreign_globals_ppc.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2020 SAP SE. All rights reserved. + * Copyright (c) 2020, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "precompiled.hpp" +#include "prims/foreign_globals.hpp" +#include "utilities/debug.hpp" + +// Stubbed out, implement later +const ABIDescriptor ForeignGlobals::parse_abi_descriptor_impl(jobject jabi) const { + Unimplemented(); + return {}; +} + +const BufferLayout ForeignGlobals::parse_buffer_layout_impl(jobject jlayout) const { + Unimplemented(); + return {}; +} diff --git a/src/hotspot/cpu/ppc/foreign_globals_ppc.hpp b/src/hotspot/cpu/ppc/foreign_globals_ppc.hpp new file mode 100644 index 00000000000..5d42aa9342e --- /dev/null +++ b/src/hotspot/cpu/ppc/foreign_globals_ppc.hpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 SAP SE. All rights reserved. + * Copyright (c) 2020, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef CPU_PPC_VM_FOREIGN_GLOBALS_PPC_HPP +#define CPU_PPC_VM_FOREIGN_GLOBALS_PPC_HPP + +class BufferLayout {}; +class ABIDescriptor {}; + +#endif // CPU_PPC_VM_FOREIGN_GLOBALS_PPC_HPP diff --git a/src/hotspot/cpu/ppc/frame_ppc.hpp b/src/hotspot/cpu/ppc/frame_ppc.hpp index afa69860855..d33f7d4ec52 100644 --- a/src/hotspot/cpu/ppc/frame_ppc.hpp +++ b/src/hotspot/cpu/ppc/frame_ppc.hpp @@ -118,7 +118,7 @@ abi_reg_args_size = sizeof(abi_reg_args) }; - #define _abi(_component) \ + #define _abi0(_component) \ (offset_of(frame::abi_reg_args, _component)) struct abi_reg_args_spill : abi_reg_args { diff --git a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp index 706ec912b04..baff8a700f7 100644 --- a/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp @@ -457,11 +457,11 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler* const int nbytes_save = (MacroAssembler::num_volatile_regs + stack_slots) * BytesPerWord; __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0 __ mflr(R0); - __ std(R0, _abi(lr), R1_SP); + __ std(R0, _abi0(lr), R1_SP); __ push_frame_reg_args(nbytes_save, R0); // dummy frame for C call __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1SATBMarkQueueSet::handle_zero_index_for_thread), R16_thread); __ pop_frame(); - __ ld(R0, _abi(lr), R1_SP); + __ ld(R0, _abi0(lr), R1_SP); __ mtlr(R0); __ restore_volatile_gprs(R1_SP, -nbytes_save); // except R0 __ b(restart); @@ -537,11 +537,11 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler* const int nbytes_save = (MacroAssembler::num_volatile_regs + stack_slots) * BytesPerWord; __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0 __ mflr(R0); - __ std(R0, _abi(lr), R1_SP); + __ std(R0, _abi0(lr), R1_SP); __ push_frame_reg_args(nbytes_save, R0); // dummy frame for C call __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1DirtyCardQueueSet::handle_zero_index_for_thread), R16_thread); __ pop_frame(); - __ ld(R0, _abi(lr), R1_SP); + __ ld(R0, _abi0(lr), R1_SP); __ mtlr(R0); __ restore_volatile_gprs(R1_SP, -nbytes_save); // except R0 __ b(restart); diff --git a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp index edaca0e462c..0e00db082f4 100644 --- a/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp +++ b/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp @@ -772,7 +772,7 @@ void InterpreterMacroAssembler::merge_frames(Register Rsender_sp, Register retur ld(Rsender_sp, _ijava_state_neg(sender_sp), Rscratch1); // top_frame_sp ld(Rscratch2, 0, Rscratch1); // **SP if (return_pc!=noreg) { - ld(return_pc, _abi(lr), Rscratch1); // LR + ld(return_pc, _abi0(lr), Rscratch1); // LR } // Merge top frames. @@ -849,7 +849,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state, // call could have a smaller SP, so that this compare succeeds for an // inner call of the method annotated with ReservedStack. ld_ptr(R0, JavaThread::reserved_stack_activation_offset(), R16_thread); - ld_ptr(R11_scratch1, _abi(callers_sp), R1_SP); // Load frame pointer. + ld_ptr(R11_scratch1, _abi0(callers_sp), R1_SP); // Load frame pointer. cmpld(CCR0, R11_scratch1, R0); blt_predict_taken(CCR0, no_reserved_zone_enabling); diff --git a/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp b/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp index 26550aea3d5..29b59bedf40 100644 --- a/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp +++ b/src/hotspot/cpu/ppc/interpreterRT_ppc.cpp @@ -42,7 +42,7 @@ // The first Java argument is at index -1. #define locals_j_arg_at(index) (Interpreter::local_offset_in_bytes(index)), R18_locals // The first C argument is at index 0. -#define sp_c_arg_at(index) ((index)*wordSize + _abi(carg_1)), R1_SP +#define sp_c_arg_at(index) ((index)*wordSize + _abi0(carg_1)), R1_SP // Implementation of SignatureHandlerGenerator diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp index ca1c0c24987..df1bc17e893 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp @@ -857,17 +857,17 @@ void MacroAssembler::restore_volatile_gprs(Register src, int offset) { void MacroAssembler::save_LR_CR(Register tmp) { mfcr(tmp); - std(tmp, _abi(cr), R1_SP); + std(tmp, _abi0(cr), R1_SP); mflr(tmp); - std(tmp, _abi(lr), R1_SP); + std(tmp, _abi0(lr), R1_SP); // 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, _abi(lr), R1_SP); + ld(tmp, _abi0(lr), R1_SP); mtlr(tmp); - ld(tmp, _abi(cr), R1_SP); + ld(tmp, _abi0(cr), R1_SP); mtcr(tmp); } @@ -888,7 +888,7 @@ void MacroAssembler::resize_frame(Register offset, Register tmp) { #endif // tmp <- *(SP) - ld(tmp, _abi(callers_sp), R1_SP); + ld(tmp, _abi0(callers_sp), R1_SP); // addr <- SP + offset; // *(addr) <- tmp; // SP <- addr @@ -900,7 +900,7 @@ void MacroAssembler::resize_frame(int offset, Register tmp) { assert_different_registers(tmp, R1_SP); assert((offset & (frame::alignment_in_bytes-1))==0, "resize_frame: unaligned"); // tmp <- *(SP) - ld(tmp, _abi(callers_sp), R1_SP); + ld(tmp, _abi0(callers_sp), R1_SP); // addr <- SP + offset; // *(addr) <- tmp; // SP <- addr @@ -954,7 +954,7 @@ void MacroAssembler::push_frame_reg_args_nonvolatiles(unsigned int bytes, // Pop current C frame. void MacroAssembler::pop_frame() { - ld(R1_SP, _abi(callers_sp), R1_SP); + ld(R1_SP, _abi0(callers_sp), R1_SP); } #if defined(ABI_ELFv2) diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad index 09c11762093..f9f5852a0a9 100644 --- a/src/hotspot/cpu/ppc/ppc.ad +++ b/src/hotspot/cpu/ppc/ppc.ad @@ -1122,6 +1122,11 @@ int MachCallRuntimeNode::ret_addr_offset() { #endif } +int MachCallNativeNode::ret_addr_offset() { + Unimplemented(); + return -1; +} + //============================================================================= // condition code conversions @@ -1515,7 +1520,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { #endif if (!method_is_frameless) { // Save return pc. - __ std(return_pc, _abi(lr), callers_sp); + __ std(return_pc, _abi0(lr), callers_sp); } C->output()->set_frame_complete(cbuf.insts_size()); @@ -1561,7 +1566,7 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { if (!method_is_frameless) { // Restore return pc relative to callers' sp. - __ ld(return_pc, ((int)framesize) + _abi(lr), R1_SP); + __ ld(return_pc, ((int)framesize) + _abi0(lr), R1_SP); } if (method_needs_polling) { @@ -14495,7 +14500,7 @@ instruct tailjmpInd(iRegPdstNoScratch jump_target, rarg1RegP ex_oop) %{ "BCTR \t// TailJump, exception oop: $ex_oop" %} size(12); ins_encode %{ - __ ld(R4_ARG2/* issuing pc */, _abi(lr), R1_SP); + __ ld(R4_ARG2/* issuing pc */, _abi0(lr), R1_SP); __ mtctr($jump_target$$Register); __ bctr(); %} diff --git a/src/hotspot/cpu/ppc/runtime_ppc.cpp b/src/hotspot/cpu/ppc/runtime_ppc.cpp index 088acbed75e..e1954de1b59 100644 --- a/src/hotspot/cpu/ppc/runtime_ppc.cpp +++ b/src/hotspot/cpu/ppc/runtime_ppc.cpp @@ -81,7 +81,7 @@ void OptoRuntime::generate_exception_blob() { OopMap* map = new OopMap(frame_size_in_bytes / sizeof(jint), 0); // Exception pc is 'return address' for stack walker. - __ std(R4_ARG2/*exception pc*/, _abi(lr), R1_SP); + __ std(R4_ARG2/*exception pc*/, _abi0(lr), R1_SP); // Store the exception in the Thread object. __ std(R3_ARG1/*exception oop*/, in_bytes(JavaThread::exception_oop_offset()), R16_thread); diff --git a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp index 59c249151be..2e1f41934f0 100644 --- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp +++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2019 SAP SE. All rights reserved. + * Copyright (c) 2012, 2020 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 @@ -285,7 +285,7 @@ OopMap* RegisterSaver::push_frame_reg_args_and_save_live_registers(MacroAssemble // 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 + _abi(cr), R1_SP); + __ std(R30, frame_size_in_bytes + _abi0(cr), R1_SP); 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; @@ -296,7 +296,7 @@ OopMap* RegisterSaver::push_frame_reg_args_and_save_live_registers(MacroAssemble if (return_pc_adjustment != 0) { __ addi(R31, R31, return_pc_adjustment); } - __ std(R31, frame_size_in_bytes + _abi(lr), R1_SP); + __ std(R31, frame_size_in_bytes + _abi0(lr), R1_SP); } // save all registers (ints and floats) @@ -426,10 +426,10 @@ void RegisterSaver::restore_live_registers_and_pop_frame(MacroAssembler* masm, assert(offset == frame_size_in_bytes, "consistency check"); // restore link and the flags - __ ld(R31, frame_size_in_bytes + _abi(lr), R1_SP); + __ ld(R31, frame_size_in_bytes + _abi0(lr), R1_SP); __ mtlr(R31); - __ ld(R31, frame_size_in_bytes + _abi(cr), R1_SP); + __ ld(R31, frame_size_in_bytes + _abi0(cr), R1_SP); __ mtcr(R31); // restore scratch register's value @@ -963,13 +963,13 @@ static address gen_c2i_adapter(MacroAssembler *masm, // Patch caller's callsite, method_(code) was not NULL which means that // compiled code exists. __ mflr(return_pc); - __ std(return_pc, _abi(lr), R1_SP); + __ std(return_pc, _abi0(lr), R1_SP); RegisterSaver::push_frame_and_save_argument_registers(masm, tmp, adapter_size, total_args_passed, regs); __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::fixup_callers_callsite), R19_method, return_pc); RegisterSaver::restore_argument_registers_and_pop_frame(masm, adapter_size, total_args_passed, regs); - __ ld(return_pc, _abi(lr), R1_SP); + __ ld(return_pc, _abi0(lr), R1_SP); __ ld(ientry, method_(interpreter_entry)); // preloaded __ mtlr(return_pc); @@ -2537,7 +2537,7 @@ static void push_skeleton_frame(MacroAssembler* masm, bool deopt, __ ld(pc_reg, 0, pcs_reg); __ ld(frame_size_reg, 0, frame_sizes_reg); - __ std(pc_reg, _abi(lr), R1_SP); + __ std(pc_reg, _abi0(lr), R1_SP); __ push_frame(frame_size_reg, R0/*tmp*/); __ std(R1_SP, _ijava_state_neg(sender_sp), R1_SP); __ addi(number_of_frames_reg, number_of_frames_reg, -1); @@ -2608,7 +2608,7 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt, // In the case where we have resized a c2i frame above, the optional // alignment below the locals has size 32 (why?). - __ std(R12_scratch2, _abi(lr), R1_SP); + __ std(R12_scratch2, _abi0(lr), R1_SP); // Initialize initial_caller_sp. __ std(frame_size_reg, _ijava_state_neg(sender_sp), R1_SP); @@ -2636,7 +2636,7 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt, // Get the return address pointing into the frame manager. __ ld(R0, 0, pcs_reg); // Store it in the top interpreter frame. - __ std(R0, _abi(lr), R1_SP); + __ std(R0, _abi0(lr), R1_SP); // Initialize frame_manager_lr of interpreter top frame. } #endif @@ -2714,7 +2714,7 @@ void SharedRuntime::generate_deopt_blob() { // This is needed since the call to "fetch_unroll_info()" may safepoint. __ std(R3_ARG1, in_bytes(JavaThread::exception_oop_offset()), R16_thread); __ std(R4_ARG2, in_bytes(JavaThread::exception_pc_offset()), R16_thread); - __ std(R4_ARG2, _abi(lr), R1_SP); + __ std(R4_ARG2, _abi0(lr), R1_SP); // Vanilla deoptimization with an exception pending in exception_oop. int exception_in_tls_offset = __ pc() - start; @@ -3075,13 +3075,13 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t if (!cause_return) { Label no_adjust; // If our stashed return pc was modified by the runtime we avoid touching it - __ ld(R0, frame_size_in_bytes + _abi(lr), R1_SP); + __ ld(R0, frame_size_in_bytes + _abi0(lr), R1_SP); __ cmpd(CCR0, R0, R31); __ bne(CCR0, no_adjust); // Adjust return pc forward to step over the safepoint poll instruction __ addi(R31, R31, 4); - __ std(R31, frame_size_in_bytes + _abi(lr), R1_SP); + __ std(R31, frame_size_in_bytes + _abi0(lr), R1_SP); __ bind(no_adjust); } @@ -3430,3 +3430,11 @@ void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints, reverse_words(m, (unsigned long *)m_ints, longwords); } + +BufferBlob* SharedRuntime::make_native_invoker(address call_target, + int shadow_space_bytes, + const GrowableArray& input_registers, + const GrowableArray& output_registers) { + Unimplemented(); + return nullptr; +} diff --git a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp index 9f6cdea66c1..a0b6f5a17f7 100644 --- a/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp @@ -309,14 +309,14 @@ class StubGenerator: public StubCodeGenerator { // to frame manager / native entry. // Access all locals via frame pointer, because we know nothing about // the topmost frame's size. - __ ld(r_entryframe_fp, _abi(callers_sp), R1_SP); + __ ld(r_entryframe_fp, _abi0(callers_sp), R1_SP); assert_different_registers(r_entryframe_fp, R3_RET, r_arg_result_addr, r_arg_result_type, r_cr, r_lr); __ ld(r_arg_result_addr, _entry_frame_locals_neg(result_address), r_entryframe_fp); __ ld(r_arg_result_type, _entry_frame_locals_neg(result_type), r_entryframe_fp); - __ ld(r_cr, _abi(cr), r_entryframe_fp); - __ ld(r_lr, _abi(lr), r_entryframe_fp); + __ ld(r_cr, _abi0(cr), r_entryframe_fp); + __ ld(r_lr, _abi0(lr), r_entryframe_fp); // pop frame and restore non-volatiles, LR and CR __ mr(R1_SP, r_entryframe_fp); diff --git a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp index 525e4f05255..a59265a714c 100644 --- a/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp +++ b/src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp @@ -150,7 +150,7 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() { // dereference it as in case of ints, floats, etc. __ mr(R4_ARG2, arg_java); __ addi(arg_java, arg_java, -BytesPerWord); - __ std(R4_ARG2, _abi(carg_2), target_sp); + __ std(R4_ARG2, _abi0(carg_2), target_sp); __ bind(L); } @@ -158,7 +158,7 @@ address TemplateInterpreterGenerator::generate_slow_signature_handler() { // corresponds to 3rd C argument. __ li(argcnt, -1); // arg_c points to 3rd C argument - __ addi(arg_c, target_sp, _abi(carg_3)); + __ addi(arg_c, target_sp, _abi0(carg_3)); // no floating-point args parsed so far __ li(fpcnt, 0); @@ -883,7 +883,7 @@ void TemplateInterpreterGenerator::lock_method(Register Rflags, Register Rscratc __ bind(Lstatic); // Static case: Lock the java mirror // Load mirror from interpreter frame. - __ ld(Robj_to_lock, _abi(callers_sp), R1_SP); + __ ld(Robj_to_lock, _abi0(callers_sp), R1_SP); __ ld(Robj_to_lock, _ijava_state_neg(mirror), Robj_to_lock); __ bind(Ldone); @@ -1044,7 +1044,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist __ mflr(R12_scratch2); __ neg(parent_frame_resize, parent_frame_resize); __ resize_frame(parent_frame_resize, R11_scratch1); - __ std(R12_scratch2, _abi(lr), R1_SP); + __ std(R12_scratch2, _abi0(lr), R1_SP); // Get mirror and store it in the frame as GC root for this Method*. __ load_mirror_from_const_method(R12_scratch2, Rconst_method); @@ -1386,7 +1386,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { __ testbitdi(CCR0, R0, access_flags, JVM_ACC_STATIC_BIT); __ bfalse(CCR0, method_is_not_static); - __ ld(R11_scratch1, _abi(callers_sp), R1_SP); + __ ld(R11_scratch1, _abi0(callers_sp), R1_SP); // Load mirror from interpreter frame. __ ld(R12_scratch2, _ijava_state_neg(mirror), R11_scratch1); // R4_ARG2 = &state->_oop_temp; @@ -1597,7 +1597,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { const Register return_pc = R31; __ ld(return_pc, 0, R1_SP); - __ ld(return_pc, _abi(lr), return_pc); + __ ld(return_pc, _abi0(lr), return_pc); // Get the address of the exception handler. __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), @@ -2045,7 +2045,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() { Label Lcaller_not_deoptimized; Register return_pc = R3_ARG1; __ ld(return_pc, 0, R1_SP); - __ ld(return_pc, _abi(lr), return_pc); + __ ld(return_pc, _abi0(lr), return_pc); __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::interpreter_contains), return_pc); __ cmpdi(CCR0, R3_RET, 0); __ bne(CCR0, Lcaller_not_deoptimized); @@ -2138,7 +2138,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() { Register return_pc = R31; // Needs to survive the runtime call. __ ld(return_pc, 0, R1_SP); - __ ld(return_pc, _abi(lr), return_pc); + __ ld(return_pc, _abi0(lr), return_pc); __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), R16_thread, return_pc); // Remove the current activation. diff --git a/src/hotspot/cpu/ppc/universalNativeInvoker_ppc.cpp b/src/hotspot/cpu/ppc/universalNativeInvoker_ppc.cpp new file mode 100644 index 00000000000..0d48f9b1009 --- /dev/null +++ b/src/hotspot/cpu/ppc/universalNativeInvoker_ppc.cpp @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 SAP SE. All rights reserved. + * Copyright (c) 2020, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "precompiled.hpp" +#include "prims/universalNativeInvoker.hpp" +#include "utilities/debug.hpp" + +address ProgrammableInvoker::generate_adapter(jobject jabi, jobject jlayout) { + Unimplemented(); + return nullptr; +} diff --git a/src/hotspot/cpu/ppc/universalUpcallHandle_ppc.cpp b/src/hotspot/cpu/ppc/universalUpcallHandle_ppc.cpp new file mode 100644 index 00000000000..5a7b9740e02 --- /dev/null +++ b/src/hotspot/cpu/ppc/universalUpcallHandle_ppc.cpp @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 SAP SE. All rights reserved. + * Copyright (c) 2020, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "precompiled.hpp" +#include "prims/universalUpcallHandler.hpp" +#include "utilities/debug.hpp" + +address ProgrammableUpcallHandler::generate_upcall_stub(jobject rec, jobject jabi, jobject jlayout) { + Unimplemented(); + return nullptr; +} diff --git a/src/hotspot/cpu/ppc/vmreg_ppc.cpp b/src/hotspot/cpu/ppc/vmreg_ppc.cpp index 5931bdf7b76..be7a435c9bb 100644 --- a/src/hotspot/cpu/ppc/vmreg_ppc.cpp +++ b/src/hotspot/cpu/ppc/vmreg_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2013 SAP SE. All rights reserved. + * Copyright (c) 2012, 2020 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 @@ -49,3 +49,7 @@ void VMRegImpl::set_regName() { } } +VMReg VMRegImpl::vmStorageToVMReg(int type, int index) { + Unimplemented(); + return VMRegImpl::Bad(); +}