001/* 002 * This file is part of the Jikes RVM project (http://jikesrvm.org). 003 * 004 * This file is licensed to You under the Eclipse Public License (EPL); 005 * You may not use this file except in compliance with the License. You 006 * may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/eclipse-1.0.php 009 * 010 * See the COPYRIGHT.txt file distributed with this work for information 011 * regarding copyright ownership. 012 */ 013package org.jikesrvm.compilers.opt.ir.ppc; 014 015import org.jikesrvm.classloader.RVMMethod; 016import org.jikesrvm.classloader.TypeReference; 017import org.jikesrvm.compilers.opt.ir.GenericRegisterPool; 018import org.jikesrvm.compilers.opt.ir.Register; 019import org.jikesrvm.compilers.opt.ir.operand.Operand; 020import org.jikesrvm.compilers.opt.ir.operand.RegisterOperand; 021 022/** 023 * Pool of symbolic registers.<p> 024 * 025 * PowerPC specific implementation where JTOC is stored in a reserved register. 026 * Each IR contains has exactly one register pool object associated with it. 027 * 028 * @see Register 029 */ 030public final class RegisterPool extends GenericRegisterPool { 031 032 /** 033 * Initializes a new register pool for the method meth. 034 * 035 * @param meth the RVMMethod of the outermost method 036 */ 037 public RegisterPool(RVMMethod meth) { 038 super(meth); 039 } 040 041 /** 042 * Get the JTOC register 043 * 044 * @return the JTOC register 045 */ 046 public Register getJTOC() { 047 return ((PhysicalRegisterSet)physical).getJTOC(); 048 } 049 050 @Override 051 public Operand makeJTOCOp() { 052 return new RegisterOperand(getJTOC(), TypeReference.Address); 053 } 054 055 @Override 056 public Operand makeTocOp() { 057 return new RegisterOperand(getJTOC(), TypeReference.JavaLangObject); 058 } 059}