Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1237)

Unified Diff: pkg/compiler/lib/src/dump_info.dart

Issue 1081313003: Improve precision of JS printer callbacks (2nd try) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/io/code_output.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dump_info.dart
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index 5792cace9ffc0fb47d9b93729ec2ad750bffa785..a3ee0f0465bf0de35bb01f2a8800d84e39e7e2b3 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -410,7 +410,6 @@ class DumpInfoTask extends CompilerTask {
// A mapping from Javascript AST Nodes to the size of their
// pretty-printed contents.
final Map<jsAst.Node, int> _nodeToSize = <jsAst.Node, int>{};
- final Map<jsAst.Node, int> _nodeBeforeSize = <jsAst.Node, int>{};
final Map<Element, int> _fieldNameToSize = <Element, int>{};
final Map<Element, Set<Selector>> selectorsFromElement = {};
@@ -461,29 +460,6 @@ class DumpInfoTask extends CompilerTask {
}
}
- /**
- * A callback that can be called before a jsAst [node] is
- * pretty-printed. The size of the code buffer ([aftersize])
- * is also passed.
- */
- void enteringAst(jsAst.Node node, int beforeSize) {
- if (isTracking(node)) {
- _nodeBeforeSize[node] = beforeSize;
- }
- }
-
- /**
- * A callback that can be called after a jsAst [node] is
- * pretty-printed. The size of the code buffer ([aftersize])
- * is also passed.
- */
- void exitingAst(jsAst.Node node, int afterSize) {
- if (isTracking(node)) {
- int diff = afterSize - _nodeBeforeSize[node];
- recordAstSize(node, diff);
- }
- }
-
// Returns true if we care about tracking the size of
// this node.
bool isTracking(jsAst.Node code) {
@@ -507,10 +483,10 @@ class DumpInfoTask extends CompilerTask {
// Records the size of a dart AST node after it has been
// pretty-printed into the output buffer.
- void recordAstSize(jsAst.Node code, int size) {
- if (compiler.dumpInfo) {
+ void recordAstSize(jsAst.Node node, int size) {
+ if (isTracking(node)) {
//TODO: should I be incrementing here instead?
- _nodeToSize[code] = size;
+ _nodeToSize[node] = size;
}
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/io/code_output.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698