mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 556315 part 1 - Remove GCReachableFrame. r=gal.
--HG-- extra : rebase_source : 1db26956cf3f73f1213ab222f4c3ee12637265c5
This commit is contained in:
parent
570eb3ecf8
commit
33d9cdc537
@ -1160,15 +1160,6 @@ typedef struct JSResolvingEntry {
|
||||
|
||||
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 {
|
||||
class AutoGCRooter;
|
||||
}
|
||||
@ -1291,19 +1282,6 @@ struct JSContext
|
||||
void *data;
|
||||
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:
|
||||
#ifdef __GNUC__
|
||||
# pragma GCC visibility push(default)
|
||||
|
@ -1227,29 +1227,9 @@ JS_GetFrameCallObject(JSContext *cx, JSStackFrame *fp)
|
||||
JS_PUBLIC_API(JSObject *)
|
||||
JS_GetFrameThis(JSContext *cx, JSStackFrame *fp)
|
||||
{
|
||||
if (fp->flags & JSFRAME_COMPUTED_THIS)
|
||||
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)
|
||||
if (!(fp->flags & JSFRAME_COMPUTED_THIS) && 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);
|
||||
}
|
||||
|
||||
|
@ -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. */
|
||||
if (acx->globalObject && !JS_HAS_OPTION(acx, JSOPTION_UNROOTED_GLOBAL))
|
||||
JS_CALL_OBJECT_TRACER(trc, acx->globalObject, "global object");
|
||||
|
Loading…
Reference in New Issue
Block a user