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

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

Issue 1571753002: [Interpreter] Loads accumulator before calling StoreNamedProperty in ForInAssignment. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/interpreter/test-interpreter.cc
diff --git a/test/cctest/interpreter/test-interpreter.cc b/test/cctest/interpreter/test-interpreter.cc
index 3db22ece19d4972925bd031dc6d6315f16c62f5b..a0bba0ac0ff222266f320510fb82820615732140 100644
--- a/test/cctest/interpreter/test-interpreter.cc
+++ b/test/cctest/interpreter/test-interpreter.cc
@@ -2854,7 +2854,27 @@ TEST(InterpreterForIn) {
" }\n"
" return flags;\n"
" }",
- 0}};
+ 0},
+ {"function f() {\n"
+ " var data = {x:23, y:34};\n"
+ " var result = 0;\n"
+ " var o = {};\n"
+ " var arr = [o];\n"
+ " for (arr[0].p in data)\n" // This is to test if value is loaded
+ " result += data[arr[0].p];\n" // back from accumulator before storing
+ " return result;\n" // named properties.
+ "}",
+ 57},
+ {"function f() {\n"
+ " var data = {x:23, y:34};\n"
+ " var result = 0;\n"
+ " var o = {};\n"
+ " var i = 0;\n"
+ " for (o[i++] in data)\n" // This is to test if value is loaded
+ " result += data[o[i-1]];\n" // back from accumulator before
+ " return result;\n" // storing keyed properties.
+ "}",
+ 57}};
for (size_t i = 0; i < arraysize(for_in_samples); i++) {
InterpreterTester tester(handles.main_isolate(), for_in_samples[i].first);
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698