| 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 library dart2js.compiler_base; | 5 library dart2js.compiler_base; |
| 6 | 6 |
| 7 import 'dart:async' show | 7 import 'dart:async' show |
| 8 EventSink, | 8 EventSink, |
| 9 Future; | 9 Future; |
| 10 | 10 |
| (...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 fullyEnqueueTopLevelElement(element, world); | 1235 fullyEnqueueTopLevelElement(element, world); |
| 1236 } | 1236 } |
| 1237 library.implementation.forEachLocalMember(enqueueAll); | 1237 library.implementation.forEachLocalMember(enqueueAll); |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 void fullyEnqueueTopLevelElement(Element element, Enqueuer world) { | 1240 void fullyEnqueueTopLevelElement(Element element, Enqueuer world) { |
| 1241 if (element.isClass) { | 1241 if (element.isClass) { |
| 1242 ClassElement cls = element; | 1242 ClassElement cls = element; |
| 1243 cls.ensureResolved(this); | 1243 cls.ensureResolved(this); |
| 1244 cls.forEachLocalMember(enqueuer.resolution.addToWorkList); | 1244 cls.forEachLocalMember(enqueuer.resolution.addToWorkList); |
| 1245 world.registerInstantiatedType(cls.rawType, globalDependencies); | 1245 backend.registerInstantiatedType( |
| 1246 cls.rawType, world, globalDependencies); |
| 1246 } else { | 1247 } else { |
| 1247 world.addToWorkList(element); | 1248 world.addToWorkList(element); |
| 1248 } | 1249 } |
| 1249 } | 1250 } |
| 1250 | 1251 |
| 1251 // Resolves metadata on library elements. This is necessary in order to | 1252 // Resolves metadata on library elements. This is necessary in order to |
| 1252 // resolve metadata classes referenced only from metadata on library tags. | 1253 // resolve metadata classes referenced only from metadata on library tags. |
| 1253 // TODO(ahe): Figure out how to do this lazily. | 1254 // TODO(ahe): Figure out how to do this lazily. |
| 1254 void resolveLibraryMetadata() { | 1255 void resolveLibraryMetadata() { |
| 1255 for (LibraryElement library in libraryLoader.libraries) { | 1256 for (LibraryElement library in libraryLoader.libraries) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1273 } | 1274 } |
| 1274 | 1275 |
| 1275 void processQueue(Enqueuer world, Element main) { | 1276 void processQueue(Enqueuer world, Element main) { |
| 1276 world.nativeEnqueuer.processNativeClasses(libraryLoader.libraries); | 1277 world.nativeEnqueuer.processNativeClasses(libraryLoader.libraries); |
| 1277 if (main != null && !main.isErroneous) { | 1278 if (main != null && !main.isErroneous) { |
| 1278 FunctionElement mainMethod = main; | 1279 FunctionElement mainMethod = main; |
| 1279 mainMethod.computeType(this); | 1280 mainMethod.computeType(this); |
| 1280 if (mainMethod.functionSignature.parameterCount != 0) { | 1281 if (mainMethod.functionSignature.parameterCount != 0) { |
| 1281 // The first argument could be a list of strings. | 1282 // The first argument could be a list of strings. |
| 1282 backend.listImplementation.ensureResolved(this); | 1283 backend.listImplementation.ensureResolved(this); |
| 1283 world.registerInstantiatedType( | 1284 backend.registerInstantiatedType( |
| 1284 backend.listImplementation.rawType, globalDependencies); | 1285 backend.listImplementation.rawType, world, globalDependencies); |
| 1285 backend.stringImplementation.ensureResolved(this); | 1286 backend.stringImplementation.ensureResolved(this); |
| 1286 world.registerInstantiatedType( | 1287 backend.registerInstantiatedType( |
| 1287 backend.stringImplementation.rawType, globalDependencies); | 1288 backend.stringImplementation.rawType, world, globalDependencies); |
| 1288 | 1289 |
| 1289 backend.registerMainHasArguments(world); | 1290 backend.registerMainHasArguments(world); |
| 1290 } | 1291 } |
| 1291 world.addToWorkList(main); | 1292 world.addToWorkList(main); |
| 1292 } | 1293 } |
| 1293 if (verbose) { | 1294 if (verbose) { |
| 1294 progress.reset(); | 1295 progress.reset(); |
| 1295 } | 1296 } |
| 1296 emptyQueue(world); | 1297 emptyQueue(world); |
| 1297 world.queueIsClosed = true; | 1298 world.queueIsClosed = true; |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1850 | 1851 |
| 1851 @override | 1852 @override |
| 1852 InterfaceType streamType([DartType elementType]) { | 1853 InterfaceType streamType([DartType elementType]) { |
| 1853 InterfaceType type = streamClass.computeType(compiler); | 1854 InterfaceType type = streamClass.computeType(compiler); |
| 1854 if (elementType == null) { | 1855 if (elementType == null) { |
| 1855 return streamClass.rawType; | 1856 return streamClass.rawType; |
| 1856 } | 1857 } |
| 1857 return type.createInstantiation([elementType]); | 1858 return type.createInstantiation([elementType]); |
| 1858 } | 1859 } |
| 1859 } | 1860 } |
| OLD | NEW |