1ef7487b65
This patch replaces the unused 'take_snapshot' parameter on FatalProcessOutOfMemory() with a 'is_heap_oom' parameter. The parameter is set to true on error paths where the JS heap is out of memory, as distinct from a malloc() failure i.e. process out of memory. The message output to stderr or passed to embedding applications via FatalErrorCallback is 'Javascript heap out of memory' rather than 'process out of memory'. BUG= R=jochen@chromium.org, verwaest@chromium.org, michael_dawson@ca.ibm.com Review URL: https://codereview.chromium.org/1873443002 Cr-Commit-Position: refs/heads/master@{#35431}
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
// Copyright 2011 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.
|
|
|
|
#ifndef V8_V8_H_
|
|
#define V8_V8_H_
|
|
|
|
#include "include/v8.h"
|
|
#include "src/allocation.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
class V8 : public AllStatic {
|
|
public:
|
|
// Global actions.
|
|
|
|
static bool Initialize();
|
|
static void TearDown();
|
|
|
|
// Report process out of memory. Implementation found in api.cc.
|
|
// This function will not return, but will terminate the execution.
|
|
static void FatalProcessOutOfMemory(const char* location,
|
|
bool is_heap_oom = false);
|
|
|
|
static void InitializePlatform(v8::Platform* platform);
|
|
static void ShutdownPlatform();
|
|
static v8::Platform* GetCurrentPlatform();
|
|
// Replaces the current platform with the given platform.
|
|
// Should be used only for testing.
|
|
static void SetPlatformForTesting(v8::Platform* platform);
|
|
|
|
static void SetNativesBlob(StartupData* natives_blob);
|
|
static void SetSnapshotBlob(StartupData* snapshot_blob);
|
|
|
|
private:
|
|
static void InitializeOncePerProcessImpl();
|
|
static void InitializeOncePerProcess();
|
|
|
|
// v8::Platform to use.
|
|
static v8::Platform* platform_;
|
|
};
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|
|
|
|
#endif // V8_V8_H_
|