scale.backend
Class SymbolDisplacement

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

public class SymbolDisplacement
extends Displacement

This class represents a displacement field in an instruction when the displacement refers to an offset that must be relocated by the loader.

$Id: SymbolDisplacement.java,v 1.6 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.


Constructor Summary
SymbolDisplacement(java.lang.String name, int handle)
          Create a displacement that the loader can relocate.
 
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.
 int getDisplacement()
          Return the displacement.
 java.lang.String getName()
          Return the symbolic name.
 int getSequence()
          Return the relocation sequence number.
 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.
static void reset()
          Reset the relocation information for each generated assembly language file.
 java.lang.String toString()
           
 Displacement unique()
          Return a unique displacement.
static int used()
          Return the relocation sequence number.
 
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

SymbolDisplacement

public SymbolDisplacement(java.lang.String name,
                          int handle)
Create a displacement that the loader can relocate.
Parameters:
handle - is information associated with the displacement for use by the code generator.
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.

used

public static int used()
Return the relocation sequence number.

unique

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

isZero

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

reset

public static void reset()
Reset the relocation information for each generated assembly language file.

offset

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

getSequence

public int getSequence()
Return the relocation sequence number.

getName

public java.lang.String getName()
Return the symbolic name.

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