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

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

Issue 1997653002: [interpreter] Bytecode register optimizer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Decouple a test from implementation. Created 4 years, 7 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/bytecode-register-optimizer-unittest.cc ('k') | test/unittests/unittests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « test/unittests/interpreter/bytecode-register-optimizer-unittest.cc ('k') | test/unittests/unittests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698