| 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 class Interceptors { | 5 class Interceptors { |
| 6 Compiler compiler; | 6 Compiler compiler; |
| 7 Interceptors(Compiler this.compiler); | 7 Interceptors(Compiler this.compiler); |
| 8 | 8 |
| 9 SourceString mapOperatorToMethodName(Operator op) { | 9 SourceString mapOperatorToMethodName(Operator op) { |
| 10 String name = op.source.stringValue; | 10 String name = op.source.stringValue; |
| (...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1232 | 1232 |
| 1233 conditionBlock.addSuccessor(loopEntryBlock); // The back-edge. | 1233 conditionBlock.addSuccessor(loopEntryBlock); // The back-edge. |
| 1234 loopEntryBlock.postProcessLoopHeader(); | 1234 loopEntryBlock.postProcessLoopHeader(); |
| 1235 | 1235 |
| 1236 endLoop(loopEntryBlock, conditionBlock, jumpHandler, localsHandler); | 1236 endLoop(loopEntryBlock, conditionBlock, jumpHandler, localsHandler); |
| 1237 jumpHandler.close(); | 1237 jumpHandler.close(); |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 visitFunctionExpression(FunctionExpression node) { | 1240 visitFunctionExpression(FunctionExpression node) { |
| 1241 ClosureData nestedClosureData = closureDataCache[node]; | 1241 ClosureData nestedClosureData = closureDataCache[node]; |
| 1242 if (nestedClosureData === null) { |
| 1243 // TODO(floitsch): we can only assume that the reason for not having a |
| 1244 // closure data here is, because the function is inside an initializer. |
| 1245 compiler.unimplemented("Closures inside initializers", node: node); |
| 1246 } |
| 1242 assert(nestedClosureData !== null); | 1247 assert(nestedClosureData !== null); |
| 1243 assert(nestedClosureData.closureClassElement !== null); | 1248 assert(nestedClosureData.closureClassElement !== null); |
| 1244 ClassElement closureClassElement = | 1249 ClassElement closureClassElement = |
| 1245 nestedClosureData.closureClassElement; | 1250 nestedClosureData.closureClassElement; |
| 1246 FunctionElement callElement = nestedClosureData.callElement; | 1251 FunctionElement callElement = nestedClosureData.callElement; |
| 1247 compiler.enqueue(new WorkItem.toCodegen(callElement, elements)); | 1252 compiler.enqueue(new WorkItem.toCodegen(callElement, elements)); |
| 1248 compiler.registerInstantiatedClass(closureClassElement); | 1253 compiler.registerInstantiatedClass(closureClassElement); |
| 1249 assert(closureClassElement.members.isEmpty()); | 1254 assert(closureClassElement.members.isEmpty()); |
| 1250 | 1255 |
| 1251 List<HInstruction> capturedVariables = <HInstruction>[]; | 1256 List<HInstruction> capturedVariables = <HInstruction>[]; |
| (...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2805 HInstruction concat = new HAdd(target, left, right); | 2810 HInstruction concat = new HAdd(target, left, right); |
| 2806 builder.add(concat); | 2811 builder.add(concat); |
| 2807 return concat; | 2812 return concat; |
| 2808 } | 2813 } |
| 2809 | 2814 |
| 2810 HInstruction result() { | 2815 HInstruction result() { |
| 2811 flushAccumulator(); | 2816 flushAccumulator(); |
| 2812 return prefix; | 2817 return prefix; |
| 2813 } | 2818 } |
| 2814 } | 2819 } |
| OLD | NEW |