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.h" | 7 #include "src/compiler.h" |
8 #include "src/interpreter/bytecode-array-iterator.h" | 8 #include "src/interpreter/bytecode-array-iterator.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" |
11 #include "test/cctest/cctest.h" | 11 #include "test/cctest/cctest.h" |
12 #include "test/cctest/test-feedback-vector.h" | 12 #include "test/cctest/test-feedback-vector.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 namespace interpreter { | 16 namespace interpreter { |
17 | 17 |
18 class BytecodeGeneratorHelper { | 18 class BytecodeGeneratorHelper { |
19 public: | 19 public: |
20 const char* kFunctionName = "f"; | 20 const char* kFunctionName = "f"; |
21 | 21 |
22 static const int kLastParamIndex = | 22 static const int kLastParamIndex = |
23 -InterpreterFrameConstants::kLastParamFromRegisterPointer / kPointerSize; | 23 -InterpreterFrameConstants::kLastParamFromRegisterPointer / kPointerSize; |
24 | 24 |
25 BytecodeGeneratorHelper() { | 25 BytecodeGeneratorHelper() { |
26 i::FLAG_ignition = true; | 26 i::FLAG_ignition = true; |
27 i::FLAG_ignition_fake_try_catch = true; | |
28 i::FLAG_ignition_fallback_on_catch = false; | 27 i::FLAG_ignition_fallback_on_catch = false; |
29 i::FLAG_ignition_filter = StrDup(kFunctionName); | 28 i::FLAG_ignition_filter = StrDup(kFunctionName); |
30 i::FLAG_always_opt = false; | 29 i::FLAG_always_opt = false; |
31 i::FLAG_allow_natives_syntax = true; | 30 i::FLAG_allow_natives_syntax = true; |
32 i::FLAG_legacy_const = true; | 31 i::FLAG_legacy_const = true; |
33 CcTest::i_isolate()->interpreter()->Initialize(); | 32 CcTest::i_isolate()->interpreter()->Initialize(); |
34 } | 33 } |
35 | 34 |
36 Isolate* isolate() { return CcTest::i_isolate(); } | 35 Isolate* isolate() { return CcTest::i_isolate(); } |
37 Factory* factory() { return CcTest::i_isolate()->factory(); } | 36 Factory* factory() { return CcTest::i_isolate()->factory(); } |
(...skipping 6778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6816 std::string(function_epilogue); | 6815 std::string(function_epilogue); |
6817 Handle<BytecodeArray> bytecode_array = | 6816 Handle<BytecodeArray> bytecode_array = |
6818 helper.MakeBytecode(script.c_str(), "*", "f"); | 6817 helper.MakeBytecode(script.c_str(), "*", "f"); |
6819 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 6818 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
6820 } | 6819 } |
6821 } | 6820 } |
6822 | 6821 |
6823 } // namespace interpreter | 6822 } // namespace interpreter |
6824 } // namespace internal | 6823 } // namespace internal |
6825 } // namespace v8 | 6824 } // namespace v8 |
OLD | NEW |