Path: blob/master/src/hotspot/cpu/ppc/c1_FrameMap_ppc.hpp
40930 views
/*1* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 2012, 2015 SAP SE. All rights reserved.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef CPU_PPC_C1_FRAMEMAP_PPC_HPP26#define CPU_PPC_C1_FRAMEMAP_PPC_HPP2728public:2930enum {31nof_reg_args = 8, // Registers R3-R10 are available for parameter passing.32first_available_sp_in_frame = frame::jit_out_preserve_size,33frame_pad_in_bytes = 034};3536static const int pd_c_runtime_reserved_arg_size;3738static LIR_Opr R0_opr;39static LIR_Opr R1_opr;40static LIR_Opr R2_opr;41static LIR_Opr R3_opr;42static LIR_Opr R4_opr;43static LIR_Opr R5_opr;44static LIR_Opr R6_opr;45static LIR_Opr R7_opr;46static LIR_Opr R8_opr;47static LIR_Opr R9_opr;48static LIR_Opr R10_opr;49static LIR_Opr R11_opr;50static LIR_Opr R12_opr;51static LIR_Opr R13_opr;52static LIR_Opr R14_opr;53static LIR_Opr R15_opr;54static LIR_Opr R16_opr;55static LIR_Opr R17_opr;56static LIR_Opr R18_opr;57static LIR_Opr R19_opr;58static LIR_Opr R20_opr;59static LIR_Opr R21_opr;60static LIR_Opr R22_opr;61static LIR_Opr R23_opr;62static LIR_Opr R24_opr;63static LIR_Opr R25_opr;64static LIR_Opr R26_opr;65static LIR_Opr R27_opr;66static LIR_Opr R28_opr;67static LIR_Opr R29_opr;68static LIR_Opr R30_opr;69static LIR_Opr R31_opr;7071static LIR_Opr R0_oop_opr;72//R1: Stack pointer. Not an oop.73static LIR_Opr R2_oop_opr;74static LIR_Opr R3_oop_opr;75static LIR_Opr R4_oop_opr;76static LIR_Opr R5_oop_opr;77static LIR_Opr R6_oop_opr;78static LIR_Opr R7_oop_opr;79static LIR_Opr R8_oop_opr;80static LIR_Opr R9_oop_opr;81static LIR_Opr R10_oop_opr;82static LIR_Opr R11_oop_opr;83static LIR_Opr R12_oop_opr;84//R13: System thread register. Not usable.85static LIR_Opr R14_oop_opr;86static LIR_Opr R15_oop_opr;87//R16: Java thread register. Not an oop.88static LIR_Opr R17_oop_opr;89static LIR_Opr R18_oop_opr;90static LIR_Opr R19_oop_opr;91static LIR_Opr R20_oop_opr;92static LIR_Opr R21_oop_opr;93static LIR_Opr R22_oop_opr;94static LIR_Opr R23_oop_opr;95static LIR_Opr R24_oop_opr;96static LIR_Opr R25_oop_opr;97static LIR_Opr R26_oop_opr;98static LIR_Opr R27_oop_opr;99static LIR_Opr R28_oop_opr;100static LIR_Opr R29_oop_opr;101//R29: TOC register. Not an oop.102static LIR_Opr R30_oop_opr;103static LIR_Opr R31_oop_opr;104105static LIR_Opr R0_metadata_opr;106//R1: Stack pointer. Not metadata.107static LIR_Opr R2_metadata_opr;108static LIR_Opr R3_metadata_opr;109static LIR_Opr R4_metadata_opr;110static LIR_Opr R5_metadata_opr;111static LIR_Opr R6_metadata_opr;112static LIR_Opr R7_metadata_opr;113static LIR_Opr R8_metadata_opr;114static LIR_Opr R9_metadata_opr;115static LIR_Opr R10_metadata_opr;116static LIR_Opr R11_metadata_opr;117static LIR_Opr R12_metadata_opr;118//R13: System thread register. Not usable.119static LIR_Opr R14_metadata_opr;120static LIR_Opr R15_metadata_opr;121//R16: Java thread register. Not metadata.122static LIR_Opr R17_metadata_opr;123static LIR_Opr R18_metadata_opr;124static LIR_Opr R19_metadata_opr;125static LIR_Opr R20_metadata_opr;126static LIR_Opr R21_metadata_opr;127static LIR_Opr R22_metadata_opr;128static LIR_Opr R23_metadata_opr;129static LIR_Opr R24_metadata_opr;130static LIR_Opr R25_metadata_opr;131static LIR_Opr R26_metadata_opr;132static LIR_Opr R27_metadata_opr;133static LIR_Opr R28_metadata_opr;134//R29: TOC register. Not metadata.135static LIR_Opr R30_metadata_opr;136static LIR_Opr R31_metadata_opr;137138static LIR_Opr SP_opr;139140static LIR_Opr R0_long_opr;141static LIR_Opr R3_long_opr;142143static LIR_Opr F1_opr;144static LIR_Opr F1_double_opr;145146private:147static FloatRegister _fpu_regs [nof_fpu_regs];148149static LIR_Opr as_long_single_opr(Register r) {150return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));151}152static LIR_Opr as_long_pair_opr(Register r) {153return LIR_OprFact::double_cpu(cpu_reg2rnr(r->successor()), cpu_reg2rnr(r));154}155156public:157158#ifdef _LP64159static LIR_Opr as_long_opr(Register r) {160return as_long_single_opr(r);161}162static LIR_Opr as_pointer_opr(Register r) {163return as_long_single_opr(r);164}165#else166static LIR_Opr as_long_opr(Register r) {167Unimplemented(); return 0;168// return as_long_pair_opr(r);169}170static LIR_Opr as_pointer_opr(Register r) {171Unimplemented(); return 0;172// return as_opr(r);173}174#endif175static LIR_Opr as_float_opr(FloatRegister r) {176return LIR_OprFact::single_fpu(r->encoding());177}178static LIR_Opr as_double_opr(FloatRegister r) {179return LIR_OprFact::double_fpu(r->encoding());180}181182static FloatRegister nr2floatreg (int rnr);183184static VMReg fpu_regname (int n);185186static bool is_caller_save_register(LIR_Opr reg);187static bool is_caller_save_register(Register r);188189static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; }190static int last_cpu_reg() { return pd_last_cpu_reg; }191192// Registers which need to be saved in the frames (e.g. for GC).193// Register usage:194// R0: scratch195// R1: sp196// R13: system thread id197// R16: java thread198// R29: global TOC199static bool reg_needs_save(Register r) { return r != R0 && r != R1 && r != R13 && r != R16 && r != R29; }200201#endif // CPU_PPC_C1_FRAMEMAP_PPC_HPP202203204