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

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: Fix test Created 5 years, 2 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 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));
}
}
« no previous file with comments | « test/cctest/interpreter/test-interpreter.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698