harpoon.Backend.RuntimeTiny
Class TinyClassFieldMap

java.lang.Object
  extended by harpoon.Backend.Maps.FieldMap
      extended by harpoon.Backend.Analysis.ClassFieldMap
          extended by harpoon.Backend.RuntimeTiny.TinyClassFieldMap
All Implemented Interfaces:
Serializable

public abstract class TinyClassFieldMap
extends ClassFieldMap

TinyClassFieldMap is an extension of ClassFieldMap which lays out objects *attempting* to align them, but not forcing an alignment.

Version:
$Id: TinyClassFieldMap.java,v 1.3 2004/02/08 03:21:01 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Constructor Summary
TinyClassFieldMap()
          Creates a TinyClassFieldMap.
TinyClassFieldMap(int first_alignment)
          Creates a TinyClassFieldMap.
 
Method Summary
protected  HField[] declaredFields(HClass hc)
          Return the declared fields of the specified class in the order in which they should be allocated.
 int fieldOffset(HField hf)
          Return an offset to the given field.
 int fieldPreferredAlignment(HField hf)
          Use this function to indicate a *preferred* but not *mandatory* alignment for the given field.
 
Methods inherited from class harpoon.Backend.Analysis.ClassFieldMap
fieldList
 
Methods inherited from class harpoon.Backend.Maps.FieldMap
fieldAlignment, fieldSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TinyClassFieldMap

public TinyClassFieldMap()
Creates a TinyClassFieldMap.


TinyClassFieldMap

public TinyClassFieldMap(int first_alignment)
Creates a TinyClassFieldMap.

Method Detail

fieldPreferredAlignment

public int fieldPreferredAlignment(HField hf)
Use this function to indicate a *preferred* but not *mandatory* alignment for the given field. We will "try hard" to honor this alignment, but not if it would mean increasing the object size.


declaredFields

protected HField[] declaredFields(HClass hc)
Description copied from class: ClassFieldMap
Return the declared fields of the specified class in the order in which they should be allocated. This implementation just returns the result of hc.getDeclaredFields(), but you can override this to use a more intelligent sorting routine to save space. You do not have to filter static methods out of the returned array, but you may if you like.

Overrides:
declaredFields in class ClassFieldMap

fieldOffset

public int fieldOffset(HField hf)
Description copied from class: FieldMap
Return an offset to the given field.

Overrides:
fieldOffset in class ClassFieldMap