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" |
(...skipping 11 matching lines...) Expand all Loading... |
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; | 27 i::FLAG_ignition_fake_try_catch = true; |
28 i::FLAG_ignition_fallback_on_eval_and_catch = false; | 28 i::FLAG_ignition_fallback_on_eval_and_catch = false; |
29 i::FLAG_ignition_filter = StrDup(kFunctionName); | 29 i::FLAG_ignition_filter = StrDup(kFunctionName); |
30 i::FLAG_always_opt = false; | 30 i::FLAG_always_opt = false; |
31 i::FLAG_allow_natives_syntax = true; | 31 i::FLAG_allow_natives_syntax = true; |
| 32 i::FLAG_legacy_const = true; |
32 CcTest::i_isolate()->interpreter()->Initialize(); | 33 CcTest::i_isolate()->interpreter()->Initialize(); |
33 } | 34 } |
34 | 35 |
35 Isolate* isolate() { return CcTest::i_isolate(); } | 36 Isolate* isolate() { return CcTest::i_isolate(); } |
36 Factory* factory() { return CcTest::i_isolate()->factory(); } | 37 Factory* factory() { return CcTest::i_isolate()->factory(); } |
37 | 38 |
38 Handle<BytecodeArray> MakeTopLevelBytecode(const char* source) { | 39 Handle<BytecodeArray> MakeTopLevelBytecode(const char* source) { |
39 const char* old_ignition_filter = i::FLAG_ignition_filter; | 40 const char* old_ignition_filter = i::FLAG_ignition_filter; |
40 i::FLAG_ignition_filter = "*"; | 41 i::FLAG_ignition_filter = "*"; |
41 Local<v8::Script> script = v8_compile(source); | 42 Local<v8::Script> script = v8_compile(source); |
(...skipping 6224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6266 std::string(function_epilogue); | 6267 std::string(function_epilogue); |
6267 Handle<BytecodeArray> bytecode_array = | 6268 Handle<BytecodeArray> bytecode_array = |
6268 helper.MakeBytecode(script.c_str(), "t", "f"); | 6269 helper.MakeBytecode(script.c_str(), "t", "f"); |
6269 CheckBytecodeArrayEqual(snippets[i], bytecode_array); | 6270 CheckBytecodeArrayEqual(snippets[i], bytecode_array); |
6270 } | 6271 } |
6271 } | 6272 } |
6272 | 6273 |
6273 } // namespace interpreter | 6274 } // namespace interpreter |
6274 } // namespace internal | 6275 } // namespace internal |
6275 } // namespace v8 | 6276 } // namespace v8 |
OLD | NEW |