private static class InlineCostEstimator.CompiledSizeEstimator extends CodeConsumer
Modifier and Type | Field and Description |
---|---|
private boolean |
continueProcessing |
private int |
cost |
private char |
last |
private int |
maxCost |
sawFunction, statementNeedsEnded, statementStarted
Constructor and Description |
---|
CompiledSizeEstimator(int costThreshold) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
add(Node root) |
(package private) void |
addConstant(java.lang.String newcode)
Constants (true, false, null) are considered basically free,
because it's likely that they will get folded when we're done.
|
(package private) void |
addIdentifier(java.lang.String identifier) |
(package private) void |
append(java.lang.String str)
Appends a string to the code, keeping track of the current line length.
|
(package private) boolean |
continueProcessing()
Provides a means of interrupting the CodeGenerator.
|
(package private) int |
getCost() |
(package private) char |
getLastChar()
Retrieve the last character of the last string sent to append.
|
add, addNumber, addOp, appendBlockEnd, appendBlockStart, appendOp, beginBlock, beginCaseBody, breakAfterBlockFor, endBlock, endBlock, endCaseBody, endClass, endFile, endFunction, endLine, endSourceMapping, endStatement, endStatement, isNegativeZero, isWordChar, listSeparator, maybeCutLine, maybeEndStatement, maybeInsertSpace, maybeLineBreak, notePreferredLineBreak, shouldPreserveExtraBlocks, startNewLine, startSourceMapping
private int maxCost
private int cost
private char last
private boolean continueProcessing
void add(Node root)
int getCost()
boolean continueProcessing()
CodeConsumer
continueProcessing
in class CodeConsumer
char getLastChar()
CodeConsumer
getLastChar
in class CodeConsumer
void append(java.lang.String str)
CodeConsumer
CodeConsumer.startNewLine()
.append
in class CodeConsumer
void addIdentifier(java.lang.String identifier)
addIdentifier
in class CodeConsumer
void addConstant(java.lang.String newcode)
addConstant
in class CodeConsumer