scale.backend
Class OffsetDisplacement

java.lang.Object
  |
  +--scale.backend.Displacement
        |
        +--scale.backend.OffsetDisplacement

public class OffsetDisplacement
extends Displacement

This class represents a displacement field in an instruction that is offset from another displacement.

$Id: OffsetDisplacement.java,v 1.7 2002/01/03 21:41:32 burrill Exp $

Copyright 2002 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.

This displacement is offset from another displacement. When the base displacement is adjusted, this displacement is also adjusted.


Constructor Summary
OffsetDisplacement(Displacement displacement, int offset)
          Obtain a Displacement with an offset from the specified Displacement.
 
Method Summary
 java.lang.String assembler(Assembler asm)
          Generate a String representation that can be used by the assembly code generater.
protected  void finalize()
          Keep the count of instances up-to-date.
 Displacement getBase()
          Return the base of the offset displacement.
 int getDisplacement()
          Return the displacement.
 boolean isNumeric()
          Return true if the displacement is zero.
 boolean isZero()
          Return true if the displacement is zero.
static int number()
          Return the current number of instances of this class.
 OffsetDisplacement offset(int offset)
          Obtain a Displacement with an offset from this Displacement.
 java.lang.String toString()
           
 Displacement unique()
          Return a unique displacement.
 
Methods inherited from class scale.backend.Displacement
adjust, remap
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OffsetDisplacement

public OffsetDisplacement(Displacement displacement,
                          int offset)
Obtain a Displacement with an offset from the specified Displacement.
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Keep the count of instances up-to-date.
Overrides:
finalize in class Displacement
Throws:
java.lang.Throwable - [needs description]

number

public static int number()
Return the current number of instances of this class.

getBase

public Displacement getBase()
Return the base of the offset displacement.

isZero

public boolean isZero()
Return true if the displacement is zero.
Overrides:
isZero in class Displacement

unique

public Displacement unique()
Return a unique displacement.
Overrides:
unique in class Displacement
See Also:
SymbolDisplacement

offset

public OffsetDisplacement offset(int offset)
Obtain a Displacement with an offset from this Displacement.
Overrides:
offset in class Displacement

isNumeric

public boolean isNumeric()
Return true if the displacement is zero.
Overrides:
isNumeric in class Displacement

getDisplacement

public int getDisplacement()
Return the displacement.
Overrides:
getDisplacement in class Displacement

assembler

public java.lang.String assembler(Assembler asm)
Generate a String representation that can be used by the assembly code generater.
Overrides:
assembler in class Displacement

toString

public java.lang.String toString()
Overrides:
toString in class Displacement