Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1252)

Unified Diff: test/unittests/compiler/interpreter-assembler-unittest.cc

Issue 1513543003: [turbofan] Make MachineType a pair of enums. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/unittests/compiler/interpreter-assembler-unittest.cc
diff --git a/test/unittests/compiler/interpreter-assembler-unittest.cc b/test/unittests/compiler/interpreter-assembler-unittest.cc
index 183795d477b3de088fdf25a64a35ca2b265a62b1..e98a3595c1dde74a371a5084cd7a3e7cbd745b23 100644
--- a/test/unittests/compiler/interpreter-assembler-unittest.cc
+++ b/test/unittests/compiler/interpreter-assembler-unittest.cc
@@ -96,7 +96,8 @@ Matcher<Node*>
InterpreterAssemblerTest::InterpreterAssemblerForTest::IsBytecodeOperand(
int offset) {
return IsLoad(
- kMachUint8, IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
+ MachineType::Uint8(),
+ IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
IsIntPtrAdd(IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
IsInt32Constant(offset)));
}
@@ -105,7 +106,8 @@ InterpreterAssemblerTest::InterpreterAssemblerForTest::IsBytecodeOperand(
Matcher<Node*> InterpreterAssemblerTest::InterpreterAssemblerForTest::
IsBytecodeOperandSignExtended(int offset) {
Matcher<Node*> load_matcher = IsLoad(
- kMachInt8, IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
+ MachineType::Int8(),
+ IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
IsIntPtrAdd(IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
IsInt32Constant(offset)));
if (kPointerSize == 8) {
@@ -120,16 +122,19 @@ InterpreterAssemblerTest::InterpreterAssemblerForTest::IsBytecodeOperandShort(
int offset) {
if (TargetSupportsUnalignedAccess()) {
return IsLoad(
- kMachUint16, IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
+ MachineType::Uint16(),
+ IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
IsIntPtrAdd(IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
IsInt32Constant(offset)));
} else {
Matcher<Node*> first_byte = IsLoad(
- kMachUint8, IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
+ MachineType::Uint8(),
+ IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
IsIntPtrAdd(IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
IsInt32Constant(offset)));
Matcher<Node*> second_byte = IsLoad(
- kMachUint8, IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
+ MachineType::Uint8(),
+ IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
IsIntPtrAdd(IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
IsInt32Constant(offset + 1)));
#if V8_TARGET_LITTLE_ENDIAN
@@ -158,13 +163,15 @@ TARGET_TEST_F(InterpreterAssemblerTest, Dispatch) {
Matcher<Node*> next_bytecode_offset_matcher =
IsIntPtrAdd(IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
IsInt32Constant(interpreter::Bytecodes::Size(bytecode)));
- Matcher<Node*> target_bytecode_matcher = m.IsLoad(
- kMachUint8, IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
- next_bytecode_offset_matcher);
- Matcher<Node*> code_target_matcher = m.IsLoad(
- kMachPtr, IsParameter(Linkage::kInterpreterDispatchTableParameter),
- IsWord32Shl(target_bytecode_matcher,
- IsInt32Constant(kPointerSizeLog2)));
+ Matcher<Node*> target_bytecode_matcher =
+ m.IsLoad(MachineType::Uint8(),
+ IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
+ next_bytecode_offset_matcher);
+ Matcher<Node*> code_target_matcher =
+ m.IsLoad(MachineType::Pointer(),
+ IsParameter(Linkage::kInterpreterDispatchTableParameter),
+ IsWord32Shl(target_bytecode_matcher,
+ IsInt32Constant(kPointerSizeLog2)));
EXPECT_EQ(CallDescriptor::kCallCodeObject, m.call_descriptor()->kind());
EXPECT_TRUE(m.call_descriptor()->flags() & CallDescriptor::kCanUseRoots);
@@ -196,13 +203,15 @@ TARGET_TEST_F(InterpreterAssemblerTest, Jump) {
Matcher<Node*> next_bytecode_offset_matcher =
IsIntPtrAdd(IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
IsInt32Constant(jump_offset));
- Matcher<Node*> target_bytecode_matcher = m.IsLoad(
- kMachUint8, IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
- next_bytecode_offset_matcher);
- Matcher<Node*> code_target_matcher = m.IsLoad(
- kMachPtr, IsParameter(Linkage::kInterpreterDispatchTableParameter),
- IsWord32Shl(target_bytecode_matcher,
- IsInt32Constant(kPointerSizeLog2)));
+ Matcher<Node*> target_bytecode_matcher =
+ m.IsLoad(MachineType::Uint8(),
+ IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
+ next_bytecode_offset_matcher);
+ Matcher<Node*> code_target_matcher =
+ m.IsLoad(MachineType::Pointer(),
+ IsParameter(Linkage::kInterpreterDispatchTableParameter),
+ IsWord32Shl(target_bytecode_matcher,
+ IsInt32Constant(kPointerSizeLog2)));
EXPECT_EQ(CallDescriptor::kCallCodeObject, m.call_descriptor()->kind());
EXPECT_TRUE(m.call_descriptor()->flags() & CallDescriptor::kCanUseRoots);
@@ -241,13 +250,15 @@ TARGET_TEST_F(InterpreterAssemblerTest, JumpIfWordEqual) {
Matcher<Node*> next_bytecode_offset_matcher =
IsIntPtrAdd(IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
IsInt32Constant(jump_offsets[i]));
- Matcher<Node*> target_bytecode_matcher = m.IsLoad(
- kMachUint8, IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
- next_bytecode_offset_matcher);
- Matcher<Node*> code_target_matcher = m.IsLoad(
- kMachPtr, IsParameter(Linkage::kInterpreterDispatchTableParameter),
- IsWord32Shl(target_bytecode_matcher,
- IsInt32Constant(kPointerSizeLog2)));
+ Matcher<Node*> target_bytecode_matcher =
+ m.IsLoad(MachineType::Uint8(),
+ IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
+ next_bytecode_offset_matcher);
+ Matcher<Node*> code_target_matcher =
+ m.IsLoad(MachineType::Pointer(),
+ IsParameter(Linkage::kInterpreterDispatchTableParameter),
+ IsWord32Shl(target_bytecode_matcher,
+ IsInt32Constant(kPointerSizeLog2)));
EXPECT_THAT(
end->InputAt(i),
IsTailCall(m.call_descriptor(), code_target_matcher,
@@ -383,7 +394,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadRegister) {
Node* load_reg_node = m.LoadRegister(reg_index_node);
EXPECT_THAT(
load_reg_node,
- m.IsLoad(kMachAnyTagged,
+ m.IsLoad(MachineType::AnyTagged(),
IsParameter(Linkage::kInterpreterRegisterFileParameter),
IsWordShl(reg_index_node, IsInt32Constant(kPointerSizeLog2))));
}
@@ -398,10 +409,11 @@ TARGET_TEST_F(InterpreterAssemblerTest, StoreRegister) {
Node* store_reg_node = m.StoreRegister(store_value, reg_index_node);
EXPECT_THAT(
store_reg_node,
- m.IsStore(StoreRepresentation(kMachAnyTagged, kNoWriteBarrier),
- IsParameter(Linkage::kInterpreterRegisterFileParameter),
- IsWordShl(reg_index_node, IsInt32Constant(kPointerSizeLog2)),
- store_value));
+ m.IsStore(
+ StoreRepresentation(MachineType::AnyTagged(), kNoWriteBarrier),
+ IsParameter(Linkage::kInterpreterRegisterFileParameter),
+ IsWordShl(reg_index_node, IsInt32Constant(kPointerSizeLog2)),
+ store_value));
}
}
@@ -456,12 +468,12 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadConstantPoolEntry) {
Node* index = m.Int32Constant(2);
Node* load_constant = m.LoadConstantPoolEntry(index);
Matcher<Node*> constant_pool_matcher = m.IsLoad(
- kMachAnyTagged,
+ MachineType::AnyTagged(),
IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
IsIntPtrConstant(BytecodeArray::kConstantPoolOffset - kHeapObjectTag));
EXPECT_THAT(
load_constant,
- m.IsLoad(kMachAnyTagged, constant_pool_matcher,
+ m.IsLoad(MachineType::AnyTagged(), constant_pool_matcher,
IsIntPtrAdd(
IsIntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag),
IsWordShl(index, IsInt32Constant(kPointerSizeLog2)))));
@@ -477,7 +489,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadFixedArrayElement) {
Node* load_element = m.LoadFixedArrayElement(fixed_array, index);
EXPECT_THAT(
load_element,
- m.IsLoad(kMachAnyTagged, fixed_array,
+ m.IsLoad(MachineType::AnyTagged(), fixed_array,
IsIntPtrAdd(
IsIntPtrConstant(FixedArray::kHeaderSize - kHeapObjectTag),
IsWordShl(IsInt32Constant(index),
@@ -493,7 +505,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadObjectField) {
int offset = 16;
Node* load_field = m.LoadObjectField(object, offset);
EXPECT_THAT(load_field,
- m.IsLoad(kMachAnyTagged, object,
+ m.IsLoad(MachineType::AnyTagged(), object,
IsIntPtrConstant(offset - kHeapObjectTag)));
}
}
@@ -509,7 +521,8 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadContextSlot) {
Matcher<Node*> offset =
IsIntPtrAdd(IsWordShl(slot_index, IsInt32Constant(kPointerSizeLog2)),
IsInt32Constant(Context::kHeaderSize - kHeapObjectTag));
- EXPECT_THAT(load_context_slot, m.IsLoad(kMachAnyTagged, context, offset));
+ EXPECT_THAT(load_context_slot,
+ m.IsLoad(MachineType::AnyTagged(), context, offset));
}
}
@@ -525,10 +538,10 @@ TARGET_TEST_F(InterpreterAssemblerTest, StoreContextSlot) {
Matcher<Node*> offset =
IsIntPtrAdd(IsWordShl(slot_index, IsInt32Constant(kPointerSizeLog2)),
IsInt32Constant(Context::kHeaderSize - kHeapObjectTag));
- EXPECT_THAT(
- store_context_slot,
- m.IsStore(StoreRepresentation(kMachAnyTagged, kFullWriteBarrier),
- context, offset, value));
+ EXPECT_THAT(store_context_slot,
+ m.IsStore(StoreRepresentation(MachineType::AnyTagged(),
+ kFullWriteBarrier),
+ context, offset, value));
}
}
@@ -561,7 +574,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, CallRuntime) {
function_table,
IsInt32Mul(function_id, IsInt32Constant(sizeof(Runtime::Function))));
Matcher<Node*> function_entry =
- m.IsLoad(kMachPtr, function,
+ m.IsLoad(MachineType::Pointer(), function,
IsInt32Constant(offsetof(Runtime::Function, entry)));
Node* call_runtime = m.CallRuntime(function_id, first_arg, arg_count);
@@ -611,18 +624,19 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadTypeFeedbackVector) {
InterpreterAssemblerForTest m(this, bytecode);
Node* feedback_vector = m.LoadTypeFeedbackVector();
- Matcher<Node*> load_function_matcher = m.IsLoad(
- kMachAnyTagged, IsParameter(Linkage::kInterpreterRegisterFileParameter),
- IsIntPtrConstant(
- InterpreterFrameConstants::kFunctionFromRegisterPointer));
+ Matcher<Node*> load_function_matcher =
+ m.IsLoad(MachineType::AnyTagged(),
+ IsParameter(Linkage::kInterpreterRegisterFileParameter),
+ IsIntPtrConstant(
+ InterpreterFrameConstants::kFunctionFromRegisterPointer));
Matcher<Node*> load_shared_function_info_matcher =
- m.IsLoad(kMachAnyTagged, load_function_matcher,
+ m.IsLoad(MachineType::AnyTagged(), load_function_matcher,
IsIntPtrConstant(JSFunction::kSharedFunctionInfoOffset -
kHeapObjectTag));
EXPECT_THAT(
feedback_vector,
- m.IsLoad(kMachAnyTagged, load_shared_function_info_matcher,
+ m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher,
IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset -
kHeapObjectTag)));
}
« no previous file with comments | « test/unittests/compiler/instruction-selector-unittest.cc ('k') | test/unittests/compiler/js-builtin-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698