| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 | 7 |
| 8 class OldEmitter implements Emitter { | 8 class OldEmitter implements Emitter { |
| 9 final Compiler compiler; | 9 final Compiler compiler; |
| 10 final CodeEmitterTask task; | 10 final CodeEmitterTask task; |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 enclosingBuilder.properties.addAll(cachedBuilder.properties); | 733 enclosingBuilder.properties.addAll(cachedBuilder.properties); |
| 734 } else { | 734 } else { |
| 735 classEmitter.emitClass( | 735 classEmitter.emitClass( |
| 736 cls, enclosingBuilder, additionalProperties[cls]); | 736 cls, enclosingBuilder, additionalProperties[cls]); |
| 737 } | 737 } |
| 738 }); | 738 }); |
| 739 } | 739 } |
| 740 | 740 |
| 741 void emitStaticFunctions(Iterable<Method> staticFunctions) { | 741 void emitStaticFunctions(Iterable<Method> staticFunctions) { |
| 742 if (staticFunctions == null) return; | 742 if (staticFunctions == null) return; |
| 743 // We need to filter out null-elements for the interceptors. | |
| 744 Iterable<Element> elements = staticFunctions | |
| 745 .where((Method method) => method.element != null) | |
| 746 .map((Method method) => method.element); | |
| 747 | 743 |
| 748 for (Element element in elements) { | 744 for (Method method in staticFunctions) { |
| 745 Element element = method.element; |
| 746 // We need to filter out null-elements for the interceptors. |
| 747 // TODO(floitsch): use the precomputed interceptors here. |
| 748 if (element == null) continue; |
| 749 ClassBuilder builder = new ClassBuilder(element, namer); | 749 ClassBuilder builder = new ClassBuilder(element, namer); |
| 750 containerBuilder.addMember(element, builder); | 750 containerBuilder.addMemberMethod(method, builder); |
| 751 getElementDescriptor(element).properties.addAll(builder.properties); | 751 getElementDescriptor(element).properties.addAll(builder.properties); |
| 752 } | 752 } |
| 753 } | 753 } |
| 754 | 754 |
| 755 void emitStaticNonFinalFieldInitializations(CodeOutput output, | 755 void emitStaticNonFinalFieldInitializations(CodeOutput output, |
| 756 OutputUnit outputUnit) { | 756 OutputUnit outputUnit) { |
| 757 void emitInitialization(Element element, jsAst.Expression initialValue) { | 757 void emitInitialization(Element element, jsAst.Expression initialValue) { |
| 758 jsAst.Expression init = | 758 jsAst.Expression init = |
| 759 js('$isolateProperties.# = #', | 759 js('$isolateProperties.# = #', |
| 760 [namer.getNameOfGlobalField(element), initialValue]); | 760 [namer.getNameOfGlobalField(element), initialValue]); |
| (...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2099 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2099 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 2100 if (element.isInstanceMember) { | 2100 if (element.isInstanceMember) { |
| 2101 cachedClassBuilders.remove(element.enclosingClass); | 2101 cachedClassBuilders.remove(element.enclosingClass); |
| 2102 | 2102 |
| 2103 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2103 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 2104 | 2104 |
| 2105 } | 2105 } |
| 2106 } | 2106 } |
| 2107 } | 2107 } |
| 2108 } | 2108 } |
| OLD | NEW |