mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 912379 - Unwrap before translating StopIteration. r=mrbkap
The current setup means that we have different cache behavior for StopIteration depending on whether we're wrapping StopIteration itself or a CCW to one. We need to maintain cache invariants for optimizations now, so this is verboten. Shuffle some code.
This commit is contained in:
parent
7735a60358
commit
40d7271354
12
js/src/jit-test/tests/auto-regress/bug912379.js
Normal file
12
js/src/jit-test/tests/auto-regress/bug912379.js
Normal file
@ -0,0 +1,12 @@
|
||||
s = newGlobal();
|
||||
evalcx("\
|
||||
try { \
|
||||
throw StopIteration;\
|
||||
} catch(a) {\
|
||||
x = a;\
|
||||
} \
|
||||
wrap(x);\
|
||||
", s);
|
||||
evalcx("\
|
||||
n = x;\
|
||||
", s);
|
@ -285,6 +285,13 @@ JSCompartment::wrap(JSContext *cx, MutableHandleObject obj, HandleObject existin
|
||||
HandleObject global = cx->global();
|
||||
JS_ASSERT(global);
|
||||
|
||||
if (obj->compartment() == this)
|
||||
return WrapForSameCompartment(cx, obj);
|
||||
|
||||
/* Unwrap the object, but don't unwrap outer windows. */
|
||||
unsigned flags = 0;
|
||||
obj.set(UncheckedUnwrap(obj, /* stopAtOuter = */ true, &flags));
|
||||
|
||||
if (obj->compartment() == this)
|
||||
return WrapForSameCompartment(cx, obj);
|
||||
|
||||
@ -297,13 +304,6 @@ JSCompartment::wrap(JSContext *cx, MutableHandleObject obj, HandleObject existin
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Unwrap the object, but don't unwrap outer windows. */
|
||||
unsigned flags = 0;
|
||||
obj.set(UncheckedUnwrap(obj, /* stopAtOuter = */ true, &flags));
|
||||
|
||||
if (obj->compartment() == this)
|
||||
return WrapForSameCompartment(cx, obj);
|
||||
|
||||
/* Invoke the prewrap callback. We're a bit worried about infinite
|
||||
* recursion here, so we do a check - see bug 809295. */
|
||||
JS_CHECK_CHROME_RECURSION(cx, return false);
|
||||
|
Loading…
Reference in New Issue
Block a user