c1_FrameMap_sparc.hpp revision 1879:f95d63e2154a
1169695Skan/* 2169695Skan * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3169695Skan * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4169695Skan * 5169695Skan * This code is free software; you can redistribute it and/or modify it 6169695Skan * under the terms of the GNU General Public License version 2 only, as 7169695Skan * published by the Free Software Foundation. 8169695Skan * 9169695Skan * This code is distributed in the hope that it will be useful, but WITHOUT 10169695Skan * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11169695Skan * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12169695Skan * version 2 for more details (a copy is included in the LICENSE file that 13169695Skan * accompanied this code). 14169695Skan * 15169695Skan * You should have received a copy of the GNU General Public License version 16169695Skan * 2 along with this work; if not, write to the Free Software Foundation, 17169695Skan * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18169695Skan * 19169695Skan * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20169695Skan * or visit www.oracle.com if you need additional information or have any 21169695Skan * questions. 22169695Skan * 23169695Skan */ 24169695Skan 25169695Skan#ifndef CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP 26169695Skan#define CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP 27169695Skan 28169695Skan public: 29243933Seadler 30243933Seadler enum { 31169695Skan nof_reg_args = 6, // registers o0-o5 are available for parameter passing 32169695Skan first_available_sp_in_frame = frame::memory_parameter_word_sp_offset * BytesPerWord, 33169695Skan frame_pad_in_bytes = 0 34169695Skan }; 35169695Skan 36169695Skan static const int pd_c_runtime_reserved_arg_size; 37169695Skan 38169695Skan static LIR_Opr G0_opr; 39169695Skan static LIR_Opr G1_opr; 40169695Skan static LIR_Opr G2_opr; 41169695Skan static LIR_Opr G3_opr; 42169695Skan static LIR_Opr G4_opr; 43169695Skan static LIR_Opr G5_opr; 44169695Skan static LIR_Opr G6_opr; 45169695Skan static LIR_Opr G7_opr; 46169695Skan static LIR_Opr O0_opr; 47169695Skan static LIR_Opr O1_opr; 48169695Skan static LIR_Opr O2_opr; 49169695Skan static LIR_Opr O3_opr; 50169695Skan static LIR_Opr O4_opr; 51169695Skan static LIR_Opr O5_opr; 52169695Skan static LIR_Opr O6_opr; 53169695Skan static LIR_Opr O7_opr; 54169695Skan static LIR_Opr L0_opr; 55169695Skan static LIR_Opr L1_opr; 56169695Skan static LIR_Opr L2_opr; 57169695Skan static LIR_Opr L3_opr; 58169695Skan static LIR_Opr L4_opr; 59169695Skan static LIR_Opr L5_opr; 60169695Skan static LIR_Opr L6_opr; 61169695Skan static LIR_Opr L7_opr; 62169695Skan static LIR_Opr I0_opr; 63169695Skan static LIR_Opr I1_opr; 64169695Skan static LIR_Opr I2_opr; 65169695Skan static LIR_Opr I3_opr; 66169695Skan static LIR_Opr I4_opr; 67169695Skan static LIR_Opr I5_opr; 68169695Skan static LIR_Opr I6_opr; 69169695Skan static LIR_Opr I7_opr; 70169695Skan 71169695Skan static LIR_Opr SP_opr; 72259405Spfg static LIR_Opr FP_opr; 73259405Spfg 74259405Spfg static LIR_Opr G0_oop_opr; 75169695Skan static LIR_Opr G1_oop_opr; 76169695Skan static LIR_Opr G2_oop_opr; 77259405Spfg static LIR_Opr G3_oop_opr; 78259405Spfg static LIR_Opr G4_oop_opr; 79259405Spfg static LIR_Opr G5_oop_opr; 80169695Skan static LIR_Opr G6_oop_opr; 81169695Skan static LIR_Opr G7_oop_opr; 82169695Skan static LIR_Opr O0_oop_opr; 83169695Skan static LIR_Opr O1_oop_opr; 84169695Skan static LIR_Opr O2_oop_opr; 85169695Skan static LIR_Opr O3_oop_opr; 86169695Skan static LIR_Opr O4_oop_opr; 87169695Skan static LIR_Opr O5_oop_opr; 88169695Skan static LIR_Opr O6_oop_opr; 89169695Skan static LIR_Opr O7_oop_opr; 90169695Skan static LIR_Opr L0_oop_opr; 91169695Skan static LIR_Opr L1_oop_opr; 92169695Skan static LIR_Opr L2_oop_opr; 93169695Skan static LIR_Opr L3_oop_opr; 94169695Skan static LIR_Opr L4_oop_opr; 95169695Skan static LIR_Opr L5_oop_opr; 96169695Skan static LIR_Opr L6_oop_opr; 97169695Skan static LIR_Opr L7_oop_opr; 98169695Skan static LIR_Opr I0_oop_opr; 99169695Skan static LIR_Opr I1_oop_opr; 100169695Skan static LIR_Opr I2_oop_opr; 101169695Skan static LIR_Opr I3_oop_opr; 102169695Skan static LIR_Opr I4_oop_opr; 103169695Skan static LIR_Opr I5_oop_opr; 104169695Skan static LIR_Opr I6_oop_opr; 105169695Skan static LIR_Opr I7_oop_opr; 106169695Skan 107169695Skan static LIR_Opr in_long_opr; 108169695Skan static LIR_Opr out_long_opr; 109169695Skan static LIR_Opr g1_long_single_opr; 110169695Skan 111169695Skan static LIR_Opr F0_opr; 112169695Skan static LIR_Opr F0_double_opr; 113169695Skan 114169695Skan static LIR_Opr Oexception_opr; 115169695Skan static LIR_Opr Oissuing_pc_opr; 116169695Skan 117169695Skan private: 118169695Skan static FloatRegister _fpu_regs [nof_fpu_regs]; 119169695Skan 120169695Skan static LIR_Opr as_long_single_opr(Register r) { 121169695Skan return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); 122169695Skan } 123169695Skan static LIR_Opr as_long_pair_opr(Register r) { 124169695Skan return LIR_OprFact::double_cpu(cpu_reg2rnr(r->successor()), cpu_reg2rnr(r)); 125169695Skan } 126169695Skan 127169695Skan public: 128169695Skan 129169695Skan#ifdef _LP64 130169695Skan static LIR_Opr as_long_opr(Register r) { 131169695Skan return as_long_single_opr(r); 132169695Skan } 133169695Skan static LIR_Opr as_pointer_opr(Register r) { 134169695Skan return as_long_single_opr(r); 135169695Skan } 136169695Skan#else 137169695Skan static LIR_Opr as_long_opr(Register r) { 138169695Skan return as_long_pair_opr(r); 139169695Skan } 140169695Skan static LIR_Opr as_pointer_opr(Register r) { 141169695Skan return as_opr(r); 142169695Skan } 143169695Skan#endif 144169695Skan static LIR_Opr as_float_opr(FloatRegister r) { 145169695Skan return LIR_OprFact::single_fpu(r->encoding()); 146169695Skan } 147169695Skan static LIR_Opr as_double_opr(FloatRegister r) { 148169695Skan return LIR_OprFact::double_fpu(r->successor()->encoding(), r->encoding()); 149169695Skan } 150169695Skan 151169695Skan static FloatRegister nr2floatreg (int rnr); 152169695Skan 153169695Skan static VMReg fpu_regname (int n); 154169695Skan 155169695Skan static bool is_caller_save_register (LIR_Opr reg); 156169695Skan static bool is_caller_save_register (Register r); 157169695Skan 158169695Skan#endif // CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP 159169695Skan