mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 901391 - Fix specializing phis with cold inputs that aren't MIRType_Value. (r=jandem)
This commit is contained in:
parent
2b436f2b47
commit
8375a98dd7
@ -541,7 +541,7 @@ TypeAnalyzer::adjustPhiInputs(MPhi *phi)
|
||||
|
||||
// If we specialized a type that's not Value, either every input is of
|
||||
// that type or the input's typeset was unobserved (i.e. the opcode hasn't
|
||||
// been executed yet.) Be optimistic and insert unboxes.
|
||||
// been executed yet.)
|
||||
if (phiType != MIRType_Value) {
|
||||
for (size_t i = 0, e = phi->numOperands(); i < e; i++) {
|
||||
MDefinition *in = phi->getOperand(i);
|
||||
@ -551,6 +551,17 @@ TypeAnalyzer::adjustPhiInputs(MPhi *phi)
|
||||
if (in->isBox() && in->toBox()->input()->type() == phiType) {
|
||||
phi->replaceOperand(i, in->toBox()->input());
|
||||
} else {
|
||||
// If we know this branch will fail to convert to phiType,
|
||||
// insert a box that'll immediately fail in the fallible unbox
|
||||
// below.
|
||||
if (in->type() != MIRType_Value) {
|
||||
MBox *box = MBox::New(in);
|
||||
in->block()->insertBefore(in->block()->lastIns(), box);
|
||||
in = box;
|
||||
}
|
||||
|
||||
// Be optimistic and insert unboxes when the operand is a
|
||||
// value.
|
||||
MUnbox *unbox = MUnbox::New(in, phiType, MUnbox::Fallible);
|
||||
in->block()->insertBefore(in->block()->lastIns(), unbox);
|
||||
phi->replaceOperand(i, unbox);
|
||||
|
4
js/src/jit-test/tests/ion/bug901391.js
Normal file
4
js/src/jit-test/tests/ion/bug901391.js
Normal file
@ -0,0 +1,4 @@
|
||||
function testPartition() {
|
||||
if( "null" || new testPartition()) {}
|
||||
}
|
||||
testPartition();
|
Loading…
Reference in New Issue
Block a user