Bug 875452 - Part 4: Handle NoPropertys on DoesntShadow{,Unique} DOMProxies. (r=djvj)

This commit is contained in:
Eric Faust 2013-08-10 22:20:36 -07:00
parent 3f7ba77e44
commit e2b438cf51

View File

@ -1361,10 +1361,6 @@ GetPropertyIC::tryAttachDOMProxyUnshadowed(JSContext *cx, IonScript *ion, Handle
return false;
if (canCache == CanAttachNone)
return true;
// Dont cache no properties, because the proxy can still contain the property
// by magic
if (!holder)
return true;
*emitted = true;
@ -1393,6 +1389,9 @@ GetPropertyIC::tryAttachDOMProxyUnshadowed(JSContext *cx, IonScript *ion, Handle
// Make sure object is a DOMProxy proxy
GenerateDOMProxyChecks(cx, masm, obj, name, object(), &failures);
if (holder) {
// Found the property on the prototype chain. Treat it like a native
// getprop.
Register scratchReg = output().valueReg().scratchReg();
GeneratePrototypeGuards(cx, ion, masm, obj, holder, object(), scratchReg, &failures);
@ -1409,9 +1408,9 @@ GetPropertyIC::tryAttachDOMProxyUnshadowed(JSContext *cx, IonScript *ion, Handle
if (canCache == CanAttachReadSlot) {
EmitLoadSlot(masm, holder, shape, holderReg, output(), scratchReg);
} else {
// EmitGetterCall() expects |obj| to be the object the property is on to do some
// checks. Since we actually looked at checkObj, and no extra guards will be generated,
// we can just pass that instead.
// EmitGetterCall() expects |obj| to be the object the property is
// on to do some checks. Since we actually looked at checkObj, and
// no extra guards will be generated, we can just pass that instead.
JS_ASSERT_IF(canCache != CanAttachCallGetter, canCache == CanAttachArrayLength);
if (!EmitGetterCall(cx, masm, attacher, checkObj, holder, shape, liveRegs_,
object(), scratchReg, output(), returnAddr))
@ -1419,6 +1418,16 @@ GetPropertyIC::tryAttachDOMProxyUnshadowed(JSContext *cx, IonScript *ion, Handle
return false;
}
}
} else {
// Property was not found on the prototype chain. Deoptimize down to
// proxy get call
if (!EmitCallProxyGet(cx, masm, name, liveRegs_, object(), output(),
returnAddr))
{
return false;
}
}
attacher.jumpRejoin(masm);
masm.bind(&failures);
attacher.jumpNextStub(masm);