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

Unified Diff: src/interpreter/bytecodes.h

Issue 2950993002: Make some functions that are hit during renderer startup available for inlining (Closed)
Patch Set: don't expose bytecode-traits.h in bytecodes.h 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
Index: src/interpreter/bytecodes.h
diff --git a/src/interpreter/bytecodes.h b/src/interpreter/bytecodes.h
index 42f68c9f92729fdb5f644a79999a31d26ee9a12f..f04daa77b93fc5fa649c6ddd58d835feb5ead03f 100644
--- a/src/interpreter/bytecodes.h
+++ b/src/interpreter/bytecodes.h
@@ -834,8 +834,17 @@ class V8_EXPORT_PRIVATE Bytecodes final {
UNREACHABLE();
}
- // Returns the size of |operand| for |operand_scale|.
- static OperandSize SizeOfOperand(OperandType operand, OperandScale scale);
+ // Returns the size of |operand_type| for |operand_scale|.
+ static OperandSize 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;
+ return kOperandKindSizes[static_cast<size_t>(operand_type)][scale_index];
+ }
// Returns true if |operand_type| is a runtime-id operand (kRuntimeId).
static bool IsRuntimeIdOperandType(OperandType operand_type);
@@ -891,6 +900,7 @@ class V8_EXPORT_PRIVATE Bytecodes final {
static const bool kIsScalable[];
static const int kBytecodeSizes[][3];
static const OperandSize* const kOperandSizes[][3];
+ static OperandSize const kOperandKindSizes[][3];
};
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,

Powered by Google App Engine
This is Rietveld 408576698