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-generator.h" | 8 #include "src/interpreter/bytecode-generator.h" |
9 #include "src/interpreter/interpreter.h" | 9 #include "src/interpreter/interpreter.h" |
10 #include "test/cctest/cctest.h" | 10 #include "test/cctest/cctest.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 namespace interpreter { | 14 namespace interpreter { |
15 | 15 |
16 class BytecodeGeneratorHelper { | 16 class BytecodeGeneratorHelper { |
17 public: | 17 public: |
18 const char* kFunctionName = "f"; | 18 const char* kFunctionName = "f"; |
19 | 19 |
20 BytecodeGeneratorHelper() { | 20 BytecodeGeneratorHelper() { |
21 i::FLAG_ignition = true; | 21 i::FLAG_ignition = true; |
22 i::FLAG_ignition_filter = kFunctionName; | 22 i::FLAG_ignition_filter = kFunctionName; |
| 23 i::FLAG_always_opt = false; |
23 CcTest::i_isolate()->interpreter()->Initialize(); | 24 CcTest::i_isolate()->interpreter()->Initialize(); |
24 } | 25 } |
25 | 26 |
26 | 27 |
27 Handle<BytecodeArray> MakeBytecode(const char* script, | 28 Handle<BytecodeArray> MakeBytecode(const char* script, |
28 const char* function_name) { | 29 const char* function_name) { |
29 CompileRun(script); | 30 CompileRun(script); |
30 Local<Function> function = | 31 Local<Function> function = |
31 Local<Function>::Cast(CcTest::global()->Get(v8_str(function_name))); | 32 Local<Function>::Cast(CcTest::global()->Get(v8_str(function_name))); |
32 i::Handle<i::JSFunction> js_function = v8::Utils::OpenHandle(*function); | 33 i::Handle<i::JSFunction> js_function = v8::Utils::OpenHandle(*function); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 CHECK(String::cast(ba->constant_pool()->get(j))->Equals(*expected)); | 323 CHECK(String::cast(ba->constant_pool()->get(j))->Equals(*expected)); |
323 } | 324 } |
324 } | 325 } |
325 } | 326 } |
326 } | 327 } |
327 | 328 |
328 | 329 |
329 } // namespace interpreter | 330 } // namespace interpreter |
330 } // namespace internal | 331 } // namespace internal |
331 } // namespance v8 | 332 } // namespance v8 |
OLD | NEW |