| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 buffer.add(' return this.${namer.getName(member)}($arguments)'); | 161 buffer.add(' return this.${namer.getName(member)}($arguments)'); |
| 162 } | 162 } |
| 163 buffer.add('\n};\n'); | 163 buffer.add('\n};\n'); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void addParameterStubs(FunctionElement member, | 166 void addParameterStubs(FunctionElement member, |
| 167 String attachTo(String invocationName), | 167 String attachTo(String invocationName), |
| 168 StringBuffer buffer) { | 168 StringBuffer buffer) { |
| 169 Set<Selector> selectors = compiler.universe.invokedNames[member.name]; | 169 Set<Selector> selectors = compiler.universe.invokedNames[member.name]; |
| 170 if (selectors == null) return; | 170 if (selectors == null) return; |
| 171 FunctionParameters parameters = member.computeParameters(compiler); | |
| 172 for (Selector selector in selectors) { | 171 for (Selector selector in selectors) { |
| 173 if (!selector.applies(parameters)) continue; | 172 if (!selector.applies(member, compiler)) continue; |
| 174 addParameterStub(member, attachTo, buffer, selector); | 173 addParameterStub(member, attachTo, buffer, selector); |
| 175 } | 174 } |
| 176 } | 175 } |
| 177 | 176 |
| 178 void addInstanceMember(Element member, | 177 void addInstanceMember(Element member, |
| 179 String attachTo(String name), | 178 String attachTo(String name), |
| 180 StringBuffer buffer) { | 179 StringBuffer buffer) { |
| 181 // TODO(floitsch): we don't need to deal with members of | 180 // TODO(floitsch): we don't need to deal with members of |
| 182 // uninstantiated classes, that have been overwritten by subclasses. | 181 // uninstantiated classes, that have been overwritten by subclasses. |
| 183 | 182 |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 mainBuffer.add( | 733 mainBuffer.add( |
| 735 'var ${namer.CURRENT_ISOLATE} = new ${namer.ISOLATE}();\n'); | 734 'var ${namer.CURRENT_ISOLATE} = new ${namer.ISOLATE}();\n'); |
| 736 nativeEmitter.emitDynamicDispatchMetadata(); | 735 nativeEmitter.emitDynamicDispatchMetadata(); |
| 737 nativeEmitter.assembleCode(mainBuffer); | 736 nativeEmitter.assembleCode(mainBuffer); |
| 738 emitMain(mainBuffer); | 737 emitMain(mainBuffer); |
| 739 compiler.assembledCode = mainBuffer.toString(); | 738 compiler.assembledCode = mainBuffer.toString(); |
| 740 }); | 739 }); |
| 741 return compiler.assembledCode; | 740 return compiler.assembledCode; |
| 742 } | 741 } |
| 743 } | 742 } |
| OLD | NEW |