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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 static const char* kGoldenFileDirectory = | 68 static const char* kGoldenFileDirectory = |
69 "test/cctest/interpreter/bytecode_expectations/"; | 69 "test/cctest/interpreter/bytecode_expectations/"; |
70 | 70 |
71 class InitializedIgnitionHandleScope : public InitializedHandleScope { | 71 class InitializedIgnitionHandleScope : public InitializedHandleScope { |
72 public: | 72 public: |
73 InitializedIgnitionHandleScope() { | 73 InitializedIgnitionHandleScope() { |
74 i::FLAG_ignition = true; | 74 i::FLAG_ignition = true; |
75 i::FLAG_always_opt = false; | 75 i::FLAG_always_opt = false; |
76 i::FLAG_allow_natives_syntax = true; | 76 i::FLAG_allow_natives_syntax = true; |
77 CcTest::i_isolate()->interpreter()->Initialize(); | |
78 } | 77 } |
79 }; | 78 }; |
80 | 79 |
81 void SkipGoldenFileHeader(std::istream& stream) { // NOLINT | 80 void SkipGoldenFileHeader(std::istream& stream) { // NOLINT |
82 std::string line; | 81 std::string line; |
83 int separators_seen = 0; | 82 int separators_seen = 0; |
84 while (std::getline(stream, line)) { | 83 while (std::getline(stream, line)) { |
85 if (line == "---") separators_seen += 1; | 84 if (line == "---") separators_seen += 1; |
86 if (separators_seen == 2) return; | 85 if (separators_seen == 2) return; |
87 } | 86 } |
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2243 "foo.f(foo, foo.x);\n", | 2242 "foo.f(foo, foo.x);\n", |
2244 }; | 2243 }; |
2245 | 2244 |
2246 CHECK(CompareTexts(BuildActual(printer, snippets), | 2245 CHECK(CompareTexts(BuildActual(printer, snippets), |
2247 LoadGolden("Modules.golden"))); | 2246 LoadGolden("Modules.golden"))); |
2248 } | 2247 } |
2249 | 2248 |
2250 } // namespace interpreter | 2249 } // namespace interpreter |
2251 } // namespace internal | 2250 } // namespace internal |
2252 } // namespace v8 | 2251 } // namespace v8 |
OLD | NEW |