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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 void TryCatchBuilder::EndCatch() { | 173 void TryCatchBuilder::EndCatch() { |
174 exit_environment_->Merge(environment()); | 174 exit_environment_->Merge(environment()); |
175 set_environment(exit_environment_); | 175 set_environment(exit_environment_); |
176 } | 176 } |
177 | 177 |
178 | 178 |
179 void TryFinallyBuilder::BeginTry() { | 179 void TryFinallyBuilder::BeginTry() { |
180 finally_environment_ = environment()->CopyAsUnreachable(); | 180 finally_environment_ = environment()->CopyAsUnreachable(); |
181 finally_environment_->Push(the_hole()); | 181 finally_environment_->Push(the_hole()); |
| 182 finally_environment_->Push(the_hole()); |
182 } | 183 } |
183 | 184 |
184 | 185 |
185 void TryFinallyBuilder::LeaveTry(Node* token) { | 186 void TryFinallyBuilder::LeaveTry(Node* token, Node* value) { |
| 187 environment()->Push(value); |
186 environment()->Push(token); | 188 environment()->Push(token); |
187 finally_environment_->Merge(environment()); | 189 finally_environment_->Merge(environment()); |
188 environment()->Pop(); | 190 environment()->Drop(2); |
189 } | 191 } |
190 | 192 |
191 | 193 |
192 void TryFinallyBuilder::EndTry(Node* fallthrough_token) { | 194 void TryFinallyBuilder::EndTry(Node* fallthrough_token, Node* value) { |
| 195 environment()->Push(value); |
193 environment()->Push(fallthrough_token); | 196 environment()->Push(fallthrough_token); |
194 finally_environment_->Merge(environment()); | 197 finally_environment_->Merge(environment()); |
195 environment()->Pop(); | 198 environment()->Drop(2); |
196 token_node_ = finally_environment_->Pop(); | 199 token_node_ = finally_environment_->Pop(); |
| 200 value_node_ = finally_environment_->Pop(); |
197 set_environment(finally_environment_); | 201 set_environment(finally_environment_); |
198 } | 202 } |
199 | 203 |
200 | 204 |
201 void TryFinallyBuilder::EndFinally() { | 205 void TryFinallyBuilder::EndFinally() { |
202 // Nothing to be done here. | 206 // Nothing to be done here. |
203 } | 207 } |
204 | 208 |
205 } // namespace compiler | 209 } // namespace compiler |
206 } // namespace internal | 210 } // namespace internal |
207 } // namespace v8 | 211 } // namespace v8 |
OLD | NEW |