OLD | NEW |
---|---|
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 const bool REPORT_EXCESS_RESOLUTION = false; | 10 const bool REPORT_EXCESS_RESOLUTION = false; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 int phase; | 175 int phase; |
176 | 176 |
177 bool compilationFailed = false; | 177 bool compilationFailed = false; |
178 | 178 |
179 bool hasCrashed = false; | 179 bool hasCrashed = false; |
180 | 180 |
181 Compiler([this.tracer = const Tracer(), | 181 Compiler([this.tracer = const Tracer(), |
182 this.enableTypeAssertions = false, | 182 this.enableTypeAssertions = false, |
183 this.enableUserAssertions = false, | 183 this.enableUserAssertions = false, |
184 this.enableMinification = false, | 184 this.enableMinification = false, |
185 bool emitJavascript = true, | 185 bool emitJavaScript = true, |
186 bool generateSourceMap = true, | 186 bool generateSourceMap = true, |
187 bool cutDeclarationTypes = false]) | 187 bool cutDeclarationTypes = false]) |
188 : libraries = new Map<String, LibraryElement>(), | 188 : libraries = new Map<String, LibraryElement>(), |
189 world = new World(), | 189 world = new World(), |
190 progress = new Stopwatch.start() { | 190 progress = new Stopwatch.start() { |
191 namer = new Namer(this); | 191 namer = new Namer(this); |
192 constantHandler = new ConstantHandler(this); | 192 ConstantSystem constantSystem = |
193 emitJavaScript ? JAVA_SCRIPT_CONSTANT_SYSTEM : DART_CONSTANT_SYSTEM; | |
ngeoffray
2012/09/05 11:20:36
Should that be part of the backend then?
floitsch
2012/09/05 16:12:01
Done.
| |
194 constantHandler = new ConstantHandler(this, constantSystem); | |
193 scanner = new ScannerTask(this); | 195 scanner = new ScannerTask(this); |
194 dietParser = new DietParserTask(this); | 196 dietParser = new DietParserTask(this); |
195 parser = new ParserTask(this); | 197 parser = new ParserTask(this); |
196 patchParser = new PatchParserTask(this); | 198 patchParser = new PatchParserTask(this); |
197 validator = new TreeValidatorTask(this); | 199 validator = new TreeValidatorTask(this); |
198 resolver = new ResolverTask(this); | 200 resolver = new ResolverTask(this); |
199 closureToClassMapper = new closureMapping.ClosureTask(this); | 201 closureToClassMapper = new closureMapping.ClosureTask(this); |
200 checker = new TypeCheckerTask(this); | 202 checker = new TypeCheckerTask(this); |
201 typesTask = new ti.TypesTask(this); | 203 typesTask = new ti.TypesTask(this); |
202 backend = emitJavascript ? | 204 backend = emitJavaScript ? |
203 new js_backend.JavaScriptBackend(this, generateSourceMap) : | 205 new js_backend.JavaScriptBackend(this, generateSourceMap) : |
204 new dart_backend.DartBackend(this, cutDeclarationTypes); | 206 new dart_backend.DartBackend(this, cutDeclarationTypes); |
205 enqueuer = new EnqueueTask(this); | 207 enqueuer = new EnqueueTask(this); |
206 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, | 208 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, |
207 checker, typesTask, constantHandler, enqueuer]; | 209 checker, typesTask, constantHandler, enqueuer]; |
208 tasks.addAll(backend.tasks); | 210 tasks.addAll(backend.tasks); |
209 } | 211 } |
210 | 212 |
211 Universe get resolverWorld => enqueuer.resolution.universe; | 213 Universe get resolverWorld => enqueuer.resolution.universe; |
212 Universe get codegenWorld => enqueuer.codegen.universe; | 214 Universe get codegenWorld => enqueuer.codegen.universe; |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
908 final endOffset = end.charOffset + end.slowCharCount; | 910 final endOffset = end.charOffset + end.slowCharCount; |
909 | 911 |
910 // [begin] and [end] might be the same for the same empty token. This | 912 // [begin] and [end] might be the same for the same empty token. This |
911 // happens for instance when scanning '$$'. | 913 // happens for instance when scanning '$$'. |
912 assert(endOffset >= beginOffset); | 914 assert(endOffset >= beginOffset); |
913 return f(beginOffset, endOffset); | 915 return f(beginOffset, endOffset); |
914 } | 916 } |
915 | 917 |
916 String toString() => 'SourceSpan($uri, $begin, $end)'; | 918 String toString() => 'SourceSpan($uri, $begin, $end)'; |
917 } | 919 } |
OLD | NEW |