Bug 948716 - Remove unnecessary TestAreKnownDOMTypes(). (r=sstangl)

This commit is contained in:
Eric Faust 2013-12-10 16:17:49 -08:00
parent b14f771ccc
commit b881546cc1

View File

@ -5100,33 +5100,6 @@ IonBuilder::testShouldDOMCall(types::TypeSet *inTypes,
return true;
}
static bool
TestAreKnownDOMTypes(types::TypeSet *inTypes)
{
if (inTypes->unknownObject())
return false;
// First iterate to make sure they all are DOM objects, then freeze all of
// them as such if they are.
for (unsigned i = 0; i < inTypes->getObjectCount(); i++) {
types::TypeObjectKey *curType = inTypes->getObject(i);
if (!curType)
continue;
if (curType->unknownProperties())
return false;
if (!(curType->clasp()->flags & JSCLASS_IS_DOMJSCLASS))
return false;
}
// If we didn't check anything, no reason to say yes.
if (inTypes->getObjectCount() > 0)
return true;
return false;
}
static bool
ArgumentTypesMatch(MDefinition *def, types::StackTypeSet *calleeTypes)
{
@ -5253,7 +5226,7 @@ IonBuilder::makeCallHelper(JSFunction *target, CallInfo &callInfo, bool cloneAtC
// MCall accordingly.
types::TemporaryTypeSet *thisTypes = thisArg->resultTypeSet();
if (thisTypes &&
TestAreKnownDOMTypes(thisTypes) &&
thisTypes->isDOMClass() &&
testShouldDOMCall(thisTypes, target, JSJitInfo::Method))
{
call->setDOMFunction();