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

Unified Diff: src/interpreter/bytecodes.cc

Issue 2313763002: [Interpreter] Add some CHECKS to track down crbug.com/642111 (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | 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 adba450e5ecd0df017cee967376cd924f888463e..b6e067e423ac5f57ba7bb6d1c146aed048532ae5 100644
--- a/src/interpreter/bytecodes.cc
+++ b/src/interpreter/bytecodes.cc
@@ -153,7 +153,7 @@ size_t Bytecodes::ReturnCount(Bytecode bytecode) {
// static
int Bytecodes::NumberOfOperands(Bytecode bytecode) {
- DCHECK(bytecode <= Bytecode::kLast);
+ CHECK(bytecode <= Bytecode::kLast);
switch (bytecode) {
#define CASE(Name, ...) \
case Bytecode::k##Name: \
@@ -310,15 +310,15 @@ bool Bytecodes::IsWithoutExternalSideEffects(Bytecode bytecode) {
// static
OperandType Bytecodes::GetOperandType(Bytecode bytecode, int i) {
- DCHECK_LE(bytecode, Bytecode::kLast);
- DCHECK_LT(i, NumberOfOperands(bytecode));
- DCHECK_GE(i, 0);
+ CHECK_LE(bytecode, Bytecode::kLast);
+ CHECK_LT(i, NumberOfOperands(bytecode));
+ CHECK_GE(i, 0);
return GetOperandTypes(bytecode)[i];
}
// static
const OperandType* Bytecodes::GetOperandTypes(Bytecode bytecode) {
- DCHECK(bytecode <= Bytecode::kLast);
+ CHECK_LE(bytecode, Bytecode::kLast);
switch (bytecode) {
#define CASE(Name, ...) \
case Bytecode::k##Name: \
@@ -347,7 +347,7 @@ const OperandTypeInfo* Bytecodes::GetOperandTypeInfos(Bytecode bytecode) {
// static
OperandSize Bytecodes::GetOperandSize(Bytecode bytecode, int i,
OperandScale operand_scale) {
- DCHECK_LT(i, NumberOfOperands(bytecode));
+ CHECK_LT(i, NumberOfOperands(bytecode));
OperandType operand_type = GetOperandType(bytecode, i);
return SizeOfOperand(operand_type, operand_scale);
}
@@ -369,6 +369,9 @@ int Bytecodes::GetOperandOffset(Bytecode bytecode, int i,
// static
OperandSize Bytecodes::SizeOfOperand(OperandType operand_type,
OperandScale operand_scale) {
+ CHECK_LE(operand_type, OperandType::kLast);
+ CHECK_GE(operand_scale, OperandScale::kSingle);
+ CHECK_LE(operand_scale, OperandScale::kLast);
return static_cast<OperandSize>(
ScaledOperandSize(operand_type, operand_scale));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698