forked from mirrors/gecko-dev
Bug 556315 part 1 - Remove GCReachableFrame. r=gal.
--HG-- extra : rebase_source : 1db26956cf3f73f1213ab222f4c3ee12637265c5
This commit is contained in:
parent
adf0fee09b
commit
2cb53b9348
3 changed files with 1 additions and 47 deletions
|
|
@ -1160,15 +1160,6 @@ typedef struct JSResolvingEntry {
|
||||||
|
|
||||||
extern const JSDebugHooks js_NullDebugHooks; /* defined in jsdbgapi.cpp */
|
extern const JSDebugHooks js_NullDebugHooks; /* defined in jsdbgapi.cpp */
|
||||||
|
|
||||||
/*
|
|
||||||
* Wraps a stack frame which has been temporarily popped from its call stack
|
|
||||||
* and needs to be GC-reachable. See JSContext::{push,pop}GCReachableFrame.
|
|
||||||
*/
|
|
||||||
struct JSGCReachableFrame {
|
|
||||||
JSGCReachableFrame *next;
|
|
||||||
JSStackFrame *frame;
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace js {
|
namespace js {
|
||||||
class AutoGCRooter;
|
class AutoGCRooter;
|
||||||
}
|
}
|
||||||
|
|
@ -1291,19 +1282,6 @@ struct JSContext
|
||||||
void *data;
|
void *data;
|
||||||
void *data2;
|
void *data2;
|
||||||
|
|
||||||
/* Linked list of frames temporarily popped from their chain. */
|
|
||||||
JSGCReachableFrame *reachableFrames;
|
|
||||||
|
|
||||||
void pushGCReachableFrame(JSGCReachableFrame &gcrf, JSStackFrame *f) {
|
|
||||||
gcrf.next = reachableFrames;
|
|
||||||
gcrf.frame = f;
|
|
||||||
reachableFrames = &gcrf;
|
|
||||||
}
|
|
||||||
|
|
||||||
void popGCReachableFrame() {
|
|
||||||
reachableFrames = reachableFrames->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
# pragma GCC visibility push(default)
|
# pragma GCC visibility push(default)
|
||||||
|
|
|
||||||
|
|
@ -1227,29 +1227,9 @@ JS_GetFrameCallObject(JSContext *cx, JSStackFrame *fp)
|
||||||
JS_PUBLIC_API(JSObject *)
|
JS_PUBLIC_API(JSObject *)
|
||||||
JS_GetFrameThis(JSContext *cx, JSStackFrame *fp)
|
JS_GetFrameThis(JSContext *cx, JSStackFrame *fp)
|
||||||
{
|
{
|
||||||
if (fp->flags & JSFRAME_COMPUTED_THIS)
|
if (!(fp->flags & JSFRAME_COMPUTED_THIS) && fp->argv)
|
||||||
return JSVAL_TO_OBJECT(fp->thisv); /* JSVAL_COMPUTED_THIS invariant */
|
|
||||||
|
|
||||||
/* js_ComputeThis gets confused if fp != cx->fp, so set it aside. */
|
|
||||||
JSStackFrame *afp = js_GetTopStackFrame(cx);
|
|
||||||
JSGCReachableFrame reachable;
|
|
||||||
if (afp != fp) {
|
|
||||||
if (afp) {
|
|
||||||
cx->fp = fp;
|
|
||||||
cx->pushGCReachableFrame(reachable, afp);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
afp = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fp->argv)
|
|
||||||
fp->thisv = OBJECT_TO_JSVAL(js_ComputeThis(cx, fp->argv));
|
fp->thisv = OBJECT_TO_JSVAL(js_ComputeThis(cx, fp->argv));
|
||||||
|
|
||||||
if (afp) {
|
|
||||||
cx->fp = afp;
|
|
||||||
cx->popGCReachableFrame();
|
|
||||||
}
|
|
||||||
|
|
||||||
return JSVAL_TO_OBJECT(fp->thisv);
|
return JSVAL_TO_OBJECT(fp->thisv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2412,10 +2412,6 @@ js_TraceContext(JSTracer *trc, JSContext *acx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Trace frames that have been temporarily removed but need to be marked. */
|
|
||||||
for (JSGCReachableFrame *rf = acx->reachableFrames; rf; rf = rf->next)
|
|
||||||
TraceFrameChain(trc, rf->frame);
|
|
||||||
|
|
||||||
/* Mark other roots-by-definition in acx. */
|
/* Mark other roots-by-definition in acx. */
|
||||||
if (acx->globalObject && !JS_HAS_OPTION(acx, JSOPTION_UNROOTED_GLOBAL))
|
if (acx->globalObject && !JS_HAS_OPTION(acx, JSOPTION_UNROOTED_GLOBAL))
|
||||||
JS_CALL_OBJECT_TRACER(trc, acx->globalObject, "global object");
|
JS_CALL_OBJECT_TRACER(trc, acx->globalObject, "global object");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue