| 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 const int kLastParamIndex = | 20 const int kLastParamIndex = |
| 21 -InterpreterFrameConstants::kLastParamFromRegisterPointer / kPointerSize; | 21 -InterpreterFrameConstants::kLastParamFromRegisterPointer / kPointerSize; |
| 22 | 22 |
| 23 BytecodeGeneratorHelper() { | 23 BytecodeGeneratorHelper() { |
| 24 i::FLAG_vector_stores = true; | 24 i::FLAG_vector_stores = true; |
| 25 i::FLAG_ignition = true; | 25 i::FLAG_ignition = true; |
| 26 i::FLAG_ignition_filter = kFunctionName; | 26 i::FLAG_ignition_filter = StrDup(kFunctionName); |
| 27 i::FLAG_always_opt = false; |
| 27 CcTest::i_isolate()->interpreter()->Initialize(); | 28 CcTest::i_isolate()->interpreter()->Initialize(); |
| 28 } | 29 } |
| 29 | 30 |
| 30 | 31 |
| 31 Factory* factory() { return CcTest::i_isolate()->factory(); } | 32 Factory* factory() { return CcTest::i_isolate()->factory(); } |
| 32 | 33 |
| 33 | 34 |
| 34 Handle<BytecodeArray> MakeBytecode(const char* script, | 35 Handle<BytecodeArray> MakeBytecode(const char* script, |
| 35 const char* function_name) { | 36 const char* function_name) { |
| 36 CompileRun(script); | 37 CompileRun(script); |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 Handle<String> expected = | 521 Handle<String> expected = |
| 521 helper.factory()->NewStringFromAsciiChecked(snippets[i].constants[j]); | 522 helper.factory()->NewStringFromAsciiChecked(snippets[i].constants[j]); |
| 522 CHECK(String::cast(ba->constant_pool()->get(j))->Equals(*expected)); | 523 CHECK(String::cast(ba->constant_pool()->get(j))->Equals(*expected)); |
| 523 } | 524 } |
| 524 } | 525 } |
| 525 } | 526 } |
| 526 | 527 |
| 527 } // namespace interpreter | 528 } // namespace interpreter |
| 528 } // namespace internal | 529 } // namespace internal |
| 529 } // namespance v8 | 530 } // namespance v8 |
| OLD | NEW |