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

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

Issue 1308693014: [Interpreter] Ensure that implicit return undefined is generated. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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
Index: src/interpreter/bytecode-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index dba816d61810d63259412f946f219494c2e134ef..5f97bce75b2f34184e3cd99753aebe084317169a 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -37,6 +37,12 @@ void BytecodeArrayBuilder::set_parameter_count(int number_of_parameters) {
int BytecodeArrayBuilder::parameter_count() const { return parameter_count_; }
+bool BytecodeArrayBuilder::HasExplicitReturn() {
+ return !bytecodes_.empty() &&
+ bytecodes_.back() == Bytecodes::ToByte(Bytecode::kReturn);
+}
+
+
Register BytecodeArrayBuilder::Parameter(int parameter_index) {
DCHECK_GE(parameter_index, 0);
DCHECK_LT(parameter_index, parameter_count_);

Powered by Google App Engine
This is Rietveld 408576698