static void handleFatalErrorInV8()
{
// FIXME: We temporarily deal with V8 internal error situations
// such as out-of-memory by crashing the renderer.
CRASH();
}
static void reportFatalErrorInV8(const char* location, const char* message)
{
// V8 is shutdown, we cannot use V8 api.
// The only thing we can do is to disable JavaScript.
// FIXME: clean up V8Proxy and disable JavaScript.
int memoryUsageMB = -1;
#if PLATFORM(CHROMIUM)
memoryUsageMB = MemoryUsageSupport::actualMemoryUsageMB();
#endif
printf("V8 error: %s (%s). Current memory usage: %d MB\n", message, location, memoryUsageMB);
handleFatalErrorInV8();
}