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

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

Issue 1664593003: [Interpreter] Adds support for rest parameters to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed failing bytecode-array-builder-unittest 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 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 4a1602a1d6ea6c3749cc74b30111c53a4cd1e730..cefd9bb6def1ae69219bb16500e9f8a89a92c631 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -606,6 +606,16 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments(
return *this;
}
+BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRestArguments(int index) {
+ size_t index_entry =
+ GetConstantPoolEntry(Handle<Object>(Smi::FromInt(index), isolate_));
+ // This would always be the first entry in the constant pool, since rest
rmcilroy 2016/02/03 14:00:56 /s/since rest/since the rest/
rmcilroy 2016/02/03 14:00:56 /s/would/will
mythria 2016/02/03 15:56:16 Done.
mythria 2016/02/03 15:56:16 Done.
+ // arguments object is created at the start of function just after creating
rmcilroy 2016/02/03 14:00:56 /s/function/the function/
mythria 2016/02/03 15:56:16 Done.
+ // arguments object.
rmcilroy 2016/02/03 14:00:56 /s/arguments/the arguments
mythria 2016/02/03 15:56:16 Done.
+ DCHECK_EQ(index_entry, 0);
mythria 2016/02/03 12:44:36 I will change it to DCHECK(FitsInIdx8Operand(index
rmcilroy 2016/02/03 14:00:56 Yes please do that, but also make it a CHECK rathe
mythria 2016/02/03 15:56:16 Done.
+ Output(Bytecode::kCreateRestArguments, static_cast<uint8_t>(index_entry));
+ return *this;
+}
BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral(
Handle<String> pattern, int literal_index, int flags) {

Powered by Google App Engine
This is Rietveld 408576698