Bug 864101 - Improve precision of TypeSetIncludes, r=dvander.

This commit is contained in:
Brian Hackett 2013-04-26 17:56:38 -06:00
parent d62ca04f63
commit a8b245d573

View File

@ -5856,9 +5856,6 @@ IonBuilder::jsop_getgname(HandlePropertyName name)
bool
ion::TypeSetIncludes(types::TypeSet *types, MIRType input, types::TypeSet *inputTypes)
{
if (inputTypes)
return inputTypes->isSubset(types);
switch (input) {
case MIRType_Undefined:
case MIRType_Null:
@ -5870,10 +5867,10 @@ ion::TypeSetIncludes(types::TypeSet *types, MIRType input, types::TypeSet *input
return types->hasType(types::Type::PrimitiveType(ValueTypeFromMIRType(input)));
case MIRType_Object:
return types->unknownObject();
return types->unknownObject() || (inputTypes && inputTypes->isSubset(types));
case MIRType_Value:
return types->unknown();
return types->unknown() || (inputTypes && inputTypes->isSubset(types));
default:
JS_NOT_REACHED("Bad input type");