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

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

Issue 10855146: Make the closure-to-class translator more accessible. It can now be (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 final bool REPORT_EXCESS_RESOLUTION = false; 10 final bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 } 117 }
118 118
119 List<CompilerTask> tasks; 119 List<CompilerTask> tasks;
120 ScannerTask scanner; 120 ScannerTask scanner;
121 DietParserTask dietParser; 121 DietParserTask dietParser;
122 ParserTask parser; 122 ParserTask parser;
123 PatchParserTask patchParser; 123 PatchParserTask patchParser;
124 TreeValidatorTask validator; 124 TreeValidatorTask validator;
125 ResolverTask resolver; 125 ResolverTask resolver;
126 ClosureTask closureToClassMapper;
126 TypeCheckerTask checker; 127 TypeCheckerTask checker;
127 ti.TypesTask typesTask; 128 ti.TypesTask typesTask;
128 Backend backend; 129 Backend backend;
129 ConstantHandler constantHandler; 130 ConstantHandler constantHandler;
130 EnqueueTask enqueuer; 131 EnqueueTask enqueuer;
131 132
132 static final SourceString MAIN = const SourceString('main'); 133 static final SourceString MAIN = const SourceString('main');
133 static final SourceString CALL_OPERATOR_NAME = const SourceString('call'); 134 static final SourceString CALL_OPERATOR_NAME = const SourceString('call');
134 static final SourceString NO_SUCH_METHOD = const SourceString('noSuchMethod'); 135 static final SourceString NO_SUCH_METHOD = const SourceString('noSuchMethod');
135 static final SourceString NO_SUCH_METHOD_EXCEPTION = 136 static final SourceString NO_SUCH_METHOD_EXCEPTION =
(...skipping 24 matching lines...) Expand all
160 world = new World(), 161 world = new World(),
161 progress = new Stopwatch.start() { 162 progress = new Stopwatch.start() {
162 namer = new Namer(this); 163 namer = new Namer(this);
163 constantHandler = new ConstantHandler(this); 164 constantHandler = new ConstantHandler(this);
164 scanner = new ScannerTask(this); 165 scanner = new ScannerTask(this);
165 dietParser = new DietParserTask(this); 166 dietParser = new DietParserTask(this);
166 parser = new ParserTask(this); 167 parser = new ParserTask(this);
167 patchParser = new PatchParserTask(this); 168 patchParser = new PatchParserTask(this);
168 validator = new TreeValidatorTask(this); 169 validator = new TreeValidatorTask(this);
169 resolver = new ResolverTask(this); 170 resolver = new ResolverTask(this);
171 closureToClassMapper = new closureMapping.ClosureTask(this);
170 checker = new TypeCheckerTask(this); 172 checker = new TypeCheckerTask(this);
171 typesTask = new ti.TypesTask(this); 173 typesTask = new ti.TypesTask(this);
172 backend = emitJavascript ? 174 backend = emitJavascript ?
173 new js_backend.JavaScriptBackend(this, generateSourceMap) : 175 new js_backend.JavaScriptBackend(this, generateSourceMap) :
174 new dart_backend.DartBackend(this, validateUnparse); 176 new dart_backend.DartBackend(this, validateUnparse);
175 enqueuer = new EnqueueTask(this); 177 enqueuer = new EnqueueTask(this);
176 tasks = [scanner, dietParser, parser, resolver, checker, 178 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper,
177 typesTask, constantHandler, enqueuer]; 179 checker, typesTask, constantHandler, enqueuer];
178 tasks.addAll(backend.tasks); 180 tasks.addAll(backend.tasks);
179 } 181 }
180 182
181 Universe get resolverWorld() => enqueuer.resolution.universe; 183 Universe get resolverWorld() => enqueuer.resolution.universe;
182 Universe get codegenWorld() => enqueuer.codegen.universe; 184 Universe get codegenWorld() => enqueuer.codegen.universe;
183 185
184 int getNextFreeClassId() => nextFreeClassId++; 186 int getNextFreeClassId() => nextFreeClassId++;
185 187
186 void ensure(bool condition) { 188 void ensure(bool condition) {
187 if (!condition) cancel('failed assertion in leg'); 189 if (!condition) cancel('failed assertion in leg');
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 final endOffset = end.charOffset + end.slowCharCount; 951 final endOffset = end.charOffset + end.slowCharCount;
950 952
951 // [begin] and [end] might be the same for the same empty token. This 953 // [begin] and [end] might be the same for the same empty token. This
952 // happens for instance when scanning '$$'. 954 // happens for instance when scanning '$$'.
953 assert(endOffset >= beginOffset); 955 assert(endOffset >= beginOffset);
954 return f(beginOffset, endOffset); 956 return f(beginOffset, endOffset);
955 } 957 }
956 958
957 String toString() => 'SourceSpan($uri, $begin, $end)'; 959 String toString() => 'SourceSpan($uri, $begin, $end)';
958 } 960 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698