[cleanup] Rename {kLastErrorMessage} to {kNumberOfReasons}
The name {kLastErrorMessage} is misleading, as it's not actually the index of the last message (or reason), but one more (i.e. number of messages / reasons). Thus this renaming. R=mstarzinger@chromium.org Bug: v8:7754 Change-Id: Id21edcecac84c0e6068423c6124ef2881116dc7c Reviewed-on: https://chromium-review.googlesource.com/1145305 Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#54593}
This commit is contained in:
parent
a462a7854a
commit
29379945b6
@ -11,7 +11,7 @@ namespace internal {
|
||||
#define ERROR_MESSAGES_TEXTS(C, T) T,
|
||||
|
||||
const char* GetBailoutReason(BailoutReason reason) {
|
||||
DCHECK_LT(reason, BailoutReason::kLastErrorMessage);
|
||||
DCHECK_LT(reason, BailoutReason::kNumberOfReasons);
|
||||
DCHECK_GE(reason, BailoutReason::kNoReason);
|
||||
static const char* error_messages_[] = {
|
||||
BAILOUT_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)};
|
||||
@ -19,7 +19,7 @@ const char* GetBailoutReason(BailoutReason reason) {
|
||||
}
|
||||
|
||||
const char* GetAbortReason(AbortReason reason) {
|
||||
DCHECK_LT(reason, AbortReason::kLastErrorMessage);
|
||||
DCHECK_LT(reason, AbortReason::kNumberOfReasons);
|
||||
DCHECK_GE(reason, AbortReason::kNoReason);
|
||||
static const char* error_messages_[] = {
|
||||
ABORT_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)};
|
||||
@ -28,7 +28,7 @@ const char* GetAbortReason(AbortReason reason) {
|
||||
|
||||
bool IsValidAbortReason(int reason_id) {
|
||||
return reason_id >= static_cast<int>(AbortReason::kNoReason) &&
|
||||
reason_id < static_cast<int>(AbortReason::kLastErrorMessage);
|
||||
reason_id < static_cast<int>(AbortReason::kNumberOfReasons);
|
||||
}
|
||||
|
||||
#undef ERROR_MESSAGES_TEXTS
|
||||
|
@ -115,11 +115,11 @@ namespace internal {
|
||||
|
||||
#define ERROR_MESSAGES_CONSTANTS(C, T) C,
|
||||
enum class BailoutReason {
|
||||
BAILOUT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kLastErrorMessage
|
||||
BAILOUT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kNumberOfReasons
|
||||
};
|
||||
|
||||
enum class AbortReason {
|
||||
ABORT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kLastErrorMessage
|
||||
ABORT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kNumberOfReasons
|
||||
};
|
||||
#undef ERROR_MESSAGES_CONSTANTS
|
||||
|
||||
|
@ -1200,7 +1200,7 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() {
|
||||
}
|
||||
|
||||
BytecodeArrayBuilder& BytecodeArrayBuilder::Abort(AbortReason reason) {
|
||||
DCHECK_LT(reason, AbortReason::kLastErrorMessage);
|
||||
DCHECK_LT(reason, AbortReason::kNumberOfReasons);
|
||||
DCHECK_GE(reason, AbortReason::kNoReason);
|
||||
OutputAbort(static_cast<int>(reason));
|
||||
return *this;
|
||||
|
@ -655,7 +655,7 @@ class SharedFunctionInfo : public HeapObject, public NeverReadOnlySpaceObject {
|
||||
#undef FLAGS_BIT_FIELDS
|
||||
|
||||
// Bailout reasons must fit in the DisabledOptimizationReason bitfield.
|
||||
STATIC_ASSERT(BailoutReason::kLastErrorMessage <=
|
||||
STATIC_ASSERT(BailoutReason::kNumberOfReasons <=
|
||||
DisabledOptimizationReasonBits::kMax);
|
||||
|
||||
STATIC_ASSERT(kLastFunctionKind <= FunctionKindBits::kMax);
|
||||
|
Loading…
Reference in New Issue
Block a user