Index: test/unittests/interpreter/bytecodes-unittest.cc |
diff --git a/test/unittests/interpreter/bytecodes-unittest.cc b/test/unittests/interpreter/bytecodes-unittest.cc |
index 6c7278e9be83b4e5704b94280c0d907a76d23927..9125175179e97e142b48f8063ece5fb538fbf4fb 100644 |
--- a/test/unittests/interpreter/bytecodes-unittest.cc |
+++ b/test/unittests/interpreter/bytecodes-unittest.cc |
@@ -332,6 +332,35 @@ TEST(OperandScale, PrefixesRequired) { |
Bytecode::kExtraWide); |
} |
+TEST(Bytecodes, OperandSizesToScale) { |
+ CHECK_EQ(Bytecodes::OperandSizesToScale(OperandSize::kByte), |
+ OperandScale::kSingle); |
+ CHECK_EQ(Bytecodes::OperandSizesToScale(OperandSize::kShort), |
+ OperandScale::kDouble); |
+ CHECK_EQ(Bytecodes::OperandSizesToScale(OperandSize::kQuad), |
+ OperandScale::kQuadruple); |
+ CHECK_EQ( |
+ Bytecodes::OperandSizesToScale(OperandSize::kShort, OperandSize::kShort, |
+ OperandSize::kShort, OperandSize::kShort), |
+ OperandScale::kDouble); |
+ CHECK_EQ( |
+ Bytecodes::OperandSizesToScale(OperandSize::kQuad, OperandSize::kShort, |
+ OperandSize::kShort, OperandSize::kShort), |
+ OperandScale::kQuadruple); |
+ CHECK_EQ( |
+ Bytecodes::OperandSizesToScale(OperandSize::kShort, OperandSize::kQuad, |
+ OperandSize::kShort, OperandSize::kShort), |
+ OperandScale::kQuadruple); |
+ CHECK_EQ( |
+ Bytecodes::OperandSizesToScale(OperandSize::kShort, OperandSize::kShort, |
+ OperandSize::kQuad, OperandSize::kShort), |
+ OperandScale::kQuadruple); |
+ CHECK_EQ( |
+ Bytecodes::OperandSizesToScale(OperandSize::kShort, OperandSize::kShort, |
+ OperandSize::kShort, OperandSize::kQuad), |
+ OperandScale::kQuadruple); |
+} |
+ |
TEST(AccumulatorUse, LogicalOperators) { |
CHECK_EQ(AccumulatorUse::kNone | AccumulatorUse::kRead, |
AccumulatorUse::kRead); |
@@ -366,7 +395,6 @@ TEST(AccumulatorUse, AccumulatorUseToString) { |
names.insert(Bytecodes::AccumulatorUseToString(AccumulatorUse::kReadWrite)); |
CHECK_EQ(names.size(), 4); |
} |
- |
} // namespace interpreter |
} // namespace internal |
} // namespace v8 |