|
|||||||||
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.SIGMA
harpoon.IR.LowQuad.PCALL
public class PCALL
PCALL
objects represent a method pointer dereference and
invocation. Interpretation is similar to that of
harpoon.IR.Quads.CALL
.
If an exception is thrown by the called method, the Temp
specified by retex
will be assigned the non-null
reference to the thrown exception, and the Temp
specified by the retval
field will be undefined
(that is, it may have any value at all).
Execution will proceed along the second outgoing edge,
nextEdge(1)
. If no exception is thrown, the
return value will be assigned to the Temp
specified
by retval
(if any), and retex
will
be undefined. Execution will proceed along the first outgoing
edge, nextEdge(0)
.
See also IR.Quads.CALL
and IR.Tree.CALL
.
Field Summary | |
---|---|
protected boolean |
isTailCall
Whether this should be treated as a tail call. |
protected boolean |
isVirtual
Whether this is a virtual or non-virtual method invocation. |
protected Temp[] |
params
Parameters to pass to the method. |
protected Temp |
ptr
The method pointer to dereference. |
protected Temp |
retex
Destination for any exception thrown by the method. |
protected Temp |
retval
Destination for the method's return value; null for void methods. |
Fields inherited from class harpoon.IR.Quads.SIGMA |
---|
dst, src |
Fields inherited from class harpoon.IR.Quads.Quad |
---|
arrayFactory |
Constructor Summary | |
---|---|
PCALL(LowQuadFactory qf,
HCodeElement source,
Temp ptr,
Temp[] params,
Temp retval,
Temp retex,
Temp[][] dst,
Temp[] src,
boolean isVirtual,
boolean isTailCall)
Creates a PCALL representing a method pointer dereference
and method invocation. |
|
PCALL(LowQuadFactory qf,
HCodeElement source,
Temp ptr,
Temp[] params,
Temp retval,
Temp retex,
Temp[] src,
boolean isVirtual,
boolean isTailCall)
Creates a PCALL with an empty dst array
of the proper size and arity. |
Method Summary | |
---|---|
void |
accept(QuadVisitor v)
Accept a visitor. |
Temp[] |
def()
Return all the Temps defined by this Quad. |
boolean |
isTailCall()
Return true if this method should return the same
value the callee returns or throw whatever exception the
callee throws (in which case we can get rid of our
stack and let the callee return directly to our caller). |
boolean |
isVirtual()
Returns true if ptr points to
the address of the method to invoke; or false if
ptr contains the direct address of the method to
invoke. |
int |
kind()
Return an integer enumeration of the kind of this Quad . |
Temp[] |
params()
Returns the parameters of this method invocation. |
Temp |
params(int i)
Returns a specified parameter in the params array. |
int |
paramsLength()
Returns the number of parameters in the params array. |
Temp |
ptr()
Returns the POINTER which is to be dereferenced by this
PCALL . |
Quad |
rename(QuadFactory qf,
TempMap defMap,
TempMap useMap)
Create a new Quad identical to the receiver, but
with all Temp s renamed according to a mapping. |
Temp |
retex()
Returns the Temp which will get any exception thrown
by the called method, or null if exceptions are
not caught. |
Temp |
retval()
Returns the Temp which will hold the return value of
the method, or the value null if the method returns
no value. |
String |
toString()
Force everyone to reimplement toString() |
Temp[] |
use()
Return all the Temps used by this Quad. |
Methods inherited from class harpoon.IR.Quads.SIGMA |
---|
accept, arity, assign, dst, dst, dst, numSigmas, removeSigma, src, src |
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 final Temp ptr
protected Temp[] params
protected Temp retval
null
for void
methods.
protected Temp retex
null
.
protected boolean isVirtual
protected boolean isTailCall
Constructor Detail |
---|
public PCALL(LowQuadFactory qf, HCodeElement source, Temp ptr, Temp[] params, Temp retval, Temp retex, Temp[][] dst, Temp[] src, boolean isVirtual, boolean isTailCall)
PCALL
representing a method pointer dereference
and method invocation. Interpretation is similar to that of
harpoon.IR.Quads.CALL
.
If an exception is thrown by the called method, the Temp
specified by retex
will be assigned the non-null
reference to the thrown exception, and the Temp
specified by the retval
field will be undefined
(that is, it may have any value at all).
Execution will proceed along the second outgoing edge,
nextEdge(1)
. If no exception is thrown, the
return value will be assigned to the Temp
specified
by retval
(if any), and retex
will
be undefined. Execution will proceed along the first outgoing
edge, nextEdge(0)
.
ptr
- the method pointer to dereference and invoke.params
- an array of Temp
s containing the parameters
to pass to the method. The object on which to invoke the
method is the first element in the parameter list of a
virtual method; non-virtual methods do not need to specify a
receiver. For non-virtual methods, params
should match exactly the number and types of parameters in
the method descriptor. For virtual methods, the receiver
object (which is not included in the descriptor) is element
zero of the params
array.retval
- the destination Temp
for the method's return
value, or null
if the method returns no
value (return type is void
.retex
- the destination Temp
for any exception thrown
by the called method. May not be null
.dst
- the elements of the pairs on the left-hand side of
the sigma function assignment block associated with
this PCALL
.src
- the arguments to the sigma functions associated with
this PCALL
.isVirtual
- true
if this is a virtual method invocation,
in which case ptr
points to the address of
the method to invoke, or false
if this is a
non-virtual invocation, in which case ptr
is
the actual address of the method to invoke.isTailCall
- true
if this method should return the same
value the callee returns or throw whatever exception the
callee throws (in which case we can get rid of our
stack and let the callee return directly to our caller).
Usually false
.public PCALL(LowQuadFactory qf, HCodeElement source, Temp ptr, Temp[] params, Temp retval, Temp retex, Temp[] src, boolean isVirtual, boolean isTailCall)
PCALL
with an empty dst
array
of the proper size and arity. Other arguments as above.
Method Detail |
---|
public Temp ptr()
POINTER
which is to be dereferenced by this
PCALL
.
public Temp[] params()
public Temp params(int i)
params
array.
public int paramsLength()
params
array.
public Temp retval()
Temp
which will hold the return value of
the method, or the value null
if the method returns
no value.
public Temp retex()
Temp
which will get any exception thrown
by the called method, or null
if exceptions are
not caught.
public boolean isVirtual()
true
if ptr
points to
the address of the method to invoke; or false
if
ptr
contains the direct address of the method to
invoke.
public boolean isTailCall()
true
if this method should return the same
value the callee returns or throw whatever exception the
callee throws (in which case we can get rid of our
stack and let the callee return directly to our caller).
Usually false
.
public int kind()
Quad
Quad
. The enumerated values are defined in
QuadKind
.
kind
in class Quad
public Temp[] use()
Quad
use
in interface UseDefable
use
in class SIGMA
public Temp[] def()
Quad
def
in interface UseDefable
def
in class SIGMA
public Quad rename(QuadFactory qf, 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 SIGMA
public String toString()
Quad
toString
in class SIGMA
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |