mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 679939 part 3. Add a CompileOptions flag for indicating that the script should be compiled runOnce. r=luke
This commit is contained in:
parent
96ca1664a7
commit
458bf125e5
@ -537,6 +537,8 @@ CompileFunctionBody(JSContext* cx, MutableHandleFunction fun, const ReadOnlyComp
|
||||
const AutoNameVector& formals, SourceBufferHolder& srcBuf,
|
||||
HandleObject enclosingStaticScope, GeneratorKind generatorKind)
|
||||
{
|
||||
MOZ_ASSERT(!options.isRunOnce);
|
||||
|
||||
js::TraceLoggerThread* logger = js::TraceLoggerForMainThread(cx->runtime());
|
||||
js::TraceLoggerEvent event(logger, TraceLogger_AnnotateScripts, options);
|
||||
js::AutoTraceLog scriptLogger(logger, event);
|
||||
|
@ -3403,6 +3403,7 @@ class JS_FRIEND_API(ReadOnlyCompileOptions)
|
||||
column(0),
|
||||
compileAndGo(false),
|
||||
hasPollutedGlobalScope(false),
|
||||
isRunOnce(false),
|
||||
forEval(false),
|
||||
noScriptRval(false),
|
||||
selfHostingMode(false),
|
||||
@ -3443,6 +3444,8 @@ class JS_FRIEND_API(ReadOnlyCompileOptions)
|
||||
unsigned column;
|
||||
bool compileAndGo;
|
||||
bool hasPollutedGlobalScope;
|
||||
// isRunOnce only applies to non-function scripts.
|
||||
bool isRunOnce;
|
||||
bool forEval;
|
||||
bool noScriptRval;
|
||||
bool selfHostingMode;
|
||||
@ -3535,6 +3538,7 @@ class JS_FRIEND_API(OwningCompileOptions) : public ReadOnlyCompileOptions
|
||||
OwningCompileOptions& setColumn(unsigned c) { column = c; return *this; }
|
||||
OwningCompileOptions& setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }
|
||||
OwningCompileOptions& setHasPollutedScope(bool p) { hasPollutedGlobalScope = p; return *this; }
|
||||
OwningCompileOptions& setIsRunOnce(bool once) { isRunOnce = once; return *this; }
|
||||
OwningCompileOptions& setForEval(bool eval) { forEval = eval; return *this; }
|
||||
OwningCompileOptions& setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }
|
||||
OwningCompileOptions& setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }
|
||||
@ -3619,6 +3623,7 @@ class MOZ_STACK_CLASS JS_FRIEND_API(CompileOptions) : public ReadOnlyCompileOpti
|
||||
CompileOptions& setColumn(unsigned c) { column = c; return *this; }
|
||||
CompileOptions& setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }
|
||||
CompileOptions& setHasPollutedScope(bool p) { hasPollutedGlobalScope = p; return *this; }
|
||||
CompileOptions& setIsRunOnce(bool once) { isRunOnce = once; return *this; }
|
||||
CompileOptions& setForEval(bool eval) { forEval = eval; return *this; }
|
||||
CompileOptions& setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }
|
||||
CompileOptions& setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }
|
||||
|
@ -2416,6 +2416,7 @@ JSScript::Create(ExclusiveContext* cx, HandleObject enclosingScope, bool savedCa
|
||||
script->hasPollutedGlobalScope_ = options.hasPollutedGlobalScope;
|
||||
script->selfHosted_ = options.selfHostingMode;
|
||||
script->noScriptRval_ = options.noScriptRval;
|
||||
script->treatAsRunOnce_ = options.isRunOnce;
|
||||
|
||||
script->version = options.version;
|
||||
MOZ_ASSERT(script->getVersion() == options.version); // assert that no overflow occurred
|
||||
|
Loading…
Reference in New Issue
Block a user