| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast-numbering.h" | 10 #include "src/ast-numbering.h" |
| (...skipping 5388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5399 break_info.break_block()); | 5399 break_info.break_block()); |
| 5400 | 5400 |
| 5401 set_current_block(loop_exit); | 5401 set_current_block(loop_exit); |
| 5402 } | 5402 } |
| 5403 | 5403 |
| 5404 | 5404 |
| 5405 void HOptimizedGraphBuilder::VisitForOfStatement(ForOfStatement* stmt) { | 5405 void HOptimizedGraphBuilder::VisitForOfStatement(ForOfStatement* stmt) { |
| 5406 DCHECK(!HasStackOverflow()); | 5406 DCHECK(!HasStackOverflow()); |
| 5407 DCHECK(current_block() != NULL); | 5407 DCHECK(current_block() != NULL); |
| 5408 DCHECK(current_block()->HasPredecessor()); | 5408 DCHECK(current_block()->HasPredecessor()); |
| 5409 return Bailout(kForOfStatement); | 5409 CHECK_ALIVE(VisitForEffect(stmt->assign_iterator())); |
| 5410 DCHECK(current_block() != NULL); |
| 5411 HBasicBlock* loop_entry = BuildLoopEntry(stmt); |
| 5412 |
| 5413 HBasicBlock* body_entry = graph()->CreateBasicBlock(); |
| 5414 HBasicBlock* loop_successor = graph()->CreateBasicBlock(); |
| 5415 CHECK_BAILOUT(VisitForEffect(stmt->next_result())); |
| 5416 CHECK_BAILOUT( |
| 5417 VisitForControl(stmt->result_done(), loop_successor, body_entry)); |
| 5418 if (body_entry->HasPredecessor()) { |
| 5419 body_entry->SetJoinId(stmt->BackEdgeId()); |
| 5420 set_current_block(body_entry); |
| 5421 } |
| 5422 if (loop_successor->HasPredecessor()) { |
| 5423 loop_successor->SetJoinId(stmt->ExitId()); |
| 5424 } else { |
| 5425 loop_successor = NULL; |
| 5426 } |
| 5427 |
| 5428 BreakAndContinueInfo break_info(stmt, scope()); |
| 5429 if (current_block() != NULL) { |
| 5430 BreakAndContinueScope push(&break_info, this); |
| 5431 CHECK_BAILOUT(VisitForEffect(stmt->assign_each())); |
| 5432 CHECK_BAILOUT(VisitLoopBody(stmt, loop_entry)); |
| 5433 } |
| 5434 HBasicBlock* body_exit = |
| 5435 JoinContinue(stmt, current_block(), break_info.continue_block()); |
| 5436 |
| 5437 HBasicBlock* loop_exit = CreateLoop(stmt, loop_entry, body_exit, |
| 5438 loop_successor, break_info.break_block()); |
| 5439 set_current_block(loop_exit); |
| 5410 } | 5440 } |
| 5411 | 5441 |
| 5412 | 5442 |
| 5413 void HOptimizedGraphBuilder::VisitTryCatchStatement(TryCatchStatement* stmt) { | 5443 void HOptimizedGraphBuilder::VisitTryCatchStatement(TryCatchStatement* stmt) { |
| 5414 DCHECK(!HasStackOverflow()); | 5444 DCHECK(!HasStackOverflow()); |
| 5415 DCHECK(current_block() != NULL); | 5445 DCHECK(current_block() != NULL); |
| 5416 DCHECK(current_block()->HasPredecessor()); | 5446 DCHECK(current_block()->HasPredecessor()); |
| 5417 return Bailout(kTryCatchStatement); | 5447 return Bailout(kTryCatchStatement); |
| 5418 } | 5448 } |
| 5419 | 5449 |
| (...skipping 8037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13457 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13487 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13458 } | 13488 } |
| 13459 | 13489 |
| 13460 #ifdef DEBUG | 13490 #ifdef DEBUG |
| 13461 graph_->Verify(false); // No full verify. | 13491 graph_->Verify(false); // No full verify. |
| 13462 #endif | 13492 #endif |
| 13463 } | 13493 } |
| 13464 | 13494 |
| 13465 } // namespace internal | 13495 } // namespace internal |
| 13466 } // namespace v8 | 13496 } // namespace v8 |
| OLD | NEW |