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 BailoutInfo { | 5 class BailoutInfo { |
6 int instructionId; | 6 int instructionId; |
7 int bailoutId; | 7 int bailoutId; |
8 BailoutInfo(this.instructionId, this.bailoutId); | 8 BailoutInfo(this.instructionId, this.bailoutId); |
9 } | 9 } |
10 | 10 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 environment.add(phi.inputs[i]); | 186 environment.add(phi.inputs[i]); |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 if (!branch.isDoWhile()) { | 190 if (!branch.isDoWhile()) { |
191 assert(block.successors[0] == block.dominatedBlocks[0]); | 191 assert(block.successors[0] == block.dominatedBlocks[0]); |
192 visitBasicBlock(block.successors[0]); | 192 visitBasicBlock(block.successors[0]); |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 void visitTry(HTry node) { | |
197 List<HBasicBlock> successors = node.block.successors; | |
198 for (int i = 0; i < successors.length; i++) { | |
199 visitBasicBlock(successors[i]); | |
ngeoffray
2012/02/08 07:56:03
I know this is wrong. I plan on adding test cases
ngeoffray
2012/02/08 09:52:23
After discussions, decided to not do any speculati
| |
200 } | |
201 } | |
202 | |
196 // Deal with all kinds of control flow instructions. In case we add | 203 // Deal with all kinds of control flow instructions. In case we add |
197 // a new one, we will hit an internal error. | 204 // a new one, we will hit an internal error. |
198 void visitExit(HExit exit) {} | 205 void visitExit(HExit exit) {} |
199 void visitReturn(HReturn instruction) {} | 206 void visitReturn(HReturn instruction) {} |
200 void visitThrow(HThrow instruction) {} | 207 void visitThrow(HThrow instruction) {} |
201 | 208 |
202 void visitControlFlow(HControlFlow instruction) { | 209 void visitControlFlow(HControlFlow instruction) { |
203 compiler.internalError('Control flow instructions already dealt with.', | 210 compiler.internalError('Control flow instructions already dealt with.', |
204 instruction: instruction); | 211 instruction: instruction); |
205 } | 212 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 void visitLoopBranch(HLoopBranch branch) { | 326 void visitLoopBranch(HLoopBranch branch) { |
320 HBasicBlock branchBlock = branch.block; | 327 HBasicBlock branchBlock = branch.block; |
321 if (!branch.isDoWhile()) { | 328 if (!branch.isDoWhile()) { |
322 // Not a do while loop. We visit the body of the loop. | 329 // Not a do while loop. We visit the body of the loop. |
323 visitBasicBlock(branchBlock.dominatedBlocks[0]); | 330 visitBasicBlock(branchBlock.dominatedBlocks[0]); |
324 } | 331 } |
325 blocks.removeLast(); | 332 blocks.removeLast(); |
326 visitBasicBlock(branchBlock.successors[1]); | 333 visitBasicBlock(branchBlock.successors[1]); |
327 } | 334 } |
328 | 335 |
336 void visitTry(HTry node) { | |
337 List<HBasicBlock> successors = node.block.successors; | |
338 for (int i = 0; i < successors.length; i++) { | |
339 visitBasicBlock(successors[i]); | |
340 } | |
ngeoffray
2012/02/08 07:56:03
ditto.
| |
341 } | |
342 | |
329 // Deal with all kinds of control flow instructions. In case we add | 343 // Deal with all kinds of control flow instructions. In case we add |
330 // a new one, we will hit an internal error. | 344 // a new one, we will hit an internal error. |
331 void visitExit(HExit exit) {} | 345 void visitExit(HExit exit) {} |
332 void visitReturn(HReturn instruction) {} | 346 void visitReturn(HReturn instruction) {} |
333 void visitThrow(HThrow instruction) {} | 347 void visitThrow(HThrow instruction) {} |
334 | 348 |
335 void visitControlFlow(HControlFlow instruction) { | 349 void visitControlFlow(HControlFlow instruction) { |
336 compiler.internalError('Control flow instructions already dealt with.', | 350 compiler.internalError('Control flow instructions already dealt with.', |
337 instruction: instruction); | 351 instruction: instruction); |
338 } | 352 } |
339 | 353 |
340 visitBailoutTarget(HBailoutTarget target) { | 354 visitBailoutTarget(HBailoutTarget target) { |
341 blocks.forEach((HBasicBlock block) { | 355 blocks.forEach((HBasicBlock block) { |
342 block.bailouts.add(target); | 356 block.bailouts.add(target); |
343 }); | 357 }); |
344 } | 358 } |
345 } | 359 } |
OLD | NEW |