Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Side by Side Diff: src/interpreter/control-flow-builders.cc

Issue 1613443002: [interpreter] Implement handling of try-finally constructs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « src/interpreter/control-flow-builders.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698