Bug 930327 - Don't deoptimize the type of a coerced argument if it has other uses. r=jandem

This commit is contained in:
Brian Hackett 2013-11-11 14:50:26 -05:00
parent 3080160eaf
commit 4eac8946e3

View File

@ -9056,9 +9056,18 @@ IonBuilder::jsop_setarg(uint32_t arg)
op->resultTypeSet() &&
op->resultTypeSet()->empty())
{
JS_ASSERT(op->resultTypeSet() == &argTypes[arg]);
if (!argTypes[arg].addType(types::Type::UnknownType(), temp_->lifoAlloc()))
return false;
bool otherUses = false;
for (MUseDefIterator iter(op); iter; iter++) {
MDefinition *def = iter.def();
if (def == val)
continue;
otherUses = true;
}
if (!otherUses) {
JS_ASSERT(op->resultTypeSet() == &argTypes[arg]);
if (!argTypes[arg].addType(types::Type::UnknownType(), temp_->lifoAlloc()))
return false;
}
}
}
}