From: marja@chromium.org Date: Fri, 14 Mar 2014 10:20:33 +0000 (+0000) Subject: New Compilation API, part 1, try 2 X-Git-Tag: upstream/4.7.83~10274 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6923d84785569a944ab3cf32daf42a05a2588ca4;p=platform%2Fupstream%2Fv8.git New Compilation API, part 1, try 2 - Distinguish between context bound scripts (Script) and context unbound scripts (UnboundScript). - Add ScriptCompiler (which will later contain functions for async compilation). This is a breaking change, in particular, Script::New no longer exists (it is replaced by ScriptCompiler::CompileUnbound). Script::Compile remains as a backwards-compatible shorthand for ScriptCompiler::Compile. Passing CompilerOptions with produce_data_to_cache = true doesn't do anything yet; the only way to generate the data to cache is the old preparsing API. (To be fixed in the next version.) This is a fixed version of https://codereview.chromium.org/186723005/ BUG= R=dcarney@chromium.org Review URL: https://codereview.chromium.org/199063003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19925 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/include/v8.h b/include/v8.h index 9bda3dc9f..fdaa2a25b 100644 --- a/include/v8.h +++ b/include/v8.h @@ -108,6 +108,7 @@ class ObjectTemplate; class Platform; class Primitive; class RawOperationDescriptor; +class Script; class Signature; class StackFrame; class StackTrace; @@ -1146,95 +1147,156 @@ class ScriptOrigin { /** - * A compiled JavaScript script. + * A compiled JavaScript script, not yet tied to a Context. */ -class V8_EXPORT Script { +class V8_EXPORT UnboundScript { public: /** - * Compiles the specified script (context-independent). - * - * \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. - * \return Compiled script object (context independent; when run it - * will use the currently entered context). + * Binds the script to the currently entered context. */ - static Local