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

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

Issue 1406183002: [Interpreter] Add support for strict mode global stores. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/interpreter.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.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 9dcfb5b01960a2dea91ef138c850da3b94d64f1e..f9756421f6bfe400a43882a7ddb3d3c8b50e75f8 100644
--- a/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/test/cctest/interpreter/test-bytecode-generator.cc
@@ -1073,17 +1073,17 @@ TEST(StoreGlobal) {
InitializedHandleScope handle_scope;
BytecodeGeneratorHelper helper;
- ExpectedSnippet<int> snippets[] = {
+ ExpectedSnippet<InstanceType> snippets[] = {
{
"var a = 1;\nfunction f() { a = 2; }\nf()",
0,
1,
6,
{
- B(LdaSmi8), U8(2), //
- B(StaGlobal), _, //
- B(LdaUndefined), //
- B(Return) //
+ B(LdaSmi8), U8(2), //
+ B(StaGlobalSloppy), _, //
+ B(LdaUndefined), //
+ B(Return) //
},
},
{
@@ -1093,11 +1093,23 @@ TEST(StoreGlobal) {
6,
{
B(Ldar), R(helper.kLastParamIndex), //
- B(StaGlobal), _, //
+ B(StaGlobalSloppy), _, //
B(LdaUndefined), //
B(Return) //
},
},
+ {
+ "'use strict'; var a = 1;\nfunction f() { a = 2; }\nf()",
+ 0,
+ 1,
+ 6,
+ {
+ B(LdaSmi8), U8(2), //
+ B(StaGlobalStrict), _, //
+ B(LdaUndefined), //
+ B(Return) //
+ },
+ },
};
for (size_t i = 0; i < arraysize(snippets); i++) {
@@ -1566,7 +1578,7 @@ TEST(DeclareGlobals) {
B(CallRuntime), U16(Runtime::kInitializeVarGlobal), R(2), //
U8(3), //
B(LdaSmi8), U8(2), //
- B(StaGlobal), _, //
+ B(StaGlobalSloppy), _, //
B(Star), R(0), //
B(Ldar), R(0), //
B(Return) //
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698