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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 environment()->MarkAsUnreachable(); | 142 environment()->MarkAsUnreachable(); |
143 } | 143 } |
144 | 144 |
145 | 145 |
146 void BlockBuilder::EndBlock() { | 146 void BlockBuilder::EndBlock() { |
147 break_environment_->Merge(environment()); | 147 break_environment_->Merge(environment()); |
148 set_environment(break_environment_); | 148 set_environment(break_environment_); |
149 } | 149 } |
150 | 150 |
151 | 151 |
| 152 void BlockBuilder::BreakUnless(Node* condition, BranchHint hint) { |
| 153 IfBuilder control_if(builder_); |
| 154 control_if.If(condition, hint); |
| 155 control_if.Then(); |
| 156 control_if.Else(); |
| 157 Break(); |
| 158 control_if.End(); |
| 159 } |
| 160 |
| 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 } |
156 | 166 |
157 | 167 |
158 void TryCatchBuilder::Throw(Node* exception) { | 168 void TryCatchBuilder::Throw(Node* exception) { |
159 environment()->Push(exception); | 169 environment()->Push(exception); |
160 catch_environment_->Merge(environment()); | 170 catch_environment_->Merge(environment()); |
161 environment()->Pop(); | 171 environment()->Pop(); |
(...skipping 40 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 |