зеркало из https://github.com/mozilla/gecko-dev.git
Bug 990787, part 7 - Propagate OOM from probes::EnterScript; make probes::ExitScript return void, as it can't fail. r=jandem.
--HG-- extra : rebase_source : 31e7a5643a5831c2fe1dae63f9d80c3f78df43fa
This commit is contained in:
Родитель
6dafb8ceb0
Коммит
f87f2c4d28
|
@ -1510,7 +1510,11 @@ Interpret(JSContext *cx, RunState &state)
|
|||
if (!activation.entryFrame()->prologue(cx))
|
||||
goto error;
|
||||
} else {
|
||||
probes::EnterScript(cx, script, script->functionNonDelazifying(), activation.entryFrame());
|
||||
if (!probes::EnterScript(cx, script, script->functionNonDelazifying(),
|
||||
activation.entryFrame()))
|
||||
{
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
if (MOZ_UNLIKELY(cx->compartment()->debugMode())) {
|
||||
JSTrapStatus status = ScriptDebugPrologue(cx, activation.entryFrame(), REGS.pc);
|
||||
|
|
|
@ -43,7 +43,6 @@ inline bool
|
|||
probes::EnterScript(JSContext *cx, JSScript *script, JSFunction *maybeFun,
|
||||
InterpreterFrame *fp)
|
||||
{
|
||||
bool ok = true;
|
||||
#ifdef INCLUDE_MOZILLA_DTRACE
|
||||
if (JAVASCRIPT_FUNCTION_ENTRY_ENABLED())
|
||||
DTraceEnterJSFun(cx, maybeFun, script);
|
||||
|
@ -54,19 +53,18 @@ probes::EnterScript(JSContext *cx, JSScript *script, JSFunction *maybeFun,
|
|||
|
||||
JSRuntime *rt = cx->runtime();
|
||||
if (rt->spsProfiler.enabled()) {
|
||||
rt->spsProfiler.enter(script, maybeFun);
|
||||
if (!rt->spsProfiler.enter(script, maybeFun))
|
||||
return false;
|
||||
JS_ASSERT_IF(!fp->isGeneratorFrame(), !fp->hasPushedSPSFrame());
|
||||
fp->setPushedSPSFrame();
|
||||
}
|
||||
|
||||
return ok;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline bool
|
||||
inline void
|
||||
probes::ExitScript(JSContext *cx, JSScript *script, JSFunction *maybeFun, bool popSPSFrame)
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
#ifdef INCLUDE_MOZILLA_DTRACE
|
||||
if (JAVASCRIPT_FUNCTION_RETURN_ENABLED())
|
||||
DTraceExitJSFun(cx, maybeFun, script);
|
||||
|
@ -77,8 +75,6 @@ probes::ExitScript(JSContext *cx, JSScript *script, JSFunction *maybeFun, bool p
|
|||
|
||||
if (popSPSFrame)
|
||||
cx->runtime()->spsProfiler.exit(script, maybeFun);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
inline bool
|
||||
|
|
|
@ -69,7 +69,7 @@ bool WantNativeAddressInfo(JSContext *);
|
|||
bool EnterScript(JSContext *, JSScript *, JSFunction *, InterpreterFrame *);
|
||||
|
||||
/* About to leave a JS function */
|
||||
bool ExitScript(JSContext *, JSScript *, JSFunction *, bool popSPSFrame);
|
||||
void ExitScript(JSContext *, JSScript *, JSFunction *, bool popSPSFrame);
|
||||
|
||||
/* Executing a script */
|
||||
bool StartExecution(JSScript *script);
|
||||
|
|
|
@ -239,14 +239,11 @@ InterpreterFrame::prologue(JSContext *cx)
|
|||
pushOnScopeChain(*callobj);
|
||||
flags_ |= HAS_CALL_OBJ;
|
||||
}
|
||||
probes::EnterScript(cx, script, nullptr, this);
|
||||
return true;
|
||||
return probes::EnterScript(cx, script, nullptr, this);
|
||||
}
|
||||
|
||||
if (isGlobalFrame()) {
|
||||
probes::EnterScript(cx, script, nullptr, this);
|
||||
return true;
|
||||
}
|
||||
if (isGlobalFrame())
|
||||
return probes::EnterScript(cx, script, nullptr, this);
|
||||
|
||||
JS_ASSERT(isNonEvalFunctionFrame());
|
||||
AssertDynamicScopeMatchesStaticScope(cx, script, scopeChain());
|
||||
|
@ -263,8 +260,7 @@ InterpreterFrame::prologue(JSContext *cx)
|
|||
functionThis() = ObjectValue(*obj);
|
||||
}
|
||||
|
||||
probes::EnterScript(cx, script, script->functionNonDelazifying(), this);
|
||||
return true;
|
||||
return probes::EnterScript(cx, script, script->functionNonDelazifying(), this);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Загрузка…
Ссылка в новой задаче