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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 if (!oneShotInterceptors.containsKey(name)) { | 550 if (!oneShotInterceptors.containsKey(name)) { |
| 551 registerSpecializedGetInterceptor(classes); | 551 registerSpecializedGetInterceptor(classes); |
| 552 oneShotInterceptors[name] = selector; | 552 oneShotInterceptors[name] = selector; |
| 553 } | 553 } |
| 554 return name; | 554 return name; |
| 555 } | 555 } |
| 556 | 556 |
| 557 /** | 557 /** |
| 558 * Record that [method] is called from a subclass via `super`. | 558 * Record that [method] is called from a subclass via `super`. |
| 559 */ | 559 */ |
| 560 void registerAliasedSuperMember(FunctionElement method) { | 560 bool registerAliasedSuperMember(Element member, Selector selector) { |
|
herhut
2014/11/27 09:13:26
I think we usually use something like
maybeRegist
ahe
2014/12/01 09:58:13
Done.
| |
| 561 aliasedSuperMembers.add(method); | 561 if (selector.isGetter || compiler.hasIncrementalSupport) { |
| 562 // Invoking a super getter isn't supported, this would require changes to | |
| 563 // compact field descriptors in the emitter. | |
| 564 // We also turn off this optimization in incremental compilation, to | |
| 565 // avoid having to regenerate a method just because someone started | |
| 566 // calling it through super. | |
| 567 return false; | |
| 568 } | |
| 569 aliasedSuperMembers.add(member); | |
| 570 return true; | |
| 562 } | 571 } |
| 563 | 572 |
| 564 /** | 573 /** |
| 565 * Returns `true` if [member] is called from a subclass via `super`. | 574 * Returns `true` if [member] is called from a subclass via `super`. |
| 566 */ | 575 */ |
| 567 bool isAliasedSuperMember(FunctionElement member) { | 576 bool isAliasedSuperMember(FunctionElement member) { |
| 568 return aliasedSuperMembers.contains(member); | 577 return aliasedSuperMembers.contains(member); |
| 569 } | 578 } |
| 570 | 579 |
| 571 bool isInterceptedMethod(Element element) { | 580 bool isInterceptedMethod(Element element) { |
| (...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2488 } | 2497 } |
| 2489 } | 2498 } |
| 2490 | 2499 |
| 2491 /// Records that [constant] is used by the element behind [registry]. | 2500 /// Records that [constant] is used by the element behind [registry]. |
| 2492 class Dependency { | 2501 class Dependency { |
| 2493 final ConstantValue constant; | 2502 final ConstantValue constant; |
| 2494 final Element annotatedElement; | 2503 final Element annotatedElement; |
| 2495 | 2504 |
| 2496 const Dependency(this.constant, this.annotatedElement); | 2505 const Dependency(this.constant, this.annotatedElement); |
| 2497 } | 2506 } |
| OLD | NEW |