| 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 "test/cctest/interpreter/interpreter-tester.h" | 5 #include "test/cctest/interpreter/interpreter-tester.h" |
| 6 | 6 |
| 7 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 namespace interpreter { | 9 namespace interpreter { |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 bytecode_(bytecode), | 22 bytecode_(bytecode), |
| 23 feedback_vector_(feedback_vector) { | 23 feedback_vector_(feedback_vector) { |
| 24 i::FLAG_ignition = true; | 24 i::FLAG_ignition = true; |
| 25 i::FLAG_always_opt = false; | 25 i::FLAG_always_opt = false; |
| 26 // Set ignition filter flag via SetFlagsFromString to avoid double-free | 26 // Set ignition filter flag via SetFlagsFromString to avoid double-free |
| 27 // (or potential leak with StrDup() based on ownership confusion). | 27 // (or potential leak with StrDup() based on ownership confusion). |
| 28 ScopedVector<char> ignition_filter(64); | 28 ScopedVector<char> ignition_filter(64); |
| 29 SNPrintF(ignition_filter, "--ignition-filter=%s", filter); | 29 SNPrintF(ignition_filter, "--ignition-filter=%s", filter); |
| 30 FlagList::SetFlagsFromString(ignition_filter.start(), | 30 FlagList::SetFlagsFromString(ignition_filter.start(), |
| 31 ignition_filter.length()); | 31 ignition_filter.length()); |
| 32 // Ensure handler table is generated. |
| 33 isolate->interpreter()->Initialize(); |
| 32 } | 34 } |
| 33 | 35 |
| 34 InterpreterTester::InterpreterTester( | 36 InterpreterTester::InterpreterTester( |
| 35 Isolate* isolate, Handle<BytecodeArray> bytecode, | 37 Isolate* isolate, Handle<BytecodeArray> bytecode, |
| 36 MaybeHandle<TypeFeedbackVector> feedback_vector, const char* filter) | 38 MaybeHandle<TypeFeedbackVector> feedback_vector, const char* filter) |
| 37 : InterpreterTester(isolate, nullptr, bytecode, feedback_vector, filter) {} | 39 : InterpreterTester(isolate, nullptr, bytecode, feedback_vector, filter) {} |
| 38 | 40 |
| 39 InterpreterTester::InterpreterTester(Isolate* isolate, const char* source, | 41 InterpreterTester::InterpreterTester(Isolate* isolate, const char* source, |
| 40 const char* filter) | 42 const char* filter) |
| 41 : InterpreterTester(isolate, source, MaybeHandle<BytecodeArray>(), | 43 : InterpreterTester(isolate, source, MaybeHandle<BytecodeArray>(), |
| (...skipping 26 matching lines...) Expand all Loading... |
| 68 return "function " + function_name() + "() {\n" + std::string(body) + "\n}"; | 70 return "function " + function_name() + "() {\n" + std::string(body) + "\n}"; |
| 69 } | 71 } |
| 70 | 72 |
| 71 std::string InterpreterTester::function_name() { | 73 std::string InterpreterTester::function_name() { |
| 72 return std::string(kFunctionName); | 74 return std::string(kFunctionName); |
| 73 } | 75 } |
| 74 | 76 |
| 75 } // namespace interpreter | 77 } // namespace interpreter |
| 76 } // namespace internal | 78 } // namespace internal |
| 77 } // namespace v8 | 79 } // namespace v8 |
| OLD | NEW |