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

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

Issue 1378523005: [Interpreter] Add support for global declarations and load/store of global variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_toplevel
Patch Set: Created 5 years, 3 months 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 eb0c2412faec884664c51cf38053c8bdd2eab26e..e4df618394414493cb01a69968356e222624564a 100644
--- a/test/unittests/compiler/interpreter-assembler-unittest.cc
+++ b/test/unittests/compiler/interpreter-assembler-unittest.cc
@@ -447,18 +447,15 @@ 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));
}
}

Powered by Google App Engine
This is Rietveld 408576698