V8 API Reference Guide generated from the header files
|
#include <v8.h>
Public Types | |
enum | FunctionCodeHandling { kClear, kKeep } |
Public Member Functions | |
SnapshotCreator (Isolate *isolate, const intptr_t *external_references=nullptr, StartupData *existing_blob=nullptr) | |
SnapshotCreator (const intptr_t *external_references=nullptr, StartupData *existing_blob=nullptr) | |
Isolate * | GetIsolate () |
void | SetDefaultContext (Local< Context > context, SerializeInternalFieldsCallback callback=SerializeInternalFieldsCallback()) |
size_t | AddContext (Local< Context > context, SerializeInternalFieldsCallback callback=SerializeInternalFieldsCallback()) |
size_t | AddTemplate (Local< Template > template_obj) |
template<class T > | |
V8_INLINE size_t | AddData (Local< Context > context, Local< T > object) |
template<class T > | |
V8_INLINE size_t | AddData (Local< T > object) |
StartupData | CreateBlob (FunctionCodeHandling function_code_handling) |
SnapshotCreator (const SnapshotCreator &)=delete | |
void | operator= (const SnapshotCreator &)=delete |
template<class T > | |
size_t | AddData (Local< Context > context, Local< T > object) |
template<class T > | |
size_t | AddData (Local< T > object) |
Helper class to create a snapshot data blob.
v8::SnapshotCreator::SnapshotCreator | ( | Isolate * | isolate, |
const intptr_t * | external_references = nullptr , |
||
StartupData * | existing_blob = nullptr |
||
) |
Initialize and enter an isolate, and set it up for serialization. The isolate is either created from scratch or from an existing snapshot. The caller keeps ownership of the argument snapshot.
existing_blob | existing snapshot from which to create this one. |
external_references | a null-terminated array of external references that must be equivalent to CreateParams::external_references. |
v8::SnapshotCreator::SnapshotCreator | ( | const intptr_t * | external_references = nullptr , |
StartupData * | existing_blob = nullptr |
||
) |
Create and enter an isolate, and set it up for serialization. The isolate is either created from scratch or from an existing snapshot. The caller keeps ownership of the argument snapshot.
existing_blob | existing snapshot from which to create this one. |
external_references | a null-terminated array of external references that must be equivalent to CreateParams::external_references. |
size_t v8::SnapshotCreator::AddContext | ( | Local< Context > | context, |
SerializeInternalFieldsCallback | callback = SerializeInternalFieldsCallback() |
||
) |
Add additional context to be included in the snapshot blob. The snapshot will include the global proxy.
callback | optional callback to serialize internal fields. |
V8_INLINE size_t v8::SnapshotCreator::AddData | ( | Local< Context > | context, |
Local< T > | object | ||
) |
Attach arbitrary V8::Data to the context snapshot, which can be retrieved via Context::GetDataFromSnapshot after deserialization. This data does not survive when a new snapshot is created from an existing snapshot.
V8_INLINE size_t v8::SnapshotCreator::AddData | ( | Local< T > | object | ) |
Attach arbitrary V8::Data to the isolate snapshot, which can be retrieved via Isolate::GetDataFromSnapshot after deserialization. This data does not survive when a new snapshot is created from an existing snapshot.
Add a template to be included in the snapshot blob.
StartupData v8::SnapshotCreator::CreateBlob | ( | FunctionCodeHandling | function_code_handling | ) |
Created a snapshot data blob. This must not be called from within a handle scope.
function_code_handling | whether to include compiled function code in the snapshot. |
Isolate* v8::SnapshotCreator::GetIsolate | ( | ) |
void v8::SnapshotCreator::SetDefaultContext | ( | Local< Context > | context, |
SerializeInternalFieldsCallback | callback = SerializeInternalFieldsCallback() |
||
) |
Set the default context to be included in the snapshot blob. The snapshot will not contain the global proxy, and we expect one or a global object template to create one, to be provided upon deserialization.
callback | optional callback to serialize internal fields. |