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 "control-builders.h" | 5 #include "control-builders.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace compiler { | 9 namespace compiler { |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void LoopBuilder::BreakUnless(Node* condition) { | 66 void LoopBuilder::BreakUnless(Node* condition) { |
67 IfBuilder control_if(builder_); | 67 IfBuilder control_if(builder_); |
68 control_if.If(condition); | 68 control_if.If(condition); |
69 control_if.Then(); | 69 control_if.Then(); |
70 control_if.Else(); | 70 control_if.Else(); |
71 Break(); | 71 Break(); |
72 control_if.End(); | 72 control_if.End(); |
73 } | 73 } |
74 | 74 |
75 | 75 |
| 76 void LoopBuilder::BreakWhen(Node* condition) { |
| 77 IfBuilder control_if(builder_); |
| 78 control_if.If(condition); |
| 79 control_if.Then(); |
| 80 Break(); |
| 81 control_if.Else(); |
| 82 control_if.End(); |
| 83 } |
| 84 |
| 85 |
76 void SwitchBuilder::BeginSwitch() { | 86 void SwitchBuilder::BeginSwitch() { |
77 body_environment_ = environment()->CopyAsUnreachable(); | 87 body_environment_ = environment()->CopyAsUnreachable(); |
78 label_environment_ = environment()->CopyAsUnreachable(); | 88 label_environment_ = environment()->CopyAsUnreachable(); |
79 break_environment_ = environment()->CopyAsUnreachable(); | 89 break_environment_ = environment()->CopyAsUnreachable(); |
80 } | 90 } |
81 | 91 |
82 | 92 |
83 void SwitchBuilder::BeginLabel(int index, Node* condition) { | 93 void SwitchBuilder::BeginLabel(int index, Node* condition) { |
84 builder_->NewBranch(condition); | 94 builder_->NewBranch(condition); |
85 label_environment_ = environment()->CopyForConditional(); | 95 label_environment_ = environment()->CopyForConditional(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 143 } |
134 | 144 |
135 | 145 |
136 void BlockBuilder::EndBlock() { | 146 void BlockBuilder::EndBlock() { |
137 break_environment_->Merge(environment()); | 147 break_environment_->Merge(environment()); |
138 set_environment(break_environment_); | 148 set_environment(break_environment_); |
139 } | 149 } |
140 } | 150 } |
141 } | 151 } |
142 } // namespace v8::internal::compiler | 152 } // namespace v8::internal::compiler |
OLD | NEW |