Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/cpu/aarch32/vm/c1_FrameMap_aarch32.hpp
32285 views
/*1* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 2014, Red Hat Inc. 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*/24// This file is a derivative work resulting from (and including) modifications25// made by Azul Systems, Inc. The dates of such changes are 2013-2016.26// Copyright 2013-2016 Azul Systems, Inc. All Rights Reserved.27//28// Please contact Azul Systems, 385 Moffett Park Drive, Suite 115, Sunnyvale,29// CA 94089 USA or visit www.azul.com if you need additional information or30// have any questions.3132#ifndef CPU_AARCH32_VM_C1_FRAMEMAP_AARCH32_HPP33#define CPU_AARCH32_VM_C1_FRAMEMAP_AARCH32_HPP3435// The following schema visualizes how a C1 frame looks like on AArch32.36// It corresponds to the case of an unextended frame. Each line of text37// represents one 4-byte slot. Every monitor takes two slots. Positions of38// incoming arguments are determined by the Java calling convention. Spill39// area and monitor area are not required to be 8-byte aligned. The slot40// for deoptimization support is used by frame::deoptimize() method to save41// the original pc before patching in the new one.42//43// When LIR_Opr's reference stack slots, they use virtual stack slot indices.44// They are mapped to the real stack slots by FrameMap::sp_offset_for_slot()45// and FrameMap::sp_offset_for_double_slot() methods. The first _argcount46// virtual stack slots correspond to the real stack slots occupied by the47// incoming arguments. Their mapping is defined by _argument_locations array48// (which is filled in by applying the Java calling convention). All other49// virtual stack slots correspond to spill slots.50//51// Higher addresses52// | incoming | virtual stack slots53// | | [0 ... _arg_count - 1]54// | arguments |55// |====================================|----X- 8-byte aligned56// | previous lr | /|\ address57// rfp ===> |------------------------------------| |58// | previous rfp | |59// |====================================| |60// | alignment slot (if needed) | |61// |====================================| |62// | slot for deoptimization support | |63// |====================================| |64// | monitor [_num_monitors - 1] object | |65// | | |66// | monitor [_num_monitors - 1] lock | |67// |------------------------------------| |68// | | |69// Direction of | ... | | _framesize70// stack growth | | | slots71// | |------------------------------------| |72// V | monitor [0] object | |73// | | |74// | monitor [0] lock | |75// |====================================| |76// | spill slot [_num_spills - 1] | | virtual stack slot77// |------------------------------------| | [_arg_count + _num_spills - 1]78// | ... | | ...79// |------------------------------------| |80// | spill slot [0] | | virtual stack slot81// |====================================| | [_arg_count]82// | reserved argument area for | |83// | ... | |84// | outgoing calls (8-byte aligned) | \|/85// sp ===> |====================================|----X- 8-byte aligned86// | | address87// Lower addresses8889public:90enum {91first_available_sp_in_frame = 0,92frame_pad_in_bytes = 893};9495public:96static LIR_Opr r0_opr;97static LIR_Opr r1_opr;98static LIR_Opr r2_opr;99static LIR_Opr r3_opr;100static LIR_Opr r4_opr;101static LIR_Opr r5_opr;102static LIR_Opr r6_opr;103static LIR_Opr r7_opr;104static LIR_Opr r8_opr;105static LIR_Opr r9_opr;106static LIR_Opr r10_opr;107static LIR_Opr r11_opr;108static LIR_Opr r12_opr;109static LIR_Opr r13_opr;110static LIR_Opr r14_opr;111static LIR_Opr r15_opr;112113static LIR_Opr r0_oop_opr;114static LIR_Opr r1_oop_opr;115static LIR_Opr r2_oop_opr;116static LIR_Opr r3_oop_opr;117static LIR_Opr r4_oop_opr;118static LIR_Opr r5_oop_opr;119static LIR_Opr r6_oop_opr;120static LIR_Opr r7_oop_opr;121static LIR_Opr r8_oop_opr;122static LIR_Opr r9_oop_opr;123static LIR_Opr r10_oop_opr;124static LIR_Opr r11_oop_opr;125static LIR_Opr r12_oop_opr;126static LIR_Opr r13_oop_opr;127static LIR_Opr r14_oop_opr;128static LIR_Opr r15_oop_opr;129130static LIR_Opr r0_metadata_opr;131static LIR_Opr r1_metadata_opr;132static LIR_Opr r2_metadata_opr;133static LIR_Opr r3_metadata_opr;134static LIR_Opr r4_metadata_opr;135static LIR_Opr r5_metadata_opr;136137static LIR_Opr sp_opr;138static LIR_Opr receiver_opr;139140static LIR_Opr rscratch1_opr;141static LIR_Opr rscratch2_opr;142static LIR_Opr rscratch_long_opr;143144static LIR_Opr long0_opr;145static LIR_Opr long1_opr;146static LIR_Opr long2_opr;147static LIR_Opr fpu0_float_opr;148static LIR_Opr fpu0_double_opr;149150static LIR_Opr as_long_opr(Register r1, Register r2) {151return LIR_OprFact::double_cpu(cpu_reg2rnr(r1), cpu_reg2rnr(r2));152}153static LIR_Opr as_pointer_opr(Register r) {154return LIR_OprFact::single_cpu(cpu_reg2rnr(r));155}156157static VMReg fpu_regname(int n);158159static bool is_caller_save_register(LIR_Opr opr) {160// On AArch32, unlike on SPARC, we never explicitly request the C1 register161// allocator to allocate a callee-saved register. Since the only place this162// method is called is the assert in LinearScan::color_lir_opr(), we can163// safely just always return true here.164return true;165}166static int nof_caller_save_cpu_regs() {167return pd_nof_caller_save_cpu_regs_frame_map;168}169static int last_cpu_reg() {170return pd_last_cpu_reg;171}172173#endif // CPU_AARCH32_VM_C1_FRAMEMAP_AARCH32_HPP174175176