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

Unified Diff: src/interpreter/bytecodes.cc

Issue 2950993002: Make some functions that are hit during renderer startup available for inlining (Closed)
Patch Set: rebase Created 3 years, 6 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 | « src/interpreter/bytecodes.h ('k') | src/parsing/scanner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecodes.cc
diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc
index c5311557fb2a5208c9d48c0e2e4723242a741300..9ee7c0a9e6ba03e12b32f6a8a93433b8af8cb048 100644
--- a/src/interpreter/bytecodes.cc
+++ b/src/interpreter/bytecodes.cc
@@ -55,6 +55,18 @@ const OperandSize* const Bytecodes::kOperandSizes[][3] = {
BYTECODE_LIST(ENTRY)
#undef ENTRY
};
+
+const OperandSize Bytecodes::kOperandKindSizes[][3] = {
+#define ENTRY(Name, ...) \
+ { OperandScaler<OperandType::k##Name, \
+ OperandScale::kSingle>::kOperandSize, \
+ OperandScaler<OperandType::k##Name, \
+ OperandScale::kDouble>::kOperandSize, \
+ OperandScaler<OperandType::k##Name, \
+ OperandScale::kQuadruple>::kOperandSize },
+ OPERAND_TYPE_LIST(ENTRY)
+#undef ENTRY
+};
// clang-format on
// static
@@ -274,31 +286,6 @@ bool Bytecodes::IsUnsignedOperandType(OperandType operand_type) {
UNREACHABLE();
}
-// static
-OperandSize Bytecodes::SizeOfOperand(OperandType operand_type,
- OperandScale operand_scale) {
- DCHECK_LE(operand_type, OperandType::kLast);
- DCHECK_GE(operand_scale, OperandScale::kSingle);
- DCHECK_LE(operand_scale, OperandScale::kLast);
- STATIC_ASSERT(static_cast<int>(OperandScale::kQuadruple) == 4 &&
- OperandScale::kLast == OperandScale::kQuadruple);
- int scale_index = static_cast<int>(operand_scale) >> 1;
- // clang-format off
- static const OperandSize kOperandSizes[][3] = {
-#define ENTRY(Name, ...) \
- { OperandScaler<OperandType::k##Name, \
- OperandScale::kSingle>::kOperandSize, \
- OperandScaler<OperandType::k##Name, \
- OperandScale::kDouble>::kOperandSize, \
- OperandScaler<OperandType::k##Name, \
- OperandScale::kQuadruple>::kOperandSize },
- OPERAND_TYPE_LIST(ENTRY)
-#undef ENTRY
- };
- // clang-format on
- return kOperandSizes[static_cast<size_t>(operand_type)][scale_index];
-}
-
// static
bool Bytecodes::BytecodeHasHandler(Bytecode bytecode,
OperandScale operand_scale) {
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/parsing/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698