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

Unified Diff: dart/compiler/java/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.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/backend/js/JsToStringGenerationVisitor.java
diff --git a/dart/compiler/java/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java b/dart/compiler/java/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java
index 937f9d60fc10ca4ecd021f1af71a1e835e12ebb4..ed0666c9d97fcc37f303f4d5370e3a774a89c210 100644
--- a/dart/compiler/java/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java
+++ b/dart/compiler/java/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java
@@ -57,11 +57,8 @@ import com.google.dart.compiler.backend.js.ast.JsVisitable;
import com.google.dart.compiler.backend.js.ast.JsVisitor;
import com.google.dart.compiler.backend.js.ast.JsWhile;
import com.google.dart.compiler.backend.js.ast.JsVars.JsVar;
-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.ArrayList;
@@ -261,44 +258,11 @@ public class JsToStringGenerationVisitor extends JsVisitor {
private final TextOutput p;
private ArrayList<Integer> statementEnds = new ArrayList<Integer>();
private ArrayList<Integer> statementStarts = new ArrayList<Integer>();
- private boolean buildMappings;
- private List<SourceMapping> mappings = Lists.newArrayList();
public JsToStringGenerationVisitor(TextOutput out) {
this.p = out;
}
- /**
- * @param generate Whether to generate the source map.
- */
- 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(JsVisitable x, JsContext ctx) {
- SourceMapping m = null;
- // TODO(johnlenz): filter out uninteresting node types
- if (buildMappings) {
- m = new SourceMapping((HasSourceInfo) x, new FilePosition(p.getLine(), p.getColumn()));
- mappings.add(m);
- }
-
- super.doTraverse(x, ctx);
-
- if (buildMappings) {
- m.setEnd(new FilePosition(p.getLine(), p.getColumn()));
- }
- }
-
@Override
public boolean visit(JsArrayAccess x, JsContext ctx) {
JsExpression arrayExpr = x.getArrayExpr();

Powered by Google App Engine
This is Rietveld 408576698