Bug 795896. Speed up UnwrapProxy, since we know what we have there is either an Xray or our proxy. r=peterv

This commit is contained in:
Boris Zbarsky 2013-01-28 23:29:25 -05:00
parent 891be940c1
commit 0f2911aa31

View File

@ -5848,7 +5848,9 @@ class CGProxyUnwrap(CGAbstractMethod):
def declare(self):
return ""
def definition_body(self):
return """ if (xpc::WrapperFactory::IsXrayWrapper(obj)) {
return """ MOZ_ASSERT(js::IsProxy(obj));
if (js::GetProxyHandler(obj) != DOMProxyHandler::getInstance()) {
MOZ_ASSERT(xpc::WrapperFactory::IsXrayWrapper(obj));
obj = js::UnwrapObject(obj);
}
MOZ_ASSERT(IsProxy(obj));