OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/control-flow-builders.h" | 5 #include "src/interpreter/control-flow-builders.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace interpreter { | 9 namespace interpreter { |
10 | 10 |
(...skipping 141 matching lines...) Loading... |
152 | 152 |
153 | 153 |
154 void TryCatchBuilder::EndCatch() { builder()->Bind(&exit_); } | 154 void TryCatchBuilder::EndCatch() { builder()->Bind(&exit_); } |
155 | 155 |
156 | 156 |
157 void TryFinallyBuilder::BeginTry(Register context) { | 157 void TryFinallyBuilder::BeginTry(Register context) { |
158 builder()->MarkTryBegin(handler_id_, context); | 158 builder()->MarkTryBegin(handler_id_, context); |
159 } | 159 } |
160 | 160 |
161 | 161 |
| 162 void TryFinallyBuilder::LeaveTry() { |
| 163 finalization_sites_.push_back(BytecodeLabel()); |
| 164 builder()->Jump(&finalization_sites_.back()); |
| 165 } |
| 166 |
| 167 |
162 void TryFinallyBuilder::EndTry() { | 168 void TryFinallyBuilder::EndTry() { |
163 builder()->MarkTryEnd(handler_id_); | 169 builder()->MarkTryEnd(handler_id_); |
| 170 } |
| 171 |
| 172 |
| 173 void TryFinallyBuilder::BeginHandler() { |
164 builder()->Bind(&handler_); | 174 builder()->Bind(&handler_); |
165 builder()->MarkHandler(handler_id_, false); | 175 builder()->MarkHandler(handler_id_, false); |
166 } | 176 } |
167 | 177 |
168 | 178 |
| 179 void TryFinallyBuilder::BeginFinally() { |
| 180 for (size_t i = 0; i < finalization_sites_.size(); i++) { |
| 181 BytecodeLabel& site = finalization_sites_.at(i); |
| 182 builder()->Bind(&site); |
| 183 } |
| 184 } |
| 185 |
| 186 |
169 void TryFinallyBuilder::EndFinally() { | 187 void TryFinallyBuilder::EndFinally() { |
170 // Nothing to be done here. | 188 // Nothing to be done here. |
171 } | 189 } |
172 | 190 |
173 } // namespace interpreter | 191 } // namespace interpreter |
174 } // namespace internal | 192 } // namespace internal |
175 } // namespace v8 | 193 } // namespace v8 |
OLD | NEW |