|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.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 architectureMethod 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 Predicate
public void visitLoadValueIndirectExpr(LoadValueIndirectExpr e)
visitLoadValueIndirectExpr
in interface Predicate
public void visitLoadDeclValueExpr(LoadDeclValueExpr e)
visitLoadDeclValueExpr
in interface Predicate
public void visitLoadFieldAddressExpr(LoadFieldAddressExpr e)
visitLoadFieldAddressExpr
in interface Predicate
public void visitLoadFieldValueExpr(LoadFieldValueExpr e)
visitLoadFieldValueExpr
in interface Predicate
public void visitArrayIndexExpr(ArrayIndexExpr e)
visitArrayIndexExpr
in interface Predicate
public void visitBeginChord(BeginChord c)
visitBeginChord
in interface Predicate
public void visitEndChord(EndChord c)
visitEndChord
in interface Predicate
public void visitExitChord(ExitChord c)
visitExitChord
in interface Predicate
public void visitReturnChord(ReturnChord c)
visitReturnChord
in interface Predicate
public void visitSwitchChord(SwitchChord c)
visitSwitchChord
in interface Predicate
public void visitExprChord(ExprChord c)
visitExprChord
in interface Predicate
public void visitIfThenElseChord(IfThenElseChord c)
visitIfThenElseChord
in interface Predicate
public void visitAbsoluteValueExpr(AbsoluteValueExpr e)
visitAbsoluteValueExpr
in interface Predicate
public void visitAdditionExpr(AdditionExpr e)
visitAdditionExpr
in interface Predicate
public void visitAndExpr(AndExpr e)
visitAndExpr
in interface Predicate
public void visitBitAndExpr(BitAndExpr e)
visitBitAndExpr
in interface Predicate
public void visitBitComplementExpr(BitComplementExpr e)
visitBitComplementExpr
in interface Predicate
public void visitBitOrExpr(BitOrExpr e)
visitBitOrExpr
in interface Predicate
public void visitBitXorExpr(BitXorExpr e)
visitBitXorExpr
in interface Predicate
public void visitOrExpr(OrExpr e)
visitOrExpr
in interface Predicate
public void visitCompareExpr(CompareExpr e)
visitCompareExpr
in interface Predicate
public void visitDivisionExpr(DivisionExpr e)
visitDivisionExpr
in interface Predicate
public void visitMultiplicationExpr(MultiplicationExpr e)
visitMultiplicationExpr
in interface Predicate
public void visitRemainderExpr(RemainderExpr e)
visitRemainderExpr
in interface Predicate
public void visitNegativeExpr(NegativeExpr e)
visitNegativeExpr
in interface Predicate
public void visitNotExpr(NotExpr e)
visitNotExpr
in interface Predicate
public void visitExponentiationExpr(ExponentiationExpr e)
visitExponentiationExpr
in interface Predicate
public void visitTranscendentalExpr(TranscendentalExpr e)
visitTranscendentalExpr
in interface Predicate
public void visitTranscendental2Expr(Transcendental2Expr e)
visitTranscendental2Expr
in interface Predicate
public void visitSubtractionExpr(SubtractionExpr e)
visitSubtractionExpr
in interface Predicate
public void visitBitShiftExpr(BitShiftExpr e)
visitBitShiftExpr
in interface Predicate
public void visitCallMethodExpr(CallMethodExpr e)
visitCallMethodExpr
in interface Predicate
public void visitCallFunctionExpr(CallFunctionExpr e)
visitCallFunctionExpr
in interface Predicate
public void visitComplexValueExpr(ComplexValueExpr e)
visitComplexValueExpr
in interface Predicate
public void visitConversionExpr(ConversionExpr e)
visitConversionExpr
in interface Predicate
public void visitDualExpr(DualExpr e)
visitDualExpr
in interface Predicate
public void visitEqualityExpr(EqualityExpr e)
visitEqualityExpr
in interface Predicate
public void visitGreaterEqualExpr(GreaterEqualExpr e)
visitGreaterEqualExpr
in interface Predicate
public void visitGreaterExpr(GreaterExpr e)
visitGreaterExpr
in interface Predicate
public void visitLessEqualExpr(LessEqualExpr e)
visitLessEqualExpr
in interface Predicate
public void visitLessExpr(LessExpr e)
visitLessExpr
in interface Predicate
public void visitNotEqualExpr(NotEqualExpr e)
visitNotEqualExpr
in interface Predicate
public void visitLeaveChord(LeaveChord c)
public void visitLiteralExpr(LiteralExpr e)
visitLiteralExpr
in interface Predicate
public void visitNilExpr(NilExpr e)
visitNilExpr
in interface Predicate
public void visitVaStartExpr(VaStartExpr e)
visitVaStartExpr
in interface Predicate
public void visitVaArgExpr(VaArgExpr e)
visitVaArgExpr
in interface Predicate
public void visitAllocateExpr(AllocateExpr e)
visitAllocateExpr
in interface Predicate
public 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 Predicate
public void visitLoadExpr(LoadExpr e)
public void visitMaxExpr(MaxExpr e)
visitMaxExpr
in interface Predicate
public void visitMinExpr(MinExpr e)
visitMinExpr
in interface Predicate
public void visitNaryExpr(NaryExpr e)
public void visitNote(Note n)
public void visitMarkerChord(MarkerChord c)
visitMarkerChord
in interface Predicate
public void visitGotoChord(GotoChord c)
visitGotoChord
in interface Predicate
public void visitLoopExitChord(LoopExitChord c)
visitLoopExitChord
in interface Predicate
public void visitLoopHeaderChord(LoopHeaderChord c)
visitLoopHeaderChord
in interface Predicate
public void visitLoopPreHeaderChord(LoopPreHeaderChord c)
visitLoopPreHeaderChord
in interface Predicate
public void visitLoopTailChord(LoopTailChord c)
visitLoopTailChord
in interface Predicate
public void visitLoopInitChord(LoopInitChord c)
visitLoopInitChord
in interface Predicate
public void visitNullChord(NullChord c)
visitNullChord
in interface Predicate
public void visitPhiExpr(PhiExpr e)
visitPhiExpr
in interface Predicate
public void visitPhiExprChord(PhiExprChord c)
visitPhiExprChord
in interface Predicate
public void visitSequentialChord(SequentialChord c)
public void visitSubscriptExpr(SubscriptExpr e)
visitSubscriptExpr
in interface Predicate
public 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 Predicate
public void visitVectorExpr(VectorExpr e)
visitVectorExpr
in interface Predicate
public void visitConditionalExpr(ConditionalExpr e)
visitConditionalExpr
in interface Predicate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |