harpoon.Interpret.Tree
Class InterpreterOffsetMap

java.lang.Object
  |
  +--harpoon.Interpret.Tree.OffsetMap
        |
        +--harpoon.Interpret.Tree.InterpreterOffsetMap

public class InterpreterOffsetMap
extends harpoon.Interpret.Tree.OffsetMap

A simple OffsetMap, used by the Tree Interpreter

Version:
$Id: InterpreterOffsetMap.java,v 1.3 2002/02/26 22:46:30 cananian Exp $
Author:
Duncan Bryce <duncan@lcs.mit.edu>

Constructor Summary
InterpreterOffsetMap(ClassHierarchy ch)
           
InterpreterOffsetMap(ClassHierarchy ch, NameMap nm)
          Class constructor
 
Method Summary
 int clazzPtrOffset(HClass hc)
          Returns the offset of the class pointer
 int componentTypeOffset(HClass hc)
          If hc is an array type, returns the offset of its component type's class pointer
 Object decodeLabel(Label label)
           
 int displaySize()
          Returns the size of the display information of the specified class
 int elementsOffset(HClass hc)
          Returns the offset of the first array element if hc is an array type, otherwise generates an assertion failure
 int fieldsOffset(HClass hc)
          Returns the offset of the first field in an object of the specified type
 int hashCodeOffset(HClass hc)
          Returns the offset of the hashcode of the specified object
 int interfaceListOffset(HClass hc)
          If hc is a class type, or an interface, returns the offset from the class pointer of the pointer to implemented interfaces
 Label jlClass(HClass hc)
           
 Label label(HClass hc)
          Returns the label corresponding to the specified HClass
 Label label(HField hf)
          Returns the label corresponding to the specified static field
 Label label(HMethod hm)
          Returns the label corrensponding to the specified method.
 Label label(String stringConstant)
          Returns the label corresponding to the specified String constant
 int lengthOffset(HClass hc)
          If hc is an array type, returns the offset of its length field
 int offset(HClass hc)
          Returns the offset from the class pointer of this class's pointer in the display
 int offset(HField hf)
          Returns the offset from the object reference of the specified non-static field
 int offset(HMethod hm)
          Returns the offset from the class pointer of the specified non-static method
 int size(HClass hc)
          Returns the size of the specified class
 Map stringConstantMap()
           
 Set stringConstants()
           
 int wordsize()
          Returns the size (in bytes) of a word in the architecture represented by this OffsetMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterpreterOffsetMap

public InterpreterOffsetMap(ClassHierarchy ch)

InterpreterOffsetMap

public InterpreterOffsetMap(ClassHierarchy ch,
                            NameMap nm)
Class constructor

Method Detail

decodeLabel

public Object decodeLabel(Label label)

jlClass

public Label jlClass(HClass hc)

label

public Label label(HClass hc)
Returns the label corresponding to the specified HClass


label

public Label label(HField hf)
Returns the label corresponding to the specified static field


label

public Label label(HMethod hm)
Returns the label corrensponding to the specified method. This method is not necessarily static


label

public Label label(String stringConstant)
Returns the label corresponding to the specified String constant


stringConstants

public Set stringConstants()

stringConstantMap

public Map stringConstantMap()

clazzPtrOffset

public int clazzPtrOffset(HClass hc)
Returns the offset of the class pointer

Specified by:
clazzPtrOffset in class harpoon.Interpret.Tree.OffsetMap

componentTypeOffset

public int componentTypeOffset(HClass hc)
If hc is an array type, returns the offset of its component type's class pointer

Specified by:
componentTypeOffset in class harpoon.Interpret.Tree.OffsetMap

displaySize

public int displaySize()
Returns the size of the display information of the specified class

Specified by:
displaySize in class harpoon.Interpret.Tree.OffsetMap

elementsOffset

public int elementsOffset(HClass hc)
Returns the offset of the first array element if hc is an array type, otherwise generates an assertion failure

Specified by:
elementsOffset in class harpoon.Interpret.Tree.OffsetMap

fieldsOffset

public int fieldsOffset(HClass hc)
Returns the offset of the first field in an object of the specified type

Specified by:
fieldsOffset in class harpoon.Interpret.Tree.OffsetMap

hashCodeOffset

public int hashCodeOffset(HClass hc)
Returns the offset of the hashcode of the specified object

Specified by:
hashCodeOffset in class harpoon.Interpret.Tree.OffsetMap

interfaceListOffset

public int interfaceListOffset(HClass hc)
If hc is a class type, or an interface, returns the offset from the class pointer of the pointer to implemented interfaces

Specified by:
interfaceListOffset in class harpoon.Interpret.Tree.OffsetMap

lengthOffset

public int lengthOffset(HClass hc)
If hc is an array type, returns the offset of its length field

Specified by:
lengthOffset in class harpoon.Interpret.Tree.OffsetMap

offset

public int offset(HClass hc)
Returns the offset from the class pointer of this class's pointer in the display

Specified by:
offset in class harpoon.Interpret.Tree.OffsetMap

offset

public int offset(HField hf)
Returns the offset from the object reference of the specified non-static field

Specified by:
offset in class harpoon.Interpret.Tree.OffsetMap

offset

public int offset(HMethod hm)
Returns the offset from the class pointer of the specified non-static method

Specified by:
offset in class harpoon.Interpret.Tree.OffsetMap

size

public int size(HClass hc)
Returns the size of the specified class

Specified by:
size in class harpoon.Interpret.Tree.OffsetMap

wordsize

public int wordsize()
Description copied from class: harpoon.Interpret.Tree.OffsetMap
Returns the size (in bytes) of a word in the architecture represented by this OffsetMap.

Specified by:
wordsize in class harpoon.Interpret.Tree.OffsetMap