2014-09-24 07:08:27 +00:00
|
|
|
// Copyright 2014 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "src/bailout-reason.h"
|
|
|
|
#include "src/base/logging.h"
|
|
|
|
|
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
#define ERROR_MESSAGES_TEXTS(C, T) T,
|
2018-01-03 23:27:03 +00:00
|
|
|
|
|
|
|
const char* GetBailoutReason(BailoutReason reason) {
|
2018-07-20 17:27:24 +00:00
|
|
|
DCHECK_LT(reason, BailoutReason::kLastErrorMessage);
|
2018-01-03 23:27:03 +00:00
|
|
|
DCHECK_GE(reason, BailoutReason::kNoReason);
|
2014-09-24 07:08:27 +00:00
|
|
|
static const char* error_messages_[] = {
|
2018-01-03 23:27:03 +00:00
|
|
|
BAILOUT_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)};
|
|
|
|
return error_messages_[static_cast<int>(reason)];
|
2014-09-24 07:08:27 +00:00
|
|
|
}
|
2018-01-03 23:27:03 +00:00
|
|
|
|
|
|
|
const char* GetAbortReason(AbortReason reason) {
|
2018-07-20 17:27:24 +00:00
|
|
|
DCHECK_LT(reason, AbortReason::kLastErrorMessage);
|
2018-01-03 23:27:03 +00:00
|
|
|
DCHECK_GE(reason, AbortReason::kNoReason);
|
|
|
|
static const char* error_messages_[] = {
|
|
|
|
ABORT_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)};
|
|
|
|
return error_messages_[static_cast<int>(reason)];
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef ERROR_MESSAGES_TEXTS
|
2015-06-01 22:46:54 +00:00
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|