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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler/pipeline.h" | 7 #include "src/compiler/pipeline.h" |
8 #include "src/handles.h" | 8 #include "src/handles.h" |
9 #include "src/interpreter/bytecode-generator.h" | 9 #include "src/interpreter/bytecode-generator.h" |
10 #include "src/interpreter/interpreter.h" | 10 #include "src/interpreter/interpreter.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 optimization_bitmap, function_body, function_decl_params, function_args); | 219 optimization_bitmap, function_body, function_decl_params, function_args); |
220 SourcePositionMatcher matcher; | 220 SourcePositionMatcher matcher; |
221 if (!matcher.Match(unoptimized_bytecode, optimized_bytecode)) { | 221 if (!matcher.Match(unoptimized_bytecode, optimized_bytecode)) { |
222 return false; | 222 return false; |
223 } | 223 } |
224 return true; | 224 return true; |
225 } | 225 } |
226 | 226 |
227 void TestSourcePositionsEquivalent(int optimization_bitmap) { | 227 void TestSourcePositionsEquivalent(int optimization_bitmap) { |
228 HandleAndZoneScope handles; | 228 HandleAndZoneScope handles; |
229 // Ensure handler table is generated. | |
230 handles.main_isolate()->interpreter()->Initialize(); | |
231 | |
232 OptimizedBytecodeSourcePositionTester tester(handles.main_isolate()); | 229 OptimizedBytecodeSourcePositionTester tester(handles.main_isolate()); |
233 for (auto test_case_data : kTestCaseData) { | 230 for (auto test_case_data : kTestCaseData) { |
234 CHECK(tester.SourcePositionsMatch( | 231 CHECK(tester.SourcePositionsMatch( |
235 optimization_bitmap, test_case_data.script(), | 232 optimization_bitmap, test_case_data.script(), |
236 test_case_data.declaration_parameters(), test_case_data.arguments())); | 233 test_case_data.declaration_parameters(), test_case_data.arguments())); |
237 } | 234 } |
238 } | 235 } |
239 | 236 |
240 #define MAKE_TEST(Name, Bitmap) \ | 237 #define MAKE_TEST(Name, Bitmap) \ |
241 TEST(TestSourcePositionsEquivalent##Name) { \ | 238 TEST(TestSourcePositionsEquivalent##Name) { \ |
242 TestSourcePositionsEquivalent(Bitmap); \ | 239 TestSourcePositionsEquivalent(Bitmap); \ |
243 } | 240 } |
244 TEST_CASES(MAKE_TEST) | 241 TEST_CASES(MAKE_TEST) |
245 #undef MAKE_TEST | 242 #undef MAKE_TEST |
246 | 243 |
247 } // namespace interpreter | 244 } // namespace interpreter |
248 } // namespace internal | 245 } // namespace internal |
249 } // namespace v8 | 246 } // namespace v8 |
OLD | NEW |