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

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

Issue 868643002: Revert "Change signature of lookupConstructor to only require a name." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 913
914 /// A customizable filter that is applied to enqueued work items. 914 /// A customizable filter that is applied to enqueued work items.
915 QueueFilter enqueuerFilter = new QueueFilter(); 915 QueueFilter enqueuerFilter = new QueueFilter();
916 916
917 static const String MAIN = 'main'; 917 static const String MAIN = 'main';
918 static const String CALL_OPERATOR_NAME = 'call'; 918 static const String CALL_OPERATOR_NAME = 'call';
919 static const String NO_SUCH_METHOD = 'noSuchMethod'; 919 static const String NO_SUCH_METHOD = 'noSuchMethod';
920 static const int NO_SUCH_METHOD_ARG_COUNT = 1; 920 static const int NO_SUCH_METHOD_ARG_COUNT = 1;
921 static const String CREATE_INVOCATION_MIRROR = 921 static const String CREATE_INVOCATION_MIRROR =
922 'createInvocationMirror'; 922 'createInvocationMirror';
923 static const String FROM_ENVIRONMENT = 'fromEnvironment';
924 923
925 static const String RUNTIME_TYPE = 'runtimeType'; 924 static const String RUNTIME_TYPE = 'runtimeType';
926 925
927 static const String UNDETERMINED_BUILD_ID = 926 static const String UNDETERMINED_BUILD_ID =
928 "build number could not be determined"; 927 "build number could not be determined";
929 928
930 final Selector iteratorSelector = 929 final Selector iteratorSelector =
931 new Selector.getter('iterator', null); 930 new Selector.getter('iterator', null);
932 final Selector currentSelector = 931 final Selector currentSelector =
933 new Selector.getter('current', null); 932 new Selector.getter('current', null);
934 final Selector moveNextSelector = 933 final Selector moveNextSelector =
935 new Selector.call('moveNext', null, 0); 934 new Selector.call('moveNext', null, 0);
936 final Selector noSuchMethodSelector = new Selector.call( 935 final Selector noSuchMethodSelector = new Selector.call(
937 Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT); 936 Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT);
938 final Selector symbolValidatedConstructorSelector = new Selector.call( 937 final Selector symbolValidatedConstructorSelector = new Selector.call(
939 'validated', null, 1); 938 'validated', null, 1);
939 final Selector fromEnvironmentSelector = new Selector.callConstructor(
940 'fromEnvironment', null, 2);
940 941
941 bool enabledNoSuchMethod = false; 942 bool enabledNoSuchMethod = false;
942 bool enabledRuntimeType = false; 943 bool enabledRuntimeType = false;
943 bool enabledFunctionApply = false; 944 bool enabledFunctionApply = false;
944 bool enabledInvokeOn = false; 945 bool enabledInvokeOn = false;
945 bool hasIsolateSupport = false; 946 bool hasIsolateSupport = false;
946 947
947 Stopwatch progress; 948 Stopwatch progress;
948 949
949 bool get shouldPrintProgress { 950 bool get shouldPrintProgress {
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 } 1353 }
1353 1354
1354 void onClassResolved(ClassElement cls) { 1355 void onClassResolved(ClassElement cls) {
1355 if (mirrorSystemClass == cls) { 1356 if (mirrorSystemClass == cls) {
1356 mirrorSystemGetNameFunction = 1357 mirrorSystemGetNameFunction =
1357 cls.lookupLocalMember('getName'); 1358 cls.lookupLocalMember('getName');
1358 } else if (symbolClass == cls) { 1359 } else if (symbolClass == cls) {
1359 symbolConstructor = cls.constructors.head; 1360 symbolConstructor = cls.constructors.head;
1360 } else if (symbolImplementationClass == cls) { 1361 } else if (symbolImplementationClass == cls) {
1361 symbolValidatedConstructor = symbolImplementationClass.lookupConstructor( 1362 symbolValidatedConstructor = symbolImplementationClass.lookupConstructor(
1362 symbolValidatedConstructorSelector.name); 1363 symbolValidatedConstructorSelector);
1363 } else if (mirrorsUsedClass == cls) { 1364 } else if (mirrorsUsedClass == cls) {
1364 mirrorsUsedConstructor = cls.constructors.head; 1365 mirrorsUsedConstructor = cls.constructors.head;
1365 } else if (intClass == cls) { 1366 } else if (intClass == cls) {
1366 intEnvironment = intClass.lookupConstructor(FROM_ENVIRONMENT); 1367 intEnvironment = intClass.lookupConstructor(fromEnvironmentSelector);
1367 } else if (stringClass == cls) { 1368 } else if (stringClass == cls) {
1368 stringEnvironment = 1369 stringEnvironment =
1369 stringClass.lookupConstructor(FROM_ENVIRONMENT); 1370 stringClass.lookupConstructor(fromEnvironmentSelector);
1370 } else if (boolClass == cls) { 1371 } else if (boolClass == cls) {
1371 boolEnvironment = 1372 boolEnvironment = boolClass.lookupConstructor(fromEnvironmentSelector);
1372 boolClass.lookupConstructor(FROM_ENVIRONMENT);
1373 } 1373 }
1374 } 1374 }
1375 1375
1376 void initializeCoreClasses() { 1376 void initializeCoreClasses() {
1377 final List missingCoreClasses = []; 1377 final List missingCoreClasses = [];
1378 ClassElement lookupCoreClass(String name) { 1378 ClassElement lookupCoreClass(String name) {
1379 ClassElement result = coreLibrary.find(name); 1379 ClassElement result = coreLibrary.find(name);
1380 if (result == null) { 1380 if (result == null) {
1381 missingCoreClasses.add(name); 1381 missingCoreClasses.add(name);
1382 } 1382 }
(...skipping 17 matching lines...) Expand all
1400 internalError( 1400 internalError(
1401 coreLibrary, 1401 coreLibrary,
1402 'dart:core library does not contain required classes: ' 1402 'dart:core library does not contain required classes: '
1403 '$missingCoreClasses'); 1403 '$missingCoreClasses');
1404 } 1404 }
1405 } 1405 }
1406 1406
1407 Element _unnamedListConstructor; 1407 Element _unnamedListConstructor;
1408 Element get unnamedListConstructor { 1408 Element get unnamedListConstructor {
1409 if (_unnamedListConstructor != null) return _unnamedListConstructor; 1409 if (_unnamedListConstructor != null) return _unnamedListConstructor;
1410 return _unnamedListConstructor = listClass.lookupDefaultConstructor(); 1410 Selector callConstructor = new Selector.callConstructor(
1411 "", listClass.library);
1412 return _unnamedListConstructor =
1413 listClass.lookupConstructor(callConstructor);
1411 } 1414 }
1412 1415
1413 Element _filledListConstructor; 1416 Element _filledListConstructor;
1414 Element get filledListConstructor { 1417 Element get filledListConstructor {
1415 if (_filledListConstructor != null) return _filledListConstructor; 1418 if (_filledListConstructor != null) return _filledListConstructor;
1416 return _filledListConstructor = listClass.lookupConstructor("filled"); 1419 Selector callConstructor = new Selector.callConstructor(
1420 "filled", listClass.library);
1421 return _filledListConstructor =
1422 listClass.lookupConstructor(callConstructor);
1417 } 1423 }
1418 1424
1419 /** 1425 /**
1420 * Get an [Uri] pointing to a patch for the dart: library with 1426 * Get an [Uri] pointing to a patch for the dart: library with
1421 * the given path. Returns null if there is no patch. 1427 * the given path. Returns null if there is no patch.
1422 */ 1428 */
1423 Uri resolvePatchUri(String dartLibraryPath); 1429 Uri resolvePatchUri(String dartLibraryPath);
1424 1430
1425 Future runCompiler(Uri uri) { 1431 Future runCompiler(Uri uri) {
1426 // TODO(ahe): This prevents memory leaks when invoking the compiler 1432 // TODO(ahe): This prevents memory leaks when invoking the compiler
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 InterfaceType get nullType => nullClass.computeType(compiler); 2388 InterfaceType get nullType => nullClass.computeType(compiler);
2383 2389
2384 @override 2390 @override
2385 InterfaceType get numType => numClass.computeType(compiler); 2391 InterfaceType get numType => numClass.computeType(compiler);
2386 2392
2387 @override 2393 @override
2388 InterfaceType get stringType => stringClass.computeType(compiler); 2394 InterfaceType get stringType => stringClass.computeType(compiler);
2389 } 2395 }
2390 2396
2391 typedef void InternalErrorFunction(Spannable location, String message); 2397 typedef void InternalErrorFunction(Spannable location, String message);
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698