Path: blob/master/src/hotspot/cpu/aarch64/c1_LinearScan_aarch64.hpp
40930 views
/*1* Copyright (c) 2005, 2019, 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*/2425#ifndef CPU_AARCH64_C1_LINEARSCAN_AARCH64_HPP26#define CPU_AARCH64_C1_LINEARSCAN_AARCH64_HPP2728inline bool LinearScan::is_processed_reg_num(int reg_num) {29return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map;30}3132inline int LinearScan::num_physical_regs(BasicType type) {33return 1;34}353637inline bool LinearScan::requires_adjacent_regs(BasicType type) {38return false;39}4041inline bool LinearScan::is_caller_save(int assigned_reg) {42assert(assigned_reg >= 0 && assigned_reg < nof_regs, "should call this only for registers");43if (assigned_reg < pd_first_callee_saved_reg)44return true;45if (assigned_reg > pd_last_callee_saved_reg && assigned_reg < pd_first_callee_saved_fpu_reg)46return true;47if (assigned_reg > pd_last_callee_saved_fpu_reg && assigned_reg < pd_last_fpu_reg)48return true;49return false;50}515253inline void LinearScan::pd_add_temps(LIR_Op* op) {54// FIXME ??55}565758// Implementation of LinearScanWalker5960inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) {61if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) {62assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");63_first_reg = pd_first_callee_saved_reg;64_last_reg = pd_last_callee_saved_reg;65return true;66} else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT || cur->type() == T_ADDRESS || cur->type() == T_METADATA) {67_first_reg = pd_first_cpu_reg;68_last_reg = pd_last_allocatable_cpu_reg;69return true;70}71return false;72}737475#endif // CPU_AARCH64_C1_LINEARSCAN_AARCH64_HPP767778