Bug 707341: remove VOUCH_DOES_NOT_REQUIRE_STACK, r=jorendorff

This commit is contained in:
David Mandelin 2011-12-07 17:49:10 -08:00
parent f58866733c
commit 218c592c3d
7 changed files with 2 additions and 50 deletions

View File

@ -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;

View File

@ -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_);

View File

@ -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();
}
/*

View File

@ -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);

View File

@ -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()) {

View File

@ -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;

View File

@ -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___ */