|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Backend.Generic.Runtime.ObjectBuilder
harpoon.Backend.Runtime1.ObjectBuilder
public class ObjectBuilder
ObjectBuilder
is an implementation of
harpoon.Backend.Generic.Runtime.ObjectBuilder
for the
Runtime1
runtime.
To accomodate transformations which add fields to
java.lang.Object
, this
Runtime.ObjectBuilder
initializes all fields of
Object
with null
, rather than attempting
to consult the given Info
for them. If other behavior
is eventually needed, it is a custom RootOracle
be
defined and provided to the constructor which will be consulted on
the value of every field *before* any Info
.
This provides for extensibility without direct code modifications
to the various parts of Runtime1
which use this
ObjectBuilder
.
Nested Class Summary | |
---|---|
static class |
ObjectBuilder.RootOracle
A RootOracle allows a transformation to add
fields to java.lang.Object (or any other
class, really) and provide the initial values for that
field in the various runtime constant objects without
having to directly extend every ObjectInfo
used in this Generic.Runtime implementation. |
Nested classes/interfaces inherited from class harpoon.Backend.Generic.Runtime.ObjectBuilder |
---|
Runtime.ObjectBuilder.ArrayInfo, Runtime.ObjectBuilder.Info, Runtime.ObjectBuilder.ObjectInfo |
Field Summary | |
---|---|
protected HClass |
HCobject
|
protected boolean |
pointersAreLong
|
protected Random |
rnd
|
protected ObjectBuilder.RootOracle |
ro
|
protected Runtime |
runtime
|
Constructor Summary | |
---|---|
ObjectBuilder(Runtime runtime)
Creates a ObjectBuilder with a RootOracle
which supplies null values to any field of
java.lang.Object (which there usually aren't any of). |
|
ObjectBuilder(Runtime runtime,
ObjectBuilder.RootOracle ro)
Creates a ObjectBuilder . |
Method Summary | |
---|---|
Stm |
buildArray(TreeFactory tf,
Runtime.ObjectBuilder.ArrayInfo info,
boolean exported)
Build an array. |
Stm |
buildObject(TreeFactory tf,
Runtime.ObjectBuilder.ObjectInfo info,
boolean exported)
Build an object. |
protected int |
headerFinalOffset(Runtime.ObjectBuilder.Info info)
|
protected Stm |
makeFields(TreeFactory tf,
Runtime.ObjectBuilder.Info info,
List<HField> fields,
int startOffset,
int endOffset)
|
protected Stm |
makeHeader(TreeFactory tf,
Runtime.ObjectBuilder.Info info,
boolean exported)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Runtime runtime
protected final boolean pointersAreLong
protected final ObjectBuilder.RootOracle ro
protected final Random rnd
protected final HClass HCobject
Constructor Detail |
---|
public ObjectBuilder(Runtime runtime)
ObjectBuilder
with a RootOracle
which supplies null
values to any field of
java.lang.Object
(which there usually aren't any of).
public ObjectBuilder(Runtime runtime, ObjectBuilder.RootOracle ro)
ObjectBuilder
.
Method Detail |
---|
public Stm buildObject(TreeFactory tf, Runtime.ObjectBuilder.ObjectInfo info, boolean exported)
Runtime.ObjectBuilder
buildObject
in class Runtime.ObjectBuilder
info
- Information about the type and contents of
the object to build.exported
- true
if this object's label
is to be exported outside its module.public Stm buildArray(TreeFactory tf, Runtime.ObjectBuilder.ArrayInfo info, boolean exported)
Runtime.ObjectBuilder
buildArray
in class Runtime.ObjectBuilder
info
- Information about the type, length and contents of
the array to build.exported
- true
if this object's label
is to be exported outside its module.protected Stm makeHeader(TreeFactory tf, Runtime.ObjectBuilder.Info info, boolean exported)
protected int headerFinalOffset(Runtime.ObjectBuilder.Info info)
protected Stm makeFields(TreeFactory tf, Runtime.ObjectBuilder.Info info, List<HField> fields, int startOffset, int endOffset)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |