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/compiler/control-builders.h" | 5 #include "src/compiler/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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 void BlockBuilder::BreakWhen(Node* condition, BranchHint hint) { | 146 void BlockBuilder::BreakWhen(Node* condition, BranchHint hint) { |
147 IfBuilder control_if(builder_); | 147 IfBuilder control_if(builder_); |
148 control_if.If(condition, hint); | 148 control_if.If(condition, hint); |
149 control_if.Then(); | 149 control_if.Then(); |
150 Break(); | 150 Break(); |
151 control_if.Else(); | 151 control_if.Else(); |
152 control_if.End(); | 152 control_if.End(); |
153 } | 153 } |
154 | 154 |
155 | 155 |
| 156 void BlockBuilder::BreakUnless(Node* condition, BranchHint hint) { |
| 157 IfBuilder control_if(builder_); |
| 158 control_if.If(condition, hint); |
| 159 control_if.Then(); |
| 160 control_if.Else(); |
| 161 Break(); |
| 162 control_if.End(); |
| 163 } |
| 164 |
| 165 |
156 void BlockBuilder::EndBlock() { | 166 void BlockBuilder::EndBlock() { |
157 break_environment_->Merge(environment()); | 167 break_environment_->Merge(environment()); |
158 set_environment(break_environment_); | 168 set_environment(break_environment_); |
159 } | 169 } |
160 | 170 |
161 | 171 |
162 void TryCatchBuilder::BeginTry() { | 172 void TryCatchBuilder::BeginTry() { |
163 exit_environment_ = environment()->CopyAsUnreachable(); | 173 exit_environment_ = environment()->CopyAsUnreachable(); |
164 catch_environment_ = environment()->CopyAsUnreachable(); | 174 catch_environment_ = environment()->CopyAsUnreachable(); |
165 catch_environment_->Push(the_hole()); | 175 catch_environment_->Push(the_hole()); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 223 } |
214 | 224 |
215 | 225 |
216 void TryFinallyBuilder::EndFinally() { | 226 void TryFinallyBuilder::EndFinally() { |
217 // Nothing to be done here. | 227 // Nothing to be done here. |
218 } | 228 } |
219 | 229 |
220 } // namespace compiler | 230 } // namespace compiler |
221 } // namespace internal | 231 } // namespace internal |
222 } // namespace v8 | 232 } // namespace v8 |
OLD | NEW |