mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1113139 - Don't attach stubs in NameIC if the lookup would throw. (r=shu)
This commit is contained in:
parent
2a57f2a27c
commit
7e5619ddac
9
js/src/jit-test/tests/ion/bug1113139.js
Normal file
9
js/src/jit-test/tests/ion/bug1113139.js
Normal file
@ -0,0 +1,9 @@
|
||||
var lfcode = new Array();
|
||||
lfcode.push = function(x) { eval("(function() { " + x + " })();"); };
|
||||
lfcode.push("\
|
||||
function error(str) { try { eval(str); } catch (e) { return e; } }\
|
||||
const YIELD_PAREN = error('(function*(){(for (y of (yield 1, 2)) y)})').message;\
|
||||
const GENEXP_YIELD = error('(function*(){(for (x of yield 1) x)})').message;\
|
||||
const GENERIC = error('(for)').message;\
|
||||
const eval = [];\
|
||||
");
|
@ -4389,6 +4389,15 @@ NameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain,
|
||||
if (!LookupName(cx, name, scopeChain, &obj, &holder, &shape))
|
||||
return false;
|
||||
|
||||
// Look first. Don't generate cache entries if the lookup fails.
|
||||
if (cache.isTypeOf()) {
|
||||
if (!FetchName<true>(cx, obj, holder, name, shape, vp))
|
||||
return false;
|
||||
} else {
|
||||
if (!FetchName<false>(cx, obj, holder, name, shape, vp))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cache.canAttachStub()) {
|
||||
if (IsCacheableNameReadSlot(scopeChain, obj, holder, shape, pc, cache.outputReg())) {
|
||||
if (!cache.attachReadSlot(cx, outerScript, ion, scopeChain, obj,
|
||||
@ -4402,14 +4411,6 @@ NameIC::update(JSContext *cx, size_t cacheIndex, HandleObject scopeChain,
|
||||
}
|
||||
}
|
||||
|
||||
if (cache.isTypeOf()) {
|
||||
if (!FetchName<true>(cx, obj, holder, name, shape, vp))
|
||||
return false;
|
||||
} else {
|
||||
if (!FetchName<false>(cx, obj, holder, name, shape, vp))
|
||||
return false;
|
||||
}
|
||||
|
||||
// Monitor changes to cache entry.
|
||||
types::TypeScript::Monitor(cx, script, pc, vp);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user