| 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 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 void registerBoundClosure(Enqueuer enqueuer) {} | 354 void registerBoundClosure(Enqueuer enqueuer) {} |
| 355 | 355 |
| 356 /// Call this to register that a static function has been closurized. | 356 /// Call this to register that a static function has been closurized. |
| 357 void registerGetOfStaticFunction(Enqueuer enqueuer) {} | 357 void registerGetOfStaticFunction(Enqueuer enqueuer) {} |
| 358 | 358 |
| 359 /** | 359 /** |
| 360 * Call this to register that the [:runtimeType:] property has been accessed. | 360 * Call this to register that the [:runtimeType:] property has been accessed. |
| 361 */ | 361 */ |
| 362 void registerRuntimeType(Enqueuer enqueuer, Registry registry) {} | 362 void registerRuntimeType(Enqueuer enqueuer, Registry registry) {} |
| 363 | 363 |
| 364 /// Call this to register a `noSuchMethod` implementation. | 364 /** |
| 365 void registerNoSuchMethod(Element noSuchMethodElement) {} | 365 * Call this method to enable [noSuchMethod] handling in the |
| 366 | 366 * backend. |
| 367 /// Call this method to enable support for `noSuchMethod`. | 367 */ |
| 368 void enableNoSuchMethod(Enqueuer enqueuer) {} | 368 void enableNoSuchMethod(Element context, Enqueuer enqueuer) { |
| 369 | 369 enqueuer.registerInvocation(compiler.noSuchMethodSelector); |
| 370 /// Returns whether or not `noSuchMethod` support has been enabled. | 370 } |
| 371 bool get enabledNoSuchMethod => false; | |
| 372 | 371 |
| 373 /// Call this method to enable support for isolates. | 372 /// Call this method to enable support for isolates. |
| 374 void enableIsolateSupport(Enqueuer enqueuer) {} | 373 void enableIsolateSupport(Enqueuer enqueuer) {} |
| 375 | 374 |
| 376 void registerRequiredType(DartType type, Element enclosingElement) {} | 375 void registerRequiredType(DartType type, Element enclosingElement) {} |
| 377 void registerClassUsingVariableExpression(ClassElement cls) {} | 376 void registerClassUsingVariableExpression(ClassElement cls) {} |
| 378 | 377 |
| 379 void registerConstSymbol(String name, Registry registry) {} | 378 void registerConstSymbol(String name, Registry registry) {} |
| 380 void registerNewSymbol(Registry registry) {} | 379 void registerNewSymbol(Registry registry) {} |
| 381 | 380 |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 new Selector.getter('iterator', null); | 942 new Selector.getter('iterator', null); |
| 944 final Selector currentSelector = | 943 final Selector currentSelector = |
| 945 new Selector.getter('current', null); | 944 new Selector.getter('current', null); |
| 946 final Selector moveNextSelector = | 945 final Selector moveNextSelector = |
| 947 new Selector.call('moveNext', null, 0); | 946 new Selector.call('moveNext', null, 0); |
| 948 final Selector noSuchMethodSelector = new Selector.call( | 947 final Selector noSuchMethodSelector = new Selector.call( |
| 949 Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT); | 948 Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT); |
| 950 final Selector symbolValidatedConstructorSelector = new Selector.call( | 949 final Selector symbolValidatedConstructorSelector = new Selector.call( |
| 951 'validated', null, 1); | 950 'validated', null, 1); |
| 952 | 951 |
| 952 bool enabledNoSuchMethod = false; |
| 953 bool enabledRuntimeType = false; | 953 bool enabledRuntimeType = false; |
| 954 bool enabledFunctionApply = false; | 954 bool enabledFunctionApply = false; |
| 955 bool enabledInvokeOn = false; | 955 bool enabledInvokeOn = false; |
| 956 bool hasIsolateSupport = false; | 956 bool hasIsolateSupport = false; |
| 957 | 957 |
| 958 Stopwatch progress; | 958 Stopwatch progress; |
| 959 | 959 |
| 960 bool get shouldPrintProgress { | 960 bool get shouldPrintProgress { |
| 961 return verbose && progress.elapsedMilliseconds > 500; | 961 return verbose && progress.elapsedMilliseconds > 500; |
| 962 } | 962 } |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1619 typesTask.onResolutionComplete(mainFunction); | 1619 typesTask.onResolutionComplete(mainFunction); |
| 1620 | 1620 |
| 1621 if (stopAfterTypeInference) return; | 1621 if (stopAfterTypeInference) return; |
| 1622 | 1622 |
| 1623 log('Compiling...'); | 1623 log('Compiling...'); |
| 1624 phase = PHASE_COMPILING; | 1624 phase = PHASE_COMPILING; |
| 1625 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. | 1625 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. |
| 1626 if (hasIsolateSupport) { | 1626 if (hasIsolateSupport) { |
| 1627 backend.enableIsolateSupport(enqueuer.codegen); | 1627 backend.enableIsolateSupport(enqueuer.codegen); |
| 1628 } | 1628 } |
| 1629 if (enabledNoSuchMethod) { |
| 1630 backend.enableNoSuchMethod(null, enqueuer.codegen); |
| 1631 } |
| 1629 if (compileAll) { | 1632 if (compileAll) { |
| 1630 libraryLoader.libraries.forEach((LibraryElement library) { | 1633 libraryLoader.libraries.forEach((LibraryElement library) { |
| 1631 fullyEnqueueLibrary(library, enqueuer.codegen); | 1634 fullyEnqueueLibrary(library, enqueuer.codegen); |
| 1632 }); | 1635 }); |
| 1633 } | 1636 } |
| 1634 processQueue(enqueuer.codegen, mainFunction); | 1637 processQueue(enqueuer.codegen, mainFunction); |
| 1635 enqueuer.codegen.logSummary(log); | 1638 enqueuer.codegen.logSummary(log); |
| 1636 | 1639 |
| 1637 int programSize = backend.assembleProgram(); | 1640 int programSize = backend.assembleProgram(); |
| 1638 | 1641 |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2417 return futureClass.computeType(compiler).createInstantiation([elementType]); | 2420 return futureClass.computeType(compiler).createInstantiation([elementType]); |
| 2418 } | 2421 } |
| 2419 | 2422 |
| 2420 @override | 2423 @override |
| 2421 InterfaceType streamType([DartType elementType = const DynamicType()]) { | 2424 InterfaceType streamType([DartType elementType = const DynamicType()]) { |
| 2422 return streamClass.computeType(compiler).createInstantiation([elementType]); | 2425 return streamClass.computeType(compiler).createInstantiation([elementType]); |
| 2423 } | 2426 } |
| 2424 } | 2427 } |
| 2425 | 2428 |
| 2426 typedef void InternalErrorFunction(Spannable location, String message); | 2429 typedef void InternalErrorFunction(Spannable location, String message); |
| OLD | NEW |