5#ifndef INCLUDE_V8_INITIALIZATION_H_
6#define INCLUDE_V8_INITIALIZATION_H_
21
22
27template <
class K,
class V,
class T>
31
32
33
34using EntropySource =
bool (*)(
unsigned char* buffer, size_t length);
37
38
39
40
41
42
43
44
45
46
47
48
49using ReturnAddressLocationResolver =
50 uintptr_t (*)(uintptr_t return_addr_location);
52using DcheckErrorCallback =
void (*)(
const char* file,
int line,
55using V8FatalErrorCallback =
void (*)(
const char* file,
int line,
59
60
64
65
66
67
68
69
70
71
72
73
74
75
76
77
84
85
86
90
91
96
97
105
106
107
109#ifdef V8_TARGET_OS_ANDROID
110 const bool kV8TargetOsIsAndroid =
true;
112 const bool kV8TargetOsIsAndroid =
false;
115#ifdef V8_ENABLE_CHECKS
116 const bool kV8EnableChecks =
true;
118 const bool kV8EnableChecks =
false;
121 const int kBuildConfiguration =
125 (kV8TargetOsIsAndroid ? kTargetOsIsAndroid : 0) |
126 (kV8EnableChecks ? kEnableChecks : 0);
127 return Initialize(kBuildConfiguration);
131
132
133
137
138
139
141 ReturnAddressLocationResolver return_address_resolver);
144
145
146
147
148
149
150
151
155
156
157
158
159
160
164
165
166
167
168
169
170
171
172
173
174
176 const char* icu_data_file =
nullptr);
179
180
181
182
183
184
185
186
187
188
189
190
191
192
197
198
199
203
204
205
208#if defined(V8_ENABLE_SANDBOX)
210
211
212
213
214
215
216
217
218
222
223
224
225
226
227
228
229
230
231
232
236
237
238
239
240
244
245
246
247
248
249
250
251
252
257
258
259
260
261
264#if defined(V8_OS_WIN)
266
267
268
269
270
271
272
273
279
280
281
282
286
287
293 enum BuildConfigurationFeatures {
294 kPointerCompression = 1 << 0,
297 kTargetOsIsAndroid = 1 << 3,
298 kEnableChecks = 1 << 4,
302
303
304
305 static bool Initialize(
int build_config);
308 template <
class K,
class V,
class T>
friend class PersistentValueMapBase
static void InitializeExternalStartupDataFromFile(const char *snapshot_blob)
static void SetReturnAddressLocationResolver(ReturnAddressLocationResolver return_address_resolver)
static const char * GetVersion()
static void InitializeExternalStartupData(const char *directory_path)
static V8_INLINE bool Initialize()
static void SetFatalMemoryErrorCallback(OOMErrorCallback callback)
static void SetDcheckErrorHandler(DcheckErrorCallback that)
static void SetFlagsFromString(const char *str, size_t length)
static void GetSharedMemoryStatistics(SharedMemoryStatistics *statistics)
static bool InitializeICU(const char *icu_data_file=nullptr)
static bool InitializeICUDefaultLocation(const char *exec_path, const char *icu_data_file=nullptr)
static void SetFlagsFromCommandLine(int *argc, char **argv, bool remove_flags)
static void SetFlagsFromString(const char *str)
static void SetEntropySource(EntropySource source)
static void InitializePlatform(Platform *platform)
static bool EnableWebAssemblyTrapHandler(bool use_v8_signal_handler)
static void DisposePlatform()
static void SetSnapshotDataBlob(StartupData *startup_blob)
static void SetFatalErrorHandler(V8FatalErrorCallback that)
constexpr bool PointerCompressionIsEnabled()
constexpr bool SmiValuesAre31Bits()
constexpr bool SandboxIsEnabled()