| 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 /** | 5 /** |
| 6 * A function element that represents a closure call. The signature is copied | 6 * A function element that represents a closure call. The signature is copied |
| 7 * from the given element. | 7 * from the given element. |
| 8 */ | 8 */ |
| 9 class ClosureInvocationElement extends FunctionElement { | 9 class ClosureInvocationElement extends FunctionElement { |
| 10 ClosureInvocationElement(SourceString name, | 10 ClosureInvocationElement(SourceString name, |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 }; | 770 }; |
| 771 '''); | 771 '''); |
| 772 } | 772 } |
| 773 | 773 |
| 774 void emitExtraAccessors(Element member, | 774 void emitExtraAccessors(Element member, |
| 775 void defineInstanceMember(String invocationName, | 775 void defineInstanceMember(String invocationName, |
| 776 String definition)) { | 776 String definition)) { |
| 777 if (member.kind == ElementKind.GETTER || member.kind == ElementKind.FIELD) { | 777 if (member.kind == ElementKind.GETTER || member.kind == ElementKind.FIELD) { |
| 778 Set<Selector> selectors = compiler.universe.invokedNames[member.name]; | 778 Set<Selector> selectors = compiler.universe.invokedNames[member.name]; |
| 779 if (selectors !== null && !selectors.isEmpty()) { | 779 if (selectors !== null && !selectors.isEmpty()) { |
| 780 compiler.emitter.emitCallStubForGetter(member, selectors, | 780 compiler.backend.emitter.emitCallStubForGetter( |
| 781 defineInstanceMember); | 781 member, selectors, defineInstanceMember); |
| 782 } | 782 } |
| 783 } else if (member.kind == ElementKind.FUNCTION) { | 783 } else if (member.kind == ElementKind.FUNCTION) { |
| 784 if (compiler.universe.hasGetter(member, compiler)) { | 784 if (compiler.universe.hasGetter(member, compiler)) { |
| 785 compiler.emitter.emitDynamicFunctionGetter(member, | 785 compiler.backend.emitter.emitDynamicFunctionGetter( |
| 786 defineInstanceMember); | 786 member, defineInstanceMember); |
| 787 } | 787 } |
| 788 } | 788 } |
| 789 } | 789 } |
| 790 | 790 |
| 791 void emitNoSuchMethodCalls(void defineInstanceMember(String invocationName, | 791 void emitNoSuchMethodCalls(void defineInstanceMember(String invocationName, |
| 792 String definition)) { | 792 String definition)) { |
| 793 // Do not generate no such method calls if there is no class. | 793 // Do not generate no such method calls if there is no class. |
| 794 if (compiler.universe.instantiatedClasses.isEmpty()) return; | 794 if (compiler.universe.instantiatedClasses.isEmpty()) return; |
| 795 | 795 |
| 796 ClassElement objectClass = | 796 ClassElement objectClass = |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 mainBuffer.add('function init() {\n'); | 980 mainBuffer.add('function init() {\n'); |
| 981 mainBuffer.add(' $isolateProperties = {};\n'); | 981 mainBuffer.add(' $isolateProperties = {};\n'); |
| 982 addDefineClassAndFinishClassFunctionsIfNecessary(mainBuffer); | 982 addDefineClassAndFinishClassFunctionsIfNecessary(mainBuffer); |
| 983 emitFinishIsolateConstructor(mainBuffer); | 983 emitFinishIsolateConstructor(mainBuffer); |
| 984 mainBuffer.add('}\n'); | 984 mainBuffer.add('}\n'); |
| 985 compiler.assembledCode = mainBuffer.toString(); | 985 compiler.assembledCode = mainBuffer.toString(); |
| 986 }); | 986 }); |
| 987 return compiler.assembledCode; | 987 return compiler.assembledCode; |
| 988 } | 988 } |
| 989 } | 989 } |
| OLD | NEW |