public class PeepholeCollectPropertyAssignments extends Object
E.g. var a = [];a[0] = 0
is optimized to var a = [0]
and
similarly for the object constructor.
Constructor and Description |
---|
PeepholeCollectPropertyAssignments() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
areNodesEqualForInlining(Node n1,
Node n2)
Are the nodes equal for the purpose of inlining?
If type aware optimizations are on, type equality is checked.
|
protected boolean |
isASTNormalized()
Is the current AST normalized? (e.g.
|
protected void |
report(DiagnosticType diagnostic,
Node n)
Helper method for reporting an error to the compiler when applying a
peephole optimization.
|
protected void |
reportCodeChange()
Helper method for telling the compiler that something has changed.
|
protected void report(DiagnosticType diagnostic, Node n)
diagnostic
- The error typen
- The node for which the error should be reportedprotected void reportCodeChange()
protected boolean areNodesEqualForInlining(Node n1, Node n2)
protected boolean isASTNormalized()
Copyright © 2009-2015 Google. All Rights Reserved.