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

Side by Side Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 2290753003: Allow lexically declared "arguments" in function scope in sloppy mode. (Closed)
Patch Set: clang format Created 4 years, 3 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
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 <fstream> 5 #include <fstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/interpreter/bytecode-array-iterator.h" 9 #include "src/interpreter/bytecode-array-iterator.h"
10 #include "src/interpreter/bytecode-generator.h" 10 #include "src/interpreter/bytecode-generator.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 REPEAT_2(__VA_ARGS__) 49 REPEAT_2(__VA_ARGS__)
50 50
51 #define REPEAT_2_UNIQUE_VARS() UNIQUE_VAR() UNIQUE_VAR() 51 #define REPEAT_2_UNIQUE_VARS() UNIQUE_VAR() UNIQUE_VAR()
52 #define REPEAT_4_UNIQUE_VARS() REPEAT_2_UNIQUE_VARS() REPEAT_2_UNIQUE_VARS() 52 #define REPEAT_4_UNIQUE_VARS() REPEAT_2_UNIQUE_VARS() REPEAT_2_UNIQUE_VARS()
53 #define REPEAT_8_UNIQUE_VARS() REPEAT_4_UNIQUE_VARS() REPEAT_4_UNIQUE_VARS() 53 #define REPEAT_8_UNIQUE_VARS() REPEAT_4_UNIQUE_VARS() REPEAT_4_UNIQUE_VARS()
54 #define REPEAT_16_UNIQUE_VARS() REPEAT_8_UNIQUE_VARS() REPEAT_8_UNIQUE_VARS() 54 #define REPEAT_16_UNIQUE_VARS() REPEAT_8_UNIQUE_VARS() REPEAT_8_UNIQUE_VARS()
55 #define REPEAT_32_UNIQUE_VARS() REPEAT_16_UNIQUE_VARS() REPEAT_16_UNIQUE_VARS() 55 #define REPEAT_32_UNIQUE_VARS() REPEAT_16_UNIQUE_VARS() REPEAT_16_UNIQUE_VARS()
56 #define REPEAT_64_UNIQUE_VARS() REPEAT_32_UNIQUE_VARS() REPEAT_32_UNIQUE_VARS() 56 #define REPEAT_64_UNIQUE_VARS() REPEAT_32_UNIQUE_VARS() REPEAT_32_UNIQUE_VARS()
57 #define REPEAT_128_UNIQUE_VARS() REPEAT_64_UNIQUE_VARS() REPEAT_64_UNIQUE_VARS() 57 #define REPEAT_128_UNIQUE_VARS() REPEAT_64_UNIQUE_VARS() REPEAT_64_UNIQUE_VARS()
58 58
59 #define REPEAT_249_UNIQUE_VARS() \ 59 #define REPEAT_250_UNIQUE_VARS() \
60 REPEAT_128_UNIQUE_VARS() \ 60 REPEAT_128_UNIQUE_VARS() \
61 REPEAT_64_UNIQUE_VARS() \ 61 REPEAT_64_UNIQUE_VARS() \
62 REPEAT_32_UNIQUE_VARS() \ 62 REPEAT_32_UNIQUE_VARS() \
63 REPEAT_16_UNIQUE_VARS() \ 63 REPEAT_16_UNIQUE_VARS() \
64 REPEAT_8_UNIQUE_VARS() \ 64 REPEAT_8_UNIQUE_VARS() \
65 UNIQUE_VAR() \
65 UNIQUE_VAR() 66 UNIQUE_VAR()
66 67
67 static const char* kGoldenFileDirectory = 68 static const char* kGoldenFileDirectory =
68 "test/cctest/interpreter/bytecode_expectations/"; 69 "test/cctest/interpreter/bytecode_expectations/";
69 70
70 class InitializedIgnitionHandleScope : public InitializedHandleScope { 71 class InitializedIgnitionHandleScope : public InitializedHandleScope {
71 public: 72 public:
72 InitializedIgnitionHandleScope() { 73 InitializedIgnitionHandleScope() {
73 i::FLAG_ignition = true; 74 i::FLAG_ignition = true;
74 i::FLAG_ignition_osr = false; // TODO(4764): Disabled for now. 75 i::FLAG_ignition_osr = false; // TODO(4764): Disabled for now.
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 1347
1347 "var a = 1; var b = 2; return function() { a = 2; b = 3 };\n", 1348 "var a = 1; var b = 2; return function() { a = 2; b = 3 };\n",
1348 1349
1349 "var a; (function() { a = 2; })(); return a;\n", 1350 "var a; (function() { a = 2; })(); return a;\n",
1350 1351
1351 "'use strict';\n" 1352 "'use strict';\n"
1352 "let a = 1;\n" 1353 "let a = 1;\n"
1353 "{ let b = 2; return function() { a + b; }; }\n", 1354 "{ let b = 2; return function() { a + b; }; }\n",
1354 1355
1355 "'use strict';\n" 1356 "'use strict';\n"
1356 REPEAT_249_UNIQUE_VARS() 1357 REPEAT_250_UNIQUE_VARS()
1357 "eval();\n" 1358 "eval();\n"
1358 "var b = 100;\n" 1359 "var b = 100;\n"
1359 "return b\n", 1360 "return b\n",
1360 }; 1361 };
1361 1362
1362 CHECK(CompareTexts(BuildActual(printer, snippets), 1363 CHECK(CompareTexts(BuildActual(printer, snippets),
1363 LoadGolden("ContextVariables.golden"))); 1364 LoadGolden("ContextVariables.golden")));
1364 } 1365 }
1365 1366
1366 TEST(ContextParameters) { 1367 TEST(ContextParameters) {
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 "f();\n", 2258 "f();\n",
2258 }; 2259 };
2259 2260
2260 CHECK(CompareTexts(BuildActual(printer, snippets), 2261 CHECK(CompareTexts(BuildActual(printer, snippets),
2261 LoadGolden("Generators.golden"))); 2262 LoadGolden("Generators.golden")));
2262 } 2263 }
2263 2264
2264 } // namespace interpreter 2265 } // namespace interpreter
2265 } // namespace internal 2266 } // namespace internal
2266 } // namespace v8 2267 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/LookupSlot.golden ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698