|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.common.Root scale.score.Note scale.score.expr.Expr scale.score.expr.NaryExpr scale.score.expr.CallExpr
public abstract class CallExpr
This is the base class for calls to routines.
$Id: CallExpr.java,v 1.46 2007-10-04 19:58:28 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Field Summary |
---|
Fields inherited from class scale.score.expr.Expr |
---|
fpReorder, SE_DOMAIN, SE_NONE, SE_OVERFLOW, SE_STATE |
Constructor Summary | |
---|---|
CallExpr(Type type,
Expr routine,
Vector<Expr> arguments)
We may want to add a constructor that accepts the routine as a Declaration node. |
Method Summary | |
---|---|
void |
addMayDef(MayDef md)
Add may definition information to the call expression. |
void |
addMayUse(MayUse mu)
Add may use information to the call expression. |
int |
executionCostEstimate()
Return a relative cost estimate for executing the expression. |
protected Chord |
findCriticalChord(HashMap<Expr,Chord> lMap,
Chord independent)
Return the Chord with the highest label value from the set of Chords that must be executed before this expression. |
Expr |
getArgument(int i)
Return the expression representing the i-th argument to the function. |
Expr[] |
getArgumentArray()
Return an array of the arguments. |
CallExpr |
getCall(boolean ignorePure)
Return the call expression or null if none. |
DColor |
getDisplayColorHint()
Return a String specifying the color to use for coloring this node in a graphical display. |
Expr |
getFunction()
Return the expression representing the function being called, |
java.util.Enumeration<MayDef> |
getMayDef()
Return a list of the may definition expressions associated with the call expression. |
java.util.Enumeration<MayUse> |
getMayUse()
Return a list of the may use expressions associated with the call expression. |
int |
getProfCallCnt()
Return the number of times this call occurred during execution. |
boolean |
inMayDef(Declaration d)
Return true if parameter's declaration already present in mayDef vector |
boolean |
isPure()
Return true if this is a call to pure function. |
boolean |
mayGenerateCall()
Return true if this expression may result in the generation of a call to a subroutine. |
int |
numArguments()
Return the number of function arguments. |
boolean |
optimizationCandidate()
Return true if the expression can be moved without problems. |
void |
setProfCallCnt(int count)
Specify the number of times this call occurred during execution. |
int |
sideEffects()
Return an indication of the side effects execution of this expression may cause. |
Methods inherited from class scale.score.expr.NaryExpr |
---|
addOperand, containsDeclaration, dependsOnDeclaration, equivalent, getDeclList, getExprList, getLoadExprList, getOperand, getOperandArray, loopClean, numOperands, pushOperands, recordRefs, removeOperand, removeRefs, removeUseDef, replaceDecl, setOperand, unlinkExpression, validate |
Methods inherited from class scale.score.Note |
---|
getChord, getEssentialUse, setAnnotationLevel, setReportLevel, toString, visit |
Methods inherited from class scale.common.Root |
---|
addAnnotation, allAnnotations, allMatchingAnnotations, getAnnotation, getDisplayName, getDisplayString, getNodeCount, getNodeID, hasAnnotation, hasEqualAnnotation, hashCode, removeAnnotation, removeAnnotations, toStringAnnotations, toStringClass, trace, trace, trace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CallExpr(Type type, Expr routine, Vector<Expr> arguments)
type
- result type of the routine call. Void for procedures.routine
- expression node holding address of routine to callarguments
- vector of expressions representing argumentsMethod Detail |
---|
public int sideEffects()
sideEffects
in class NaryExpr
Expr.SE_NONE
public final Expr getFunction()
public final Expr getArgument(int i)
public final int numArguments()
public final Expr[] getArgumentArray()
public final void setProfCallCnt(int count)
public final int getProfCallCnt()
public void addMayDef(MayDef md)
md
- the may definition expressionpublic java.util.Enumeration<MayDef> getMayDef()
public void addMayUse(MayUse mu)
mu
- the may use expressionpublic java.util.Enumeration<MayUse> getMayUse()
public boolean inMayDef(Declaration d)
protected Chord findCriticalChord(HashMap<Expr,Chord> lMap, Chord independent)
findCriticalChord
in class Expr
lMap
- is used to memoize the expression to critical Chord
informationindependent
- is returned if the expression is not dependent
on anythingpublic DColor getDisplayColorHint()
getDisplayColorHint
in interface DisplayNode
getDisplayColorHint
in class Expr
DColor
public boolean mayGenerateCall()
mayGenerateCall
in class Expr
public boolean isPure()
public CallExpr getCall(boolean ignorePure)
getCall
in class Expr
ignorePure
- is true if pure function calls are to be
ignored.public boolean optimizationCandidate()
optimizationCandidate
in class NaryExpr
public int executionCostEstimate()
executionCostEstimate
in class NaryExpr
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |