|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Backend.Generic.Runtime.TreeBuilder
public abstract static class Runtime.TreeBuilder
The TreeBuilder
constructs bits of code in the
IR.Tree
form to handle various runtime-dependent
tasks---primarily method and field access.
Constructor Summary | |
---|---|
Runtime.TreeBuilder()
|
Method Summary | |
---|---|
abstract Translation.Exp |
arrayBase(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
Translation.Exp objectref)
Return a Translation.Exp representing the
array-base of the object referenced by the given
objectref Translation.Exp . |
abstract Translation.Exp |
arrayLength(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
Translation.Exp arrayRef)
Return a Translation.Exp giving the length of the
array pointed to by the given expression. |
abstract Translation.Exp |
arrayNew(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
AllocationInformation.AllocationProperties ap,
HClass arraytype,
Translation.Exp length,
boolean initialize)
Return a Translation.Exp which will create a
array of the given type, with length specified by the
given expression. |
abstract Translation.Exp |
arrayOffset(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
HClass arrayType,
Translation.Exp index)
Return a Translation.Exp representing the
offset from the array base needed to access the array
element specified by the index expression. |
abstract Translation.Exp |
classConst(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
HClass classData)
Return a Translation.Exp which represents a
reference to a Class constant. |
abstract Translation.Exp |
componentOf(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
Translation.Exp arrayref,
Translation.Exp objectref)
Return a Translation.Exp which tests the
given object expression for membership in the component
type of the given array expression. |
abstract Translation.Exp |
fieldBase(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
Translation.Exp objectref)
Return a Translation.Exp representing the
field base of the object referenced by the given
objectref expression. |
abstract Translation.Exp |
fieldConst(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
HField fieldData)
Return a Translation.Exp which represents a
reference to a java.lang.reflect.Field
constant. |
abstract Translation.Exp |
fieldOffset(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
HField field)
Return a Translation.Exp representing an
offset from the field base required to access the given
field . |
abstract int |
headerSize(HClass hc)
Utility method for external analyses that want to know the size of an object header. |
abstract Translation.Exp |
instanceOf(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
Translation.Exp objectref,
HClass classType)
Return a Translation.Exp which tests the
given expression for membership in the given class or
interface. |
abstract Translation.Exp |
methodBase(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
Translation.Exp objectref)
Return a Translation.Exp representing the
method base of the object referenced by the given
objectref expression. |
abstract Translation.Exp |
methodConst(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
HMethod methodData)
Return a Translation.Exp which represents a
reference to a java.lang.reflect.Method
constant. |
abstract Translation.Exp |
methodOffset(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
HMethod method)
Return a Translation.Exp representing an
offset from the method base required to access the
given method . |
abstract Translation.Exp |
monitorEnter(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
Translation.Exp objectref)
Return a Translation.Exp which acquires
the monitor lock of the object specified by the given
expression. |
abstract Translation.Exp |
monitorExit(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
Translation.Exp objectref)
Return a Translation.Exp which releases
the monitor lock of the object specified by the given
expression. |
abstract Translation.Exp |
objectNew(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
AllocationInformation.AllocationProperties ap,
HClass classType,
boolean initialize)
Return a Translation.Exp which will create a
object of the given type, with length specified by the
given expression. |
abstract int |
objectSize(HClass hc)
Utility method for external analyses that want to know the exact size of an object. |
abstract Translation.Exp |
referenceEqual(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
Translation.Exp refLeft,
Translation.Exp refRight)
Return a Translation.Exp representing an
comparison between expressions evaluating to two references,
refLeft and refRight . |
abstract Translation.Exp |
stringConst(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
String stringData)
Return a Translation.Exp which represents
a reference to a string constant. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Runtime.TreeBuilder()
Method Detail |
---|
public abstract int objectSize(HClass hc)
public abstract int headerSize(HClass hc)
objectSize(hc)+headerSize(hc)
.
public abstract Translation.Exp arrayLength(TreeFactory tf, HCodeElement source, DerivationGenerator dg, Translation.Exp arrayRef)
Translation.Exp
giving the length of the
array pointed to by the given expression.
public abstract Translation.Exp arrayNew(TreeFactory tf, HCodeElement source, DerivationGenerator dg, AllocationInformation.AllocationProperties ap, HClass arraytype, Translation.Exp length, boolean initialize)
Translation.Exp
which will create a
array of the given type, with length specified by the
given expression. Only a single dimension of a multidimensional
array will be created. Elements of the array are only
initialized if the initialize
parameter is
true
; however the internal object header,
length, and any internal fields of the array inherited
from java.lang.Object
are always initialized.
public abstract Translation.Exp componentOf(TreeFactory tf, HCodeElement source, DerivationGenerator dg, Translation.Exp arrayref, Translation.Exp objectref)
Translation.Exp
which tests the
given object expression for membership in the component
type of the given array expression.
public abstract Translation.Exp instanceOf(TreeFactory tf, HCodeElement source, DerivationGenerator dg, Translation.Exp objectref, HClass classType)
Translation.Exp
which tests the
given expression for membership in the given class or
interface.
public abstract Translation.Exp monitorEnter(TreeFactory tf, HCodeElement source, DerivationGenerator dg, Translation.Exp objectref)
Translation.Exp
which acquires
the monitor lock of the object specified by the given
expression.
public abstract Translation.Exp monitorExit(TreeFactory tf, HCodeElement source, DerivationGenerator dg, Translation.Exp objectref)
Translation.Exp
which releases
the monitor lock of the object specified by the given
expression.
public abstract Translation.Exp objectNew(TreeFactory tf, HCodeElement source, DerivationGenerator dg, AllocationInformation.AllocationProperties ap, HClass classType, boolean initialize)
Translation.Exp
which will create a
object of the given type, with length specified by the
given expression. Fields of the object are only initialized
if the initialize
parameter is true
;
however the internal object header is always created
and initialized.
public abstract Translation.Exp classConst(TreeFactory tf, HCodeElement source, DerivationGenerator dg, HClass classData)
Translation.Exp
which represents a
reference to a Class
constant. The runtime
may implement this by a call to
Class.forName(classname)
or other lookup
function, or may return a NAME
if the class
objects are statically allocated.
public abstract Translation.Exp fieldConst(TreeFactory tf, HCodeElement source, DerivationGenerator dg, HField fieldData)
Translation.Exp
which represents a
reference to a java.lang.reflect.Field
constant. The runtime may implement this by a call to
Class.forName(classname).getDeclaredField(fieldname)
or other lookup functions, or may return a
NAME
if the Field
objects are statically
allocated.
public abstract Translation.Exp methodConst(TreeFactory tf, HCodeElement source, DerivationGenerator dg, HMethod methodData)
Translation.Exp
which represents a
reference to a java.lang.reflect.Method
constant. The runtime may implement this by a call to
Class.forName(classname).getDeclaredMethod(name,...)
or other lookup functions, or may return a
NAME
if the Method
objects are statically
allocated.
public abstract Translation.Exp stringConst(TreeFactory tf, HCodeElement source, DerivationGenerator dg, String stringData)
Translation.Exp
which represents
a reference to a string constant. Note that invoking
String.intern()
on the String
object reference returned must return a result identical to
the reference. This may involve fix-up and/or addition
of objects to the class or global HData
; these
tasks are the responsibility of the
Generic.Runtime
, and it is anticipated that
the invocation of this method may have such side-effects
(although other implementations are certainly possible).
public abstract Translation.Exp arrayBase(TreeFactory tf, HCodeElement source, DerivationGenerator dg, Translation.Exp objectref)
Translation.Exp
representing the
array-base of the object referenced by the given
objectref
Translation.Exp
.
This expression should point to the zero'th element of
the array object specified by objectref
.
public abstract Translation.Exp arrayOffset(TreeFactory tf, HCodeElement source, DerivationGenerator dg, HClass arrayType, Translation.Exp index)
Translation.Exp
representing the
offset from the array base needed to access the array
element specified by the index
expression.
If index
is zero, then the
Translation.Exp
returned should also have
value zero.
public abstract Translation.Exp fieldBase(TreeFactory tf, HCodeElement source, DerivationGenerator dg, Translation.Exp objectref)
Translation.Exp
representing the
field base of the object referenced by the given
objectref
expression. This expression should
point to the first field in the object.
public abstract Translation.Exp fieldOffset(TreeFactory tf, HCodeElement source, DerivationGenerator dg, HField field)
Translation.Exp
representing an
offset from the field base required to access the given
field
. If the given field is the first in
the object, then the Translation.Exp
returned
should have value zero.
public abstract Translation.Exp methodBase(TreeFactory tf, HCodeElement source, DerivationGenerator dg, Translation.Exp objectref)
Translation.Exp
representing the
method base of the object referenced by the given
objectref
expression. This expression
should point a location containing a pointer to the
first method of the object.
public abstract Translation.Exp methodOffset(TreeFactory tf, HCodeElement source, DerivationGenerator dg, HMethod method)
Translation.Exp
representing an
offset from the method base required to access the
given method
. If the given method is the
first of the object, then the Translation.Exp
returned should have value zero.
public abstract Translation.Exp referenceEqual(TreeFactory tf, HCodeElement source, DerivationGenerator dg, Translation.Exp refLeft, Translation.Exp refRight)
Translation.Exp
representing an
comparison between expressions evaluating to two references,
refLeft
and refRight
.
Note that this is *reference* equality, not *POINTER* equality.
The fieldBase
method, for example, is required
to return a POINTER expression (which is typically a bit-masked
and offset version of the reference value); one valid
implementation of referenceEqual
would be to
compare the values returned by a call to fieldBase()
on the operands, but there is typically a more efficient means.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |