1010N/A/*
1879N/A * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
1010N/A * Copyright 2007 Red Hat, Inc.
1010N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1010N/A *
1010N/A * This code is free software; you can redistribute it and/or modify it
1010N/A * under the terms of the GNU General Public License version 2 only, as
1010N/A * published by the Free Software Foundation.
1010N/A *
1010N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1010N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1010N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1010N/A * version 2 for more details (a copy is included in the LICENSE file that
1010N/A * accompanied this code).
1010N/A *
1010N/A * You should have received a copy of the GNU General Public License version
1010N/A * 2 along with this work; if not, write to the Free Software Foundation,
1010N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1010N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
1010N/A *
1010N/A */
1010N/A
1879N/A#include "precompiled.hpp"
1879N/A#include "asm/assembler.hpp"
1879N/A#include "code/vmreg.hpp"
1010N/A
1010N/Avoid VMRegImpl::set_regName() {
1010N/A int i = 0;
1010N/A Register reg = ::as_Register(0);
1010N/A for ( ; i < ConcreteRegisterImpl::max_gpr ; ) {
1010N/A regName[i++] = reg->name();
1010N/A reg = reg->successor();
1010N/A }
1010N/A FloatRegister freg = ::as_FloatRegister(0);
1010N/A for ( ; i < ConcreteRegisterImpl::max_fpr ; ) {
1010N/A regName[i++] = freg->name();
1010N/A freg = freg->successor();
1010N/A }
1010N/A assert(i == ConcreteRegisterImpl::number_of_registers, "fix this");
1010N/A}
1010N/A
1010N/Abool VMRegImpl::is_Register() {
1010N/A return value() >= 0 &&
1010N/A value() < ConcreteRegisterImpl::max_gpr;
1010N/A}
1010N/A
1010N/Abool VMRegImpl::is_FloatRegister() {
1010N/A return value() >= ConcreteRegisterImpl::max_gpr &&
1010N/A value() < ConcreteRegisterImpl::max_fpr;
1010N/A}
1010N/A
1010N/ARegister VMRegImpl::as_Register() {
1010N/A assert(is_Register(), "must be");
1010N/A return ::as_Register(value());
1010N/A}
1010N/A
1010N/AFloatRegister VMRegImpl::as_FloatRegister() {
1010N/A assert(is_FloatRegister(), "must be" );
1010N/A return ::as_FloatRegister(value() - ConcreteRegisterImpl::max_gpr);
1010N/A}