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

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

Issue 996263002: Don't generate forwarding hooks if all noSuchMethod implementations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix typo 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 typesTask.onResolutionComplete(mainFunction); 1616 typesTask.onResolutionComplete(mainFunction);
1617 1617
1618 if (stopAfterTypeInference) return; 1618 if (stopAfterTypeInference) return;
1619 1619
1620 log('Compiling...'); 1620 log('Compiling...');
1621 phase = PHASE_COMPILING; 1621 phase = PHASE_COMPILING;
1622 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. 1622 // TODO(johnniwinther): Move these to [CodegenEnqueuer].
1623 if (hasIsolateSupport) { 1623 if (hasIsolateSupport) {
1624 backend.enableIsolateSupport(enqueuer.codegen); 1624 backend.enableIsolateSupport(enqueuer.codegen);
1625 } 1625 }
1626 if (enabledNoSuchMethod) {
1627 backend.enableNoSuchMethod(null, enqueuer.codegen);
1628 }
1629 if (compileAll) { 1626 if (compileAll) {
1630 libraryLoader.libraries.forEach((LibraryElement library) { 1627 libraryLoader.libraries.forEach((LibraryElement library) {
1631 fullyEnqueueLibrary(library, enqueuer.codegen); 1628 fullyEnqueueLibrary(library, enqueuer.codegen);
1632 }); 1629 });
1633 } 1630 }
1634 processQueue(enqueuer.codegen, mainFunction); 1631 processQueue(enqueuer.codegen, mainFunction);
1635 enqueuer.codegen.logSummary(log); 1632 enqueuer.codegen.logSummary(log);
1636 1633
1637 int programSize = backend.assembleProgram(); 1634 int programSize = backend.assembleProgram();
1638 1635
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 return futureClass.computeType(compiler).createInstantiation([elementType]); 2414 return futureClass.computeType(compiler).createInstantiation([elementType]);
2418 } 2415 }
2419 2416
2420 @override 2417 @override
2421 InterfaceType streamType([DartType elementType = const DynamicType()]) { 2418 InterfaceType streamType([DartType elementType = const DynamicType()]) {
2422 return streamClass.computeType(compiler).createInstantiation([elementType]); 2419 return streamClass.computeType(compiler).createInstantiation([elementType]);
2423 } 2420 }
2424 } 2421 }
2425 2422
2426 typedef void InternalErrorFunction(Spannable location, String message); 2423 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