harpoon.Interpret.Tree
Class InterpreterOffsetMap

java.lang.Object
  extended by harpoon.Interpret.Tree.InterpreterOffsetMap

public class InterpreterOffsetMap
extends Object

A simple OffsetMap, used by the Tree Interpreter

Version:
$Id: InterpreterOffsetMap.java,v 1.5 2004/02/08 01:58:09 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


componentTypeOffset

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


displaySize

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


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


fieldsOffset

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


hashCodeOffset

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


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


lengthOffset

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


offset

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


offset

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


offset

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


size

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


wordsize

public int wordsize()
Returns the size (in bytes) of a word in the architecture represented by this OffsetMap.