mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 707341: remove VOUCH_DOES_NOT_REQUIRE_STACK, r=jorendorff
This commit is contained in:
parent
f58866733c
commit
218c592c3d
@ -5268,13 +5268,6 @@ JS_TriggerAllOperationCallbacks(JSRuntime *rt)
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_IsRunning(JSContext *cx)
|
||||
{
|
||||
/*
|
||||
* The use of cx->fp below is safe. Rationale: Here we don't care if the
|
||||
* interpreter state is stale. We just want to know if there *is* any
|
||||
* interpreter state.
|
||||
*/
|
||||
VOUCH_DOES_NOT_REQUIRE_STACK();
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
if (!cx->thread())
|
||||
return false;
|
||||
|
@ -433,7 +433,6 @@ js_NewContext(JSRuntime *rt, size_t stackChunkSize)
|
||||
return NULL;
|
||||
|
||||
JS_ASSERT(cx->findVersion() == JSVERSION_DEFAULT);
|
||||
VOUCH_DOES_NOT_REQUIRE_STACK();
|
||||
|
||||
if (!cx->busyArrays.init()) {
|
||||
Foreground::delete_(cx);
|
||||
@ -1474,7 +1473,6 @@ JSContext::~JSContext()
|
||||
#endif
|
||||
|
||||
/* Free the stuff hanging off of cx. */
|
||||
VOUCH_DOES_NOT_REQUIRE_STACK();
|
||||
if (parseMapPool_)
|
||||
Foreground::delete_<ParseMapPool>(parseMapPool_);
|
||||
|
||||
|
@ -75,16 +75,6 @@ struct PreserveRegsGuard
|
||||
static inline GlobalObject *
|
||||
GetGlobalForScopeChain(JSContext *cx)
|
||||
{
|
||||
/*
|
||||
* This is essentially GetScopeChain(cx)->getGlobal(), but without
|
||||
* falling off trace.
|
||||
*
|
||||
* This use of cx->fp, possibly on trace, is deliberate:
|
||||
* cx->fp->scopeChain->getGlobal() returns the same object whether we're on
|
||||
* trace or not, since we do not trace calls across global objects.
|
||||
*/
|
||||
VOUCH_DOES_NOT_REQUIRE_STACK();
|
||||
|
||||
if (cx->hasfp())
|
||||
return cx->fp()->scopeChain().getGlobal();
|
||||
|
||||
@ -152,7 +142,6 @@ class CompartmentChecker
|
||||
public:
|
||||
explicit CompartmentChecker(JSContext *cx) : context(cx), compartment(cx->compartment) {
|
||||
check(cx->hasfp() ? JS_GetGlobalForScopeChain(cx) : cx->globalObject);
|
||||
VOUCH_DOES_NOT_REQUIRE_STACK();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2289,12 +2289,7 @@ js_NewFlatClosure(JSContext *cx, JSFunction *fun, JSOp op, size_t oplen)
|
||||
* Flat closures cannot yet be partial, that is, all upvars must be copied,
|
||||
* or the closure won't be flattened. Therefore they do not need to search
|
||||
* enclosing scope objects via JSOP_NAME, etc.
|
||||
*
|
||||
* FIXME: bug 545759 proposes to enable partial flat closures. Fixing this
|
||||
* bug requires a GetScopeChainFast call here, along with JS_REQUIRES_STACK
|
||||
* annotations on this function's prototype and definition.
|
||||
*/
|
||||
VOUCH_DOES_NOT_REQUIRE_STACK();
|
||||
JSObject *scopeChain = &cx->fp()->scopeChain();
|
||||
|
||||
JSFunction *closure = js_AllocFlatClosure(cx, fun, scopeChain);
|
||||
|
@ -4975,26 +4975,12 @@ js_FindClassObject(JSContext *cx, JSObject *start, JSProtoKey protoKey,
|
||||
JSProperty *prop;
|
||||
const Shape *shape;
|
||||
|
||||
/*
|
||||
* Find the global object. Use cx->fp() directly to avoid falling off
|
||||
* trace; all JIT-elided stack frames have the same global object as
|
||||
* cx->fp().
|
||||
*/
|
||||
VOUCH_DOES_NOT_REQUIRE_STACK();
|
||||
if (!start && (fp = cx->maybefp()) != NULL)
|
||||
start = &fp->scopeChain();
|
||||
|
||||
if (start) {
|
||||
obj = start->getGlobal();
|
||||
OBJ_TO_INNER_OBJECT(cx, obj);
|
||||
} else {
|
||||
obj = cx->globalObject;
|
||||
if (!obj) {
|
||||
vp->setUndefined();
|
||||
return true;
|
||||
}
|
||||
obj = GetGlobalForScopeChain(cx);
|
||||
}
|
||||
|
||||
OBJ_TO_INNER_OBJECT(cx, obj);
|
||||
if (!obj)
|
||||
return false;
|
||||
|
||||
@ -6755,7 +6741,6 @@ JSBool
|
||||
js_GetClassPrototype(JSContext *cx, JSObject *scopeobj, JSProtoKey protoKey,
|
||||
JSObject **protop, Class *clasp)
|
||||
{
|
||||
VOUCH_DOES_NOT_REQUIRE_STACK();
|
||||
JS_ASSERT(JSProto_Null <= protoKey);
|
||||
JS_ASSERT(protoKey < JSProto_LIMIT);
|
||||
|
||||
@ -7383,8 +7368,6 @@ JS_FRIEND_API(void)
|
||||
js_DumpStackFrame(JSContext *cx, StackFrame *start)
|
||||
{
|
||||
/* This should only called during live debugging. */
|
||||
VOUCH_DOES_NOT_REQUIRE_STACK();
|
||||
|
||||
FrameRegsIter i(cx, StackIter::GO_THROUGH_SAVED);
|
||||
if (!start) {
|
||||
if (i.done()) {
|
||||
|
@ -4349,7 +4349,6 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb)
|
||||
tmp = (TableEntry *)
|
||||
cx->malloc_((size_t)j * sizeof *table);
|
||||
if (tmp) {
|
||||
VOUCH_DOES_NOT_REQUIRE_STACK();
|
||||
MergeSort(table, size_t(j), tmp, CompareTableEntries);
|
||||
Foreground::free_(tmp);
|
||||
ok = true;
|
||||
|
@ -378,12 +378,9 @@ inline __attribute__ ((unused)) void MUST_FLOW_THROUGH(const char *label) {}
|
||||
/* Avoid unused goto-label warnings. */
|
||||
# define MUST_FLOW_LABEL(label) goto label; label:
|
||||
|
||||
inline JS_FORCES_STACK void VOUCH_DOES_NOT_REQUIRE_STACK() {}
|
||||
|
||||
#else
|
||||
# define MUST_FLOW_THROUGH(label) ((void) 0)
|
||||
# define MUST_FLOW_LABEL(label)
|
||||
# define VOUCH_DOES_NOT_REQUIRE_STACK() ((void) 0)
|
||||
#endif
|
||||
|
||||
/* Crash diagnostics */
|
||||
@ -443,6 +440,4 @@ typedef size_t jsbitmap;
|
||||
#define JS_CLEAR_BIT(_map,_bit) ((_map)[(_bit)>>JS_BITS_PER_WORD_LOG2] &= \
|
||||
~((jsbitmap)1<<((_bit)&(JS_BITS_PER_WORD-1))))
|
||||
|
||||
#define VOUCH_HAVE_STACK VOUCH_DOES_NOT_REQUIRE_STACK
|
||||
|
||||
#endif /* jsutil_h___ */
|
||||
|
Loading…
Reference in New Issue
Block a user