| 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 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 | 1387 |
| 1388 endLoop(conditionBlock, conditionExitBlock, jumpHandler, savedLocals); | 1388 endLoop(conditionBlock, conditionExitBlock, jumpHandler, savedLocals); |
| 1389 HLoopBlockInformation info = | 1389 HLoopBlockInformation info = |
| 1390 new HLoopBlockInformation( | 1390 new HLoopBlockInformation( |
| 1391 HLoopBlockInformation.loopType(loop), | 1391 HLoopBlockInformation.loopType(loop), |
| 1392 wrapExpressionGraph(initializerGraph), | 1392 wrapExpressionGraph(initializerGraph), |
| 1393 wrapExpressionGraph(conditionExpression), | 1393 wrapExpressionGraph(conditionExpression), |
| 1394 wrapStatementGraph(bodyGraph), | 1394 wrapStatementGraph(bodyGraph), |
| 1395 wrapExpressionGraph(updateGraph), | 1395 wrapExpressionGraph(updateGraph), |
| 1396 conditionBlock.loopInformation.target, | 1396 conditionBlock.loopInformation.target, |
| 1397 conditionBlock.loopInformation.labels); | 1397 conditionBlock.loopInformation.labels, |
| 1398 loop); |
| 1398 | 1399 |
| 1399 startBlock.setBlockFlow(info, current); | 1400 startBlock.setBlockFlow(info, current); |
| 1400 loopInfo.loopBlockInformation = info; | 1401 loopInfo.loopBlockInformation = info; |
| 1401 } | 1402 } |
| 1402 | 1403 |
| 1403 visitFor(For node) { | 1404 visitFor(For node) { |
| 1404 assert(node.body !== null); | 1405 assert(node.body !== null); |
| 1405 void buildInitializer() { | 1406 void buildInitializer() { |
| 1406 if (node.initializer === null) return; | 1407 if (node.initializer === null) return; |
| 1407 Node initializer = node.initializer; | 1408 Node initializer = node.initializer; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1514 SubGraph bodyGraph = new SubGraph(bodyEntryBlock, bodyExitBlock); | 1515 SubGraph bodyGraph = new SubGraph(bodyEntryBlock, bodyExitBlock); |
| 1515 | 1516 |
| 1516 HLoopBlockInformation loopBlockInfo = | 1517 HLoopBlockInformation loopBlockInfo = |
| 1517 new HLoopBlockInformation( | 1518 new HLoopBlockInformation( |
| 1518 HLoopBlockInformation.DO_WHILE_LOOP, | 1519 HLoopBlockInformation.DO_WHILE_LOOP, |
| 1519 null, | 1520 null, |
| 1520 wrapExpressionGraph(conditionExpression), | 1521 wrapExpressionGraph(conditionExpression), |
| 1521 wrapStatementGraph(bodyGraph), | 1522 wrapStatementGraph(bodyGraph), |
| 1522 null, | 1523 null, |
| 1523 loopEntryBlock.loopInformation.target, | 1524 loopEntryBlock.loopInformation.target, |
| 1524 loopEntryBlock.loopInformation.labels); | 1525 loopEntryBlock.loopInformation.labels, |
| 1526 node); |
| 1525 loopEntryBlock.setBlockFlow(loopBlockInfo, current); | 1527 loopEntryBlock.setBlockFlow(loopBlockInfo, current); |
| 1526 loopInfo.loopBlockInformation = loopBlockInfo; | 1528 loopInfo.loopBlockInformation = loopBlockInfo; |
| 1527 } | 1529 } |
| 1528 | 1530 |
| 1529 visitFunctionExpression(FunctionExpression node) { | 1531 visitFunctionExpression(FunctionExpression node) { |
| 1530 ClosureData nestedClosureData = builder.closureDataCache[node]; | 1532 ClosureData nestedClosureData = builder.closureDataCache[node]; |
| 1531 if (nestedClosureData === null) { | 1533 if (nestedClosureData === null) { |
| 1532 // TODO(floitsch): we can only assume that the reason for not having a | 1534 // TODO(floitsch): we can only assume that the reason for not having a |
| 1533 // closure data here is, because the function is inside an initializer. | 1535 // closure data here is, because the function is inside an initializer. |
| 1534 compiler.unimplemented("Closures inside initializers", node: node); | 1536 compiler.unimplemented("Closures inside initializers", node: node); |
| (...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3583 new HSubGraphBlockInformation(elseBranch.graph)); | 3585 new HSubGraphBlockInformation(elseBranch.graph)); |
| 3584 | 3586 |
| 3585 HBasicBlock conditionStartBlock = conditionBranch.block; | 3587 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 3586 conditionStartBlock.setBlockFlow(info, joinBlock); | 3588 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 3587 SubGraph conditionGraph = conditionBranch.graph; | 3589 SubGraph conditionGraph = conditionBranch.graph; |
| 3588 HIf branch = conditionGraph.end.last; | 3590 HIf branch = conditionGraph.end.last; |
| 3589 assert(branch is HIf); | 3591 assert(branch is HIf); |
| 3590 branch.blockInformation = conditionStartBlock.blockFlow; | 3592 branch.blockInformation = conditionStartBlock.blockFlow; |
| 3591 } | 3593 } |
| 3592 } | 3594 } |
| OLD | NEW |