[vm] Update to variadic FATAL.

TEST=ci
Change-Id: Ic6bc784605e10760bb28ea6df34242336a33b4d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286947
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2023-03-06 22:06:59 +00:00
committed by Commit Queue
parent c9e29fa85f
commit 63e6041ca9
78 changed files with 295 additions and 308 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ void DartDevIsolate::DartDevRunner::Run(
int result = Thread::Start("DartDev Runner", RunCallback,
reinterpret_cast<uword>(this));
if (result != 0) {
FATAL1("Failed to start DartDev thread: %d", result);
FATAL("Failed to start DartDev thread: %d", result);
}
monitor_->WaitMicros(Monitor::kNoTimeout);
+2 -2
View File
@@ -208,7 +208,7 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
default:
// We should have covered all the bases. If not, let's get an error.
FATAL1("Unexpected d_type: %d\n", entry->d_type);
FATAL("Unexpected d_type: %d\n", entry->d_type);
return kListError;
}
}
@@ -351,7 +351,7 @@ static bool DeleteRecursively(int dirfd, PathBuffer* path) {
}
default:
// We should have covered all the bases. If not, let's get an error.
FATAL1("Unexpected d_type: %d\n", entry->d_type);
FATAL("Unexpected d_type: %d\n", entry->d_type);
break;
}
if (!ok) {
+2 -2
View File
@@ -214,7 +214,7 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
default:
// We should have covered all the bases. If not, let's get an error.
FATAL1("Unexpected d_type: %d\n", entry->d_type);
FATAL("Unexpected d_type: %d\n", entry->d_type);
return kListError;
}
}
@@ -461,7 +461,7 @@ static bool DeleteRecursively(int dirfd, PathBuffer* path) {
}
default:
// We should have covered all the bases. If not, let's get an error.
FATAL1("Unexpected d_type: %d\n", entry->d_type);
FATAL("Unexpected d_type: %d\n", entry->d_type);
break;
}
if (!ok) {
+2 -2
View File
@@ -208,7 +208,7 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
default:
// We should have covered all the bases. If not, let's get an error.
FATAL1("Unexpected d_type: %d\n", entry->d_type);
FATAL("Unexpected d_type: %d\n", entry->d_type);
return kListError;
}
}
@@ -351,7 +351,7 @@ static bool DeleteRecursively(int dirfd, PathBuffer* path) {
}
default:
// We should have covered all the bases. If not, let's get an error.
FATAL1("Unexpected d_type: %d\n", entry->d_type);
FATAL("Unexpected d_type: %d\n", entry->d_type);
break;
}
if (!ok) {
+2 -2
View File
@@ -195,7 +195,7 @@ ListType DirectoryListingEntry::Next(DirectoryListing* listing) {
default:
// We should have covered all the bases. If not, let's get an error.
FATAL1("Unexpected d_type: %d\n", entry.d_type);
FATAL("Unexpected d_type: %d\n", entry.d_type);
return kListError;
}
}
@@ -313,7 +313,7 @@ static bool DeleteRecursively(PathBuffer* path) {
}
default:
// We should have covered all the bases. If not, let's get an error.
FATAL1("Unexpected d_type: %d\n", entry.d_type);
FATAL("Unexpected d_type: %d\n", entry.d_type);
break;
}
if (!ok) {
+3 -3
View File
@@ -97,7 +97,7 @@ EventHandlerImplementation::EventHandlerImplementation()
static const int kEpollInitialSize = 64;
epoll_fd_ = NO_RETRY_EXPECTED(epoll_create(kEpollInitialSize));
if (epoll_fd_ == -1) {
FATAL1("Failed creating epoll file descriptor: %i", errno);
FATAL("Failed creating epoll file descriptor: %i", errno);
}
if (!FDUtils::SetCloseOnExec(epoll_fd_)) {
FATAL("Failed to set epoll fd close on exec\n");
@@ -179,7 +179,7 @@ void EventHandlerImplementation::WakeupHandler(intptr_t id,
if (result == -1) {
perror("Interrupt message failure:");
}
FATAL1("Interrupt message failure. Wrote %" Pd " bytes.", result);
FATAL("Interrupt message failure. Wrote %" Pd " bytes.", result);
}
}
@@ -409,7 +409,7 @@ void EventHandlerImplementation::Start(EventHandler* handler) {
Thread::Start("dart:io EventHandler", &EventHandlerImplementation::Poll,
reinterpret_cast<uword>(handler));
if (result != 0) {
FATAL1("Failed to start event handler thread %d", result);
FATAL("Failed to start event handler thread %d", result);
}
}
+4 -4
View File
@@ -398,7 +398,7 @@ EventHandlerImplementation::EventHandlerImplementation()
if (status != ZX_OK) {
// This is a FATAL because the VM won't work at all if we can't create this
// port.
FATAL1("zx_port_create failed: %s\n", zx_status_get_string(status));
FATAL("zx_port_create failed: %s\n", zx_status_get_string(status));
}
ASSERT(port_handle_ != ZX_HANDLE_INVALID);
}
@@ -468,7 +468,7 @@ void EventHandlerImplementation::WakeupHandler(intptr_t id,
if (status != ZX_OK) {
// This is a FATAL because the VM won't work at all if we can't send any
// messages to the EventHandler thread.
FATAL1("zx_port_queue failed: %s\n", zx_status_get_string(status));
FATAL("zx_port_queue failed: %s\n", zx_status_get_string(status));
}
}
@@ -653,7 +653,7 @@ void EventHandlerImplementation::Poll(uword args) {
if (status == ZX_ERR_TIMED_OUT) {
handler_impl->HandleTimeout();
} else if (status != ZX_OK) {
FATAL1("zx_port_wait failed: %s\n", zx_status_get_string(status));
FATAL("zx_port_wait failed: %s\n", zx_status_get_string(status));
} else {
handler_impl->HandleTimeout();
handler_impl->HandlePacket(&pkt);
@@ -668,7 +668,7 @@ void EventHandlerImplementation::Start(EventHandler* handler) {
Thread::Start("dart:io EventHandler", &EventHandlerImplementation::Poll,
reinterpret_cast<uword>(handler));
if (result != 0) {
FATAL1("Failed to start event handler thread %d", result);
FATAL("Failed to start event handler thread %d", result);
}
}
+6 -6
View File
@@ -91,7 +91,7 @@ EventHandlerImplementation::EventHandlerImplementation()
static const int kEpollInitialSize = 64;
epoll_fd_ = NO_RETRY_EXPECTED(epoll_create(kEpollInitialSize));
if (epoll_fd_ == -1) {
FATAL1("Failed creating epoll file descriptor: %i", errno);
FATAL("Failed creating epoll file descriptor: %i", errno);
}
if (!FDUtils::SetCloseOnExec(epoll_fd_)) {
FATAL("Failed to set epoll fd close on exec\n");
@@ -107,7 +107,7 @@ EventHandlerImplementation::EventHandlerImplementation()
}
timer_fd_ = NO_RETRY_EXPECTED(timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC));
if (timer_fd_ == -1) {
FATAL1("Failed creating timerfd file descriptor: %i", errno);
FATAL("Failed creating timerfd file descriptor: %i", errno);
}
// Register the timer_fd_ with the epoll instance.
event.events = EPOLLIN;
@@ -115,8 +115,8 @@ EventHandlerImplementation::EventHandlerImplementation()
status =
NO_RETRY_EXPECTED(epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, timer_fd_, &event));
if (status == -1) {
FATAL2("Failed adding timerfd fd(%i) to epoll instance: %i", timer_fd_,
errno);
FATAL("Failed adding timerfd fd(%i) to epoll instance: %i", timer_fd_,
errno);
}
}
@@ -187,7 +187,7 @@ void EventHandlerImplementation::WakeupHandler(intptr_t id,
if (result == -1) {
perror("Interrupt message failure:");
}
FATAL1("Interrupt message failure. Wrote %" Pd " bytes.", result);
FATAL("Interrupt message failure. Wrote %" Pd " bytes.", result);
}
}
@@ -413,7 +413,7 @@ void EventHandlerImplementation::Start(EventHandler* handler) {
Thread::Start("dart:io EventHandler", &EventHandlerImplementation::Poll,
reinterpret_cast<uword>(handler));
if (result != 0) {
FATAL1("Failed to start event handler thread %d", result);
FATAL("Failed to start event handler thread %d", result);
}
}
+5 -5
View File
@@ -126,7 +126,7 @@ EventHandlerImplementation::EventHandlerImplementation()
const int kBufferSize = 1024;
char error_message[kBufferSize];
Utils::StrError(errno, error_message, kBufferSize);
FATAL1("Failed adding interrupt fd to kqueue: %s\n", error_message);
FATAL("Failed adding interrupt fd to kqueue: %s\n", error_message);
}
}
@@ -195,7 +195,7 @@ void EventHandlerImplementation::WakeupHandler(intptr_t id,
if (result == -1) {
perror("Interrupt message failure:");
}
FATAL1("Interrupt message failure. Wrote %" Pd " bytes.", result);
FATAL("Interrupt message failure. Wrote %" Pd " bytes.", result);
}
}
@@ -380,7 +380,7 @@ void EventHandlerImplementation::HandleEvents(struct kevent* events, int size) {
const int kBufferSize = 1024;
char error_message[kBufferSize];
Utils::StrError(events[i].data, error_message, kBufferSize);
FATAL1("kevent failed %s\n", error_message);
FATAL("kevent failed %s\n", error_message);
}
if (events[i].udata == NULL) {
interrupt_seen = true;
@@ -458,7 +458,7 @@ void EventHandlerImplementation::EventHandlerEntry(uword args) {
const int kBufferSize = 1024;
char error_message[kBufferSize];
Utils::StrError(errno, error_message, kBufferSize);
FATAL1("kevent failed %s\n", error_message);
FATAL("kevent failed %s\n", error_message);
} else {
handler_impl->HandleTimeout();
handler_impl->HandleEvents(events, result);
@@ -473,7 +473,7 @@ void EventHandlerImplementation::Start(EventHandler* handler) {
&EventHandlerImplementation::EventHandlerEntry,
reinterpret_cast<uword>(handler));
if (result != 0) {
FATAL1("Failed to start event handler thread %d", result);
FATAL("Failed to start event handler thread %d", result);
}
}
+3 -3
View File
@@ -306,7 +306,7 @@ bool Handle::IssueRead() {
int result = Thread::Start("dart:io ReadFile", ReadFileThread,
reinterpret_cast<uword>(this));
if (result != 0) {
FATAL1("Failed to start read file thread %d", result);
FATAL("Failed to start read file thread %d", result);
}
return true;
}
@@ -800,7 +800,7 @@ intptr_t StdHandle::Write(const void* buffer, intptr_t num_bytes) {
int result = Thread::Start("dart:io WriteFile", WriteFileThread,
reinterpret_cast<uword>(this));
if (result != 0) {
FATAL1("Failed to start write file thread %d", result);
FATAL("Failed to start write file thread %d", result);
}
while (!write_thread_running_) {
// Wait until we the thread is running.
@@ -1493,7 +1493,7 @@ void EventHandlerImplementation::Start(EventHandler* handler) {
int result = Thread::Start("dart:io EventHandler", EventHandlerEntry,
reinterpret_cast<uword>(handler));
if (result != 0) {
FATAL1("Failed to start event handler thread %d", result);
FATAL("Failed to start event handler thread %d", result);
}
{
+8 -8
View File
@@ -25,13 +25,13 @@ NamespaceImpl::NamespaceImpl(fdio_ns_t* fdio_ns)
cwd_(strdup("/")) {
rootfd_ = fdio_ns_opendir(fdio_ns);
if (rootfd_ < 0) {
FATAL2("Failed to open file descriptor for namespace: errno=%d: %s", errno,
strerror(errno));
FATAL("Failed to open file descriptor for namespace: errno=%d: %s", errno,
strerror(errno));
}
cwdfd_ = dup(rootfd_);
if (cwdfd_ < 0) {
FATAL2("Failed to dup() namespace file descriptor: errno=%d: %s", errno,
strerror(errno));
FATAL("Failed to dup() namespace file descriptor: errno=%d: %s", errno,
strerror(errno));
}
}
@@ -40,13 +40,13 @@ NamespaceImpl::NamespaceImpl(const char* path)
cwd_(strdup("/")) {
rootfd_ = TEMP_FAILURE_RETRY(open(path, O_DIRECTORY));
if (rootfd_ < 0) {
FATAL2("Failed to open file descriptor for namespace: errno=%d: %s", errno,
strerror(errno));
FATAL("Failed to open file descriptor for namespace: errno=%d: %s", errno,
strerror(errno));
}
cwdfd_ = dup(rootfd_);
if (cwdfd_ < 0) {
FATAL2("Failed to dup() namespace file descriptor: errno=%d: %s", errno,
strerror(errno));
FATAL("Failed to dup() namespace file descriptor: errno=%d: %s", errno,
strerror(errno));
}
}
+3 -3
View File
@@ -150,7 +150,7 @@ class ExitCodeHandler {
int result =
Thread::Start("dart:io Process.start", ExitCodeHandlerEntry, 0);
if (result != 0) {
FATAL1("Failed to start exit code handler worker thread %d", result);
FATAL("Failed to start exit code handler worker thread %d", result);
}
running_ = true;
@@ -223,7 +223,7 @@ class ExitCodeHandler {
if ((result != -1) && (result != sizeof(message))) {
FATAL("Failed to write entire process exit message");
} else if ((result == -1) && (errno != EPIPE)) {
FATAL1("Failed to write exit code: %d", errno);
FATAL("Failed to write exit code: %d", errno);
}
ProcessInfoList::RemoveProcess(pid);
{
@@ -232,7 +232,7 @@ class ExitCodeHandler {
}
}
} else if (pid < 0) {
FATAL1("Wait for process exit failed: %d", errno);
FATAL("Wait for process exit failed: %d", errno);
}
}
}
+5 -5
View File
@@ -166,8 +166,8 @@ class ExitCodeHandler {
zx_status_t status = zx_port_create(0, &port_);
if (status != ZX_OK) {
FATAL1("ExitCodeHandler: zx_port_create failed: %s\n",
zx_status_get_string(status));
FATAL("ExitCodeHandler: zx_port_create failed: %s\n",
zx_status_get_string(status));
return;
}
@@ -175,7 +175,7 @@ class ExitCodeHandler {
intptr_t result =
Thread::Start("dart:io Process.start", ExitCodeHandlerEntry, 0);
if (result != 0) {
FATAL1("Failed to start exit code handler worker thread %ld", result);
FATAL("Failed to start exit code handler worker thread %ld", result);
}
running_ = true;
@@ -227,8 +227,8 @@ class ExitCodeHandler {
while (true) {
zx_status_t status = zx_port_wait(port_, ZX_TIME_INFINITE, &pkt);
if (status != ZX_OK) {
FATAL1("ExitCodeHandler: zx_port_wait failed: %s\n",
zx_status_get_string(status));
FATAL("ExitCodeHandler: zx_port_wait failed: %s\n",
zx_status_get_string(status));
}
if (pkt.type == ZX_PKT_TYPE_USER) {
ASSERT(pkt.key == kShutdownPacketKey);
+3 -3
View File
@@ -150,7 +150,7 @@ class ExitCodeHandler {
int result =
Thread::Start("dart:io Process.start", ExitCodeHandlerEntry, 0);
if (result != 0) {
FATAL1("Failed to start exit code handler worker thread %d", result);
FATAL("Failed to start exit code handler worker thread %d", result);
}
running_ = true;
@@ -222,7 +222,7 @@ class ExitCodeHandler {
if ((result != -1) && (result != sizeof(message))) {
FATAL("Failed to write entire process exit message");
} else if ((result == -1) && (errno != EPIPE)) {
FATAL1("Failed to write exit code: %d", errno);
FATAL("Failed to write exit code: %d", errno);
}
ProcessInfoList::RemoveProcess(pid);
{
@@ -231,7 +231,7 @@ class ExitCodeHandler {
}
}
} else if (pid < 0) {
FATAL1("Wait for process exit failed: %d", errno);
FATAL("Wait for process exit failed: %d", errno);
}
}
}
+3 -3
View File
@@ -149,7 +149,7 @@ class ExitCodeHandler {
int result =
Thread::Start("dart:io Process.start", ExitCodeHandlerEntry, 0);
if (result != 0) {
FATAL1("Failed to start exit code handler worker thread %d", result);
FATAL("Failed to start exit code handler worker thread %d", result);
}
running_ = true;
@@ -219,7 +219,7 @@ class ExitCodeHandler {
if ((result != -1) && (result != sizeof(message))) {
FATAL("Failed to write entire process exit message");
} else if ((result == -1) && (errno != EPIPE)) {
FATAL1("Failed to write exit code: %d", errno);
FATAL("Failed to write exit code: %d", errno);
}
ProcessInfoList::RemoveProcess(pid);
{
@@ -228,7 +228,7 @@ class ExitCodeHandler {
}
}
} else if (pid < 0) {
FATAL1("Wait for process exit failed: %d", errno);
FATAL("Wait for process exit failed: %d", errno);
}
}
}
+2 -2
View File
@@ -168,7 +168,7 @@ class ProcessInfoList {
int exit_code;
ok = GetExitCodeProcess(handle, reinterpret_cast<DWORD*>(&exit_code));
if (!ok) {
FATAL1("GetExitCodeProcess failed %d\n", GetLastError());
FATAL("GetExitCodeProcess failed %d\n", GetLastError());
}
int negative = 0;
if (exit_code < 0) {
@@ -185,7 +185,7 @@ class ProcessInfoList {
if (ok && (written != sizeof(message))) {
FATAL("Failed to write entire process exit message");
} else if (!ok && (GetLastError() != ERROR_NO_DATA)) {
FATAL1("Failed to write exit code: %d", GetLastError());
FATAL("Failed to write exit code: %d", GetLastError());
}
// Remove the process from the list of active processes.
RemoveProcess(pid);
+4 -4
View File
@@ -277,10 +277,10 @@ static void TrustEvaluateHandler(Dart_Port dest_port_id,
CObjectArray request(message);
if (request.Length() != kNumTrustEvaluateRequestParams) {
FATAL2("Malformed trust evaluate message: got %" Pd
" parameters "
"expected %d\n",
request.Length(), kNumTrustEvaluateRequestParams);
FATAL("Malformed trust evaluate message: got %" Pd
" parameters "
"expected %d\n",
request.Length(), kNumTrustEvaluateRequestParams);
}
CObjectIntptr trust_cobject(request[0]);
ScopedSecTrustRef trust(reinterpret_cast<SecTrustRef>(trust_cobject.Value()));
+7 -7
View File
@@ -120,7 +120,7 @@ static AppSnapshot* TryReadAppSnapshotBlobs(const char* script_name,
vm_data_mapping =
file->Map(File::kReadOnly, vm_data_position, vm_data_size);
if (vm_data_mapping == nullptr) {
FATAL1("Failed to memory map snapshot: %s\n", script_name);
FATAL("Failed to memory map snapshot: %s\n", script_name);
}
}
@@ -129,7 +129,7 @@ static AppSnapshot* TryReadAppSnapshotBlobs(const char* script_name,
vm_instr_mapping = file->Map(File::kReadExecute, vm_instructions_position,
vm_instructions_size);
if (vm_instr_mapping == nullptr) {
FATAL1("Failed to memory map snapshot: %s\n", script_name);
FATAL("Failed to memory map snapshot: %s\n", script_name);
}
}
@@ -138,7 +138,7 @@ static AppSnapshot* TryReadAppSnapshotBlobs(const char* script_name,
isolate_data_mapping =
file->Map(File::kReadOnly, isolate_data_position, isolate_data_size);
if (isolate_data_mapping == nullptr) {
FATAL1("Failed to memory map snapshot: %s\n", script_name);
FATAL("Failed to memory map snapshot: %s\n", script_name);
}
}
@@ -148,7 +148,7 @@ static AppSnapshot* TryReadAppSnapshotBlobs(const char* script_name,
file->Map(File::kReadExecute, isolate_instructions_position,
isolate_instructions_size);
if (isolate_instr_mapping == nullptr) {
FATAL1("Failed to memory map snapshot: %s\n", script_name);
FATAL("Failed to memory map snapshot: %s\n", script_name);
}
}
@@ -476,15 +476,15 @@ static AppSnapshot* TryReadAppSnapshotDynamicLibrary(const char* script_name) {
reinterpret_cast<const uint8_t*>(Utils::ResolveSymbolInDynamicLibrary(
library, kIsolateSnapshotDataCSymbol));
if (isolate_data_buffer == nullptr) {
FATAL1("Failed to resolve symbol '%s'\n", kIsolateSnapshotDataCSymbol);
FATAL("Failed to resolve symbol '%s'\n", kIsolateSnapshotDataCSymbol);
}
const uint8_t* isolate_instructions_buffer =
reinterpret_cast<const uint8_t*>(Utils::ResolveSymbolInDynamicLibrary(
library, kIsolateSnapshotInstructionsCSymbol));
if (isolate_instructions_buffer == nullptr) {
FATAL1("Failed to resolve symbol '%s'\n",
kIsolateSnapshotInstructionsCSymbol);
FATAL("Failed to resolve symbol '%s'\n",
kIsolateSnapshotInstructionsCSymbol);
}
return new DylibAppSnapshot(library, vm_data_buffer, vm_instructions_buffer,
+2 -2
View File
@@ -21,8 +21,8 @@ namespace bin {
if (result != 0) { \
const int kBufferSize = 1024; \
char error_buf[kBufferSize]; \
FATAL2("pthread error: %d (%s)", result, \
Utils::StrError(result, error_buf, kBufferSize)); \
FATAL("pthread error: %d (%s)", result, \
Utils::StrError(result, error_buf, kBufferSize)); \
}
#ifdef DEBUG
+1 -1
View File
@@ -22,7 +22,7 @@ namespace bin {
const int kBufferSize = 1024; \
char error_message[kBufferSize]; \
Utils::StrError(result, error_message, kBufferSize); \
FATAL2("pthread error: %d (%s)", result, error_message); \
FATAL("pthread error: %d (%s)", result, error_message); \
}
#ifdef DEBUG
+2 -2
View File
@@ -25,8 +25,8 @@ namespace bin {
if (result != 0) { \
const int kBufferSize = 1024; \
char error_buf[kBufferSize]; \
FATAL2("pthread error: %d (%s)", result, \
Utils::StrError(result, error_buf, kBufferSize)); \
FATAL("pthread error: %d (%s)", result, \
Utils::StrError(result, error_buf, kBufferSize)); \
}
#ifdef DEBUG
+2 -2
View File
@@ -22,8 +22,8 @@ namespace bin {
if (result != 0) { \
const int kBufferSize = 1024; \
char error_buf[kBufferSize]; \
FATAL2("pthread error: %d (%s)", result, \
Utils::StrError(result, error_buf, kBufferSize)); \
FATAL("pthread error: %d (%s)", result, \
Utils::StrError(result, error_buf, kBufferSize)); \
}
#ifdef DEBUG
+1 -1
View File
@@ -30,7 +30,7 @@ namespace bin {
const int kBufferSize = 1024; \
char error_message[kBufferSize]; \
Utils::StrError(result, error_message, kBufferSize); \
FATAL2("pthread error: %d (%s)", result, error_message); \
FATAL("pthread error: %d (%s)", result, error_message); \
}
#ifdef DEBUG
+1 -1
View File
@@ -248,7 +248,7 @@ void VmService::SetServerAddress(const char* server_uri) {
}
const intptr_t server_uri_len = strlen(server_uri);
if (server_uri_len >= (kServerUriStringBufferSize - 1)) {
FATAL1("vm-service: Server URI exceeded length: %s\n", server_uri);
FATAL("vm-service: Server URI exceeded length: %s\n", server_uri);
}
strncpy(server_uri_, server_uri, kServerUriStringBufferSize);
server_uri_[kServerUriStringBufferSize - 1] = '\0';
+1 -1
View File
@@ -1604,7 +1604,7 @@ DEFINE_NATIVE_ENTRY(DeclarationMirror_location, 0, 1) {
const String& uri = String::Handle(zone, script.url());
return CreateSourceLocation(uri, 1, 1);
} else {
FATAL1("Unexpected declaration type: %s", decl.ToCString());
FATAL("Unexpected declaration type: %s", decl.ToCString());
}
ASSERT(!script.IsNull());
-10
View File
@@ -243,16 +243,6 @@ void Expect::Null(const T p) {
dart::Assert(__FILE__, __LINE__).Fail(format, ##__VA_ARGS__);
#endif
// Leaving old non-varargs versions to avoid having to rewrite all uses.
#define FATAL1(format, p1) dart::Assert(__FILE__, __LINE__).Fail(format, (p1))
#define FATAL2(format, p1, p2) \
dart::Assert(__FILE__, __LINE__).Fail(format, (p1), (p2))
#define FATAL3(format, p1, p2, p3) \
dart::Assert(__FILE__, __LINE__).Fail(format, (p1), (p2), (p3))
#define UNIMPLEMENTED() FATAL("unimplemented code")
#define UNREACHABLE() FATAL("unreachable code")
+1 -1
View File
@@ -33,7 +33,7 @@ int Utils::SNPrint(char* str, size_t size, const char* format, ...) {
int Utils::VSNPrint(char* str, size_t size, const char* format, va_list args) {
int retval = vsnprintf(str, size, format, args);
if (retval < 0) {
FATAL1("Fatal error in Utils::VSNPrint with format '%s'", format);
FATAL("Fatal error in Utils::VSNPrint with format '%s'", format);
}
return retval;
}
+1 -1
View File
@@ -38,7 +38,7 @@ int Utils::SNPrint(char* str, size_t size, const char* format, ...) {
int Utils::VSNPrint(char* str, size_t size, const char* format, va_list args) {
int retval = vsnprintf(str, size, format, args);
if (retval < 0) {
FATAL1("Fatal error in Utils::VSNPrint with format '%s'", format);
FATAL("Fatal error in Utils::VSNPrint with format '%s'", format);
}
return retval;
}
+1 -1
View File
@@ -34,7 +34,7 @@ int Utils::VSNPrint(char* str, size_t size, const char* format, va_list args) {
MSAN_UNPOISON(str, size);
int retval = vsnprintf(str, size, format, args);
if (retval < 0) {
FATAL1("Fatal error in Utils::VSNPrint with format '%s'", format);
FATAL("Fatal error in Utils::VSNPrint with format '%s'", format);
}
return retval;
}
+3 -3
View File
@@ -64,7 +64,7 @@ int Utils::SNPrint(char* str, size_t size, const char* format, ...) {
int Utils::VSNPrint(char* str, size_t size, const char* format, va_list args) {
int retval = vsnprintf(str, size, format, args);
if (retval < 0) {
FATAL1("Fatal error in Utils::VSNPrint with format '%s'", format);
FATAL("Fatal error in Utils::VSNPrint with format '%s'", format);
}
return retval;
}
@@ -97,7 +97,7 @@ int32_t DarwinMajorVersionInternal() {
}
if (strcmp(uname_info.sysname, "Darwin") != 0) {
FATAL1(
FATAL(
"Fatal error in DarwinMajorVersionInternal : unexpected uname"
" sysname '%s'",
uname_info.sysname);
@@ -116,7 +116,7 @@ int32_t DarwinMajorVersionInternal() {
}
if (!dot) {
FATAL1(
FATAL(
"Fatal error in DarwinMajorVersionInternal :"
" could not parse uname release '%s'",
uname_info.release);
+2 -2
View File
@@ -46,7 +46,7 @@ int Utils::VSNPrint(char* str, size_t size, const char* format, va_list args) {
if (str == NULL || size == 0) {
int retval = _vscprintf(format, args);
if (retval < 0) {
FATAL1("Fatal error in Utils::VSNPrint with format '%s'", format);
FATAL("Fatal error in Utils::VSNPrint with format '%s'", format);
}
return retval;
}
@@ -62,7 +62,7 @@ int Utils::VSNPrint(char* str, size_t size, const char* format, va_list args) {
va_copy(args_retry, args);
written = _vscprintf(format, args_retry);
if (written < 0) {
FATAL1("Fatal error in Utils::VSNPrint with format '%s'", format);
FATAL("Fatal error in Utils::VSNPrint with format '%s'", format);
}
va_end(args_retry);
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace dart {
static void* Allocate(uword size, Zone* zone) {
ASSERT(zone != NULL);
if (size > static_cast<uword>(kIntptrMax)) {
FATAL1("ZoneAllocated object has unexpectedly large size %" Pu "", size);
FATAL("ZoneAllocated object has unexpectedly large size %" Pu "", size);
}
return reinterpret_cast<void*>(zone->AllocUnsafe(size));
}
+4 -4
View File
@@ -8497,7 +8497,7 @@ DeserializationCluster* Deserializer::ReadCluster() {
default:
break;
}
FATAL1("No cluster defined for cid %" Pd, cid);
FATAL("No cluster defined for cid %" Pd, cid);
return NULL;
}
@@ -8863,9 +8863,9 @@ void Deserializer::Deserialize(DeserializationRoots* roots) {
primary = roots->AddBaseObjects(this);
if (num_base_objects_ != (next_ref_index_ - kFirstReference)) {
FATAL2("Snapshot expects %" Pd
" base objects, but deserializer provided %" Pd,
num_base_objects_, next_ref_index_ - kFirstReference);
FATAL("Snapshot expects %" Pd
" base objects, but deserializer provided %" Pd,
num_base_objects_, next_ref_index_ - kFirstReference);
}
{
+1 -1
View File
@@ -149,7 +149,7 @@ class DeserializationCluster : public ZoneAllocated {
const Array& refs,
bool primary) {
if (!primary && is_canonical()) {
FATAL1("%s needs canonicalization but doesn't define PostLoad", name());
FATAL("%s needs canonicalization but doesn't define PostLoad", name());
}
}
+1 -1
View File
@@ -133,7 +133,7 @@ bool BitmapBuilder::GetBit(intptr_t bit_offset) const {
void BitmapBuilder::SetBit(intptr_t bit_offset, bool value) {
if (!InRange(bit_offset)) {
FATAL1(
FATAL(
"Fatal error in BitmapBuilder::SetBit :"
" invalid bit_offset, %" Pd "\n",
bit_offset);
+1 -1
View File
@@ -63,7 +63,7 @@ class BitmapBuilder : public ZoneAllocated {
bool InRange(intptr_t offset) const {
if (offset < 0) {
FATAL1(
FATAL(
"Fatal error in BitmapBuilder::InRange :"
" invalid bit_offset, %" Pd "\n",
offset);
+12 -12
View File
@@ -31,7 +31,7 @@ class UnoptimizedCall : public ValueObject {
if (MatchesPattern(pc, call_pattern, ARRAY_SIZE(call_pattern))) {
pc -= ARRAY_SIZE(call_pattern);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
// movq CODE_REG, [PP + offset]
@@ -49,7 +49,7 @@ class UnoptimizedCall : public ValueObject {
pc -= ARRAY_SIZE(load_code_disp32);
code_index_ = IndexFromPPLoadDisp32(pc + 3);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
ASSERT(Object::Handle(object_pool_.ObjectAt(code_index_)).IsCode());
@@ -69,7 +69,7 @@ class UnoptimizedCall : public ValueObject {
pc -= ARRAY_SIZE(load_argument_disp32);
argument_index_ = IndexFromPPLoadDisp32(pc + 3);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
}
@@ -171,7 +171,7 @@ class PoolPointerCall : public ValueObject {
if (MatchesPattern(pc, call_pattern, ARRAY_SIZE(call_pattern))) {
pc -= ARRAY_SIZE(call_pattern);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
// movq CODE_REG, [PP + offset]
@@ -189,7 +189,7 @@ class PoolPointerCall : public ValueObject {
pc -= ARRAY_SIZE(load_code_disp32);
code_index_ = IndexFromPPLoadDisp32(pc + 3);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
ASSERT(Object::Handle(object_pool_.ObjectAt(code_index_)).IsCode());
}
@@ -261,7 +261,7 @@ class SwitchableCall : public SwitchableCallBase {
if (MatchesPattern(pc, call_pattern, ARRAY_SIZE(call_pattern))) {
pc -= ARRAY_SIZE(call_pattern);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
// movq RBX, [PP + offset]
@@ -279,7 +279,7 @@ class SwitchableCall : public SwitchableCallBase {
pc -= ARRAY_SIZE(load_data_disp32);
data_index_ = IndexFromPPLoadDisp32(pc + 3);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
ASSERT(!Object::Handle(object_pool_.ObjectAt(data_index_)).IsCode());
@@ -291,7 +291,7 @@ class SwitchableCall : public SwitchableCallBase {
ARRAY_SIZE(load_entry_pattern))) {
pc -= ARRAY_SIZE(load_entry_pattern);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
// movq CODE_REG, [PP + offset]
@@ -309,7 +309,7 @@ class SwitchableCall : public SwitchableCallBase {
pc -= ARRAY_SIZE(load_code_disp32);
target_index_ = IndexFromPPLoadDisp32(pc + 3);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
ASSERT(Object::Handle(object_pool_.ObjectAt(target_index_)).IsCode());
}
@@ -344,7 +344,7 @@ class BareSwitchableCall : public SwitchableCallBase {
if (MatchesPattern(pc, call_pattern, ARRAY_SIZE(call_pattern))) {
pc -= ARRAY_SIZE(call_pattern);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
// movq RBX, [PP + offset]
@@ -362,7 +362,7 @@ class BareSwitchableCall : public SwitchableCallBase {
pc -= ARRAY_SIZE(load_data_disp32);
data_index_ = IndexFromPPLoadDisp32(pc + 3);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
ASSERT(!Object::Handle(object_pool_.ObjectAt(data_index_)).IsCode());
@@ -381,7 +381,7 @@ class BareSwitchableCall : public SwitchableCallBase {
pc -= ARRAY_SIZE(load_code_disp32);
target_index_ = IndexFromPPLoadDisp32(pc + 3);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
ASSERT(object_pool_.TypeAt(target_index_) ==
ObjectPool::EntryType::kImmediate);
+5 -5
View File
@@ -655,8 +655,8 @@ void Precompiler::DoCompileAll() {
const auto& non_visited =
Function::Handle(Z, FindUnvisitedRetainedFunction());
if (!non_visited.IsNull()) {
FATAL1("Code visitor would miss the code for function \"%s\"\n",
non_visited.ToFullyQualifiedCString());
FATAL("Code visitor would miss the code for function \"%s\"\n",
non_visited.ToFullyQualifiedCString());
}
#endif
DiscardCodeObjects();
@@ -2028,8 +2028,8 @@ void Precompiler::TraceForRetainedFunctions() {
// they are referenced only from code (object pool).
if (!functions_to_retain_.ContainsKey(function) &&
!function.IsFfiTrampoline()) {
FATAL1("Function %s was not traced in TraceForRetainedFunctions\n",
function.ToFullyQualifiedCString());
FATAL("Function %s was not traced in TraceForRetainedFunctions\n",
function.ToFullyQualifiedCString());
}
}
#endif // DEBUG
@@ -2745,7 +2745,7 @@ void Precompiler::DropLibraryEntries() {
} else if (entry.IsLibraryPrefix()) {
// Always drop.
} else {
FATAL1("Unexpected library entry: %s", entry.ToCString());
FATAL("Unexpected library entry: %s", entry.ToCString());
}
dict.SetAt(j, Object::null_object());
}
@@ -1686,7 +1686,7 @@ const char* RISCVDisassembler::PrintOption(const char* format, Instr instr) {
return format + 4;
}
FATAL1("Bad format %s\n", format);
FATAL("Bad format %s\n", format);
return nullptr;
}
@@ -1766,7 +1766,7 @@ const char* RISCVDisassembler::PrintOption(const char* format, CInstr instr) {
return format + 8;
}
FATAL1("Bad format %s\n", format);
FATAL("Bad format %s\n", format);
return nullptr;
}
+1 -1
View File
@@ -7686,7 +7686,7 @@ SimdOpInstr::Kind SimdOpInstr::KindForMethod(MethodRecognizer::Kind kind) {
break;
}
FATAL1("Not a SIMD method: %s", MethodRecognizer::KindToCString(kind));
FATAL("Not a SIMD method: %s", MethodRecognizer::KindToCString(kind));
return kIllegalSimdOp;
}
@@ -2709,7 +2709,7 @@ void ConstantInstr::InferRange(RangeAnalysis* analysis, Range* range) {
RangeBoundary::FromConstant(value));
} else {
// Only Smi and Mint supported.
FATAL1("Unexpected constant: %s\n", value_.ToCString());
FATAL("Unexpected constant: %s\n", value_.ToCString());
}
}
@@ -407,7 +407,7 @@ InstancePtr ConstantReader::ReadConstantInternal(intptr_t constant_index) {
const NameIndex index = reader.ReadCanonicalNameReference();
const auto& klass = Class::Handle(Z, H.LookupClassByKernelClass(index));
if (!klass.is_declaration_loaded()) {
FATAL1(
FATAL(
"Trying to evaluate an instance constant whose references class "
"%s is not loaded yet.",
klass.ToCString());
+4 -6
View File
@@ -802,13 +802,11 @@ FlowGraph* FlowGraphBuilder::BuildGraph() {
MethodRecognizer::IsMarkedAsRecognized(function)) &&
!function.IsDynamicInvocationForwarder()) {
if (function.IsRecognized()) {
FATAL1(
"Recognized method %s is not marked with the vm:recognized pragma.",
function.ToQualifiedCString());
FATAL("Recognized method %s is not marked with the vm:recognized pragma.",
function.ToQualifiedCString());
} else {
FATAL1(
"Non-recognized method %s is marked with the vm:recognized pragma.",
function.ToQualifiedCString());
FATAL("Non-recognized method %s is marked with the vm:recognized pragma.",
function.ToQualifiedCString());
}
}
#endif
@@ -1579,7 +1579,7 @@ void MetadataHelper::ScanMetadataMappings() {
if (H.StringEquals(tag, tag_)) {
if ((!FLAG_precompiled_mode) && precompiler_only_) {
FATAL1("%s metadata is allowed in precompiled mode only", tag_);
FATAL("%s metadata is allowed in precompiled mode only", tag_);
}
SetMetadataMappings(offset + kUInt32Size, mappings_num);
return;
@@ -1913,7 +1913,7 @@ void LoadingUnitsMetadataHelper::ReadMetadata(intptr_t node_offset) {
translation_helper_.DartSymbolPlain(helper_->ReadStringReference());
lib = Library::LookupLibrary(thread, uri);
if (lib.IsNull()) {
FATAL1("Missing library: %s\n", uri.ToCString());
FATAL("Missing library: %s\n", uri.ToCString());
}
lib.set_loading_unit(unit);
uris.SetAt(j, uri);
@@ -2165,8 +2165,8 @@ void KernelReaderHelper::SkipInterfaceMemberNameReference() {
}
void KernelReaderHelper::ReportUnexpectedTag(const char* variant, Tag tag) {
FATAL3("Unexpected tag %d (%s) in ?, expected %s", tag, Reader::TagName(tag),
variant);
FATAL("Unexpected tag %d (%s) in ?, expected %s", tag, Reader::TagName(tag),
variant);
}
void KernelReaderHelper::ReadUntilFunctionNode() {
+2 -2
View File
@@ -172,8 +172,8 @@ static Definition* PrepareIndexedOp(FlowGraph* flow_graph,
static void VerifyParameterIsBoxed(BlockBuilder* builder, intptr_t arg_index) {
const auto& function = builder->function();
if (function.is_unboxed_parameter_at(arg_index)) {
FATAL2("Unsupported unboxed parameter %" Pd " in %s", arg_index,
function.ToFullyQualifiedCString());
FATAL("Unsupported unboxed parameter %" Pd " in %s", arg_index,
function.ToFullyQualifiedCString());
}
}
+6 -6
View File
@@ -243,8 +243,8 @@ void Intrinsifier::InitializeState() {
if (!func.IsNull()) {
func.set_is_intrinsic(true);
} else if (!FLAG_precompiled_mode) {
FATAL2("Intrinsifier failed to find method %s in class %s\n",
intrinsic->function_name, intrinsic->class_name);
FATAL("Intrinsifier failed to find method %s in class %s\n",
intrinsic->function_name, intrinsic->class_name);
}
}
}
@@ -288,12 +288,12 @@ bool Intrinsifier::Intrinsify(const ParsedFunction& parsed_function,
const auto size_after = compiler->assembler()->CodeSize(); \
if (size_before == size_after) return false; \
if (function.HasUnboxedParameters()) { \
FATAL1("Unsupported unboxed parameters in asm intrinsic %s", \
function.ToFullyQualifiedCString()); \
FATAL("Unsupported unboxed parameters in asm intrinsic %s", \
function.ToFullyQualifiedCString()); \
} \
if (function.HasUnboxedReturnValue()) { \
FATAL1("Unsupported unboxed return value in asm intrinsic %s", \
function.ToFullyQualifiedCString()); \
FATAL("Unsupported unboxed return value in asm intrinsic %s", \
function.ToFullyQualifiedCString()); \
} \
if (!normal_ir_body.IsBound()) { \
EMIT_BREAKPOINT(); \
+12 -12
View File
@@ -821,10 +821,10 @@ ObjectPtr Compiler::CompileFunction(Thread* thread, const Function& function) {
#endif
#if defined(DART_PRECOMPILED_RUNTIME)
FATAL3("Precompilation missed function %s (%s, %s)\n",
function.ToLibNamePrefixedQualifiedCString(),
function.token_pos().ToCString(),
Function::KindToCString(function.kind()));
FATAL("Precompilation missed function %s (%s, %s)\n",
function.ToLibNamePrefixedQualifiedCString(),
function.token_pos().ToCString(),
Function::KindToCString(function.kind()));
#endif // defined(DART_PRECOMPILED_RUNTIME)
VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId);
@@ -1256,10 +1256,10 @@ CompilationPipeline* CompilationPipeline::New(Zone* zone,
DEFINE_RUNTIME_ENTRY(CompileFunction, 1) {
const Function& function = Function::CheckedHandle(zone, arguments.ArgAt(0));
FATAL3("Precompilation missed function %s (%s, %s)\n",
function.ToLibNamePrefixedQualifiedCString(),
function.token_pos().ToCString(),
Function::KindToCString(function.kind()));
FATAL("Precompilation missed function %s (%s, %s)\n",
function.ToLibNamePrefixedQualifiedCString(),
function.token_pos().ToCString(),
Function::KindToCString(function.kind()));
}
bool Compiler::IsBackgroundCompilation() {
@@ -1272,20 +1272,20 @@ bool Compiler::CanOptimizeFunction(Thread* thread, const Function& function) {
}
ObjectPtr Compiler::CompileFunction(Thread* thread, const Function& function) {
FATAL1("Attempt to compile function %s", function.ToCString());
FATAL("Attempt to compile function %s", function.ToCString());
return Error::null();
}
ErrorPtr Compiler::EnsureUnoptimizedCode(Thread* thread,
const Function& function) {
FATAL1("Attempt to compile function %s", function.ToCString());
FATAL("Attempt to compile function %s", function.ToCString());
return Error::null();
}
ObjectPtr Compiler::CompileOptimizedFunction(Thread* thread,
const Function& function,
intptr_t osr_id) {
FATAL1("Attempt to compile function %s", function.ToCString());
FATAL("Attempt to compile function %s", function.ToCString());
return Error::null();
}
@@ -1294,7 +1294,7 @@ void Compiler::ComputeLocalVarDescriptors(const Code& code) {
}
ErrorPtr Compiler::CompileAllFunctions(const Class& cls) {
FATAL1("Attempt to compile class %s", cls.ToCString());
FATAL("Attempt to compile class %s", cls.ToCString());
return Error::null();
}
+3 -3
View File
@@ -487,9 +487,9 @@ static uword GetInstanceSizeImpl(const dart::Class& handle) {
return handle.target_instance_size();
}
}
FATAL3("Unsupported class for size translation: %s (id=%" Pd
", kNumPredefinedCids=%" Pd ")\n",
handle.ToCString(), handle.id(), kNumPredefinedCids);
FATAL("Unsupported class for size translation: %s (id=%" Pd
", kNumPredefinedCids=%" Pd ")\n",
handle.ToCString(), handle.id(), kNumPredefinedCids);
return -1;
}
+21 -21
View File
@@ -871,7 +871,7 @@ DART_EXPORT void Dart_PropagateError(Dart_Handle handle) {
TransitionNativeToVM transition(thread);
const Object& obj = Object::Handle(thread->zone(), Api::UnwrapHandle(handle));
if (!obj.IsError()) {
FATAL1(
FATAL(
"%s expects argument 'handle' to be an error handle. "
"Did you forget to check Dart_IsError first?",
CURRENT_FUNC);
@@ -1136,7 +1136,7 @@ DART_EXPORT void Dart_UpdateFinalizableExternalSize(
intptr_t external_allocation_size) {
if (!::Dart_IdentityEquals(strong_ref_to_object,
HandleFromFinalizable(object))) {
FATAL1(
FATAL(
"%s expects arguments 'object' and 'strong_ref_to_object' to point to "
"the same object.",
CURRENT_FUNC);
@@ -1179,7 +1179,7 @@ DART_EXPORT void Dart_DeleteFinalizableHandle(
Dart_Handle strong_ref_to_object) {
if (!::Dart_IdentityEquals(strong_ref_to_object,
HandleFromFinalizable(object))) {
FATAL1(
FATAL(
"%s expects arguments 'object' and 'strong_ref_to_object' to point to "
"the same object.",
CURRENT_FUNC);
@@ -1243,8 +1243,8 @@ VM_METRIC_LIST(VM_METRIC_API)
DART_EXPORT int64_t Dart_IsolateGroup##variable##Metric( \
Dart_IsolateGroup isolate_group) { \
if (isolate_group == nullptr) { \
FATAL1("%s expects argument 'isolate_group' to be non-null.", \
CURRENT_FUNC); \
FATAL("%s expects argument 'isolate_group' to be non-null.", \
CURRENT_FUNC); \
} \
IsolateGroup* group = reinterpret_cast<IsolateGroup*>(isolate_group); \
return group->Get##variable##Metric()->Value(); \
@@ -1256,7 +1256,7 @@ ISOLATE_GROUP_METRIC_LIST(ISOLATE_GROUP_METRIC_API)
#define ISOLATE_METRIC_API(type, variable, name, unit) \
DART_EXPORT int64_t Dart_Isolate##variable##Metric(Dart_Isolate isolate) { \
if (isolate == NULL) { \
FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); \
FATAL("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC); \
} \
Isolate* iso = reinterpret_cast<Isolate*>(isolate); \
return iso->Get##variable##Metric()->Value(); \
@@ -1515,7 +1515,7 @@ DART_EXPORT void* Dart_CurrentIsolateData() {
DART_EXPORT void* Dart_IsolateData(Dart_Isolate isolate) {
if (isolate == NULL) {
FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
FATAL("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
}
// TODO(http://dartbug.com/16615): Validate isolate parameter.
return reinterpret_cast<Isolate*>(isolate)->init_callback_data();
@@ -1540,7 +1540,7 @@ DART_EXPORT Dart_IsolateGroupId Dart_CurrentIsolateGroupId() {
DART_EXPORT void* Dart_IsolateGroupData(Dart_Isolate isolate) {
if (isolate == NULL) {
FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
FATAL("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
}
// TODO(http://dartbug.com/16615): Validate isolate parameter.
return reinterpret_cast<Isolate*>(isolate)->group()->embedder_data();
@@ -1556,7 +1556,7 @@ DART_EXPORT Dart_Handle Dart_DebugName() {
DART_EXPORT const char* Dart_IsolateServiceId(Dart_Isolate isolate) {
if (isolate == NULL) {
FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
FATAL("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
}
// TODO(http://dartbug.com/16615): Validate isolate parameter.
Isolate* I = reinterpret_cast<Isolate*>(isolate);
@@ -1681,15 +1681,15 @@ DART_EXPORT bool Dart_ShouldPauseOnStart() {
DART_EXPORT void Dart_SetShouldPauseOnStart(bool should_pause) {
#if defined(PRODUCT)
if (should_pause) {
FATAL1("%s(true) is not supported in a PRODUCT build", CURRENT_FUNC);
FATAL("%s(true) is not supported in a PRODUCT build", CURRENT_FUNC);
}
#else
Isolate* isolate = Isolate::Current();
CHECK_ISOLATE(isolate);
NoSafepointScope no_safepoint_scope;
if (isolate->is_runnable()) {
FATAL1("%s expects the current isolate to not be runnable yet.",
CURRENT_FUNC);
FATAL("%s expects the current isolate to not be runnable yet.",
CURRENT_FUNC);
}
isolate->message_handler()->set_should_pause_on_start(should_pause);
#endif
@@ -1709,7 +1709,7 @@ DART_EXPORT bool Dart_IsPausedOnStart() {
DART_EXPORT void Dart_SetPausedOnStart(bool paused) {
#if defined(PRODUCT)
if (paused) {
FATAL1("%s(true) is not supported in a PRODUCT build", CURRENT_FUNC);
FATAL("%s(true) is not supported in a PRODUCT build", CURRENT_FUNC);
}
#else
Isolate* isolate = Isolate::Current();
@@ -1735,7 +1735,7 @@ DART_EXPORT bool Dart_ShouldPauseOnExit() {
DART_EXPORT void Dart_SetShouldPauseOnExit(bool should_pause) {
#if defined(PRODUCT)
if (should_pause) {
FATAL1("%s(true) is not supported in a PRODUCT build", CURRENT_FUNC);
FATAL("%s(true) is not supported in a PRODUCT build", CURRENT_FUNC);
}
#else
Isolate* isolate = Isolate::Current();
@@ -1759,7 +1759,7 @@ DART_EXPORT bool Dart_IsPausedOnExit() {
DART_EXPORT void Dart_SetPausedOnExit(bool paused) {
#if defined(PRODUCT)
if (paused) {
FATAL1("%s(true) is not supported in a PRODUCT build", CURRENT_FUNC);
FATAL("%s(true) is not supported in a PRODUCT build", CURRENT_FUNC);
}
#else
Isolate* isolate = Isolate::Current();
@@ -1780,12 +1780,12 @@ DART_EXPORT void Dart_SetStickyError(Dart_Handle error) {
const Error& error_handle = Api::UnwrapErrorHandle(Z, error);
if ((isolate->sticky_error() != Error::null()) &&
(error_handle.ptr() != Object::null())) {
FATAL1("%s expects there to be no sticky error.", CURRENT_FUNC);
FATAL("%s expects there to be no sticky error.", CURRENT_FUNC);
}
if (!error_handle.IsUnhandledException() &&
(error_handle.ptr() != Object::null())) {
FATAL1("%s expects the error to be an unhandled exception error or null.",
CURRENT_FUNC);
FATAL("%s expects the error to be an unhandled exception error or null.",
CURRENT_FUNC);
}
isolate->SetStickyError(error_handle.ptr());
}
@@ -1952,7 +1952,7 @@ DART_EXPORT char* Dart_IsolateMakeRunnable(Dart_Isolate isolate) {
CHECK_NO_ISOLATE(Isolate::Current());
API_TIMELINE_DURATION(Thread::Current());
if (isolate == NULL) {
FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
FATAL("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
}
// TODO(16615): Validate isolate parameter.
const char* error = reinterpret_cast<Isolate*>(isolate)->MakeRunnable();
@@ -5323,7 +5323,7 @@ DART_EXPORT void Dart_SetReturnValue(Dart_NativeArguments args,
OS::PrintErr("=== Current Trace:\n%s===\n", stacktrace.ToCString());
const Object& ret_obj = Object::Handle(Api::UnwrapHandle(retval));
FATAL1(
FATAL(
"Return value check failed: saw '%s' expected a dart Instance or "
"an Error.",
ret_obj.ToCString());
@@ -6164,7 +6164,7 @@ Dart_CompileToKernel(const char* script_uri,
KernelIsolate::AcceptCompilation():
KernelIsolate::RejectCompilation();
if (ack_result.status != Dart_KernelCompilationStatus_Ok) {
FATAL1(
FATAL(
"An error occurred in the CFE while acking the most recent"
" compilation results: %s",
ack_result.error);
+4 -4
View File
@@ -32,7 +32,7 @@ const char* CanonicalFunction(const char* func);
#define CHECK_ISOLATE_GROUP(isolate_group) \
do { \
if ((isolate_group) == NULL) { \
FATAL1( \
FATAL( \
"%s expects there to be a current isolate group. Did you " \
"forget to call Dart_CreateIsolateGroup or Dart_EnterIsolate?", \
CURRENT_FUNC); \
@@ -43,7 +43,7 @@ const char* CanonicalFunction(const char* func);
#define CHECK_ISOLATE(isolate) \
do { \
if ((isolate) == NULL) { \
FATAL1( \
FATAL( \
"%s expects there to be a current isolate. Did you " \
"forget to call Dart_CreateIsolateGroup or Dart_EnterIsolate?", \
CURRENT_FUNC); \
@@ -54,7 +54,7 @@ const char* CanonicalFunction(const char* func);
#define CHECK_NO_ISOLATE(isolate) \
do { \
if ((isolate) != NULL) { \
FATAL1( \
FATAL( \
"%s expects there to be no current isolate. Did you " \
"forget to call Dart_ExitIsolate?", \
CURRENT_FUNC); \
@@ -68,7 +68,7 @@ const char* CanonicalFunction(const char* func);
Isolate* tmpI = tmpT == NULL ? NULL : tmpT->isolate(); \
CHECK_ISOLATE(tmpI); \
if (tmpT->api_top_scope() == NULL) { \
FATAL1( \
FATAL( \
"%s expects to find a current scope. Did you forget to call " \
"Dart_EnterScope?", \
CURRENT_FUNC); \
+2 -2
View File
@@ -109,8 +109,8 @@ void DeferredRetAddr::Materialize(DeoptContext* deopt_context) {
uword continue_at_pc =
code.GetPcForDeoptId(deopt_id_, UntaggedPcDescriptors::kDeopt);
if (continue_at_pc == 0) {
FATAL2("Can't locate continuation PC for deoptid %" Pd " within %s\n",
deopt_id_, function.ToFullyQualifiedCString());
FATAL("Can't locate continuation PC for deoptid %" Pd " within %s\n",
deopt_id_, function.ToFullyQualifiedCString());
}
uword* dest_addr = reinterpret_cast<uword*>(slot());
*dest_addr = continue_at_pc;
+5 -5
View File
@@ -211,8 +211,8 @@ intptr_t Dwarf::LookupFunction(const Function& function) {
RELEASE_ASSERT(!function.IsNull());
FunctionIndexPair* pair = function_to_index_.Lookup(&function);
if (pair == NULL) {
FATAL1("Function detected too late during DWARF generation: %s",
function.ToCString());
FATAL("Function detected too late during DWARF generation: %s",
function.ToCString());
}
return pair->index_;
}
@@ -221,8 +221,8 @@ intptr_t Dwarf::LookupScript(const Script& script) {
RELEASE_ASSERT(!script.IsNull());
ScriptIndexPair* pair = script_to_index_.Lookup(&script);
if (pair == NULL) {
FATAL1("Script detected too late during DWARF generation: %s",
script.ToCString());
FATAL("Script detected too late during DWARF generation: %s",
script.ToCString());
}
return pair->index_;
}
@@ -429,7 +429,7 @@ InliningNode* Dwarf::ExpandInliningTree(const Code& code) {
const Array& functions = Array::Handle(zone_, code.inlined_id_to_function());
const Function& root_function = Function::ZoneHandle(zone_, code.function());
if (root_function.IsNull()) {
FATAL1("Wherefore art thou functionless code, %s?\n", code.ToCString());
FATAL("Wherefore art thou functionless code, %s?\n", code.ToCString());
}
GrowableArray<InliningNode*> node_stack(zone_, 4);
+16 -16
View File
@@ -877,7 +877,7 @@ class CheckStoreBufferVisitor : public ObjectVisitor,
if (raw_obj->IsHeapObject() && raw_obj->IsNewObject()) {
if (is_card_remembered_) {
if (!Page::Of(visiting_)->IsCardRemembered(ptr)) {
FATAL3(
FATAL(
"Old object %#" Px " references new object %#" Px
", but the "
"slot's card is not remembered. Consider using rr to watch the "
@@ -887,13 +887,13 @@ class CheckStoreBufferVisitor : public ObjectVisitor,
ptr);
}
} else if (!is_remembered_) {
FATAL3(
"Old object %#" Px " references new object %#" Px
", but it is "
"not in any store buffer. Consider using rr to watch the "
"slot %p and reverse-continue to find the store with a missing "
"barrier.\n",
static_cast<uword>(visiting_), static_cast<uword>(raw_obj), ptr);
FATAL("Old object %#" Px " references new object %#" Px
", but it is "
"not in any store buffer. Consider using rr to watch the "
"slot %p and reverse-continue to find the store with a missing "
"barrier.\n",
static_cast<uword>(visiting_), static_cast<uword>(raw_obj),
ptr);
}
RELEASE_ASSERT(to_->Contains(UntaggedObject::ToAddr(raw_obj)));
}
@@ -908,7 +908,7 @@ class CheckStoreBufferVisitor : public ObjectVisitor,
if (raw_obj->IsHeapObject() && raw_obj->IsNewObject()) {
if (is_card_remembered_) {
if (!Page::Of(visiting_)->IsCardRemembered(ptr)) {
FATAL3(
FATAL(
"Old object %#" Px " references new object %#" Px
", but the "
"slot's card is not remembered. Consider using rr to watch the "
@@ -918,13 +918,13 @@ class CheckStoreBufferVisitor : public ObjectVisitor,
ptr);
}
} else if (!is_remembered_) {
FATAL3(
"Old object %#" Px " references new object %#" Px
", but it is "
"not in any store buffer. Consider using rr to watch the "
"slot %p and reverse-continue to find the store with a missing "
"barrier.\n",
static_cast<uword>(visiting_), static_cast<uword>(raw_obj), ptr);
FATAL("Old object %#" Px " references new object %#" Px
", but it is "
"not in any store buffer. Consider using rr to watch the "
"slot %p and reverse-continue to find the store with a missing "
"barrier.\n",
static_cast<uword>(visiting_), static_cast<uword>(raw_obj),
ptr);
}
RELEASE_ASSERT(to_->Contains(UntaggedObject::ToAddr(raw_obj)));
}
+2 -2
View File
@@ -93,7 +93,7 @@ intptr_t TypeTestingStubCallPattern::GetSubtypeTestCachePoolIndex() {
ARRAY_SIZE(indirect_call_pattern))) {
pc -= ARRAY_SIZE(indirect_call_pattern);
} else {
FATAL1("Failed to decode at %" Px, pc_);
FATAL("Failed to decode at %" Px, pc_);
}
if (MatchesPattern(pc, pattern_disp8, ARRAY_SIZE(pattern_disp8))) {
@@ -101,7 +101,7 @@ intptr_t TypeTestingStubCallPattern::GetSubtypeTestCachePoolIndex() {
} else if (MatchesPattern(pc, pattern_disp32, ARRAY_SIZE(pattern_disp32))) {
return IndexFromPPLoadDisp32(pc - 4);
} else {
FATAL1("Failed to decode at %" Px, pc);
FATAL("Failed to decode at %" Px, pc);
}
}
+1 -1
View File
@@ -1310,7 +1310,7 @@ ErrorPtr IsolateMessageHandler::HandleLibMessage(const Array& message) {
#if defined(DEBUG)
// Malformed OOB messages are silently ignored in release builds.
default:
FATAL1("Unknown OOB message type: %" Pd "\n", msg_type);
FATAL("Unknown OOB message type: %" Pd "\n", msg_type);
break;
#endif // defined(DEBUG)
}
+2 -2
View File
@@ -639,7 +639,7 @@ static ObjectPtr AcceptCompilation(Thread* thread) {
Dart_KernelCompilationResult result = KernelIsolate::AcceptCompilation();
if (result.status != Dart_KernelCompilationStatus_Ok) {
if (result.status != Dart_KernelCompilationStatus_MsgFailed) {
FATAL1(
FATAL(
"An error occurred while accepting the most recent"
" compilation results: %s",
result.error);
@@ -661,7 +661,7 @@ static ObjectPtr RejectCompilation(Thread* thread) {
Dart_KernelCompilationResult result = KernelIsolate::RejectCompilation();
if (result.status != Dart_KernelCompilationStatus_Ok) {
if (result.status != Dart_KernelCompilationStatus_MsgFailed) {
FATAL1(
FATAL(
"An error occurred while rejecting the most recent"
" compilation results: %s",
result.error);
+1 -1
View File
@@ -430,7 +430,7 @@ class Reader : public ValueObject {
void EnsureEnd() {
if (offset_ != size_) {
FATAL2(
FATAL(
"Reading Kernel file: Expected to be at EOF "
"(offset: %" Pd ", size: %" Pd ")",
offset_, size_);
+3 -3
View File
@@ -281,7 +281,7 @@ Object& KernelLoader::LoadEntireProgram(Program* program,
const bool line_starts_differ =
!pair->line_starts->CanonicalizeEquals(line_starts);
if (src_differ || line_starts_differ) {
FATAL3(
FATAL(
"Invalid kernel binary: Contains at least two source entries "
"that do not agree. URI '%s', difference: %s. Subprogram count: "
"%" Pd ".",
@@ -311,7 +311,7 @@ Object& KernelLoader::LoadEntireProgram(Program* program,
const char* error = nullptr;
std::unique_ptr<Program> subprogram = Program::ReadFrom(&reader, &error);
if (subprogram == nullptr) {
FATAL1("Failed to load kernel file: %s", error);
FATAL("Failed to load kernel file: %s", error);
}
ASSERT(subprogram->is_single_program());
KernelLoader loader(subprogram.get(), &uri_to_source_table);
@@ -792,7 +792,7 @@ void KernelLoader::FindModifiedLibraries(Program* program,
const char* error = nullptr;
std::unique_ptr<Program> subprogram = Program::ReadFrom(&reader, &error);
if (subprogram == nullptr) {
FATAL1("Failed to load kernel file: %s", error);
FATAL("Failed to load kernel file: %s", error);
}
ASSERT(subprogram->is_single_program());
KernelLoader loader(subprogram.get(), /*uri_to_source_table=*/nullptr);
+2 -2
View File
@@ -242,8 +242,8 @@ static NativeFunction ResolveNativeFunction(Zone* zone,
NativeFunction native_function = NativeEntry::ResolveNative(
library, native_name, num_params, is_auto_scope);
if (native_function == NULL) {
FATAL2("Failed to resolve native function '%s' in '%s'\n",
native_name.ToCString(), func.ToQualifiedCString());
FATAL("Failed to resolve native function '%s' in '%s'\n",
native_name.ToCString(), func.ToQualifiedCString());
}
return native_function;
}
+24 -25
View File
@@ -4699,7 +4699,7 @@ void Class::EnsureDeclarationLoaded() const {
#if defined(DART_PRECOMPILED_RUNTIME)
UNREACHABLE();
#else
FATAL1("Unable to use class %s which is not loaded yet.", ToCString());
FATAL("Unable to use class %s which is not loaded yet.", ToCString());
#endif
}
}
@@ -7475,7 +7475,7 @@ TypeArgumentsPtr TypeArguments::InstantiateAndCanonicalizeFrom(
TypeArgumentsPtr TypeArguments::New(intptr_t len, Heap::Space space) {
if (len < 0 || len > kMaxElements) {
// This should be caught before we reach here.
FATAL1("Fatal error in TypeArguments::New: invalid len %" Pd "\n", len);
FATAL("Fatal error in TypeArguments::New: invalid len %" Pd "\n", len);
}
TypeArguments& result = TypeArguments::Handle();
{
@@ -15270,7 +15270,7 @@ InstructionsPtr Instructions::New(intptr_t size, bool has_monomorphic_entry) {
ASSERT(Object::instructions_class() != Class::null());
if (size < 0 || size > kMaxElements) {
// This should be caught before we reach here.
FATAL1("Fatal error in Instructions::New: invalid size %" Pd "\n", size);
FATAL("Fatal error in Instructions::New: invalid size %" Pd "\n", size);
}
Instructions& result = Instructions::Handle();
{
@@ -15477,7 +15477,7 @@ ObjectPoolPtr ObjectPool::New(intptr_t len) {
ASSERT(Object::object_pool_class() != Class::null());
if (len < 0 || len > kMaxElements) {
// This should be caught before we reach here.
FATAL1("Fatal error in ObjectPool::New: invalid length %" Pd "\n", len);
FATAL("Fatal error in ObjectPool::New: invalid length %" Pd "\n", len);
}
ObjectPool& result = ObjectPool::Handle();
{
@@ -15823,7 +15823,7 @@ CompressedStackMapsPtr CompressedStackMaps::New(const void* payload,
ASSERT(size != 0);
if (!UntaggedCompressedStackMaps::SizeField::is_valid(size)) {
FATAL1(
FATAL(
"Fatal error in CompressedStackMaps::New: "
"invalid payload size %" Pu "\n",
size);
@@ -15973,7 +15973,7 @@ LocalVarDescriptorsPtr LocalVarDescriptors::New(intptr_t num_variables) {
ASSERT(Object::var_descriptors_class() != Class::null());
if (num_variables < 0 || num_variables > kMaxElements) {
// This should be caught before we reach here.
FATAL2(
FATAL(
"Fatal error in LocalVarDescriptors::New: "
"invalid num_variables %" Pd ". Maximum is: %d\n",
num_variables, UntaggedLocalVarDescriptors::kMaxIndex);
@@ -16086,7 +16086,7 @@ void ExceptionHandlers::set_handled_types_data(const Array& value) const {
ExceptionHandlersPtr ExceptionHandlers::New(intptr_t num_handlers) {
ASSERT(Object::exception_handlers_class() != Class::null());
if ((num_handlers < 0) || (num_handlers >= kMaxHandlers)) {
FATAL1(
FATAL(
"Fatal error in ExceptionHandlers::New(): "
"invalid num_handlers %" Pd "\n",
num_handlers);
@@ -16114,7 +16114,7 @@ ExceptionHandlersPtr ExceptionHandlers::New(const Array& handled_types_data) {
ASSERT(Object::exception_handlers_class() != Class::null());
const intptr_t num_handlers = handled_types_data.Length();
if ((num_handlers < 0) || (num_handlers >= kMaxHandlers)) {
FATAL1(
FATAL(
"Fatal error in ExceptionHandlers::New(): "
"invalid num_handlers %" Pd "\n",
num_handlers);
@@ -17479,8 +17479,7 @@ Code::Comments& Code::Comments::New(intptr_t count) {
Comments* comments;
if (count < 0 || count > (kIntptrMax / kNumberOfEntries)) {
// This should be caught before we reach here.
FATAL1("Fatal error in Code::Comments::New: invalid count %" Pd "\n",
count);
FATAL("Fatal error in Code::Comments::New: invalid count %" Pd "\n", count);
}
if (count == 0) {
comments = new Comments(Object::empty_array());
@@ -17891,8 +17890,8 @@ void Code::set_inlined_id_to_function(const Array& value) const {
CodePtr Code::New(intptr_t pointer_offsets_length) {
if (pointer_offsets_length < 0 || pointer_offsets_length > kMaxElements) {
// This should be caught before we reach here.
FATAL1("Fatal error in Code::New: invalid pointer_offsets_length %" Pd "\n",
pointer_offsets_length);
FATAL("Fatal error in Code::New: invalid pointer_offsets_length %" Pd "\n",
pointer_offsets_length);
}
ASSERT(Object::code_class() != Class::null());
Code& result = Code::Handle();
@@ -18451,8 +18450,8 @@ ContextPtr Context::New(intptr_t num_variables, Heap::Space space) {
if (!IsValidLength(num_variables)) {
// This should be caught before we reach here.
FATAL1("Fatal error in Context::New: invalid num_variables %" Pd "\n",
num_variables);
FATAL("Fatal error in Context::New: invalid num_variables %" Pd "\n",
num_variables);
}
Context& result = Context::Handle();
{
@@ -18521,8 +18520,8 @@ ContextScopePtr ContextScope::New(intptr_t num_variables, bool is_implicit) {
ASSERT(Object::context_scope_class() != Class::null());
if (num_variables < 0 || num_variables > kMaxElements) {
// This should be caught before we reach here.
FATAL1("Fatal error in ContextScope::New: invalid num_variables %" Pd "\n",
num_variables);
FATAL("Fatal error in ContextScope::New: invalid num_variables %" Pd "\n",
num_variables);
}
intptr_t size = ContextScope::InstanceSize(num_variables);
ContextScope& result = ContextScope::Handle();
@@ -24844,7 +24843,7 @@ OneByteStringPtr OneByteString::New(intptr_t len, Heap::Space space) {
Class::null())));
if (len < 0 || len > kMaxElements) {
// This should be caught before we reach here.
FATAL1("Fatal error in OneByteString::New: invalid len %" Pd "\n", len);
FATAL("Fatal error in OneByteString::New: invalid len %" Pd "\n", len);
}
{
ObjectPtr raw = Object::Allocate(
@@ -25053,7 +25052,7 @@ TwoByteStringPtr TwoByteString::New(intptr_t len, Heap::Space space) {
nullptr);
if (len < 0 || len > kMaxElements) {
// This should be caught before we reach here.
FATAL1("Fatal error in TwoByteString::New: invalid len %" Pd "\n", len);
FATAL("Fatal error in TwoByteString::New: invalid len %" Pd "\n", len);
}
String& result = String::Handle();
{
@@ -25212,8 +25211,8 @@ ExternalOneByteStringPtr ExternalOneByteString::New(
->external_one_byte_string_class() != Class::null());
if (len < 0 || len > kMaxElements) {
// This should be caught before we reach here.
FATAL1("Fatal error in ExternalOneByteString::New: invalid len %" Pd "\n",
len);
FATAL("Fatal error in ExternalOneByteString::New: invalid len %" Pd "\n",
len);
}
String& result = String::Handle();
{
@@ -25244,8 +25243,8 @@ ExternalTwoByteStringPtr ExternalTwoByteString::New(
->external_two_byte_string_class() != Class::null());
if (len < 0 || len > kMaxElements) {
// This should be caught before we reach here.
FATAL1("Fatal error in ExternalTwoByteString::New: invalid len %" Pd "\n",
len);
FATAL("Fatal error in ExternalTwoByteString::New: invalid len %" Pd "\n",
len);
}
String& result = String::Handle();
{
@@ -25346,7 +25345,7 @@ ArrayPtr Array::NewUninitialized(intptr_t class_id,
Heap::Space space) {
if (!IsValidLength(len)) {
// This should be caught before we reach here.
FATAL1("Fatal error in Array::New: invalid len %" Pd "\n", len);
FATAL("Fatal error in Array::New: invalid len %" Pd "\n", len);
}
{
ArrayPtr raw = static_cast<ArrayPtr>(
@@ -26193,7 +26192,7 @@ TypedDataPtr TypedData::New(intptr_t class_id,
intptr_t len,
Heap::Space space) {
if (len < 0 || len > TypedData::MaxElements(class_id)) {
FATAL1("Fatal error in TypedData::New: invalid len %" Pd "\n", len);
FATAL("Fatal error in TypedData::New: invalid len %" Pd "\n", len);
}
TypedData& result = TypedData::Handle();
{
@@ -26241,7 +26240,7 @@ ExternalTypedDataPtr ExternalTypedData::New(
Heap::Space space,
bool perform_eager_msan_initialization_check) {
if (len < 0 || len > ExternalTypedData::MaxElements(class_id)) {
FATAL1("Fatal error in ExternalTypedData::New: invalid len %" Pd "\n", len);
FATAL("Fatal error in ExternalTypedData::New: invalid len %" Pd "\n", len);
}
if (perform_eager_msan_initialization_check) {
+4 -4
View File
@@ -150,8 +150,8 @@ class BaseTextBuffer;
object* obj = reinterpret_cast<object*>(VMHandles::AllocateHandle(zone)); \
initializeHandle(obj, ptr); \
if (!obj->Is##object()) { \
FATAL2("Handle check failed: saw %s expected %s", obj->ToCString(), \
#object); \
FATAL("Handle check failed: saw %s expected %s", obj->ToCString(), \
#object); \
} \
return *obj; \
} \
@@ -160,8 +160,8 @@ class BaseTextBuffer;
reinterpret_cast<object*>(VMHandles::AllocateZoneHandle(zone)); \
initializeHandle(obj, ptr); \
if (!obj->Is##object()) { \
FATAL2("Handle check failed: saw %s expected %s", obj->ToCString(), \
#object); \
FATAL("Handle check failed: saw %s expected %s", obj->ToCString(), \
#object); \
} \
return *obj; \
} \
+1 -1
View File
@@ -1626,7 +1626,7 @@ class ObjectCopy : public Base {
}
const Object& obj = Types::HandlifyObject(from);
FATAL1("Unexpected object: %s\n", obj.ToCString());
FATAL("Unexpected object: %s\n", obj.ToCString());
}
void CopyUserdefinedInstance(typename Types::Object from,
+3 -3
View File
@@ -114,7 +114,7 @@ static void FindICData(const Array& ic_data_array,
lo = mid + 1;
}
}
FATAL1("Missing deopt id %" Pd "\n", deopt_id);
FATAL("Missing deopt id %" Pd "\n", deopt_id);
}
void CallSiteResetter::ResetSwitchableCalls(const Code& code) {
@@ -146,8 +146,8 @@ void CallSiteResetter::ResetSwitchableCalls(const Code& code) {
descriptors_ = code.pc_descriptors();
PcDescriptors::Iterator iter(descriptors_, UntaggedPcDescriptors::kIcCall);
while (iter.MoveNext()) {
FATAL1("%s has IC calls but no ic_data_array\n",
function.ToFullyQualifiedCString());
FATAL("%s has IC calls but no ic_data_array\n",
function.ToFullyQualifiedCString());
}
#endif
return;
+2 -2
View File
@@ -282,13 +282,13 @@ void OS::Init() {
// libnotify is initialized early before any fork happens.
struct timeval tv;
if (gettimeofday(&tv, NULL) < 0) {
FATAL1("gettimeofday returned an error (%s)\n", strerror(errno));
FATAL("gettimeofday returned an error (%s)\n", strerror(errno));
return;
}
tm decomposed;
struct tm* error_code = localtime_r(&(tv.tv_sec), &decomposed);
if (error_code == NULL) {
FATAL1("localtime_r returned an error (%s)\n", strerror(errno));
FATAL("localtime_r returned an error (%s)\n", strerror(errno));
return;
}
}
+9 -9
View File
@@ -34,8 +34,8 @@ DEFINE_FLAG(int,
if (result != 0) { \
const int kBufferSize = 1024; \
char error_buf[kBufferSize]; \
FATAL2("pthread error: %d (%s)", result, \
Utils::StrError(result, error_buf, kBufferSize)); \
FATAL("pthread error: %d (%s)", result, \
Utils::StrError(result, error_buf, kBufferSize)); \
}
// Variation of VALIDATE_PTHREAD_RESULT for named objects.
@@ -46,8 +46,8 @@ DEFINE_FLAG(int,
if (result != 0) { \
const int kBufferSize = 1024; \
char error_buf[kBufferSize]; \
FATAL3("[%s] pthread error: %d (%s)", name_, result, \
Utils::StrError(result, error_buf, kBufferSize)); \
FATAL("[%s] pthread error: %d (%s)", name_, result, \
Utils::StrError(result, error_buf, kBufferSize)); \
}
#endif
@@ -114,8 +114,8 @@ static void* ThreadStart(void* data_ptr) {
if (FLAG_worker_thread_priority != kMinInt) {
if (setpriority(PRIO_PROCESS, syscall(__NR_gettid),
FLAG_worker_thread_priority) == -1) {
FATAL2("Setting thread priority to %d failed: errno = %d\n",
FLAG_worker_thread_priority, errno);
FATAL("Setting thread priority to %d failed: errno = %d\n",
FLAG_worker_thread_priority, errno);
}
}
#elif defined(DART_HOST_OS_MACOS)
@@ -124,12 +124,12 @@ static void* ThreadStart(void* data_ptr) {
int policy = SCHED_FIFO;
struct sched_param schedule;
if (pthread_getschedparam(thread, &policy, &schedule) != 0) {
FATAL1("Obtaining sched param failed: errno = %d\n", errno);
FATAL("Obtaining sched param failed: errno = %d\n", errno);
}
schedule.sched_priority = FLAG_worker_thread_priority;
if (pthread_setschedparam(thread, policy, &schedule) != 0) {
FATAL2("Setting thread priority to %d failed: errno = %d\n",
FLAG_worker_thread_priority, errno);
FATAL("Setting thread priority to %d failed: errno = %d\n",
FLAG_worker_thread_priority, errno);
}
}
#endif
+4 -4
View File
@@ -34,7 +34,7 @@ DEFINE_FLAG(int,
const int kBufferSize = 1024; \
char error_message[kBufferSize]; \
Utils::StrError(result, error_message, kBufferSize); \
FATAL2("pthread error: %d (%s)", result, error_message); \
FATAL("pthread error: %d (%s)", result, error_message); \
}
#if defined(PRODUCT)
@@ -45,7 +45,7 @@ DEFINE_FLAG(int,
const int kBufferSize = 1024; \
char error_message[kBufferSize]; \
Utils::StrError(result, error_message, kBufferSize); \
FATAL3("[%s] pthread error: %d (%s)", name_, result, error_message); \
FATAL("[%s] pthread error: %d (%s)", name_, result, error_message); \
}
#endif
@@ -126,8 +126,8 @@ static void* ThreadStart(void* data_ptr) {
if (FLAG_worker_thread_priority != kMinInt) {
if (setpriority(PRIO_PROCESS, gettid(), FLAG_worker_thread_priority) ==
-1) {
FATAL2("Setting thread priority to %d failed: errno = %d\n",
FLAG_worker_thread_priority, errno);
FATAL("Setting thread priority to %d failed: errno = %d\n",
FLAG_worker_thread_priority, errno);
}
}
+2 -2
View File
@@ -24,7 +24,7 @@ namespace dart {
#define VALIDATE_PTHREAD_RESULT(result) \
if (result != 0) { \
FATAL1("pthread error: %d", result); \
FATAL("pthread error: %d", result); \
}
#if defined(PRODUCT)
@@ -32,7 +32,7 @@ namespace dart {
#else
#define VALIDATE_PTHREAD_RESULT_NAMED(result) \
if (result != 0) { \
FATAL2("[%s] pthread error: %d", name_, result); \
FATAL("[%s] pthread error: %d", name_, result); \
}
#endif
+6 -6
View File
@@ -33,8 +33,8 @@ DEFINE_FLAG(int,
if (result != 0) { \
const int kBufferSize = 1024; \
char error_buf[kBufferSize]; \
FATAL2("pthread error: %d (%s)", result, \
Utils::StrError(result, error_buf, kBufferSize)); \
FATAL("pthread error: %d (%s)", result, \
Utils::StrError(result, error_buf, kBufferSize)); \
}
// Variation of VALIDATE_PTHREAD_RESULT for named objects.
@@ -45,8 +45,8 @@ DEFINE_FLAG(int,
if (result != 0) { \
const int kBufferSize = 1024; \
char error_buf[kBufferSize]; \
FATAL3("[%s] pthread error: %d (%s)", name_, result, \
Utils::StrError(result, error_buf, kBufferSize)); \
FATAL("[%s] pthread error: %d (%s)", name_, result, \
Utils::StrError(result, error_buf, kBufferSize)); \
}
#endif
@@ -126,8 +126,8 @@ static void* ThreadStart(void* data_ptr) {
if (FLAG_worker_thread_priority != kMinInt) {
if (setpriority(PRIO_PROCESS, syscall(__NR_gettid),
FLAG_worker_thread_priority) == -1) {
FATAL2("Setting thread priority to %d failed: errno = %d\n",
FLAG_worker_thread_priority, errno);
FATAL("Setting thread priority to %d failed: errno = %d\n",
FLAG_worker_thread_priority, errno);
}
}
+5 -5
View File
@@ -39,7 +39,7 @@ DEFINE_FLAG(int,
const int kBufferSize = 1024; \
char error_message[kBufferSize]; \
Utils::StrError(result, error_message, kBufferSize); \
FATAL2("pthread error: %d (%s)", result, error_message); \
FATAL("pthread error: %d (%s)", result, error_message); \
}
#if defined(PRODUCT)
@@ -50,7 +50,7 @@ DEFINE_FLAG(int,
const int kBufferSize = 1024; \
char error_message[kBufferSize]; \
Utils::StrError(result, error_message, kBufferSize); \
FATAL3("[%s] pthread error: %d (%s)", name_, result, error_message); \
FATAL("[%s] pthread error: %d (%s)", name_, result, error_message); \
}
#endif
@@ -104,12 +104,12 @@ static void* ThreadStart(void* data_ptr) {
int policy = SCHED_FIFO;
struct sched_param schedule;
if (pthread_getschedparam(thread, &policy, &schedule) != 0) {
FATAL1("Obtaining sched param failed: errno = %d\n", errno);
FATAL("Obtaining sched param failed: errno = %d\n", errno);
}
schedule.sched_priority = FLAG_worker_thread_priority;
if (pthread_setschedparam(thread, policy, &schedule) != 0) {
FATAL2("Setting thread priority to %d failed: errno = %d\n",
FLAG_worker_thread_priority, errno);
FATAL("Setting thread priority to %d failed: errno = %d\n",
FLAG_worker_thread_priority, errno);
}
}
+5 -5
View File
@@ -54,8 +54,8 @@ static unsigned int __stdcall ThreadEntry(void* data_ptr) {
if (FLAG_worker_thread_priority != kMinInt) {
if (SetThreadPriority(GetCurrentThread(), FLAG_worker_thread_priority) ==
0) {
FATAL2("Setting thread priority to %d failed: GetLastError() = %d\n",
FLAG_worker_thread_priority, GetLastError());
FATAL("Setting thread priority to %d failed: GetLastError() = %d\n",
FLAG_worker_thread_priority, GetLastError());
}
}
@@ -105,7 +105,7 @@ const ThreadJoinId OSThread::kInvalidThreadJoinId = NULL;
ThreadLocalKey OSThread::CreateThreadLocal(ThreadDestructor destructor) {
ThreadLocalKey key = TlsAlloc();
if (key == kUnsetThreadLocalKey) {
FATAL1("TlsAlloc failed %d", GetLastError());
FATAL("TlsAlloc failed %d", GetLastError());
}
ThreadLocalData::AddThreadLocal(key, destructor);
return key;
@@ -115,7 +115,7 @@ void OSThread::DeleteThreadLocal(ThreadLocalKey key) {
ASSERT(key != kUnsetThreadLocalKey);
BOOL result = TlsFree(key);
if (!result) {
FATAL1("TlsFree failed %d", GetLastError());
FATAL("TlsFree failed %d", GetLastError());
}
ThreadLocalData::RemoveThreadLocal(key);
}
@@ -223,7 +223,7 @@ void OSThread::SetThreadLocal(ThreadLocalKey key, uword value) {
ASSERT(key != kUnsetThreadLocalKey);
BOOL result = TlsSetValue(key, reinterpret_cast<void*>(value));
if (!result) {
FATAL1("TlsSetValue failed %d", GetLastError());
FATAL("TlsSetValue failed %d", GetLastError());
}
}
+1 -1
View File
@@ -121,7 +121,7 @@ class ProgramWalker : public ValueObject {
} else if (worklist_entry_.IsCode()) {
VisitCode(Code::Cast(worklist_entry_));
} else {
FATAL1("Got unexpected object %s", worklist_entry_.ToCString());
FATAL("Got unexpected object %s", worklist_entry_.ToCString());
}
}
}
+14 -14
View File
@@ -49,28 +49,28 @@ void UntaggedObject::Validate(IsolateGroup* isolate_group) const {
uword tags = tags_;
if (IsNewObject()) {
if (!NewBit::decode(tags)) {
FATAL1("New object missing kNewBit: %" Px "\n", tags);
FATAL("New object missing kNewBit: %" Px "\n", tags);
}
if (OldBit::decode(tags)) {
FATAL1("New object has kOldBit: %" Px "\n", tags);
FATAL("New object has kOldBit: %" Px "\n", tags);
}
if (OldAndNotMarkedBit::decode(tags)) {
FATAL1("New object has kOldAndNotMarkedBit: %" Px "\n", tags);
FATAL("New object has kOldAndNotMarkedBit: %" Px "\n", tags);
}
if (OldAndNotRememberedBit::decode(tags)) {
FATAL1("New object has kOldAndNotRememberedBit: %" Px "\n", tags);
FATAL("New object has kOldAndNotRememberedBit: %" Px "\n", tags);
}
} else {
if (NewBit::decode(tags)) {
FATAL1("Old object has kNewBit: %" Px "\n", tags);
FATAL("Old object has kNewBit: %" Px "\n", tags);
}
if (!OldBit::decode(tags)) {
FATAL1("Old object missing kOldBit: %" Px "\n", tags);
FATAL("Old object missing kOldBit: %" Px "\n", tags);
}
}
const intptr_t class_id = ClassIdTag::decode(tags);
if (!isolate_group->class_table()->IsValidIndex(class_id)) {
FATAL1("Invalid class id encountered %" Pd "\n", class_id);
FATAL("Invalid class id encountered %" Pd "\n", class_id);
}
if (class_id == kNullCid &&
isolate_group->class_table()->HasValidClassAt(class_id)) {
@@ -80,7 +80,7 @@ void UntaggedObject::Validate(IsolateGroup* isolate_group) const {
intptr_t size_from_tags = SizeTag::decode(tags);
intptr_t size_from_class = HeapSizeFromClass(tags);
if ((size_from_tags != 0) && (size_from_tags != size_from_class)) {
FATAL3(
FATAL(
"Inconsistent size encountered "
"cid: %" Pd ", size_from_tags: %" Pd ", size_from_class: %" Pd "\n",
class_id, size_from_tags, size_from_class);
@@ -257,8 +257,8 @@ intptr_t UntaggedObject::HeapSizeFromClass(uword tags) const {
auto class_table = isolate_group->heap_walk_class_table();
if (!class_table->IsValidIndex(class_id) ||
!class_table->HasValidClassAt(class_id)) {
FATAL3("Invalid cid: %" Pd ", obj: %p, tags: %x. Corrupt heap?",
class_id, this, static_cast<uint32_t>(tags));
FATAL("Invalid cid: %" Pd ", obj: %p, tags: %x. Corrupt heap?",
class_id, this, static_cast<uint32_t>(tags));
}
ASSERT(class_table->SizeAt(class_id) > 0);
#endif // DEBUG
@@ -281,8 +281,8 @@ intptr_t UntaggedObject::HeapSizeFromClass(uword tags) const {
} while ((instance_size > tags_size) && (--retries_remaining > 0));
}
if ((instance_size != tags_size) && (tags_size != 0)) {
FATAL3("Size mismatch: %" Pd " from class vs %" Pd " from tags %" Px "\n",
instance_size, tags_size, tags);
FATAL("Size mismatch: %" Pd " from class vs %" Pd " from tags %" Px "\n",
instance_size, tags_size, tags);
}
#endif // DEBUG
return instance_size;
@@ -359,8 +359,8 @@ intptr_t UntaggedObject::VisitPointersPredefined(ObjectPointerVisitor* visitor,
size = HeapSize();
break;
default:
FATAL3("Invalid cid: %" Pd ", obj: %p, tags: %x. Corrupt heap?", class_id,
this, static_cast<uint32_t>(tags_));
FATAL("Invalid cid: %" Pd ", obj: %p, tags: %x. Corrupt heap?", class_id,
this, static_cast<uint32_t>(tags_));
break;
}
+1 -1
View File
@@ -2886,7 +2886,7 @@ static void HandleStackOverflowTestCases(Thread* thread) {
const bool success =
isolate_group->ReloadSources(&js, /*force_reload=*/true, script_uri);
if (!success) {
FATAL1("*** Isolate reload failed:\n%s\n", js.ToCString());
FATAL("*** Isolate reload failed:\n%s\n", js.ToCString());
}
}
if (do_stacktrace) {
+1 -1
View File
@@ -296,7 +296,7 @@ void ThreadPool::Worker::StartThread() {
int result = OSThread::Start("DartWorker", &Worker::Main,
reinterpret_cast<uword>(this));
if (result != 0) {
FATAL1("Could not start worker thread: result = %d.", result);
FATAL("Could not start worker thread: result = %d.", result);
}
}
+1 -1
View File
@@ -118,7 +118,7 @@
RELEASE_ASSERT(far_branch_level < 2); \
far_branch_level++; \
} else { \
FATAL1("Unexpected error: %s\n", error.ToErrorCString()); \
FATAL("Unexpected error: %s\n", error.ToErrorCString()); \
} \
} \
} \
+3 -3
View File
@@ -117,7 +117,7 @@ static void Unmap(zx_handle_t vmar, uword start, uword end) {
zx_status_t status = zx_vmar_unmap(vmar, start, size);
if (status != ZX_OK) {
FATAL1("zx_vmar_unmap failed: %s\n", zx_status_get_string(status));
FATAL("zx_vmar_unmap failed: %s\n", zx_status_get_string(status));
}
}
@@ -294,8 +294,8 @@ void VirtualMemory::Protect(void* address, intptr_t size, Protection mode) {
LOG_INFO("zx_vmar_protect(%u, 0x%lx, 0x%lx)\n", prot, page_address,
end_address - page_address);
if (status != ZX_OK) {
FATAL3("zx_vmar_protect(0x%lx, 0x%lx) failed: %s\n", page_address,
end_address - page_address, zx_status_get_string(status));
FATAL("zx_vmar_protect(0x%lx, 0x%lx) failed: %s\n", page_address,
end_address - page_address, zx_status_get_string(status));
}
}
+3 -3
View File
@@ -189,7 +189,7 @@ VirtualMemory::~VirtualMemory() {
return;
}
if (VirtualFree(reserved_.pointer(), 0, MEM_RELEASE) == 0) {
FATAL1("VirtualFree failed: Error code %d\n", GetLastError());
FATAL("VirtualFree failed: Error code %d\n", GetLastError());
}
}
@@ -201,7 +201,7 @@ bool VirtualMemory::FreeSubSegment(void* address, intptr_t size) {
}
#endif // defined(DART_COMPRESSED_POINTERS)
if (VirtualFree(address, size, MEM_DECOMMIT) == 0) {
FATAL1("VirtualFree failed: Error code %d\n", GetLastError());
FATAL("VirtualFree failed: Error code %d\n", GetLastError());
}
return true;
}
@@ -237,7 +237,7 @@ void VirtualMemory::Protect(void* address, intptr_t size, Protection mode) {
DWORD old_prot = 0;
if (VirtualProtect(reinterpret_cast<void*>(page_address),
end_address - page_address, prot, &old_prot) == 0) {
FATAL1("VirtualProtect failed %d\n", GetLastError());
FATAL("VirtualProtect failed %d\n", GetLastError());
}
}
+3 -3
View File
@@ -260,7 +260,7 @@ inline uword Zone::AllocUnsafe(intptr_t size) {
ASSERT(size >= 0);
// Round up the requested size to fit the alignment.
if (size > (kIntptrMax - kAlignment)) {
FATAL1("Zone::Alloc: 'size' is too large: size=%" Pd "", size);
FATAL("Zone::Alloc: 'size' is too large: size=%" Pd "", size);
}
size = Utils::RoundUp(size, kAlignment);
@@ -284,8 +284,8 @@ template <class ElementType>
inline void Zone::CheckLength(intptr_t len) {
const intptr_t kElementSize = sizeof(ElementType);
if (len > (kIntptrMax / kElementSize)) {
FATAL2("Zone::Alloc: 'len' is too large: len=%" Pd ", kElementSize=%" Pd,
len, kElementSize);
FATAL("Zone::Alloc: 'len' is too large: len=%" Pd ", kElementSize=%" Pd,
len, kElementSize);
}
}