Index: test/unittests/interpreter/interpreter-assembler-unittest.cc |
diff --git a/test/unittests/interpreter/interpreter-assembler-unittest.cc b/test/unittests/interpreter/interpreter-assembler-unittest.cc |
index ad49b798f660033aeff25cdebb92d9062ad2ba84..b8eb64c8844261c26f72f6962731f9e3ed069aa0 100644 |
--- a/test/unittests/interpreter/interpreter-assembler-unittest.cc |
+++ b/test/unittests/interpreter/interpreter-assembler-unittest.cc |
@@ -5,6 +5,7 @@ |
#include "test/unittests/interpreter/interpreter-assembler-unittest.h" |
#include "src/code-factory.h" |
+#include "src/compiler/graph.h" |
#include "src/compiler/node.h" |
#include "src/interface-descriptors.h" |
#include "src/isolate.h" |
@@ -19,14 +20,6 @@ |
using namespace compiler; |
namespace interpreter { |
- |
-InterpreterAssemblerTestState::InterpreterAssemblerTestState( |
- InterpreterAssemblerTest* test, Bytecode bytecode) |
- : compiler::CodeAssemblerState( |
- test->isolate(), test->zone(), |
- InterpreterDispatchDescriptor(test->isolate()), |
- Code::ComputeFlags(Code::BYTECODE_HANDLER), |
- Bytecodes::ToString(bytecode), Bytecodes::ReturnCount(bytecode)) {} |
const interpreter::Bytecode kBytecodes[] = { |
#define DEFINE_BYTECODE(Name, ...) interpreter::Bytecode::k##Name, |
@@ -305,8 +298,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, Dispatch) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* tail_call_node = m.Dispatch(); |
OperandScale operand_scale = OperandScale::kSingle; |
@@ -372,8 +364,7 @@ |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
if (!interpreter::Bytecodes::IsJump(bytecode)) return; |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* tail_call_node = m.Jump(m.IntPtrConstant(jump_offset)); |
Matcher<Node*> next_bytecode_offset_matcher = IsIntPtrAdd( |
@@ -407,8 +398,7 @@ |
OperandScale::kSingle, OperandScale::kDouble, OperandScale::kQuadruple}; |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
TRACED_FOREACH(interpreter::OperandScale, operand_scale, kOperandScales) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode, operand_scale); |
+ InterpreterAssemblerForTest m(this, bytecode, operand_scale); |
int number_of_operands = |
interpreter::Bytecodes::NumberOfOperands(bytecode); |
for (int i = 0; i < number_of_operands; i++) { |
@@ -473,8 +463,7 @@ |
continue; |
} |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
// Should be incoming accumulator if not set. |
EXPECT_THAT(m.GetAccumulator(), |
IsParameter(InterpreterDispatchDescriptor::kAccumulator)); |
@@ -496,8 +485,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, GetContext) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
EXPECT_THAT( |
m.GetContext(), |
m.IsLoad(MachineType::AnyTagged(), IsLoadParentFramePointer(), |
@@ -508,8 +496,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, RegisterLocation) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* reg_index_node = m.IntPtrConstant(44); |
Node* reg_location_node = m.RegisterLocation(reg_index_node); |
EXPECT_THAT(reg_location_node, |
@@ -521,8 +508,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, LoadRegister) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* reg_index_node = m.IntPtrConstant(44); |
Node* load_reg_node = m.LoadRegister(reg_index_node); |
EXPECT_THAT(load_reg_node, |
@@ -534,8 +520,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, StoreRegister) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* store_value = m.Int32Constant(0xdeadbeef); |
Node* reg_index_node = m.IntPtrConstant(44); |
Node* store_reg_node = m.StoreRegister(store_value, reg_index_node); |
@@ -551,8 +536,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, SmiTag) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* value = m.Int32Constant(44); |
EXPECT_THAT(m.SmiTag(value), IsBitcastWordToTaggedSigned(IsIntPtrConstant( |
static_cast<intptr_t>(44) |
@@ -565,8 +549,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, IntPtrAdd) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* a = m.Int32Constant(0); |
Node* b = m.Int32Constant(1); |
Node* add = m.IntPtrAdd(a, b); |
@@ -576,8 +559,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, IntPtrSub) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* a = m.Int32Constant(0); |
Node* b = m.Int32Constant(1); |
Node* add = m.IntPtrSub(a, b); |
@@ -587,8 +569,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, WordShl) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* a = m.IntPtrConstant(0); |
Node* add = m.WordShl(a, 10); |
EXPECT_THAT(add, IsWordShl(a, IsIntPtrConstant(10))); |
@@ -597,8 +578,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, LoadConstantPoolEntry) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* index = m.IntPtrConstant(2); |
Node* load_constant = m.LoadConstantPoolEntry(index); |
Matcher<Node*> constant_pool_matcher = m.IsLoad( |
@@ -616,8 +596,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, LoadObjectField) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* object = m.IntPtrConstant(0xdeadbeef); |
int offset = 16; |
Node* load_field = m.LoadObjectField(object, offset); |
@@ -629,8 +608,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime2) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* arg1 = m.Int32Constant(2); |
Node* arg2 = m.Int32Constant(3); |
Node* context = m.Int32Constant(4); |
@@ -644,8 +622,7 @@ |
const int kResultSizes[] = {1, 2}; |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
TRACED_FOREACH(int, result_size, kResultSizes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Callable builtin = CodeFactory::InterpreterCEntry(isolate(), result_size); |
Node* function_id = m.Int32Constant(0); |
@@ -676,8 +653,7 @@ |
TailCallMode::kAllow}; |
TRACED_FOREACH(TailCallMode, tail_call_mode, tail_call_modes) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Callable builtin = |
CodeFactory::InterpreterPushArgsAndCall(isolate(), tail_call_mode); |
Node* function = m.Int32Constant(0); |
@@ -694,8 +670,7 @@ |
TARGET_TEST_F(InterpreterAssemblerTest, LoadTypeFeedbackVector) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
- InterpreterAssemblerTestState state(this, bytecode); |
- InterpreterAssemblerForTest m(&state, bytecode); |
+ InterpreterAssemblerForTest m(this, bytecode); |
Node* feedback_vector = m.LoadTypeFeedbackVector(); |
Matcher<Node*> load_function_matcher = |