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

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: Cleanup. 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') | pkg/js_ast/lib/src/printer.dart » ('J')
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..61e8a7364bfc0d703882283b4520e3f1b71626a4 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) {
@@ -508,7 +484,7 @@ 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) {
floitsch 2015/04/14 15:09:31 I would rename the variable to "node" since it rea
Johnni Winther 2015/04/15 11:15:28 Done.
- if (compiler.dumpInfo) {
+ if (isTracking(code)) {
//TODO: should I be incrementing here instead?
_nodeToSize[code] = size;
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/io/code_output.dart » ('j') | pkg/js_ast/lib/src/printer.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698