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 1020853004: Don't generate invocation mirror code if all noSuchMethods forward to (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add test Created 5 years, 9 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 | pkg/compiler/lib/src/dump_info.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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 /** 364 /// Call this to register a `noSuchMethod` implementation.
365 * Call this method to enable [noSuchMethod] handling in the 365 void registerNoSuchMethod(Element noSuchMethodElement) {}
366 * backend. 366
367 */ 367 /// Call this method to enable support for `noSuchMethod`.
368 void enableNoSuchMethod(Element context, Enqueuer enqueuer) { 368 void enableNoSuchMethod(Enqueuer enqueuer) {}
369 enqueuer.registerInvocation(compiler.noSuchMethodSelector); 369
370 } 370 /// Returns whether or not `noSuchMethod` support has been enabled.
371 bool get enabledNoSuchMethod => false;
371 372
372 /// Call this method to enable support for isolates. 373 /// Call this method to enable support for isolates.
373 void enableIsolateSupport(Enqueuer enqueuer) {} 374 void enableIsolateSupport(Enqueuer enqueuer) {}
374 375
375 void registerRequiredType(DartType type, Element enclosingElement) {} 376 void registerRequiredType(DartType type, Element enclosingElement) {}
376 void registerClassUsingVariableExpression(ClassElement cls) {} 377 void registerClassUsingVariableExpression(ClassElement cls) {}
377 378
378 void registerConstSymbol(String name, Registry registry) {} 379 void registerConstSymbol(String name, Registry registry) {}
379 void registerNewSymbol(Registry registry) {} 380 void registerNewSymbol(Registry registry) {}
380 381
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 new Selector.getter('iterator', null); 943 new Selector.getter('iterator', null);
943 final Selector currentSelector = 944 final Selector currentSelector =
944 new Selector.getter('current', null); 945 new Selector.getter('current', null);
945 final Selector moveNextSelector = 946 final Selector moveNextSelector =
946 new Selector.call('moveNext', null, 0); 947 new Selector.call('moveNext', null, 0);
947 final Selector noSuchMethodSelector = new Selector.call( 948 final Selector noSuchMethodSelector = new Selector.call(
948 Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT); 949 Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT);
949 final Selector symbolValidatedConstructorSelector = new Selector.call( 950 final Selector symbolValidatedConstructorSelector = new Selector.call(
950 'validated', null, 1); 951 'validated', null, 1);
951 952
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
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 }
1632 if (compileAll) { 1629 if (compileAll) {
1633 libraryLoader.libraries.forEach((LibraryElement library) { 1630 libraryLoader.libraries.forEach((LibraryElement library) {
1634 fullyEnqueueLibrary(library, enqueuer.codegen); 1631 fullyEnqueueLibrary(library, enqueuer.codegen);
1635 }); 1632 });
1636 } 1633 }
1637 processQueue(enqueuer.codegen, mainFunction); 1634 processQueue(enqueuer.codegen, mainFunction);
1638 enqueuer.codegen.logSummary(log); 1635 enqueuer.codegen.logSummary(log);
1639 1636
1640 int programSize = backend.assembleProgram(); 1637 int programSize = backend.assembleProgram();
1641 1638
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
2420 return futureClass.computeType(compiler).createInstantiation([elementType]); 2417 return futureClass.computeType(compiler).createInstantiation([elementType]);
2421 } 2418 }
2422 2419
2423 @override 2420 @override
2424 InterfaceType streamType([DartType elementType = const DynamicType()]) { 2421 InterfaceType streamType([DartType elementType = const DynamicType()]) {
2425 return streamClass.computeType(compiler).createInstantiation([elementType]); 2422 return streamClass.computeType(compiler).createInstantiation([elementType]);
2426 } 2423 }
2427 } 2424 }
2428 2425
2429 typedef void InternalErrorFunction(Spannable location, String message); 2426 typedef void InternalErrorFunction(Spannable location, String message);
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/dump_info.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698