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

Unified Diff: test/unittests/interpreter/register-translator-unittest.cc

Issue 1633153002: [interpreter] Reduce move operations for wide register support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/interpreter/register-translator-unittest.cc
diff --git a/test/unittests/interpreter/register-translator-unittest.cc b/test/unittests/interpreter/register-translator-unittest.cc
index 0a3bd00ef2c2f83abc3682cfdf1d91121aaf915e..15199ce8c5a1e11aec1036806674de28b93878a3 100644
--- a/test/unittests/interpreter/register-translator-unittest.cc
+++ b/test/unittests/interpreter/register-translator-unittest.cc
@@ -52,8 +52,10 @@ class RegisterTranslatorTest : public TestWithIsolateAndZone,
bool RegisterOperandIsMovable(Bytecode bytecode, int operand_index) override {
OperandType operand_type =
Bytecodes::GetOperandType(bytecode, operand_index);
+
+ EXPECT_TRUE(Bytecodes::IsRegisterOperandType(operand_type));
if (operand_type == OperandType::kReg8 ||
- operand_type == OperandType::kReg16) {
+ operand_type == OperandType::kRegOut8) {
if (operand_index == Bytecodes::NumberOfOperands(bytecode) - 1) {
return true;
}
@@ -74,7 +76,8 @@ class RegisterTranslatorTest : public TestWithIsolateAndZone,
};
const char* const RegisterTranslatorTest::kBadOperandRegex =
- ".*OperandType::kReg8 && mover\\(\\)->RegisterOperandIsMovable.*";
+ ".*OperandType::kReg8 \\|\\| .*OperandType::kRegOut8\\) && "
+ "mover\\(\\)->RegisterOperandIsMovable.*";
TEST_F(RegisterTranslatorTest, TestFrameSizeAdjustmentsForTranslationWindow) {
EXPECT_EQ(0, RegisterTranslator::RegisterCountAdjustment(0, 0));
@@ -157,7 +160,7 @@ TEST_F(RegisterTranslatorTest, NoTranslationRequired) {
Register param_reg = Register::FromParameterIndex(129, 130);
operands[0] = param_reg.ToRawOperand();
- translator()->TranslateInputRegisters(Bytecode::kLdar, operands, 1);
+ translator()->TranslateInputRegisters(Bytecode::kAdd, operands, 1);
translator()->TranslateOutputRegisters();
EXPECT_EQ(0, move_count());
}
@@ -172,6 +175,14 @@ TEST_F(RegisterTranslatorTest, TranslationRequired) {
EXPECT_EQ(1, move_count());
EXPECT_TRUE(PopMoveAndMatch(local_reg_translated, window_reg));
translator()->TranslateOutputRegisters();
+ EXPECT_EQ(1, move_count());
+ EXPECT_FALSE(PopMoveAndMatch(window_reg, local_reg_translated));
+
+ operands[0] = local_reg.ToRawOperand();
+ translator()->TranslateInputRegisters(Bytecode::kStar, operands, 1);
+ EXPECT_EQ(1, move_count());
+ EXPECT_FALSE(PopMoveAndMatch(local_reg_translated, window_reg));
+ translator()->TranslateOutputRegisters();
EXPECT_EQ(2, move_count());
EXPECT_TRUE(PopMoveAndMatch(window_reg, local_reg_translated));
@@ -181,6 +192,14 @@ TEST_F(RegisterTranslatorTest, TranslationRequired) {
EXPECT_EQ(3, move_count());
EXPECT_TRUE(PopMoveAndMatch(param_reg, window_reg));
translator()->TranslateOutputRegisters();
+ EXPECT_EQ(3, move_count());
+ EXPECT_FALSE(PopMoveAndMatch(window_reg, param_reg));
+
+ operands[0] = {param_reg.ToRawOperand()};
+ translator()->TranslateInputRegisters(Bytecode::kStar, operands, 1);
+ EXPECT_EQ(3, move_count());
+ EXPECT_FALSE(PopMoveAndMatch(local_reg_translated, window_reg));
+ translator()->TranslateOutputRegisters();
EXPECT_EQ(4, move_count());
EXPECT_TRUE(PopMoveAndMatch(window_reg, param_reg));
}
« src/interpreter/bytecodes.cc ('K') | « test/unittests/interpreter/bytecodes-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698