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

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

Issue 1676883002: [runtime] Optimize and unify rest parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 7d8089b90b6e39bfd023dd8afbe883a791d0f45f..357ea0b4de2bda41ef546aced0896bb96bf94a3c 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -589,16 +589,6 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments(
return *this;
}
-BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRestArguments(int index) {
- size_t index_entry =
- GetConstantPoolEntry(Handle<Object>(Smi::FromInt(index), isolate_));
- // This will always be the first entry in the constant pool, since the rest
- // arguments object is created at the start of the function just after
- // creating the arguments object.
- CHECK(FitsInIdx8Operand(index_entry));
- Output(Bytecode::kCreateRestArguments, static_cast<uint8_t>(index_entry));
- return *this;
-}
BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral(
Handle<String> pattern, int literal_index, int flags) {
@@ -1617,7 +1607,6 @@ Bytecode BytecodeArrayBuilder::BytecodeForStoreLookupSlot(
return static_cast<Bytecode>(-1);
}
-
// static
Bytecode BytecodeArrayBuilder::BytecodeForCreateArguments(
CreateArgumentsType type) {
@@ -1626,9 +1615,10 @@ Bytecode BytecodeArrayBuilder::BytecodeForCreateArguments(
return Bytecode::kCreateMappedArguments;
case CreateArgumentsType::kUnmappedArguments:
return Bytecode::kCreateUnmappedArguments;
- default:
- UNREACHABLE();
+ case CreateArgumentsType::kRestParameter:
+ return Bytecode::kCreateRestParameter;
}
+ UNREACHABLE();
return static_cast<Bytecode>(-1);
}

Powered by Google App Engine
This is Rietveld 408576698