scale.backend
Class StackDisplacement

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

public class StackDisplacement
extends Displacement

This class represents a displacement field in an instruction when the displacement refers to an offset on the stack.

$Id: StackDisplacement.java,v 1.5 2002/01/03 21:41:34 burrill Exp $

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

A separate class is used for this so that instanceof may be used to distinguish between a normal displacement and a stack displacement. Also, stack displacements must often be changed after the code for a routine is generated to reflect additional stack entries for spills, etc.


Constructor Summary
StackDisplacement(int offset)
           
 
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.
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, getDisplacement, isNumeric, isZero, remap
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StackDisplacement

public StackDisplacement(int offset)
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.

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

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