|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectscale.backend.ICEstimator
public class ICEstimator
This class is the base class for code size estimators.
$Id: ICEstimator.java,v 1.19 2007-03-21 13:31:45 burrill Exp $
Copyright 2007 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
This class is intended to be used as the base class for the estimator for any architecture that requires instruction count estimates prior to code generation. This class provides a rough estimate only.
The estimator works by visiting every in-coming data edge of a
specified node. It does not follow CFG edges. To obtain the cost
of a CFG node, call the estimate() method with the node as the argument. The
estimate() method can also be applied to an
expression. In this case, the estimate for the specified
expression sub-tree will be computed.
NOTE - to facilitate obtaining the estimate for a CFG or a
sub-graph of a CFG, the resetEstimate() method is provided. The estimate returned by any method
is always the sum of the individual estimates between calls to
reset().
| Field Summary | |
|---|---|
protected int |
estimate
The current estimate. |
protected Machine |
machine
Machine specific information. |
| Constructor Summary | |
|---|---|
ICEstimator(Machine machine)
This class is used to convert the Scribble CFG to machine instructions. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Machine machine
protected int estimate
| Constructor Detail |
|---|
public ICEstimator(Machine machine)
machine - specifies the target architecture| Method Detail |
|---|
public int estimate(Note n)
resetEstimate()public final Machine getMachine()
public final int getEstimate()
public final int getEstimateAndReset()
public final void setEstimate(int estimate)
public final void resetEstimate()
protected void whatIsThis(Note n)
public void visitLoadDeclAddressExpr(LoadDeclAddressExpr e)
visitLoadDeclAddressExpr in interface Predicatepublic void visitLoadValueIndirectExpr(LoadValueIndirectExpr e)
visitLoadValueIndirectExpr in interface Predicatepublic void visitLoadDeclValueExpr(LoadDeclValueExpr e)
visitLoadDeclValueExpr in interface Predicatepublic void visitLoadFieldAddressExpr(LoadFieldAddressExpr e)
visitLoadFieldAddressExpr in interface Predicatepublic void visitLoadFieldValueExpr(LoadFieldValueExpr e)
visitLoadFieldValueExpr in interface Predicatepublic void visitArrayIndexExpr(ArrayIndexExpr e)
visitArrayIndexExpr in interface Predicatepublic void visitBeginChord(BeginChord c)
visitBeginChord in interface Predicatepublic void visitEndChord(EndChord c)
visitEndChord in interface Predicatepublic void visitExitChord(ExitChord c)
visitExitChord in interface Predicatepublic void visitReturnChord(ReturnChord c)
visitReturnChord in interface Predicatepublic void visitSwitchChord(SwitchChord c)
visitSwitchChord in interface Predicatepublic void visitExprChord(ExprChord c)
visitExprChord in interface Predicatepublic void visitIfThenElseChord(IfThenElseChord c)
visitIfThenElseChord in interface Predicatepublic void visitAbsoluteValueExpr(AbsoluteValueExpr e)
visitAbsoluteValueExpr in interface Predicatepublic void visitAdditionExpr(AdditionExpr e)
visitAdditionExpr in interface Predicatepublic void visitAndExpr(AndExpr e)
visitAndExpr in interface Predicatepublic void visitBitAndExpr(BitAndExpr e)
visitBitAndExpr in interface Predicatepublic void visitBitComplementExpr(BitComplementExpr e)
visitBitComplementExpr in interface Predicatepublic void visitBitOrExpr(BitOrExpr e)
visitBitOrExpr in interface Predicatepublic void visitBitXorExpr(BitXorExpr e)
visitBitXorExpr in interface Predicatepublic void visitOrExpr(OrExpr e)
visitOrExpr in interface Predicatepublic void visitCompareExpr(CompareExpr e)
visitCompareExpr in interface Predicatepublic void visitDivisionExpr(DivisionExpr e)
visitDivisionExpr in interface Predicatepublic void visitMultiplicationExpr(MultiplicationExpr e)
visitMultiplicationExpr in interface Predicatepublic void visitRemainderExpr(RemainderExpr e)
visitRemainderExpr in interface Predicatepublic void visitNegativeExpr(NegativeExpr e)
visitNegativeExpr in interface Predicatepublic void visitNotExpr(NotExpr e)
visitNotExpr in interface Predicatepublic void visitExponentiationExpr(ExponentiationExpr e)
visitExponentiationExpr in interface Predicatepublic void visitTranscendentalExpr(TranscendentalExpr e)
visitTranscendentalExpr in interface Predicatepublic void visitTranscendental2Expr(Transcendental2Expr e)
visitTranscendental2Expr in interface Predicatepublic void visitSubtractionExpr(SubtractionExpr e)
visitSubtractionExpr in interface Predicatepublic void visitBitShiftExpr(BitShiftExpr e)
visitBitShiftExpr in interface Predicatepublic void visitCallMethodExpr(CallMethodExpr e)
visitCallMethodExpr in interface Predicatepublic void visitCallFunctionExpr(CallFunctionExpr e)
visitCallFunctionExpr in interface Predicatepublic void visitComplexValueExpr(ComplexValueExpr e)
visitComplexValueExpr in interface Predicatepublic void visitConversionExpr(ConversionExpr e)
visitConversionExpr in interface Predicatepublic void visitDualExpr(DualExpr e)
visitDualExpr in interface Predicatepublic void visitEqualityExpr(EqualityExpr e)
visitEqualityExpr in interface Predicatepublic void visitGreaterEqualExpr(GreaterEqualExpr e)
visitGreaterEqualExpr in interface Predicatepublic void visitGreaterExpr(GreaterExpr e)
visitGreaterExpr in interface Predicatepublic void visitLessEqualExpr(LessEqualExpr e)
visitLessEqualExpr in interface Predicatepublic void visitLessExpr(LessExpr e)
visitLessExpr in interface Predicatepublic void visitNotEqualExpr(NotEqualExpr e)
visitNotEqualExpr in interface Predicatepublic void visitLeaveChord(LeaveChord c)
public void visitLiteralExpr(LiteralExpr e)
visitLiteralExpr in interface Predicatepublic void visitNilExpr(NilExpr e)
visitNilExpr in interface Predicatepublic void visitVaStartExpr(VaStartExpr e)
visitVaStartExpr in interface Predicatepublic void visitVaArgExpr(VaArgExpr e)
visitVaArgExpr in interface Predicatepublic void visitAllocateExpr(AllocateExpr e)
visitAllocateExpr in interface Predicatepublic void visitBinaryExpr(BinaryExpr e)
public void visitBranchChord(BranchChord c)
public void visitCallExpr(CallExpr e)
public void visitChord(Chord c)
public void visitDecisionChord(DecisionChord c)
public void visitExpr(Expr e)
public void visitExprPhiExpr(ExprPhiExpr e)
visitExprPhiExpr in interface Predicatepublic void visitLoadExpr(LoadExpr e)
public void visitMaxExpr(MaxExpr e)
visitMaxExpr in interface Predicatepublic void visitMinExpr(MinExpr e)
visitMinExpr in interface Predicatepublic void visitNaryExpr(NaryExpr e)
public void visitNote(Note n)
public void visitMarkerChord(MarkerChord c)
visitMarkerChord in interface Predicatepublic void visitGotoChord(GotoChord c)
visitGotoChord in interface Predicatepublic void visitLoopExitChord(LoopExitChord c)
visitLoopExitChord in interface Predicatepublic void visitLoopHeaderChord(LoopHeaderChord c)
visitLoopHeaderChord in interface Predicatepublic void visitLoopPreHeaderChord(LoopPreHeaderChord c)
visitLoopPreHeaderChord in interface Predicatepublic void visitLoopTailChord(LoopTailChord c)
visitLoopTailChord in interface Predicatepublic void visitLoopInitChord(LoopInitChord c)
visitLoopInitChord in interface Predicatepublic void visitNullChord(NullChord c)
visitNullChord in interface Predicatepublic void visitPhiExpr(PhiExpr e)
visitPhiExpr in interface Predicatepublic void visitPhiExprChord(PhiExprChord c)
visitPhiExprChord in interface Predicatepublic void visitSequentialChord(SequentialChord c)
public void visitSubscriptExpr(SubscriptExpr e)
visitSubscriptExpr in interface Predicatepublic void visitTernaryExpr(TernaryExpr e)
public void visitUnaryExpr(UnaryExpr e)
public void visitValueExpr(ValueExpr e)
public void visitVarArgExpr(VarArgExpr e)
public void visitVaEndExpr(VaEndExpr e)
visitVaEndExpr in interface Predicatepublic void visitVectorExpr(VectorExpr e)
visitVectorExpr in interface Predicatepublic void visitConditionalExpr(ConditionalExpr e)
visitConditionalExpr in interface Predicate
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||