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

Unified Diff: src/interpreter/bytecodes.cc

Issue 2955793002: Revert of Make some functions that are hit during renderer startup available for inlining (Closed)
Patch Set: 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 9ee7c0a9e6ba03e12b32f6a8a93433b8af8cb048..c5311557fb2a5208c9d48c0e2e4723242a741300 100644
--- a/src/interpreter/bytecodes.cc
+++ b/src/interpreter/bytecodes.cc
@@ -53,18 +53,6 @@
BytecodeTraits<__VA_ARGS__>::kDoubleScaleOperandSizes, \
BytecodeTraits<__VA_ARGS__>::kQuadrupleScaleOperandSizes },
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
@@ -287,6 +275,31 @@
}
// 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) {
return operand_scale == OperandScale::kSingle ||
« 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