OLD | NEW |
---|---|
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 Loading... | |
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_249_UNIQUE_VARS() \ |
adamk
2016/09/01 20:09:26
Doesn't look like this is used anymore.
| |
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 | 66 |
67 #define REPEAT_250_UNIQUE_VARS() \ | |
68 REPEAT_128_UNIQUE_VARS() \ | |
69 REPEAT_64_UNIQUE_VARS() \ | |
70 REPEAT_32_UNIQUE_VARS() \ | |
71 REPEAT_16_UNIQUE_VARS() \ | |
72 REPEAT_8_UNIQUE_VARS() \ | |
73 UNIQUE_VAR() \ | |
74 UNIQUE_VAR() | |
75 | |
67 static const char* kGoldenFileDirectory = | 76 static const char* kGoldenFileDirectory = |
68 "test/cctest/interpreter/bytecode_expectations/"; | 77 "test/cctest/interpreter/bytecode_expectations/"; |
69 | 78 |
70 class InitializedIgnitionHandleScope : public InitializedHandleScope { | 79 class InitializedIgnitionHandleScope : public InitializedHandleScope { |
71 public: | 80 public: |
72 InitializedIgnitionHandleScope() { | 81 InitializedIgnitionHandleScope() { |
73 i::FLAG_ignition = true; | 82 i::FLAG_ignition = true; |
74 i::FLAG_ignition_osr = false; // TODO(4764): Disabled for now. | 83 i::FLAG_ignition_osr = false; // TODO(4764): Disabled for now. |
75 i::FLAG_always_opt = false; | 84 i::FLAG_always_opt = false; |
76 i::FLAG_allow_natives_syntax = true; | 85 i::FLAG_allow_natives_syntax = true; |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1346 | 1355 |
1347 "var a = 1; var b = 2; return function() { a = 2; b = 3 };\n", | 1356 "var a = 1; var b = 2; return function() { a = 2; b = 3 };\n", |
1348 | 1357 |
1349 "var a; (function() { a = 2; })(); return a;\n", | 1358 "var a; (function() { a = 2; })(); return a;\n", |
1350 | 1359 |
1351 "'use strict';\n" | 1360 "'use strict';\n" |
1352 "let a = 1;\n" | 1361 "let a = 1;\n" |
1353 "{ let b = 2; return function() { a + b; }; }\n", | 1362 "{ let b = 2; return function() { a + b; }; }\n", |
1354 | 1363 |
1355 "'use strict';\n" | 1364 "'use strict';\n" |
1356 REPEAT_249_UNIQUE_VARS() | 1365 REPEAT_250_UNIQUE_VARS() |
1357 "eval();\n" | 1366 "eval();\n" |
1358 "var b = 100;\n" | 1367 "var b = 100;\n" |
1359 "return b\n", | 1368 "return b\n", |
1360 }; | 1369 }; |
1361 | 1370 |
1362 CHECK(CompareTexts(BuildActual(printer, snippets), | 1371 CHECK(CompareTexts(BuildActual(printer, snippets), |
1363 LoadGolden("ContextVariables.golden"))); | 1372 LoadGolden("ContextVariables.golden"))); |
1364 } | 1373 } |
1365 | 1374 |
1366 TEST(ContextParameters) { | 1375 TEST(ContextParameters) { |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2257 "f();\n", | 2266 "f();\n", |
2258 }; | 2267 }; |
2259 | 2268 |
2260 CHECK(CompareTexts(BuildActual(printer, snippets), | 2269 CHECK(CompareTexts(BuildActual(printer, snippets), |
2261 LoadGolden("Generators.golden"))); | 2270 LoadGolden("Generators.golden"))); |
2262 } | 2271 } |
2263 | 2272 |
2264 } // namespace interpreter | 2273 } // namespace interpreter |
2265 } // namespace internal | 2274 } // namespace internal |
2266 } // namespace v8 | 2275 } // namespace v8 |
OLD | NEW |