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_fallback_on_catch = false; | |
28 i::FLAG_ignition_filter = StrDup(kFunctionName); | 27 i::FLAG_ignition_filter = StrDup(kFunctionName); |
29 i::FLAG_always_opt = false; | 28 i::FLAG_always_opt = false; |
30 i::FLAG_allow_natives_syntax = true; | 29 i::FLAG_allow_natives_syntax = true; |
31 i::FLAG_legacy_const = true; | 30 i::FLAG_legacy_const = true; |
32 CcTest::i_isolate()->interpreter()->Initialize(); | 31 CcTest::i_isolate()->interpreter()->Initialize(); |
33 } | 32 } |
34 | 33 |
35 Isolate* isolate() { return CcTest::i_isolate(); } | 34 Isolate* isolate() { return CcTest::i_isolate(); } |
36 Factory* factory() { return CcTest::i_isolate()->factory(); } | 35 Factory* factory() { return CcTest::i_isolate()->factory(); } |
37 | 36 |
(...skipping 7241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7279 std::string(function_epilogue); | 7278 std::string(function_epilogue); |
7280 Handle<BytecodeArray> bytecode_array = | 7279 Handle<BytecodeArray> bytecode_array = |
7281 helper.MakeBytecode(script.c_str(), "*", "f"); | 7280 helper.MakeBytecode(script.c_str(), "*", "f"); |
7282 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 7281 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
7283 } | 7282 } |
7284 } | 7283 } |
7285 | 7284 |
7286 } // namespace interpreter | 7285 } // namespace interpreter |
7287 } // namespace internal | 7286 } // namespace internal |
7288 } // namespace v8 | 7287 } // namespace v8 |
OLD | NEW |