Commit 26b0ba28 authored by Jan de Mooij's avatar Jan de Mooij
Browse files

Bug 1338828 part 2 - Add CacheIR SetProp/SetElem stubs for shadowing DOM proxies. r=h4writer

parent 71aecda2
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -2538,6 +2538,25 @@ SetPropIRGenerator::tryAttachGenericProxy(HandleObject obj, ObjOperandId objId,
    return true;
}

bool
SetPropIRGenerator::tryAttachDOMProxyShadowed(HandleObject obj, ObjOperandId objId, HandleId id,
                                              ValOperandId rhsId)
{
    MOZ_ASSERT(IsCacheableDOMProxy(obj));

    maybeEmitIdGuard(id);
    writer.guardShape(objId, obj->maybeShape());

    // No need for more guards: we know this is a DOM proxy, since the shape
    // guard enforces a given JSClass, so just go ahead and emit the call to
    // ProxySet.
    writer.callProxySet(objId, id, rhsId, IsStrictSetPC(pc_));
    writer.returnFromIC();

    trackAttached("DOMProxyShadowed");
    return true;
}

bool
SetPropIRGenerator::tryAttachProxy(HandleObject obj, ObjOperandId objId, HandleId id,
                                   ValOperandId rhsId)
@@ -2547,6 +2566,7 @@ SetPropIRGenerator::tryAttachProxy(HandleObject obj, ObjOperandId objId, HandleI
        return false;
      case ProxyStubType::DOMExpando:
      case ProxyStubType::DOMShadowed:
        return tryAttachDOMProxyShadowed(obj, objId, id, rhsId);
      case ProxyStubType::DOMUnshadowed:
      case ProxyStubType::Generic:
        return tryAttachGenericProxy(obj, objId, id, rhsId);
+2 −0
Original line number Diff line number Diff line
@@ -1093,6 +1093,8 @@ class MOZ_RAII SetPropIRGenerator : public IRGenerator

    bool tryAttachGenericProxy(HandleObject obj, ObjOperandId objId, HandleId id,
                               ValOperandId rhsId);
    bool tryAttachDOMProxyShadowed(HandleObject obj, ObjOperandId objId, HandleId id,
                                   ValOperandId rhsId);
    bool tryAttachProxy(HandleObject obj, ObjOperandId objId, HandleId id, ValOperandId rhsId);
    bool tryAttachProxyElement(HandleObject obj, ObjOperandId objId, ValOperandId rhsId);