| 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 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 7 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 8 final Set<HInstruction> boundsChecked; | 8 final Set<HInstruction> boundsChecked; |
| 9 | 9 |
| 10 JavaScriptItemCompilationContext() | 10 JavaScriptItemCompilationContext() |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 ClassElement cls, Enqueuer enqueuer) { | 608 ClassElement cls, Enqueuer enqueuer) { |
| 609 if (enqueuer.isResolutionQueue) { | 609 if (enqueuer.isResolutionQueue) { |
| 610 cls.ensureResolved(compiler); | 610 cls.ensureResolved(compiler); |
| 611 cls.forEachMember((ClassElement classElement, Element member) { | 611 cls.forEachMember((ClassElement classElement, Element member) { |
| 612 if (member.isSynthesized) return; | 612 if (member.isSynthesized) return; |
| 613 // All methods on [Object] are shadowed by [Interceptor]. | 613 // All methods on [Object] are shadowed by [Interceptor]. |
| 614 if (classElement == compiler.objectClass) return; | 614 if (classElement == compiler.objectClass) return; |
| 615 Set<Element> set = interceptedElements.putIfAbsent( | 615 Set<Element> set = interceptedElements.putIfAbsent( |
| 616 member.name, () => new Set<Element>()); | 616 member.name, () => new Set<Element>()); |
| 617 set.add(member); | 617 set.add(member); |
| 618 if (classElement == jsInterceptorClass) return; |
| 619 if (classElement.isMixinApplication) { |
| 620 MixinApplicationElement mixinApplication = classElement; |
| 621 assert(member.getEnclosingClass() == mixinApplication.mixin); |
| 622 classesMixedIntoNativeClasses.add(mixinApplication.mixin); |
| 623 } |
| 618 }, | 624 }, |
| 619 includeSuperAndInjectedMembers: true); | 625 includeSuperAndInjectedMembers: true); |
| 620 | |
| 621 // Walk superclass chain to find mixins. | |
| 622 for (; cls != null; cls = cls.superclass) { | |
| 623 if (cls.isMixinApplication) { | |
| 624 MixinApplicationElement mixinApplication = cls; | |
| 625 classesMixedIntoNativeClasses.add(mixinApplication.mixin); | |
| 626 } | |
| 627 } | |
| 628 } | 626 } |
| 629 } | 627 } |
| 630 | 628 |
| 631 void addInterceptors(ClassElement cls, | 629 void addInterceptors(ClassElement cls, |
| 632 Enqueuer enqueuer, | 630 Enqueuer enqueuer, |
| 633 TreeElements elements) { | 631 TreeElements elements) { |
| 634 if (enqueuer.isResolutionQueue) { | 632 if (enqueuer.isResolutionQueue) { |
| 635 cls.ensureResolved(compiler); | 633 cls.ensureResolved(compiler); |
| 636 cls.forEachMember((ClassElement classElement, Element member) { | 634 cls.forEachMember((ClassElement classElement, Element member) { |
| 637 // All methods on [Object] are shadowed by [Interceptor]. | 635 // All methods on [Object] are shadowed by [Interceptor]. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 } | 748 } |
| 751 | 749 |
| 752 JavaScriptItemCompilationContext createItemCompilationContext() { | 750 JavaScriptItemCompilationContext createItemCompilationContext() { |
| 753 return new JavaScriptItemCompilationContext(); | 751 return new JavaScriptItemCompilationContext(); |
| 754 } | 752 } |
| 755 | 753 |
| 756 void enqueueHelpers(ResolutionEnqueuer world, TreeElements elements) { | 754 void enqueueHelpers(ResolutionEnqueuer world, TreeElements elements) { |
| 757 jsIndexingBehaviorInterface = | 755 jsIndexingBehaviorInterface = |
| 758 compiler.findHelper(const SourceString('JavaScriptIndexingBehavior')); | 756 compiler.findHelper(const SourceString('JavaScriptIndexingBehavior')); |
| 759 if (jsIndexingBehaviorInterface != null) { | 757 if (jsIndexingBehaviorInterface != null) { |
| 760 jsIndexingBehaviorInterface.ensureResolved(compiler); | |
| 761 world.registerIsCheck(jsIndexingBehaviorInterface.computeType(compiler), | 758 world.registerIsCheck(jsIndexingBehaviorInterface.computeType(compiler), |
| 762 elements); | 759 elements); |
| 763 enqueue( | 760 enqueue( |
| 764 world, | 761 world, |
| 765 compiler.findHelper(const SourceString('isJsIndexable')), | 762 compiler.findHelper(const SourceString('isJsIndexable')), |
| 766 elements); | 763 elements); |
| 767 enqueue( | 764 enqueue( |
| 768 world, | 765 world, |
| 769 compiler.findInterceptor(const SourceString('dispatchPropertyName')), | 766 compiler.findInterceptor(const SourceString('dispatchPropertyName')), |
| 770 elements); | 767 elements); |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1624 copy(constant.values); | 1621 copy(constant.values); |
| 1625 copy(constant.protoValue); | 1622 copy(constant.protoValue); |
| 1626 copy(constant); | 1623 copy(constant); |
| 1627 } | 1624 } |
| 1628 | 1625 |
| 1629 void visitConstructed(ConstructedConstant constant) { | 1626 void visitConstructed(ConstructedConstant constant) { |
| 1630 copy(constant.fields); | 1627 copy(constant.fields); |
| 1631 copy(constant); | 1628 copy(constant); |
| 1632 } | 1629 } |
| 1633 } | 1630 } |
| OLD | NEW |