|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.IR.Quads.Quad
harpoon.IR.Quads.COMPONENTOF
public class COMPONENTOF
COMPONENTOF
objects implement the test needed to determine
if an ASET
needs to throw an exception. Specifically,
COMPONENTOF
evaluates to boolean true
if
a certain temporary is an instance of the component
type of a certain array, or boolean false
otherwise.
The given array should never have components of primitive
type, as COMPONENTOF
would always return true
in
this case, given a type-safe program.
In quad-with-try form ONLY:
The component object to test (componentref
) may have
the value null, in which case COMPONENTOF
returns
true
(it is always safe to store null
in an object array).
In all other forms the component object must be provably
non-null. An explicit null-check may be needed prior to the
COMPONENTOF
if the component object cannot be
proven non-null.
ASET
,
"The Java Virtual Machine Specification",
Serialized FormField Summary | |
---|---|
protected Temp |
arrayref
The array object to test. |
protected Temp |
dst
The Temp in which to store the result of the test. |
protected Temp |
objectref
The component object to test. |
Fields inherited from class harpoon.IR.Quads.Quad |
---|
arrayFactory |
Constructor Summary | |
---|---|
COMPONENTOF(QuadFactory qf,
HCodeElement source,
Temp dst,
Temp arrayref,
Temp objectref)
Creates a COMPONENTOF representing a typecheck test. |
Method Summary | ||
---|---|---|
|
accept(QuadValueVisitor<T> v)
|
|
void |
accept(QuadVisitor v)
Accept a visitor. |
|
Temp |
arrayref()
Returns the array reference to test. |
|
Temp[] |
def()
Returns the Temp s defined by this quad. |
|
Temp |
dst()
Returns the Temp in which to store the result of the
type check test. |
|
int |
kind()
Return an integer enumeration of the kind of this Quad . |
|
Temp |
objectref()
Returns the component object reference to test. |
|
Quad |
rename(QuadFactory qqf,
TempMap defMap,
TempMap useMap)
Create a new Quad identical to the receiver, but
with all Temp s renamed according to a mapping. |
|
String |
toString()
Returns a human-readable representation of this Quad. |
|
Temp[] |
use()
Returns the Temp s used by this quad. |
Methods inherited from class harpoon.IR.Quads.Quad |
---|
addEdge, addEdges, addHandlers, clone, clone, clone, compareTo, defC, edgeC, edges, getFactory, getID, getLineNumber, getSourceFile, handlers, hashCode, isPred, isSucc, map, map, map, next, next, nextEdge, nextEdge, nextLength, pred, predC, prev, prev, prevEdge, prevEdge, prevLength, remove, removeHandlers, rename, replace, succ, succC, toLongString, transferHandlers, useC |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Temp dst
Temp
in which to store the result of the test.
protected Temp arrayref
protected Temp objectref
Constructor Detail |
---|
public COMPONENTOF(QuadFactory qf, HCodeElement source, Temp dst, Temp arrayref, Temp objectref)
COMPONENTOF
representing a typecheck test.
dst
- the Temp
in which to store the result of the test.
The Temp
specified by dst
gets a
boolean true
value if objectref
contains a reference to an instance
of the component type of the array in arrayref
or any subtype; or a boolean false
value otherwise.
In quad-with-try form only, the result is also
true
if objectref
is
null
; in all other forms this possibility
is a semantic error.arrayref
- the array object to test. Should never be an
array of primitive component type.
The Temp
specified by arrayref
should never contain the value
null
at run-time.objectref
- the component object to test.
The Temp
specified by objectref
may contain the value null
at run-time if and only if we are in
quad-with-try form.Method Detail |
---|
public Temp dst()
Temp
in which to store the result of the
type check test.
public Temp arrayref()
public Temp objectref()
public Temp[] use()
Temp
s used by this quad.
use
in interface UseDefable
use
in class Quad
public Temp[] def()
Temp
s defined by this quad.
def
in interface UseDefable
def
in class Quad
public int kind()
Quad
Quad
. The enumerated values are defined in
QuadKind
.
kind
in class Quad
public Quad rename(QuadFactory qqf, TempMap defMap, TempMap useMap)
Quad
Quad
identical to the receiver, but
with all Temp
s renamed according to a mapping.
The new Quad
will have no edges.
The new Quad
will come from the specified
QuadFactory
.
rename
in class Quad
public void accept(QuadVisitor v)
Quad
accept
in class Quad
public <T> T accept(QuadValueVisitor<T> v)
accept
in class Quad
public String toString()
toString
in class Quad
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |