| 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 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 conditionBlock = close(new HLoopBranch(popBoolified(), | 1147 conditionBlock = close(new HLoopBranch(popBoolified(), |
| 1148 HLoopBranch.DO_WHILE_LOOP)); | 1148 HLoopBranch.DO_WHILE_LOOP)); |
| 1149 | 1149 |
| 1150 conditionBlock.addSuccessor(loopEntryBlock); // The back-edge. | 1150 conditionBlock.addSuccessor(loopEntryBlock); // The back-edge. |
| 1151 loopEntryBlock.postProcessLoopHeader(); | 1151 loopEntryBlock.postProcessLoopHeader(); |
| 1152 | 1152 |
| 1153 endLoop(loopEntryBlock, conditionBlock, breakHandler); | 1153 endLoop(loopEntryBlock, conditionBlock, breakHandler); |
| 1154 } | 1154 } |
| 1155 | 1155 |
| 1156 visitFunctionExpression(FunctionExpression node) { | 1156 visitFunctionExpression(FunctionExpression node) { |
| 1157 ClosureData nestedClosureData = closureDataCache[node]; | 1157 ClosureData nestedClosureData = compiler.closureDataCache[node]; |
| 1158 assert(nestedClosureData !== null); | 1158 assert(nestedClosureData !== null); |
| 1159 assert(nestedClosureData.closureClassElement !== null); | 1159 assert(nestedClosureData.closureClassElement !== null); |
| 1160 ClassElement closureClassElement = | 1160 ClassElement closureClassElement = |
| 1161 nestedClosureData.closureClassElement; | 1161 nestedClosureData.closureClassElement; |
| 1162 FunctionElement callElement = nestedClosureData.callElement; | 1162 FunctionElement callElement = nestedClosureData.callElement; |
| 1163 compiler.enqueue(new WorkItem.toCodegen(callElement, elements)); | 1163 compiler.enqueue(new WorkItem.toCodegen(callElement, elements)); |
| 1164 compiler.registerInstantiatedClass(closureClassElement); | 1164 compiler.registerInstantiatedClass(closureClassElement); |
| 1165 assert(closureClassElement.members.isEmpty()); | 1165 assert(closureClassElement.members.isEmpty()); |
| 1166 | 1166 |
| 1167 List<HInstruction> capturedVariables = <HInstruction>[]; | 1167 List<HInstruction> capturedVariables = <HInstruction>[]; |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2480 // Normally, we would call [close] here. However, then we hit | 2480 // Normally, we would call [close] here. However, then we hit |
| 2481 // another unimplemented feature: aborting loop body. Simply | 2481 // another unimplemented feature: aborting loop body. Simply |
| 2482 // calling [add] does not work as it asserts that the instruction | 2482 // calling [add] does not work as it asserts that the instruction |
| 2483 // isn't a control flow instruction. So we inline parts of [add]. | 2483 // isn't a control flow instruction. So we inline parts of [add]. |
| 2484 current.addAfter(current.last, new HThrow(message)); | 2484 current.addAfter(current.last, new HThrow(message)); |
| 2485 if (isExpression) { | 2485 if (isExpression) { |
| 2486 stack.add(graph.addConstantNull()); | 2486 stack.add(graph.addConstantNull()); |
| 2487 } | 2487 } |
| 2488 } | 2488 } |
| 2489 } | 2489 } |
| OLD | NEW |