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

Unified Diff: dart/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java

Issue 9353015: Remove dartc optimizing backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix minor test issues Created 8 years, 10 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
Index: dart/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
diff --git a/dart/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java b/dart/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
index 059620cb5006e3c4d043c72d453df35daaf1e06d..02f28caf5531e996dbcac8650deb961c98c5e050 100644
--- a/dart/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
+++ b/dart/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
@@ -5,11 +5,8 @@
package com.google.dart.compiler.ast;
import com.google.common.collect.Lists;
-import com.google.dart.compiler.common.GenerateSourceMap;
import com.google.dart.compiler.common.HasSourceInfo;
-import com.google.dart.compiler.common.SourceMapping;
import com.google.dart.compiler.util.TextOutput;
-import com.google.debugging.sourcemap.FilePosition;
import java.io.IOException;
import java.util.Iterator;
@@ -21,8 +18,6 @@ import java.util.List;
public class DartToSourceVisitor extends DartVisitor {
private final TextOutput out;
- private boolean buildMappings;
- private List<SourceMapping> mappings = Lists.newArrayList();
private final boolean isDiet;
public DartToSourceVisitor(TextOutput out) {
@@ -34,42 +29,6 @@ public class DartToSourceVisitor extends DartVisitor {
this.isDiet = isDiet;
}
- public void generateSourceMap(boolean generate) {
- this.buildMappings = generate;
- }
-
- public void writeSourceMap(Appendable out, String name) throws IOException {
- GenerateSourceMap generator = new GenerateSourceMap();
- for (SourceMapping m : mappings) {
- generator.addMapping(m.getNode(), m.getStart(), m.getEnd());
- }
- generator.appendTo(out, name);
- }
-
- @Override
- public void doTraverse(DartVisitable x, DartContext ctx) {
- SourceMapping m = null;
-
- boolean mapThis = shouldMap(x);
- if (mapThis) {
- m = new SourceMapping((HasSourceInfo) x, new FilePosition(out.getLine(), out.getColumn()));
- mappings.add(m);
- }
-
- super.doTraverse(x, ctx);
-
- if (mapThis) {
- m.setEnd(new FilePosition(out.getLine(), out.getColumn()));
- }
- }
-
- /**
- * Filter uninteresting AST nodes out of the source map
- */
- private boolean shouldMap(DartVisitable x) {
- return buildMappings && !(x instanceof DartExprStmt);
- }
-
@Override
public boolean visit(DartUnit x, DartContext ctx) {
p("// unit " + x.getSourceName());

Powered by Google App Engine
This is Rietveld 408576698