| Index: include/v8.h
|
| diff --git a/include/v8.h b/include/v8.h
|
| index 12a0b2894dd81d6145680dce990ec48821d23792..514568ed7b4d014911f4694e54419516037fc5b9 100644
|
| --- a/include/v8.h
|
| +++ b/include/v8.h
|
| @@ -1009,15 +1009,32 @@ class V8_EXPORT Script {
|
| * \param source Script source code.
|
| * \param origin Script origin, owned by caller, no references are kept
|
| * when New() returns
|
| - * \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile()
|
| - * using pre_data speeds compilation if it's done multiple times.
|
| - * Owned by caller, no references are kept when New() returns.
|
| + * \param cached_data Cached ScriptData, as obtained from a previous
|
| + * compilation. Using cached_data speeds compilation if it's done multiple
|
| + * times. Owned by caller, no references are kept when New() returns.
|
| * \return Compiled script object (context independent; when run it
|
| * will use the currently entered context).
|
| */
|
| static Local<Script> New(Handle<String> source,
|
| ScriptOrigin* origin = NULL,
|
| - ScriptData* pre_data = NULL);
|
| + ScriptData* cached_data = NULL);
|
| +
|
| + /**
|
| + * Compiles the specified script (context-independent).
|
| + *
|
| + * \param source Script source code.
|
| + * \param origin Script origin, owned by caller, no references are kept
|
| + * when this function returns
|
| + * \param cached_data Cached ScriptData, as obtained from a previous run, or a
|
| + * pointer to where we should store it, or NULL if we shouldn't store it
|
| + * anywhere. Using cached_data speeds compilation if it's done multiple
|
| + * times. Owned by caller (ownership of the generated data will also be
|
| + * passed to the caller), no references are kept when this function returns.
|
| + * \return Compiled script object (context independent; when run it
|
| + * will use the currently entered context).
|
| + */
|
| + static Local<Script> NewAndGenerateScriptDataIfNeeded(
|
| + Handle<String> source, ScriptOrigin* origin, ScriptData** cached_data);
|
|
|
| /**
|
| * Compiles the specified script using the specified file name
|
| @@ -1038,8 +1055,8 @@ class V8_EXPORT Script {
|
| * \param source Script source code.
|
| * \param origin Script origin, owned by caller, no references are kept
|
| * when Compile() returns
|
| - * \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile()
|
| - * using pre_data speeds compilation if it's done multiple times.
|
| + * \param cached_data Cached ScriptData, as obtained from a previous run.
|
| + * Using cached_data speeds compilation if it's done multiple times.
|
| * Owned by caller, no references are kept when Compile() returns.
|
| * \return Compiled script object, bound to the context that was active
|
| * when this function was called. When run it will always use this
|
| @@ -1047,9 +1064,31 @@ class V8_EXPORT Script {
|
| */
|
| static Local<Script> Compile(Handle<String> source,
|
| ScriptOrigin* origin = NULL,
|
| - ScriptData* pre_data = NULL);
|
| + ScriptData* cached_data = NULL);
|
|
|
| /**
|
| + * Compiles the specified script (bound to current context).
|
| + *
|
| + * \param source Script source code.
|
| + * \param origin Script origin, owned by caller, no references are kept
|
| + * when this function returns
|
| + * \param cached_data Cached ScriptData, as obtained from a previous run, or a
|
| + * pointer to where to store we don't have it yet, or NULL if we should not
|
| + * generate it. Using cached_data speeds compilation if it's done multiple
|
| + * times. Owned by caller (ownership of the generated data will also be
|
| + * passed to the caller), no references are kept when this function returns.
|
| + * \param extra_data Arbitrary data associated with script. Using
|
| + * this has same effect as calling SetData(), but makes data available
|
| + * earlier (i.e. to compile event handlers).
|
| + * \return Compiled script object, bound to the context that was active
|
| + * when this function was called. When run it will always use this
|
| + * context.
|
| + */
|
| + static Local<Script> CompileAndGenerateScriptDataIfNeeded(
|
| + Handle<String> source, ScriptOrigin* origin = NULL,
|
| + ScriptData** cached_data = NULL);
|
| +
|
| + /**
|
| * Compiles the specified script using the specified file name
|
| * object (typically a string) as the script's origin.
|
| *
|
|
|