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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 break_environment_ = environment()->CopyAsUnreachable(); | 136 break_environment_ = environment()->CopyAsUnreachable(); |
137 } | 137 } |
138 | 138 |
139 | 139 |
140 void BlockBuilder::Break() { | 140 void BlockBuilder::Break() { |
141 break_environment_->Merge(environment()); | 141 break_environment_->Merge(environment()); |
142 environment()->MarkAsUnreachable(); | 142 environment()->MarkAsUnreachable(); |
143 } | 143 } |
144 | 144 |
145 | 145 |
| 146 void BlockBuilder::BreakWhen(Node* condition, BranchHint hint) { |
| 147 IfBuilder control_if(builder_); |
| 148 control_if.If(condition, hint); |
| 149 control_if.Then(); |
| 150 Break(); |
| 151 control_if.Else(); |
| 152 control_if.End(); |
| 153 } |
| 154 |
| 155 |
146 void BlockBuilder::EndBlock() { | 156 void BlockBuilder::EndBlock() { |
147 break_environment_->Merge(environment()); | 157 break_environment_->Merge(environment()); |
148 set_environment(break_environment_); | 158 set_environment(break_environment_); |
149 } | 159 } |
150 | 160 |
151 | 161 |
152 void TryCatchBuilder::BeginTry() { | 162 void TryCatchBuilder::BeginTry() { |
153 catch_environment_ = environment()->CopyAsUnreachable(); | 163 catch_environment_ = environment()->CopyAsUnreachable(); |
154 catch_environment_->Push(the_hole()); | 164 catch_environment_->Push(the_hole()); |
155 } | 165 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 212 } |
203 | 213 |
204 | 214 |
205 void TryFinallyBuilder::EndFinally() { | 215 void TryFinallyBuilder::EndFinally() { |
206 // Nothing to be done here. | 216 // Nothing to be done here. |
207 } | 217 } |
208 | 218 |
209 } // namespace compiler | 219 } // namespace compiler |
210 } // namespace internal | 220 } // namespace internal |
211 } // namespace v8 | 221 } // namespace v8 |
OLD | NEW |