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 8a37c873a1a062d8237f76e005ef7f220eab6b4d..0fab029d565c462b82d2bd9a573a4616dbc20170 100644 |
--- a/test/unittests/compiler/interpreter-assembler-unittest.cc |
+++ b/test/unittests/compiler/interpreter-assembler-unittest.cc |
@@ -474,18 +474,14 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadConstantPoolEntry) { |
TARGET_TEST_F(InterpreterAssemblerTest, LoadContextSlot) { |
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
InterpreterAssemblerForTest m(this, bytecode); |
- Node* load_from_current_context = m.LoadContextSlot(22); |
- Matcher<Node*> load_from_current_context_matcher = m.IsLoad( |
- kMachAnyTagged, IsParameter(Linkage::kInterpreterContextParameter), |
- IsIntPtrConstant(Context::SlotOffset(22))); |
- EXPECT_THAT(load_from_current_context, load_from_current_context_matcher); |
- |
- // Let's imagine that the loaded context slot is another context. |
- Node* load_from_any_context = |
- m.LoadContextSlot(load_from_current_context, 23); |
- EXPECT_THAT(load_from_any_context, |
- m.IsLoad(kMachAnyTagged, load_from_current_context_matcher, |
- IsIntPtrConstant(Context::SlotOffset(23)))); |
+ Node* context = m.Int32Constant(1); |
+ Node* slot_index = m.Int32Constant(22); |
+ Node* load_context_slot = m.LoadContextSlot(context, slot_index); |
+ |
+ Matcher<Node*> offset = |
+ IsIntPtrAdd(IsWordShl(slot_index, IsInt32Constant(kPointerSizeLog2)), |
+ IsInt32Constant(Context::kHeaderSize - kHeapObjectTag)); |
+ EXPECT_THAT(load_context_slot, m.IsLoad(kMachAnyTagged, context, offset)); |
} |
} |