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

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 1410863002: [Interpreter] Add support for Throw. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 8e52ecd7fd287b1d475b2971f5f24df86c5edd84..d9391ebb2d9a5f5390e47ed38386217abcb9a6ec 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -15,7 +15,7 @@ BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone)
bytecode_generated_(false),
last_block_end_(0),
last_bytecode_start_(~0),
- return_seen_in_block_(false),
+ exit_seen_in_block_(false),
constants_map_(isolate->heap(), zone),
constants_(zone),
parameter_count_(-1),
@@ -564,9 +564,16 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfToBooleanFalse(
}
+BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() {
+ Output(Bytecode::kThrow);
+ exit_seen_in_block_ = true;
+ return *this;
+}
+
+
BytecodeArrayBuilder& BytecodeArrayBuilder::Return() {
Output(Bytecode::kReturn);
- return_seen_in_block_ = true;
+ exit_seen_in_block_ = true;
return *this;
}
@@ -576,13 +583,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::EnterBlock() { return *this; }
BytecodeArrayBuilder& BytecodeArrayBuilder::LeaveBlock() {
last_block_end_ = bytecodes()->size();
- return_seen_in_block_ = false;
+ exit_seen_in_block_ = false;
return *this;
}
void BytecodeArrayBuilder::EnsureReturn() {
- if (!return_seen_in_block_) {
+ if (!exit_seen_in_block_) {
LoadUndefined();
Return();
}
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698