| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 if (instruction.hasElse) { | 199 if (instruction.hasElse) { |
| 200 environment = elseEnvironment; | 200 environment = elseEnvironment; |
| 201 visitSubGraph(info.elseGraph); | 201 visitSubGraph(info.elseGraph); |
| 202 elseEnvironment = environment; | 202 elseEnvironment = environment; |
| 203 } | 203 } |
| 204 | 204 |
| 205 environment = thenEnvironment; | 205 environment = thenEnvironment; |
| 206 visitSubGraph(info.thenGraph); | 206 visitSubGraph(info.thenGraph); |
| 207 environment.addAll(elseEnvironment); | 207 environment.addAll(elseEnvironment); |
| 208 visitInstruction(instruction); |
| 208 } | 209 } |
| 209 | 210 |
| 210 void visitGoto(HGoto goto) { | 211 void visitGoto(HGoto goto) { |
| 211 HBasicBlock block = goto.block; | 212 HBasicBlock block = goto.block; |
| 212 if (block.successors[0].dominator != block) return; | 213 if (block.successors[0].dominator != block) return; |
| 213 visitBasicBlock(block.successors[0]); | 214 visitBasicBlock(block.successors[0]); |
| 214 } | 215 } |
| 215 | 216 |
| 216 void visitBreak(HBreak breakInstruction) { | 217 void visitBreak(HBreak breakInstruction) { |
| 217 compiler.unimplemented("SsaEnvironmentBuilder.visitBreak"); | 218 compiler.unimplemented("SsaEnvironmentBuilder.visitBreak"); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 245 environment.addLoopMarker(header); | 246 environment.addLoopMarker(header); |
| 246 | 247 |
| 247 if (!branch.isDoWhile()) { | 248 if (!branch.isDoWhile()) { |
| 248 assert(block.successors[0] == block.dominatedBlocks[0]); | 249 assert(block.successors[0] == block.dominatedBlocks[0]); |
| 249 visitBasicBlock(block.successors[0]); | 250 visitBasicBlock(block.successors[0]); |
| 250 } | 251 } |
| 251 | 252 |
| 252 // We merge the environment required by the code after the loop, | 253 // We merge the environment required by the code after the loop, |
| 253 // and the code inside the loop. | 254 // and the code inside the loop. |
| 254 environment.addAll(joinEnvironment); | 255 environment.addAll(joinEnvironment); |
| 256 visitInstruction(branch); |
| 255 } | 257 } |
| 256 | 258 |
| 257 // Deal with all kinds of control flow instructions. In case we add | 259 // Deal with all kinds of control flow instructions. In case we add |
| 258 // a new one, we will hit an internal error. | 260 // a new one, we will hit an internal error. |
| 259 void visitExit(HExit exit) {} | 261 void visitExit(HExit exit) {} |
| 260 | 262 |
| 261 void visitReturn(HReturn instruction) { | 263 void visitReturn(HReturn instruction) { |
| 262 environment.clear(); | 264 environment.clear(); |
| 263 visitInstruction(instruction); | 265 visitInstruction(instruction); |
| 264 } | 266 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 compiler.internalError('Control flow instructions already dealt with.', | 359 compiler.internalError('Control flow instructions already dealt with.', |
| 358 instruction: instruction); | 360 instruction: instruction); |
| 359 } | 361 } |
| 360 | 362 |
| 361 visitTypeGuard(HTypeGuard guard) { | 363 visitTypeGuard(HTypeGuard guard) { |
| 362 blocks.forEach((HBasicBlock block) { | 364 blocks.forEach((HBasicBlock block) { |
| 363 block.guards.add(guard); | 365 block.guards.add(guard); |
| 364 }); | 366 }); |
| 365 } | 367 } |
| 366 } | 368 } |
| OLD | NEW |