Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp
32285 views
/*1* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP25#define CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP2627inline bool LinearScan::is_processed_reg_num(int reg_num) {28return reg_num < 26 || reg_num > 31;29}3031inline int LinearScan::num_physical_regs(BasicType type) {32// Sparc requires two cpu registers for long33// and two cpu registers for double34#ifdef _LP6435if (type == T_DOUBLE) {36#else37if (type == T_DOUBLE || type == T_LONG) {38#endif39return 2;40}41return 1;42}434445inline bool LinearScan::requires_adjacent_regs(BasicType type) {46#ifdef _LP6447return type == T_DOUBLE;48#else49return type == T_DOUBLE || type == T_LONG;50#endif51}5253inline bool LinearScan::is_caller_save(int assigned_reg) {54return assigned_reg > pd_last_callee_saved_reg && assigned_reg <= pd_last_fpu_reg;55}565758inline void LinearScan::pd_add_temps(LIR_Op* op) {59// No special case behaviours yet60}616263inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) {64if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) {65assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");66_first_reg = pd_first_callee_saved_reg;67_last_reg = pd_last_callee_saved_reg;68return true;69} else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT || cur->type() == T_ADDRESS || cur->type() == T_METADATA) {70_first_reg = pd_first_cpu_reg;71_last_reg = pd_last_allocatable_cpu_reg;72return true;73}74return false;75}7677#endif // CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP787980