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

Unified Diff: src/interpreter/bytecode-traits.h

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 | « src/interpreter/bytecode-register-optimizer.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-traits.h
diff --git a/src/interpreter/bytecode-traits.h b/src/interpreter/bytecode-traits.h
index e7d14325037a44ce8757fc9ed07be47d85a8f00f..be2202b1a5249745351401320b56604443a15114 100644
--- a/src/interpreter/bytecode-traits.h
+++ b/src/interpreter/bytecode-traits.h
@@ -89,7 +89,7 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2,
return operand_types;
}
- static OperandSize GetOperandSize(int i, OperandScale operand_scale) {
+ static const OperandSize* GetOperandSizes(OperandScale operand_scale) {
switch (operand_scale) {
#define CASE(Name, _) \
case OperandScale::k##Name: { \
@@ -99,14 +99,13 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2,
OperandScaler<operand_2, OperandScale::k##Name>::kOperandSize, \
OperandScaler<operand_3, OperandScale::k##Name>::kOperandSize, \
}; \
- DCHECK_LT(static_cast<size_t>(i), arraysize(kOperandSizes)); \
- return kOperandSizes[i]; \
+ return kOperandSizes; \
}
OPERAND_SCALE_LIST(CASE)
#undef CASE
}
UNREACHABLE();
- return OperandSize::kNone;
+ return nullptr;
}
template <OperandType ot>
@@ -145,7 +144,7 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2> {
return operand_types;
}
- static OperandSize GetOperandSize(int i, OperandScale operand_scale) {
+ static const OperandSize* GetOperandSizes(OperandScale operand_scale) {
switch (operand_scale) {
#define CASE(Name, _) \
case OperandScale::k##Name: { \
@@ -154,14 +153,13 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1, operand_2> {
OperandScaler<operand_1, OperandScale::k##Name>::kOperandSize, \
OperandScaler<operand_2, OperandScale::k##Name>::kOperandSize, \
}; \
- DCHECK_LT(static_cast<size_t>(i), arraysize(kOperandSizes)); \
- return kOperandSizes[i]; \
+ return kOperandSizes; \
}
OPERAND_SCALE_LIST(CASE)
#undef CASE
}
UNREACHABLE();
- return OperandSize::kNone;
+ return nullptr;
}
template <OperandType ot>
@@ -196,7 +194,7 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1> {
return operand_types;
}
- static OperandSize GetOperandSize(int i, OperandScale operand_scale) {
+ static const OperandSize* GetOperandSizes(OperandScale operand_scale) {
switch (operand_scale) {
#define CASE(Name, _) \
case OperandScale::k##Name: { \
@@ -204,14 +202,13 @@ struct BytecodeTraits<accumulator_use, operand_0, operand_1> {
OperandScaler<operand_0, OperandScale::k##Name>::kOperandSize, \
OperandScaler<operand_1, OperandScale::k##Name>::kOperandSize, \
}; \
- DCHECK_LT(static_cast<size_t>(i), arraysize(kOperandSizes)); \
- return kOperandSizes[i]; \
+ return kOperandSizes; \
}
OPERAND_SCALE_LIST(CASE)
#undef CASE
}
UNREACHABLE();
- return OperandSize::kNone;
+ return nullptr;
}
template <OperandType ot>
@@ -241,21 +238,20 @@ struct BytecodeTraits<accumulator_use, operand_0> {
return operand_types;
}
- static OperandSize GetOperandSize(int i, OperandScale operand_scale) {
+ static const OperandSize* GetOperandSizes(OperandScale operand_scale) {
switch (operand_scale) {
#define CASE(Name, _) \
case OperandScale::k##Name: { \
static const OperandSize kOperandSizes[] = { \
OperandScaler<operand_0, OperandScale::k##Name>::kOperandSize, \
}; \
- DCHECK_LT(static_cast<size_t>(i), arraysize(kOperandSizes)); \
- return kOperandSizes[i]; \
+ return kOperandSizes; \
}
OPERAND_SCALE_LIST(CASE)
#undef CASE
}
UNREACHABLE();
- return OperandSize::kNone;
+ return nullptr;
}
template <OperandType ot>
@@ -282,9 +278,8 @@ struct BytecodeTraits<accumulator_use> {
return operand_types;
}
- static OperandSize GetOperandSize(int i, OperandScale operand_scale) {
- UNREACHABLE();
- return OperandSize::kNone;
+ static const OperandSize* GetOperandSizes(OperandScale operand_scale) {
+ return nullptr;
}
template <OperandType ot>
« no previous file with comments | « src/interpreter/bytecode-register-optimizer.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698