| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 } | 153 } |
| 154 | 154 |
| 155 | 155 |
| 156 void BlockBuilder::EndBlock() { | 156 void BlockBuilder::EndBlock() { |
| 157 break_environment_->Merge(environment()); | 157 break_environment_->Merge(environment()); |
| 158 set_environment(break_environment_); | 158 set_environment(break_environment_); |
| 159 } | 159 } |
| 160 | 160 |
| 161 | 161 |
| 162 void TryCatchBuilder::BeginTry() { | 162 void TryCatchBuilder::BeginTry() { |
| 163 exit_environment_ = environment()->CopyAsUnreachable(); |
| 163 catch_environment_ = environment()->CopyAsUnreachable(); | 164 catch_environment_ = environment()->CopyAsUnreachable(); |
| 164 catch_environment_->Push(the_hole()); | 165 catch_environment_->Push(the_hole()); |
| 165 } | 166 } |
| 166 | 167 |
| 167 | 168 |
| 168 void TryCatchBuilder::Throw(Node* exception) { | 169 void TryCatchBuilder::Throw(Node* exception) { |
| 169 environment()->Push(exception); | 170 environment()->Push(exception); |
| 170 catch_environment_->Merge(environment()); | 171 catch_environment_->Merge(environment()); |
| 171 environment()->Pop(); | 172 environment()->Pop(); |
| 172 environment()->MarkAsUnreachable(); | 173 environment()->MarkAsUnreachable(); |
| 173 } | 174 } |
| 174 | 175 |
| 175 | 176 |
| 176 void TryCatchBuilder::EndTry() { | 177 void TryCatchBuilder::EndTry() { |
| 177 exit_environment_ = environment(); | 178 exit_environment_->Merge(environment()); |
| 178 exception_node_ = catch_environment_->Pop(); | 179 exception_node_ = catch_environment_->Pop(); |
| 179 set_environment(catch_environment_); | 180 set_environment(catch_environment_); |
| 180 } | 181 } |
| 181 | 182 |
| 182 | 183 |
| 183 void TryCatchBuilder::EndCatch() { | 184 void TryCatchBuilder::EndCatch() { |
| 184 exit_environment_->Merge(environment()); | 185 exit_environment_->Merge(environment()); |
| 185 set_environment(exit_environment_); | 186 set_environment(exit_environment_); |
| 186 } | 187 } |
| 187 | 188 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 212 } | 213 } |
| 213 | 214 |
| 214 | 215 |
| 215 void TryFinallyBuilder::EndFinally() { | 216 void TryFinallyBuilder::EndFinally() { |
| 216 // Nothing to be done here. | 217 // Nothing to be done here. |
| 217 } | 218 } |
| 218 | 219 |
| 219 } // namespace compiler | 220 } // namespace compiler |
| 220 } // namespace internal | 221 } // namespace internal |
| 221 } // namespace v8 | 222 } // namespace v8 |
| OLD | NEW |