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

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

Issue 1852213002: [interpreter] Add accumulator use description to bytecodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 8 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
« no previous file with comments | « test/unittests/interpreter/interpreter-assembler-unittest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/interpreter/interpreter-assembler-unittest.cc
diff --git a/test/unittests/interpreter/interpreter-assembler-unittest.cc b/test/unittests/interpreter/interpreter-assembler-unittest.cc
index 79626ea9b49bd2f98be578083d67fab7d65c7c8f..0106c577bd90646341070b5a61682a969ba20dc3 100644
--- a/test/unittests/interpreter/interpreter-assembler-unittest.cc
+++ b/test/unittests/interpreter/interpreter-assembler-unittest.cc
@@ -62,6 +62,18 @@ Matcher<Node*> IsWordOr(const Matcher<Node*>& lhs_matcher,
: IsWord32Or(lhs_matcher, rhs_matcher);
}
+InterpreterAssemblerTest::InterpreterAssemblerForTest::
+ ~InterpreterAssemblerForTest() {
+ // Tests don't necessarily read and write accumulator but
+ // InterpreterAssembler checks accumulator uses.
+ if (Bytecodes::ReadsAccumulator(bytecode())) {
+ GetAccumulator();
+ }
+ if (Bytecodes::WritesAccumulator(bytecode())) {
+ SetAccumulator(nullptr);
+ }
+}
+
Matcher<Node*> InterpreterAssemblerTest::InterpreterAssemblerForTest::IsLoad(
const Matcher<LoadRepresentation>& rep_matcher,
const Matcher<Node*>& base_matcher, const Matcher<Node*>& index_matcher) {
@@ -524,12 +536,16 @@ TARGET_TEST_F(InterpreterAssemblerTest, BytecodeOperand) {
TARGET_TEST_F(InterpreterAssemblerTest, GetSetAccumulator) {
TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) {
+ if (!interpreter::Bytecodes::ReadsAccumulator(bytecode) ||
+ !interpreter::Bytecodes::WritesAccumulator(bytecode)) {
+ continue;
+ }
+
InterpreterAssemblerForTest m(this, bytecode);
// Should be incoming accumulator if not set.
EXPECT_THAT(
m.GetAccumulator(),
IsParameter(InterpreterDispatchDescriptor::kAccumulatorParameter));
-
// Should be set by SetAccumulator.
Node* accumulator_value_1 = m.Int32Constant(0xdeadbeef);
m.SetAccumulator(accumulator_value_1);
« no previous file with comments | « test/unittests/interpreter/interpreter-assembler-unittest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698