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

Unified Diff: test/cctest/interpreter/test-bytecode-generator.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: test/cctest/interpreter/test-bytecode-generator.cc
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc
index 644f45d9e6973d336daae2d0d58d5dfb36434f6e..2980cefe14976d609425ef8807cc87b2354cae7b 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -6002,7 +6002,7 @@ TEST(CreateArguments) {
}
}
-TEST(CreateRestArguments) {
+TEST(CreateRestParameter) {
InitializedHandleScope handle_scope;
BytecodeGeneratorHelper helper;
Zone zone;
@@ -6018,45 +6018,45 @@ TEST(CreateRestArguments) {
ExpectedSnippet<int> snippets[] = {
{"function f(...restArgs) { return restArgs; }",
1 * kPointerSize,
- 2,
- 8,
+ 1,
+ 7,
{
- B(CreateRestArguments), U8(0), //
+ B(CreateRestParameter), //
B(Star), R(0), //
B(StackCheck), //
B(Ldar), R(0), //
B(Return), //
},
- 1,
- {0}},
+ 0,
+ {}},
{"function f(a, ...restArgs) { return restArgs; }",
2 * kPointerSize,
- 3,
- 15,
+ 2,
+ 14,
{
- B(CreateRestArguments), U8(0), //
+ B(CreateRestParameter), //
B(Star), R(0), //
B(LdaTheHole), //
B(Star), R(1), //
B(StackCheck), //
- B(Ldar), A(1, 3), //
+ B(Ldar), A(1, 2), //
B(Star), R(1), //
B(Ldar), R(0), //
B(Return), //
},
- 1,
- {1}},
+ 0,
+ {}},
{"function f(a, ...restArgs) { return restArgs[0]; }",
3 * kPointerSize,
- 3,
- 21,
+ 2,
+ 20,
{
- B(CreateRestArguments), U8(0), //
+ B(CreateRestParameter), //
B(Star), R(0), //
B(LdaTheHole), //
B(Star), R(1), //
B(StackCheck), //
- B(Ldar), A(1, 3), //
+ B(Ldar), A(1, 2), //
B(Star), R(1), //
B(Ldar), R(0), //
B(Star), R(2), //
@@ -6064,21 +6064,21 @@ TEST(CreateRestArguments) {
B(KeyedLoadICSloppy), R(2), U8(vector->GetIndex(slot)), //
B(Return), //
},
- 1,
- {1}},
+ 0,
+ {}},
{"function f(a, ...restArgs) { return restArgs[0] + arguments[0]; }",
5 * kPointerSize,
- 3,
- 36,
+ 2,
+ 35,
{
B(CreateUnmappedArguments), //
B(Star), R(0), //
- B(CreateRestArguments), U8(0), //
+ B(CreateRestParameter), //
B(Star), R(1), //
B(LdaTheHole), //
B(Star), R(2), //
B(StackCheck), //
- B(Ldar), A(1, 3), //
+ B(Ldar), A(1, 2), //
B(Star), R(2), //
B(Ldar), R(1), //
B(Star), R(3), //
@@ -6092,8 +6092,8 @@ TEST(CreateRestArguments) {
B(Add), R(4), //
B(Return), //
},
- 1,
- {1}},
+ 0,
+ {}},
};
// clang-format on

Powered by Google App Engine
This is Rietveld 408576698