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

Unified Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 1546643002: [Interpreter] Updates load/store global and named property to accept variable name. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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-generator.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0ecd59b36840ea13c5cfa690af3696b263116474..52a5decf226e9e8e8472a48df172b743ee8c4eee 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -1026,25 +1026,25 @@ TEST(PropertyStores) {
2,
8,
{
- B(LdaConstant), U8(1), //
- B(StoreICSloppy), A(1, 2), U8(0), U8(vector->GetIndex(slot1)), //
+ B(LdaConstant), U8(0), //
+ B(StoreICSloppy), A(1, 2), U8(1), U8(vector->GetIndex(slot1)), //
B(LdaUndefined), //
B(Return), //
},
2,
- {"name", "val"}},
+ {"val", "name"}},
{"function f(a) { a[\"key\"] = \"val\"; }\nf({key : \"test\"})",
0,
2,
8,
{
- B(LdaConstant), U8(1), //
- B(StoreICSloppy), A(1, 2), U8(0), U8(vector->GetIndex(slot1)), //
+ B(LdaConstant), U8(0), //
+ B(StoreICSloppy), A(1, 2), U8(1), U8(vector->GetIndex(slot1)), //
B(LdaUndefined), //
B(Return), //
},
2,
- {"key", "val"}},
+ {"val", "key"}},
{"function f(a) { a[100] = \"val\"; }\nf({100 : \"test\"})",
kPointerSize,
2,
@@ -1093,13 +1093,13 @@ TEST(PropertyStores) {
2,
8,
{
- B(LdaConstant), U8(1), //
- B(StoreICStrict), A(1, 2), U8(0), U8(vector->GetIndex(slot1)), //
+ B(LdaConstant), U8(0), //
+ B(StoreICStrict), A(1, 2), U8(1), U8(vector->GetIndex(slot1)), //
B(LdaUndefined), //
B(Return), //
},
2,
- {"name", "val"}},
+ {"val", "name"}},
{"function f(a, b) { \"use strict\"; a[b] = \"val\"; }\n"
"f({arg : \"test\"}, \"arg\")",
0,
@@ -3334,15 +3334,15 @@ TEST(ObjectLiterals) {
{
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
- B(CreateClosure), U8(2), U8(0), //
- B(StoreICSloppy), R(0), U8(1), U8(vector->GetIndex(slot1)), //
+ B(CreateClosure), U8(1), U8(0), //
+ B(StoreICSloppy), R(0), U8(2), U8(vector->GetIndex(slot1)), //
B(Ldar), R(0), //
B(Return), //
},
3,
{InstanceType::FIXED_ARRAY_TYPE,
- InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
- InstanceType::SHARED_FUNCTION_INFO_TYPE}},
+ InstanceType::SHARED_FUNCTION_INFO_TYPE,
+ InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
{"return { func(a) { return a; } };",
1 * kPointerSize,
1,
@@ -3350,15 +3350,15 @@ TEST(ObjectLiterals) {
{
B(CreateObjectLiteral), U8(0), U8(0), U8(deep_elements_flags), //
B(Star), R(0), //
- B(CreateClosure), U8(2), U8(0), //
- B(StoreICSloppy), R(0), U8(1), U8(vector->GetIndex(slot1)), //
+ B(CreateClosure), U8(1), U8(0), //
+ B(StoreICSloppy), R(0), U8(2), U8(vector->GetIndex(slot1)), //
B(Ldar), R(0), //
B(Return), //
},
3,
{InstanceType::FIXED_ARRAY_TYPE,
- InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
- InstanceType::SHARED_FUNCTION_INFO_TYPE}},
+ InstanceType::SHARED_FUNCTION_INFO_TYPE,
+ InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
{"return { get a() { return 2; } };",
5 * kPointerSize,
1,
@@ -3659,8 +3659,8 @@ TEST(TopLevelObjectLiterals) {
B(Star), R(2), //
B(CreateObjectLiteral), U8(2), U8(0), U8(has_function_flags), //
B(Star), R(4), //
- B(CreateClosure), U8(4), U8(1), //
- B(StoreICSloppy), R(4), U8(3), U8(3), //
+ B(CreateClosure), U8(3), U8(1), //
+ B(StoreICSloppy), R(4), U8(4), U8(3), //
B(CallRuntime), U16(Runtime::kToFastProperties), R(4), U8(1), //
B(Ldar), R(4), //
B(Star), R(3), //
@@ -3672,8 +3672,8 @@ TEST(TopLevelObjectLiterals) {
{InstanceType::FIXED_ARRAY_TYPE,
InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
InstanceType::FIXED_ARRAY_TYPE,
- InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE,
- InstanceType::SHARED_FUNCTION_INFO_TYPE}},
+ InstanceType::SHARED_FUNCTION_INFO_TYPE,
+ InstanceType::ONE_BYTE_INTERNALIZED_STRING_TYPE}},
};
for (size_t i = 0; i < arraysize(snippets); i++) {
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/cctest/interpreter/test-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698