v8  5.5.372(node7.10.1)
V8 is Google's open source JavaScript engine
SnapshotCreator Class Reference

#include <v8.h>

Public Types

enum  FunctionCodeHandling { kClear, kKeep }

Public Member Functions

 SnapshotCreator (intptr_t *external_references=nullptr, StartupData *existing_blob=nullptr)
 ~SnapshotCreator ()
IsolateGetIsolate ()
size_t AddContext (Local< Context > context)
size_t AddTemplate (Local< Template > template_obj)
StartupData CreateBlob (FunctionCodeHandling function_code_handling)
 SnapshotCreator (const SnapshotCreator &)=delete
void operator= (const SnapshotCreator &)=delete

Detailed Description

Helper class to create a snapshot data blob.

Definition at line 7531 of file v8.h.

Member Enumeration Documentation

enum FunctionCodeHandling

Definition at line 7533 of file v8.h.

Constructor & Destructor Documentation

SnapshotCreator ( 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_blobexisting snapshot from which to create this one.
external_referencesa null-terminated array of external references that must be equivalent to CreateParams::external_references.
SnapshotCreator ( const SnapshotCreator )

Member Function Documentation

size_t AddContext ( Local< Context context)

Add a context to be included in the snapshot blob.

the index of the context in the snapshot blob.
size_t AddTemplate ( Local< Template template_obj)

Add a template to be included in the snapshot blob.

the index of the template in the snapshot blob.
StartupData CreateBlob ( FunctionCodeHandling  function_code_handling)

Created a snapshot data blob. This must not be called from within a handle scope.

function_code_handlingwhether to include compiled function code in the snapshot.
{ nullptr, 0 } on failure, and a startup snapshot on success. The caller acquires ownership of the data array in the return value.
Isolate* GetIsolate ( )
the isolate prepared by the snapshot creator.
void operator= ( const SnapshotCreator )

The documentation for this class was generated from the following file: