harpoon.IR.Tree
Class SEGMENT

java.lang.Object
  extended by harpoon.IR.Tree.Tree
      extended by harpoon.IR.Tree.Stm
          extended by harpoon.IR.Tree.SEGMENT
All Implemented Interfaces:
HCodeElement, HDataElement

public class SEGMENT
extends Stm
implements HDataElement

The SEGMENT class is used to mark the beginning of a new section of memory. All subsequent Tree objects will be stored in the specified section.

Version:
$Id: SEGMENT.java,v 1.4 2002/04/10 03:05:45 cananian Exp $
Author:
Duncan Bryce <duncan@lcs.mit.edu>

Nested Class Summary
 
Nested classes/interfaces inherited from class harpoon.IR.Tree.Tree
Tree.CloneCallback
 
Field Summary
static int CLASS
          R/O storage for static class data (display, vmtable, etc)
static int CODE
          Read-only instruction memory
static int GC
          R/O storage for GC tables
static int GC_INDEX
          R/O storage for GC index
static int INIT_DATA
          R/W memory that must be initialized before use
static int REFLECTION_DATA
          R/O memory that stores reflection tables and other non-object data.
static int REFLECTION_OBJECTS
          R/O memory that stores reflection data objects.
 int segtype
          The type of segment this SEGMENT precedes.
static int STATIC_OBJECTS
          R/W storage for static aggregate data
static int STATIC_PRIMITIVES
          R/W storage for static primitive data
static int STRING_CONSTANTS
          R/O storage for string constant objects
static int STRING_DATA
          R/O storage for component character arrays of statically allocated string constant objects.
static int TEXT
          Read-only memory (other than machine instructions)
static int ZERO_DATA
          R/W memory initialized at load time to be 0
 
Fields inherited from class harpoon.IR.Tree.Tree
arrayFactory, child
 
Constructor Summary
SEGMENT(TreeFactory tf, HCodeElement source, int segtype)
          Class constructor.
 
Method Summary
 void accept(TreeVisitor v)
          Accept a visitor
 Stm build(TreeFactory tf, ExpList kids)
           
static String decode(int segtype)
          Converts a segtype into its string representation.
static int encode(String segtype)
          Converts a segtype string into its enumerated value.
 int kind()
          Return an integer enumeration of the kind of this Tree.
 Tree rename(TreeFactory tf, TempMap tm, Tree.CloneCallback cb)
          Rename while cloning a subtree.
 String toString()
           
 
Methods inherited from class harpoon.IR.Tree.Stm
build, isNop, linearize, toStm
 
Methods inherited from class harpoon.IR.Tree.Tree
clone, clone, getChild, getFactory, getFirstChild, getID, getLineNumber, getParent, getSibling, getSourceFile, hashCode, kids, rename, replace, setChild, unlink
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface harpoon.ClassFile.HDataElement
getID, getSourceFile
 

Field Detail

CLASS

public static final int CLASS
R/O storage for static class data (display, vmtable, etc)

See Also:
Constant Field Values

CODE

public static final int CODE
Read-only instruction memory

See Also:
Constant Field Values

GC

public static final int GC
R/O storage for GC tables

See Also:
Constant Field Values

INIT_DATA

public static final int INIT_DATA
R/W memory that must be initialized before use

See Also:
Constant Field Values

REFLECTION_OBJECTS

public static final int REFLECTION_OBJECTS
R/O memory that stores reflection data objects.

See Also:
Constant Field Values

REFLECTION_DATA

public static final int REFLECTION_DATA
R/O memory that stores reflection tables and other non-object data.

See Also:
Constant Field Values

STATIC_OBJECTS

public static final int STATIC_OBJECTS
R/W storage for static aggregate data

See Also:
Constant Field Values

STATIC_PRIMITIVES

public static final int STATIC_PRIMITIVES
R/W storage for static primitive data

See Also:
Constant Field Values

STRING_CONSTANTS

public static final int STRING_CONSTANTS
R/O storage for string constant objects

See Also:
Constant Field Values

STRING_DATA

public static final int STRING_DATA
R/O storage for component character arrays of statically allocated string constant objects.

See Also:
Constant Field Values

TEXT

public static final int TEXT
Read-only memory (other than machine instructions)

See Also:
Constant Field Values

ZERO_DATA

public static final int ZERO_DATA
R/W memory initialized at load time to be 0

See Also:
Constant Field Values

GC_INDEX

public static final int GC_INDEX
R/O storage for GC index

See Also:
Constant Field Values

segtype

public final int segtype
The type of segment this SEGMENT precedes.

Constructor Detail

SEGMENT

public SEGMENT(TreeFactory tf,
               HCodeElement source,
               int segtype)
Class constructor. segtype must be one the segments types specified in this class.

Method Detail

encode

public static final int encode(String segtype)
Converts a segtype string into its enumerated value. Returns -1 if the string does not represent a valid segtype.


decode

public static final String decode(int segtype)
Converts a segtype into its string representation.


kind

public int kind()
Description copied from class: Tree
Return an integer enumeration of the kind of this Tree. The enumerated values are defined in TreeKind.

Specified by:
kind in class Tree

build

public Stm build(TreeFactory tf,
                 ExpList kids)
Specified by:
build in class Stm

accept

public void accept(TreeVisitor v)
Accept a visitor

Specified by:
accept in class Tree

rename

public Tree rename(TreeFactory tf,
                   TempMap tm,
                   Tree.CloneCallback cb)
Description copied from class: Tree
Rename while cloning a subtree. This node and all child nodes are cloned; the 'temp' information of all TEMP nodes are renamed according to the supplied TempMap. Note that Temps not belonging to this.getFactory().tempFactory() are not affected. The callback() method of the supplied CloneCallback is invoked once on each subtree cloned, starting from the leaves and working back to the root in a post-order depth-first manner.

Specified by:
rename in class Tree

toString

public String toString()
Overrides:
toString in class Object