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

Side by Side Diff: dart/pkg/compiler/lib/src/compiler.dart

Issue 930143002: Remove implicit dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Changes committed as r43874. Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/pkg/compiler/lib/src/dart_backend/backend.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 ClassElement get symbolClass => _coreTypes.symbolClass; 798 ClassElement get symbolClass => _coreTypes.symbolClass;
799 ClassElement get stackTraceClass => _coreTypes.stackTraceClass; 799 ClassElement get stackTraceClass => _coreTypes.stackTraceClass;
800 ClassElement get futureClass => _coreTypes.futureClass; 800 ClassElement get futureClass => _coreTypes.futureClass;
801 ClassElement get iterableClass => _coreTypes.iterableClass; 801 ClassElement get iterableClass => _coreTypes.iterableClass;
802 ClassElement get streamClass => _coreTypes.streamClass; 802 ClassElement get streamClass => _coreTypes.streamClass;
803 803
804 CoreTypes get coreTypes => _coreTypes; 804 CoreTypes get coreTypes => _coreTypes;
805 805
806 ClassElement typedDataClass; 806 ClassElement typedDataClass;
807 807
808 /// The constant for the [proxy] variable defined in dart:core. 808 /// The class for the [proxy] value defined in dart:core.
809 ConstantValue proxyConstant; 809 ClassElement proxyClass;
810 810
811 // TODO(johnniwinther): Move this to the JavaScriptBackend. 811 // TODO(johnniwinther): Move this to the JavaScriptBackend.
812 /// The class for patch annotation defined in dart:_js_helper. 812 /// The class for patch annotation defined in dart:_js_helper.
813 ClassElement patchAnnotationClass; 813 ClassElement patchAnnotationClass;
814 814
815 // TODO(johnniwinther): Move this to the JavaScriptBackend. 815 // TODO(johnniwinther): Move this to the JavaScriptBackend.
816 ClassElement nativeAnnotationClass; 816 ClassElement nativeAnnotationClass;
817 817
818 // Initialized after symbolClass has been resolved. 818 // Initialized after symbolClass has been resolved.
819 FunctionElement symbolConstructor; 819 FunctionElement symbolConstructor;
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 }); 1324 });
1325 reportWarning(NO_LOCATION_SPANNABLE, 1325 reportWarning(NO_LOCATION_SPANNABLE,
1326 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, 1326 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
1327 {'importChain': importChains.join( 1327 {'importChain': importChains.join(
1328 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS_PADDING)}); 1328 MessageKind.IMPORT_EXPERIMENTAL_MIRRORS_PADDING)});
1329 } 1329 }
1330 1330
1331 functionClass.ensureResolved(this); 1331 functionClass.ensureResolved(this);
1332 functionApplyMethod = functionClass.lookupLocalMember('apply'); 1332 functionApplyMethod = functionClass.lookupLocalMember('apply');
1333 1333
1334 proxyConstant =
1335 resolver.constantCompiler.compileConstant(
1336 coreLibrary.find('proxy')).value;
1337
1338 if (preserveComments) { 1334 if (preserveComments) {
1339 return libraryLoader.loadLibrary(DART_MIRRORS) 1335 return libraryLoader.loadLibrary(DART_MIRRORS)
1340 .then((LibraryElement libraryElement) { 1336 .then((LibraryElement libraryElement) {
1341 documentClass = libraryElement.find('Comment'); 1337 documentClass = libraryElement.find('Comment');
1342 }); 1338 });
1343 } 1339 }
1344 }).then((_) => backend.onLibrariesLoaded(loadedLibraries)); 1340 }).then((_) => backend.onLibrariesLoaded(loadedLibraries));
1345 } 1341 }
1346 1342
1347 Element findRequiredElement(LibraryElement library, String name) { 1343 Element findRequiredElement(LibraryElement library, String name) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 _coreTypes.doubleClass = lookupCoreClass('double'); 1392 _coreTypes.doubleClass = lookupCoreClass('double');
1397 _coreTypes.stringClass = lookupCoreClass('String'); 1393 _coreTypes.stringClass = lookupCoreClass('String');
1398 _coreTypes.functionClass = lookupCoreClass('Function'); 1394 _coreTypes.functionClass = lookupCoreClass('Function');
1399 _coreTypes.listClass = lookupCoreClass('List'); 1395 _coreTypes.listClass = lookupCoreClass('List');
1400 _coreTypes.typeClass = lookupCoreClass('Type'); 1396 _coreTypes.typeClass = lookupCoreClass('Type');
1401 _coreTypes.mapClass = lookupCoreClass('Map'); 1397 _coreTypes.mapClass = lookupCoreClass('Map');
1402 _coreTypes.nullClass = lookupCoreClass('Null'); 1398 _coreTypes.nullClass = lookupCoreClass('Null');
1403 _coreTypes.stackTraceClass = lookupCoreClass('StackTrace'); 1399 _coreTypes.stackTraceClass = lookupCoreClass('StackTrace');
1404 _coreTypes.iterableClass = lookupCoreClass('Iterable'); 1400 _coreTypes.iterableClass = lookupCoreClass('Iterable');
1405 _coreTypes.symbolClass = lookupCoreClass('Symbol'); 1401 _coreTypes.symbolClass = lookupCoreClass('Symbol');
1402 proxyClass = lookupCoreClass('_Proxy');
1406 if (!missingCoreClasses.isEmpty) { 1403 if (!missingCoreClasses.isEmpty) {
1407 internalError( 1404 internalError(
1408 coreLibrary, 1405 coreLibrary,
1409 'dart:core library does not contain required classes: ' 1406 'dart:core library does not contain required classes: '
1410 '$missingCoreClasses'); 1407 '$missingCoreClasses');
1411 } 1408 }
1412 } 1409 }
1413 1410
1414 Element _unnamedListConstructor; 1411 Element _unnamedListConstructor;
1415 Element get unnamedListConstructor { 1412 Element get unnamedListConstructor {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 } 1664 }
1668 } 1665 }
1669 } 1666 }
1670 } 1667 }
1671 1668
1672 void processQueue(Enqueuer world, Element main) { 1669 void processQueue(Enqueuer world, Element main) {
1673 world.nativeEnqueuer.processNativeClasses(libraryLoader.libraries); 1670 world.nativeEnqueuer.processNativeClasses(libraryLoader.libraries);
1674 if (main != null && !main.isErroneous) { 1671 if (main != null && !main.isErroneous) {
1675 FunctionElement mainMethod = main; 1672 FunctionElement mainMethod = main;
1676 if (mainMethod.computeSignature(this).parameterCount != 0) { 1673 if (mainMethod.computeSignature(this).parameterCount != 0) {
1677 // The first argument could be a list of strings.
1678 world.registerInstantiatedClass(
1679 backend.listImplementation, globalDependencies);
1680 world.registerInstantiatedClass(
1681 backend.stringImplementation, globalDependencies);
1682
1683 backend.registerMainHasArguments(world); 1674 backend.registerMainHasArguments(world);
1684 } 1675 }
1685 world.addToWorkList(main); 1676 world.addToWorkList(main);
1686 } 1677 }
1687 if (verbose) { 1678 if (verbose) {
1688 progress.reset(); 1679 progress.reset();
1689 } 1680 }
1690 world.forEach((WorkItem work) { 1681 world.forEach((WorkItem work) {
1691 withCurrentElement(work.element, () => work.run(this, world)); 1682 withCurrentElement(work.element, () => work.run(this, world));
1692 }); 1683 });
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
2408 return futureClass.computeType(compiler).createInstantiation([elementType]); 2399 return futureClass.computeType(compiler).createInstantiation([elementType]);
2409 } 2400 }
2410 2401
2411 @override 2402 @override
2412 InterfaceType streamType([DartType elementType = const DynamicType()]) { 2403 InterfaceType streamType([DartType elementType = const DynamicType()]) {
2413 return streamClass.computeType(compiler).createInstantiation([elementType]); 2404 return streamClass.computeType(compiler).createInstantiation([elementType]);
2414 } 2405 }
2415 } 2406 }
2416 2407
2417 typedef void InternalErrorFunction(Spannable location, String message); 2408 typedef void InternalErrorFunction(Spannable location, String message);
OLDNEW
« no previous file with comments | « no previous file | dart/pkg/compiler/lib/src/dart_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698