Chromium Code Reviews| 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 const VERBOSE_OPTIMIZER_HINTS = false; | 7 const VERBOSE_OPTIMIZER_HINTS = false; |
| 8 | 8 |
| 9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); | 9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); |
| 10 | 10 |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 532 bool isInterceptorClass(ClassElement element) { | 532 bool isInterceptorClass(ClassElement element) { |
| 533 if (element == null) return false; | 533 if (element == null) return false; |
| 534 if (Elements.isNativeOrExtendsNative(element)) return true; | 534 if (Elements.isNativeOrExtendsNative(element)) return true; |
| 535 if (interceptedClasses.contains(element)) return true; | 535 if (interceptedClasses.contains(element)) return true; |
| 536 if (classesMixedIntoInterceptedClasses.contains(element)) return true; | 536 if (classesMixedIntoInterceptedClasses.contains(element)) return true; |
| 537 return false; | 537 return false; |
| 538 } | 538 } |
| 539 | 539 |
| 540 String registerOneShotInterceptor(Selector selector) { | 540 String registerOneShotInterceptor(Selector selector) { |
| 541 Set<ClassElement> classes = getInterceptedClassesOn(selector.name); | 541 Set<ClassElement> classes = getInterceptedClassesOn(selector.name); |
| 542 String name = namer.getOneShotInterceptorName(selector, classes); | 542 String name = namer.nameForOneShotInterceptor(selector, classes); |
|
floitsch
2015/02/04 00:10:11
This is not really accurate.
The `getOneShotInterc
asgerf
2015/02/06 12:15:17
Done.
| |
| 543 if (!oneShotInterceptors.containsKey(name)) { | 543 if (!oneShotInterceptors.containsKey(name)) { |
| 544 registerSpecializedGetInterceptor(classes); | 544 registerSpecializedGetInterceptor(classes); |
| 545 oneShotInterceptors[name] = selector; | 545 oneShotInterceptors[name] = selector; |
| 546 } | 546 } |
| 547 return name; | 547 return name; |
| 548 } | 548 } |
| 549 | 549 |
| 550 /** | 550 /** |
| 551 * Record that [method] is called from a subclass via `super`. | 551 * Record that [method] is called from a subclass via `super`. |
| 552 */ | 552 */ |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 731 } | 731 } |
| 732 enqueueClass(enqueuer, cls, registry); | 732 enqueueClass(enqueuer, cls, registry); |
| 733 } | 733 } |
| 734 | 734 |
| 735 Set<ClassElement> get interceptedClasses { | 735 Set<ClassElement> get interceptedClasses { |
| 736 assert(compiler.enqueuer.resolution.queueIsClosed); | 736 assert(compiler.enqueuer.resolution.queueIsClosed); |
| 737 return _interceptedClasses; | 737 return _interceptedClasses; |
| 738 } | 738 } |
| 739 | 739 |
| 740 void registerSpecializedGetInterceptor(Set<ClassElement> classes) { | 740 void registerSpecializedGetInterceptor(Set<ClassElement> classes) { |
| 741 String name = namer.getInterceptorName(getInterceptorMethod, classes); | 741 String name = namer.nameForGetInterceptor(classes); |
| 742 if (classes.contains(jsInterceptorClass)) { | 742 if (classes.contains(jsInterceptorClass)) { |
| 743 // We can't use a specialized [getInterceptorMethod], so we make | 743 // We can't use a specialized [getInterceptorMethod], so we make |
| 744 // sure we emit the one with all checks. | 744 // sure we emit the one with all checks. |
| 745 specializedGetInterceptors[name] = interceptedClasses; | 745 specializedGetInterceptors[name] = interceptedClasses; |
| 746 } else { | 746 } else { |
| 747 specializedGetInterceptors[name] = classes; | 747 specializedGetInterceptors[name] = classes; |
| 748 } | 748 } |
| 749 } | 749 } |
| 750 | 750 |
| 751 void registerCompileTimeConstant(ConstantValue constant, Registry registry) { | 751 void registerCompileTimeConstant(ConstantValue constant, Registry registry) { |
| (...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2527 } | 2527 } |
| 2528 } | 2528 } |
| 2529 | 2529 |
| 2530 /// Records that [constant] is used by the element behind [registry]. | 2530 /// Records that [constant] is used by the element behind [registry]. |
| 2531 class Dependency { | 2531 class Dependency { |
| 2532 final ConstantValue constant; | 2532 final ConstantValue constant; |
| 2533 final Element annotatedElement; | 2533 final Element annotatedElement; |
| 2534 | 2534 |
| 2535 const Dependency(this.constant, this.annotatedElement); | 2535 const Dependency(this.constant, this.annotatedElement); |
| 2536 } | 2536 } |
| OLD | NEW |