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

Side by Side Diff: lib/compiler/implementation/compiler.dart

Issue 10414024: Add a flag to control the backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Next iteration Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class WorkItem { 5 class WorkItem {
6 final Element element; 6 final Element element;
7 TreeElements resolutionTree; 7 TreeElements resolutionTree;
8 bool allowSpeculativeOptimization = true; 8 bool allowSpeculativeOptimization = true;
9 List<HTypeGuard> guards = const <HTypeGuard>[]; 9 List<HTypeGuard> guards = const <HTypeGuard>[];
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return generator.generateMethod(work, graph); 66 return generator.generateMethod(work, graph);
67 } 67 }
68 68
69 void processNativeClasses(libraries) { 69 void processNativeClasses(libraries) {
70 native.processNativeClasses(emitter, libraries); 70 native.processNativeClasses(emitter, libraries);
71 } 71 }
72 72
73 void assembleProgram() => emitter.assembleProgram(); 73 void assembleProgram() => emitter.assembleProgram();
74 } 74 }
75 75
76 class DartBackend extends Backend {
77 DartBackend(Compiler compiler) : super(compiler);
78 }
79
76 class Compiler implements DiagnosticListener { 80 class Compiler implements DiagnosticListener {
77 final Map<String, LibraryElement> libraries; 81 final Map<String, LibraryElement> libraries;
78 int nextFreeClassId = 0; 82 int nextFreeClassId = 0;
79 World world; 83 World world;
80 String assembledCode; 84 String assembledCode;
81 Namer namer; 85 Namer namer;
82 Types types; 86 Types types;
83 bool enableTypeAssertions = false; 87 bool enableTypeAssertions = false;
84 88
85 final Tracer tracer; 89 final Tracer tracer;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 world = new World(), 146 world = new World(),
143 codegenProgress = new Stopwatch.start() { 147 codegenProgress = new Stopwatch.start() {
144 namer = new Namer(this); 148 namer = new Namer(this);
145 constantHandler = new ConstantHandler(this); 149 constantHandler = new ConstantHandler(this);
146 scanner = new ScannerTask(this); 150 scanner = new ScannerTask(this);
147 dietParser = new DietParserTask(this); 151 dietParser = new DietParserTask(this);
148 parser = new ParserTask(this); 152 parser = new ParserTask(this);
149 validator = new TreeValidatorTask(this); 153 validator = new TreeValidatorTask(this);
150 resolver = new ResolverTask(this); 154 resolver = new ResolverTask(this);
151 checker = new TypeCheckerTask(this); 155 checker = new TypeCheckerTask(this);
152 backend = new JavaScriptBackend(this);
Anton Muhin 2012/05/21 15:22:08 I am somewhat concerned that we create a compiler
ahe 2012/05/21 15:38:55 I agree. How about adding one more optional argume
153 enqueuer = new EnqueueTask(this); 156 enqueuer = new EnqueueTask(this);
154 tasks = [scanner, dietParser, parser, resolver, checker, 157 tasks = [scanner, dietParser, parser, resolver, checker,
155 constantHandler, enqueuer]; 158 constantHandler, enqueuer];
156 } 159 }
157 160
158 Universe get codegenWorld() => enqueuer.codegen.universe; 161 Universe get codegenWorld() => enqueuer.codegen.universe;
159 162
160 int getNextFreeClassId() => nextFreeClassId++; 163 int getNextFreeClassId() => nextFreeClassId++;
161 164
162 void ensure(bool condition) { 165 void ensure(bool condition) {
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 When compiling the above method, the compiler crashed. It is not 595 When compiling the above method, the compiler crashed. It is not
593 possible to tell if this is caused by a problem in your program or 596 possible to tell if this is caused by a problem in your program or
594 not. Regardless, the compiler should not crash. 597 not. Regardless, the compiler should not crash.
595 598
596 The Dart team would greatly appreciate if you would take a moment to 599 The Dart team would greatly appreciate if you would take a moment to
597 report this problem at http://dartbug.com/new. 600 report this problem at http://dartbug.com/new.
598 601
599 Please copy and paste the error and stack trace that you see here into 602 Please copy and paste the error and stack trace that you see here into
600 the bug report, include your OS and the Dart SDK build number. 603 the bug report, include your OS and the Dart SDK build number.
601 '''; 604 ''';
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698