Commit 9741c7e3 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

Revert "[cleanup] Rename {kLastErrorMessage} to {kNumberOfReasons}"

This reverts commit 29379945.

Reason for revert: Needed for other revert:
https://chromium-review.googlesource.com/c/v8/v8/+/1145431

Original change's description:
> [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}

TBR=mstarzinger@chromium.org,clemensh@chromium.org

Change-Id: I2af83f4a2299e05ad9bcacfe69c0b483fd1488de
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7754
Reviewed-on: https://chromium-review.googlesource.com/1145520Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54596}
parent b6f7ea58
......@@ -11,7 +11,7 @@ namespace internal {
#define ERROR_MESSAGES_TEXTS(C, T) T,
const char* GetBailoutReason(BailoutReason reason) {
DCHECK_LT(reason, BailoutReason::kNumberOfReasons);
DCHECK_LT(reason, BailoutReason::kLastErrorMessage);
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::kNumberOfReasons);
DCHECK_LT(reason, AbortReason::kLastErrorMessage);
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::kNumberOfReasons);
reason_id < static_cast<int>(AbortReason::kLastErrorMessage);
}
#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) kNumberOfReasons
BAILOUT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kLastErrorMessage
};
enum class AbortReason {
ABORT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kNumberOfReasons
ABORT_MESSAGES_LIST(ERROR_MESSAGES_CONSTANTS) kLastErrorMessage
};
#undef ERROR_MESSAGES_CONSTANTS
......
......@@ -1207,7 +1207,7 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() {
}
BytecodeArrayBuilder& BytecodeArrayBuilder::Abort(AbortReason reason) {
DCHECK_LT(reason, AbortReason::kNumberOfReasons);
DCHECK_LT(reason, AbortReason::kLastErrorMessage);
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::kNumberOfReasons <=
STATIC_ASSERT(BailoutReason::kLastErrorMessage <=
DisabledOptimizationReasonBits::kMax);
STATIC_ASSERT(kLastFunctionKind <= FunctionKindBits::kMax);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment