v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8.h
Go to the documentation of this file.
1// Copyright 2011 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_INIT_V8_H_
6#define V8_INIT_V8_H_
7
9
10namespace v8 {
11
12struct OOMDetails;
13class Platform;
14class StartupData;
15
16namespace internal {
17
18class Isolate;
19
20class V8 : public AllStatic {
21 public:
22 // Global actions.
23 static void Initialize();
24 static void Dispose();
25
26 // Report process out of memory. Implementation found in api.cc.
27 // This function will not return, but will terminate the execution.
28 // IMPORTANT: Update the Google-internal crash processer if this signature
29 // changes to be able to extract detailed v8::internal::HeapStats on OOM.
31 Isolate* isolate, const char* location,
32 const OOMDetails& details = kNoOOMDetails);
33
34 // Constants to be used for V8::FatalProcessOutOfMemory. They avoid having
35 // to include v8-callbacks.h in all callers.
38
39 // Another variant of FatalProcessOutOfMemory, which constructs the OOMDetails
40 // struct internally from another "detail" c-string.
41 // This can be removed once we support designated initializers (C++20).
43 Isolate* isolate, const char* location, const char* detail);
44
45 static void InitializePlatform(v8::Platform* platform);
47 v8::Platform* platform);
48 static void DisposePlatform();
50 // Replaces the current platform with the given platform.
51 // Should be used only for testing.
53
54 static void SetSnapshotBlob(StartupData* snapshot_blob);
55
56 private:
58};
59
60} // namespace internal
61} // namespace v8
62
63#endif // V8_INIT_V8_H_
static V8_EXPORT_PRIVATE void SetPlatformForTesting(v8::Platform *platform)
Definition v8.cc:289
static v8::Platform * platform_
Definition v8.h:57
static V8_EXPORT_PRIVATE const OOMDetails kNoOOMDetails
Definition v8.h:36
static void SetSnapshotBlob(StartupData *snapshot_blob)
Definition v8.cc:294
static V8_EXPORT_PRIVATE void InitializePlatformForTesting(v8::Platform *platform)
Definition v8.cc:126
static V8_EXPORT_PRIVATE v8::Platform * GetCurrentPlatform()
Definition v8.cc:282
static void InitializePlatform(v8::Platform *platform)
Definition v8.cc:103
static V8_EXPORT_PRIVATE void FatalProcessOutOfMemory(Isolate *isolate, const char *location, const char *detail)
static void DisposePlatform()
Definition v8.cc:257
static V8_EXPORT_PRIVATE void FatalProcessOutOfMemory(Isolate *isolate, const char *location, const OOMDetails &details=kNoOOMDetails)
static V8_EXPORT_PRIVATE const OOMDetails kHeapOOM
Definition v8.h:37
static void Initialize()
Definition v8.cc:135
static void Dispose()
Definition v8.cc:240
#define V8_EXPORT_PRIVATE
Definition macros.h:460