edu.ustc.cs.compile.arch.mips.regalloc
类 AllocateResult

java.lang.Object
  继承者 edu.ustc.cs.compile.arch.mips.regalloc.AllocateResult

public class AllocateResult
extends java.lang.Object

Represents the result of the register allocation.

After register allocation, each pseudo register is allocated to a hard register or spilt to the stack.


字段摘要
private  java.lang.Integer offset
           
private  MIPSRegister reg
           
 
构造函数摘要
AllocateResult(java.lang.Integer offset)
          Constructs an AllocateResult object representing that a pseudo register is spilt to the stack.
AllocateResult(MIPSRegister register)
          Constructs an AllocateResult object representing that a pseudo register is allocated to a hard register.
 
方法摘要
 boolean isRegister()
          Indicates whether the pseudo register is allocated to a hard register.
 boolean isSpilt()
          Indicates whether the pseudo register is spilt to the stack.
 java.lang.Integer offset()
          Get the offset from the bottom of the stack.
 MIPSRegister register()
          Get the hard register to which the pseudo register is allocated.
 java.lang.String toString()
          Get the string representation of the allocation result.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

reg

private MIPSRegister reg

offset

private java.lang.Integer offset
构造函数详细信息

AllocateResult

public AllocateResult(MIPSRegister register)

Constructs an AllocateResult object representing that a pseudo register is allocated to a hard register.

参数:
register - the hard register to which the pseudo register is allocated.

AllocateResult

public AllocateResult(java.lang.Integer offset)

Constructs an AllocateResult object representing that a pseudo register is spilt to the stack.

参数:
offset - the offset from the bottom of the stack.
方法详细信息

isRegister

public boolean isRegister()

Indicates whether the pseudo register is allocated to a hard register.

返回:
true if the pseudo register is allocated to a hard register.

register

public MIPSRegister register()

Get the hard register to which the pseudo register is allocated.

返回:
the hard register to which the pseudo register is allocated, or null if the pseudo register is split to the stack.

isSpilt

public boolean isSpilt()

Indicates whether the pseudo register is spilt to the stack.

返回:
true if the pseudo register is spilt to the stack.

offset

public java.lang.Integer offset()

Get the offset from the bottom of the stack.

返回:
the offset from the bottom of the stack, or null if the pseudo register is allocated to a hard register.

toString

public java.lang.String toString()

Get the string representation of the allocation result.

覆盖:
java.lang.Object 中的 toString
返回:
the string representation of the allocation result.