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 part of ssa; | 5 part of ssa; |
6 | 6 |
7 class Interceptors { | 7 class Interceptors { |
8 Compiler compiler; | 8 Compiler compiler; |
9 Interceptors(Compiler this.compiler); | 9 Interceptors(Compiler this.compiler); |
10 | 10 |
(...skipping 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2257 HInstruction generateInstanceSendReceiver(Send send) { | 2257 HInstruction generateInstanceSendReceiver(Send send) { |
2258 assert(Elements.isInstanceSend(send, elements)); | 2258 assert(Elements.isInstanceSend(send, elements)); |
2259 if (send.receiver == null) { | 2259 if (send.receiver == null) { |
2260 return localsHandler.readThis(); | 2260 return localsHandler.readThis(); |
2261 } | 2261 } |
2262 visit(send.receiver); | 2262 visit(send.receiver); |
2263 return pop(); | 2263 return pop(); |
2264 } | 2264 } |
2265 | 2265 |
2266 String getTargetName(ErroneousElement error, [String prefix]) { | 2266 String getTargetName(ErroneousElement error, [String prefix]) { |
2267 String result = error.targetName.slowToString(); | 2267 String result = error.name.slowToString(); |
2268 if (?prefix) { | 2268 if (?prefix) { |
2269 result = '$prefix $result'; | 2269 result = '$prefix $result'; |
2270 } | 2270 } |
2271 return result; | 2271 return result; |
2272 } | 2272 } |
2273 | 2273 |
2274 void generateInstanceGetterWithCompiledReceiver(Send send, | 2274 void generateInstanceGetterWithCompiledReceiver(Send send, |
2275 HInstruction receiver) { | 2275 HInstruction receiver) { |
2276 assert(Elements.isInstanceSend(send, elements)); | 2276 assert(Elements.isInstanceSend(send, elements)); |
2277 // TODO(kasperl): This is a convoluted way of checking if we're | 2277 // TODO(kasperl): This is a convoluted way of checking if we're |
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4338 // successor. | 4338 // successor. |
4339 if (endCatchBlock != null) { | 4339 if (endCatchBlock != null) { |
4340 endCatchBlock.addSuccessor( | 4340 endCatchBlock.addSuccessor( |
4341 startFinallyBlock != null ? startFinallyBlock : exitBlock); | 4341 startFinallyBlock != null ? startFinallyBlock : exitBlock); |
4342 } | 4342 } |
4343 | 4343 |
4344 // The finally block has the exit block as successor. | 4344 // The finally block has the exit block as successor. |
4345 if (endFinallyBlock != null) { | 4345 if (endFinallyBlock != null) { |
4346 endFinallyBlock.addSuccessor(exitBlock); | 4346 endFinallyBlock.addSuccessor(exitBlock); |
4347 } | 4347 } |
4348 | 4348 |
4349 // If a block inside try/catch aborts (eg with a return statement), | 4349 // If a block inside try/catch aborts (eg with a return statement), |
4350 // we explicitely mark this block a predecessor of the catch | 4350 // we explicitely mark this block a predecessor of the catch |
4351 // block and the finally block. | 4351 // block and the finally block. |
4352 addExitTrySuccessor(startCatchBlock); | 4352 addExitTrySuccessor(startCatchBlock); |
4353 addExitTrySuccessor(startFinallyBlock); | 4353 addExitTrySuccessor(startFinallyBlock); |
4354 | 4354 |
4355 // Use the locals handler not altered by the catch and finally | 4355 // Use the locals handler not altered by the catch and finally |
4356 // blocks. | 4356 // blocks. |
4357 localsHandler = savedLocals; | 4357 localsHandler = savedLocals; |
4358 open(exitBlock); | 4358 open(exitBlock); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4771 new HSubGraphBlockInformation(elseBranch.graph)); | 4771 new HSubGraphBlockInformation(elseBranch.graph)); |
4772 | 4772 |
4773 HBasicBlock conditionStartBlock = conditionBranch.block; | 4773 HBasicBlock conditionStartBlock = conditionBranch.block; |
4774 conditionStartBlock.setBlockFlow(info, joinBlock); | 4774 conditionStartBlock.setBlockFlow(info, joinBlock); |
4775 SubGraph conditionGraph = conditionBranch.graph; | 4775 SubGraph conditionGraph = conditionBranch.graph; |
4776 HIf branch = conditionGraph.end.last; | 4776 HIf branch = conditionGraph.end.last; |
4777 assert(branch is HIf); | 4777 assert(branch is HIf); |
4778 branch.blockInformation = conditionStartBlock.blockFlow; | 4778 branch.blockInformation = conditionStartBlock.blockFlow; |
4779 } | 4779 } |
4780 } | 4780 } |
OLD | NEW |