OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 } | 782 } |
783 have_no_properties.End(); | 783 have_no_properties.End(); |
784 } | 784 } |
785 is_null.End(); | 785 is_null.End(); |
786 } | 786 } |
787 is_undefined.End(); | 787 is_undefined.End(); |
788 } | 788 } |
789 | 789 |
790 | 790 |
791 void AstGraphBuilder::VisitForOfStatement(ForOfStatement* stmt) { | 791 void AstGraphBuilder::VisitForOfStatement(ForOfStatement* stmt) { |
792 VisitForValue(stmt->subject()); | 792 LoopBuilder for_loop(this); |
793 environment()->Pop(); | 793 VisitForEffect(stmt->assign_iterator()); |
794 // TODO(turbofan): create and use loop builder. | 794 for_loop.BeginLoop(GetVariablesAssignedInLoop(stmt), IsOsrLoopEntry(stmt)); |
| 795 VisitForEffect(stmt->next_result()); |
| 796 VisitForTest(stmt->result_done()); |
| 797 Node* condition = environment()->Pop(); |
| 798 for_loop.BreakWhen(condition); |
| 799 VisitForEffect(stmt->assign_each()); |
| 800 VisitIterationBody(stmt, &for_loop, 0); |
| 801 for_loop.EndBody(); |
| 802 for_loop.EndLoop(); |
795 } | 803 } |
796 | 804 |
797 | 805 |
798 void AstGraphBuilder::VisitTryCatchStatement(TryCatchStatement* stmt) { | 806 void AstGraphBuilder::VisitTryCatchStatement(TryCatchStatement* stmt) { |
799 UNREACHABLE(); | 807 UNREACHABLE(); |
800 } | 808 } |
801 | 809 |
802 | 810 |
803 void AstGraphBuilder::VisitTryFinallyStatement(TryFinallyStatement* stmt) { | 811 void AstGraphBuilder::VisitTryFinallyStatement(TryFinallyStatement* stmt) { |
804 UNREACHABLE(); | 812 UNREACHABLE(); |
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 | 2243 |
2236 BitVector* AstGraphBuilder::GetVariablesAssignedInLoop( | 2244 BitVector* AstGraphBuilder::GetVariablesAssignedInLoop( |
2237 IterationStatement* stmt) { | 2245 IterationStatement* stmt) { |
2238 if (loop_assignment_analysis_ == NULL) return NULL; | 2246 if (loop_assignment_analysis_ == NULL) return NULL; |
2239 return loop_assignment_analysis_->GetVariablesAssignedInLoop(stmt); | 2247 return loop_assignment_analysis_->GetVariablesAssignedInLoop(stmt); |
2240 } | 2248 } |
2241 | 2249 |
2242 } // namespace compiler | 2250 } // namespace compiler |
2243 } // namespace internal | 2251 } // namespace internal |
2244 } // namespace v8 | 2252 } // namespace v8 |
OLD | NEW |