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_250_UNIQUE_VARS() \ | 59 #define REPEAT_249_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() \ | |
66 UNIQUE_VAR() | 65 UNIQUE_VAR() |
67 | 66 |
68 static const char* kGoldenFileDirectory = | 67 static const char* kGoldenFileDirectory = |
69 "test/cctest/interpreter/bytecode_expectations/"; | 68 "test/cctest/interpreter/bytecode_expectations/"; |
70 | 69 |
71 class InitializedIgnitionHandleScope : public InitializedHandleScope { | 70 class InitializedIgnitionHandleScope : public InitializedHandleScope { |
72 public: | 71 public: |
73 InitializedIgnitionHandleScope() { | 72 InitializedIgnitionHandleScope() { |
74 i::FLAG_ignition = true; | 73 i::FLAG_ignition = true; |
75 i::FLAG_ignition_osr = false; // TODO(4764): Disabled for now. | 74 i::FLAG_ignition_osr = false; // TODO(4764): Disabled for now. |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 | 1346 |
1348 "var a = 1; var b = 2; return function() { a = 2; b = 3 };\n", | 1347 "var a = 1; var b = 2; return function() { a = 2; b = 3 };\n", |
1349 | 1348 |
1350 "var a; (function() { a = 2; })(); return a;\n", | 1349 "var a; (function() { a = 2; })(); return a;\n", |
1351 | 1350 |
1352 "'use strict';\n" | 1351 "'use strict';\n" |
1353 "let a = 1;\n" | 1352 "let a = 1;\n" |
1354 "{ let b = 2; return function() { a + b; }; }\n", | 1353 "{ let b = 2; return function() { a + b; }; }\n", |
1355 | 1354 |
1356 "'use strict';\n" | 1355 "'use strict';\n" |
1357 REPEAT_250_UNIQUE_VARS() | 1356 REPEAT_249_UNIQUE_VARS() |
1358 "eval();\n" | 1357 "eval();\n" |
1359 "var b = 100;\n" | 1358 "var b = 100;\n" |
1360 "return b\n", | 1359 "return b\n", |
1361 }; | 1360 }; |
1362 | 1361 |
1363 CHECK(CompareTexts(BuildActual(printer, snippets), | 1362 CHECK(CompareTexts(BuildActual(printer, snippets), |
1364 LoadGolden("ContextVariables.golden"))); | 1363 LoadGolden("ContextVariables.golden"))); |
1365 } | 1364 } |
1366 | 1365 |
1367 TEST(ContextParameters) { | 1366 TEST(ContextParameters) { |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2258 "f();\n", | 2257 "f();\n", |
2259 }; | 2258 }; |
2260 | 2259 |
2261 CHECK(CompareTexts(BuildActual(printer, snippets), | 2260 CHECK(CompareTexts(BuildActual(printer, snippets), |
2262 LoadGolden("Generators.golden"))); | 2261 LoadGolden("Generators.golden"))); |
2263 } | 2262 } |
2264 | 2263 |
2265 } // namespace interpreter | 2264 } // namespace interpreter |
2266 } // namespace internal | 2265 } // namespace internal |
2267 } // namespace v8 | 2266 } // namespace v8 |
OLD | NEW |