mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 823482 part 1 - Refactor JSOP_EXCEPTION implementation in the interpreter. r=djvj
--HG-- extra : rebase_source : ec8f44feae0e8c74245347b1763f0275867764f5
This commit is contained in:
parent
40c5a12a40
commit
21795a7536
@ -3109,9 +3109,12 @@ END_VARLEN_CASE
|
||||
}
|
||||
|
||||
BEGIN_CASE(JSOP_EXCEPTION)
|
||||
PUSH_COPY(cx->getPendingException());
|
||||
cx->clearPendingException();
|
||||
CHECK_BRANCH();
|
||||
{
|
||||
PUSH_NULL();
|
||||
MutableHandleValue res = MutableHandleValue::fromMarkedLocation(®s.sp[-1]);
|
||||
if (!GetAndClearException(cx, res))
|
||||
goto error;
|
||||
}
|
||||
END_CASE(JSOP_EXCEPTION)
|
||||
|
||||
BEGIN_CASE(JSOP_FINALLY)
|
||||
@ -3910,6 +3913,19 @@ js::DefFunOperation(JSContext *cx, HandleScript script, HandleObject scopeChain,
|
||||
return JSObject::setProperty(cx, parent, parent, name, &rval, script->strict);
|
||||
}
|
||||
|
||||
bool
|
||||
js::GetAndClearException(JSContext *cx, MutableHandleValue res)
|
||||
{
|
||||
// Check the interrupt flag to allow interrupting deeply nested exception
|
||||
// handling.
|
||||
if (cx->runtime->interrupt && !js_HandleExecutionInterrupt(cx))
|
||||
return false;
|
||||
|
||||
res.set(cx->getPendingException());
|
||||
cx->clearPendingException();
|
||||
return true;
|
||||
}
|
||||
|
||||
template <bool strict>
|
||||
bool
|
||||
js::SetProperty(JSContext *cx, HandleObject obj, HandleId id, const Value &value)
|
||||
|
@ -384,6 +384,9 @@ DeleteProperty(JSContext *ctx, HandleValue val, HandlePropertyName name, JSBool
|
||||
bool
|
||||
DefFunOperation(JSContext *cx, HandleScript script, HandleObject scopeChain, HandleFunction funArg);
|
||||
|
||||
bool
|
||||
GetAndClearException(JSContext *cx, MutableHandleValue res);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
#endif /* jsinterp_h___ */
|
||||
|
Loading…
Reference in New Issue
Block a user