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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/execution.h" 7 #include "src/execution.h"
8 #include "src/handles.h" 8 #include "src/handles.h"
9 #include "src/interpreter/bytecode-array-builder.h" 9 #include "src/interpreter/bytecode-array-builder.h"
10 #include "src/interpreter/interpreter.h" 10 #include "src/interpreter/interpreter.h"
(...skipping 2836 matching lines...) Expand 10 before | Expand all | Expand 10 after
2847 " }\n" 2847 " }\n"
2848 "\n" 2848 "\n"
2849 " var hasOwnProperty = !teamMeeting.hasOwnProperty('name') &&\n" 2849 " var hasOwnProperty = !teamMeeting.hasOwnProperty('name') &&\n"
2850 " !teamMeeting.hasOwnProperty('startTime') &&\n" 2850 " !teamMeeting.hasOwnProperty('startTime') &&\n"
2851 " !teamMeeting.hasOwnProperty('conferenceCall');\n" 2851 " !teamMeeting.hasOwnProperty('conferenceCall');\n"
2852 " if (!hasOwnProperty) {\n" 2852 " if (!hasOwnProperty) {\n"
2853 " flags |= 8;\n" 2853 " flags |= 8;\n"
2854 " }\n" 2854 " }\n"
2855 " return flags;\n" 2855 " return flags;\n"
2856 " }", 2856 " }",
2857 0}}; 2857 0},
2858 {"function f() {\n"
2859 " var data = {x:23, y:34};\n"
2860 " var result = 0;\n"
2861 " var o = {};\n"
2862 " var arr = [o];\n"
2863 " for (arr[0].p in data)\n" // This is to test if value is loaded
2864 " result += data[arr[0].p];\n" // back from accumulator before storing
2865 " return result;\n" // named properties.
2866 "}",
2867 57},
2868 {"function f() {\n"
2869 " var data = {x:23, y:34};\n"
2870 " var result = 0;\n"
2871 " var o = {};\n"
2872 " var i = 0;\n"
2873 " for (o[i++] in data)\n" // This is to test if value is loaded
2874 " result += data[o[i-1]];\n" // back from accumulator before
2875 " return result;\n" // storing keyed properties.
2876 "}",
2877 57}};
2858 2878
2859 for (size_t i = 0; i < arraysize(for_in_samples); i++) { 2879 for (size_t i = 0; i < arraysize(for_in_samples); i++) {
2860 InterpreterTester tester(handles.main_isolate(), for_in_samples[i].first); 2880 InterpreterTester tester(handles.main_isolate(), for_in_samples[i].first);
2861 auto callable = tester.GetCallable<>(); 2881 auto callable = tester.GetCallable<>();
2862 Handle<Object> return_val = callable().ToHandleChecked(); 2882 Handle<Object> return_val = callable().ToHandleChecked();
2863 CHECK_EQ(Handle<Smi>::cast(return_val)->value(), for_in_samples[i].second); 2883 CHECK_EQ(Handle<Smi>::cast(return_val)->value(), for_in_samples[i].second);
2864 } 2884 }
2865 } 2885 }
2866 2886
2867 2887
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
3383 callable(factory->NewNumberFromInt(a)).ToHandleChecked(); 3403 callable(factory->NewNumberFromInt(a)).ToHandleChecked();
3384 static const int results[] = {11, 12, 2}; 3404 static const int results[] = {11, 12, 2};
3385 CHECK_EQ(Handle<Smi>::cast(return_val)->value(), results[a]); 3405 CHECK_EQ(Handle<Smi>::cast(return_val)->value(), results[a]);
3386 } 3406 }
3387 } 3407 }
3388 } 3408 }
3389 3409
3390 } // namespace interpreter 3410 } // namespace interpreter
3391 } // namespace internal 3411 } // namespace internal
3392 } // namespace v8 3412 } // namespace v8
OLDNEW
« 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