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

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

Issue 1294133004: [Interpreter] Pass context to interpreter bytecode handlers and add LoadConstextSlot (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 a869f7ebb1121450022f63395029c5567b55bbce..bc5be263fff4d615741e78189144a08f6ce975e5 100644
--- a/test/unittests/compiler/interpreter-assembler-unittest.cc
+++ b/test/unittests/compiler/interpreter-assembler-unittest.cc
@@ -23,6 +23,12 @@ const interpreter::Bytecode kBytecodes[] = {
};
+Matcher<Node*> IsIntPtrConstant(const intptr_t value) {
+ return kPointerSize == 8 ? IsInt64Constant(static_cast<int64_t>(value))
+ : IsInt32Constant(static_cast<int32_t>(value));
+}
+
+
Matcher<Node*> IsIntPtrAdd(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher) {
return kPointerSize == 8 ? IsInt64Add(lhs_matcher, rhs_matcher)
@@ -130,6 +136,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, Dispatch) {
next_bytecode_offset_matcher,
IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
IsParameter(Linkage::kInterpreterDispatchTableParameter),
+ IsParameter(Linkage::kInterpreterContextParameter),
graph->start(), graph->start()));
}
}
@@ -158,6 +165,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, Return) {
IsParameter(Linkage::kInterpreterBytecodeOffsetParameter),
IsParameter(Linkage::kInterpreterBytecodeArrayParameter),
IsParameter(Linkage::kInterpreterDispatchTableParameter),
+ IsParameter(Linkage::kInterpreterContextParameter),
graph->start(), graph->start()));
}
}
@@ -223,7 +231,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, LoadRegister) {
Node* load_reg_node = m.LoadRegister(reg_index_node);
EXPECT_THAT(
load_reg_node,
- m.IsLoad(kMachPtr,
+ m.IsLoad(kMachAnyTagged,
IsParameter(Linkage::kInterpreterRegisterFileParameter),
IsWordShl(reg_index_node, IsInt32Constant(kPointerSizeLog2))));
}
@@ -238,7 +246,7 @@ TARGET_TEST_F(InterpreterAssemblerTest, StoreRegister) {
Node* store_reg_node = m.StoreRegister(store_value, reg_index_node);
EXPECT_THAT(
store_reg_node,
- m.IsStore(StoreRepresentation(kMachPtr, kNoWriteBarrier),
+ m.IsStore(StoreRepresentation(kMachAnyTagged, kNoWriteBarrier),
IsParameter(Linkage::kInterpreterRegisterFileParameter),
IsWordShl(reg_index_node, IsInt32Constant(kPointerSizeLog2)),
store_value));
@@ -257,6 +265,18 @@ TARGET_TEST_F(InterpreterAssemblerTest, SmiTag) {
}
}
+
+TARGET_TEST_F(InterpreterAssemblerTest, LoadContextSlot) {
+ TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
+ InterpreterAssemblerForTest m(this, bytecode);
+ Node* load_context = m.LoadContextSlot(22);
+ EXPECT_THAT(load_context,
+ m.IsLoad(kMachAnyTagged,
+ IsParameter(Linkage::kInterpreterContextParameter),
+ IsIntPtrConstant(Context::SlotOffset(22))));
+ }
+}
+
} // namespace compiler
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698