mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 940686. When we eliminate a barrier, make its unbox infallible if it was a barrier-type unbox before. r=h4writer
This commit is contained in:
parent
45c142619f
commit
ee72990f4e
@ -1576,11 +1576,16 @@ TryEliminateTypeBarrierFromTest(MTypeBarrier *barrier, bool filtersNull, bool fi
|
||||
|
||||
// Disregard the possible unbox added before the Typebarrier for checking.
|
||||
MDefinition *input = barrier->input();
|
||||
if (input->isUnbox() && input->toUnbox()->mode() != MUnbox::Fallible)
|
||||
input = input->toUnbox()->input();
|
||||
MUnbox *inputUnbox = nullptr;
|
||||
if (input->isUnbox() && input->toUnbox()->mode() != MUnbox::Fallible) {
|
||||
inputUnbox = input->toUnbox();
|
||||
input = inputUnbox->input();
|
||||
}
|
||||
|
||||
if (test->getOperand(0) == input && direction == TRUE_BRANCH) {
|
||||
*eliminated = true;
|
||||
if (inputUnbox)
|
||||
inputUnbox->makeInfallible();
|
||||
barrier->replaceAllUsesWith(barrier->input());
|
||||
return;
|
||||
}
|
||||
@ -1614,6 +1619,8 @@ TryEliminateTypeBarrierFromTest(MTypeBarrier *barrier, bool filtersNull, bool fi
|
||||
}
|
||||
|
||||
*eliminated = true;
|
||||
if (inputUnbox)
|
||||
inputUnbox->makeInfallible();
|
||||
barrier->replaceAllUsesWith(barrier->input());
|
||||
}
|
||||
|
||||
|
@ -2373,6 +2373,11 @@ class MUnbox : public MUnaryInstruction, public BoxInputsPolicy
|
||||
return AliasSet::None();
|
||||
}
|
||||
void printOpcode(FILE *fp) const;
|
||||
void makeInfallible() {
|
||||
// Should only be called if we're already Infallible or TypeBarrier
|
||||
JS_ASSERT(mode() != Fallible);
|
||||
mode_ = Infallible;
|
||||
}
|
||||
};
|
||||
|
||||
class MGuardObject : public MUnaryInstruction, public SingleObjectPolicy
|
||||
|
Loading…
Reference in New Issue
Block a user