Closed Bug 940686 Opened 11 years ago Closed 11 years ago

When eliminating barriers in TryEliminateTypeBarrierFromTest, also make the input unbox (if any) infallible

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Details

Attachments

(1 file)

If we can eliminate a type barrier and its input was a TypeBarrier unbox, then we can replace it with an Infallible unbox instead.

Or so says Hannes over in bug 939835 comment 16.  But the theory makes sense to me.  ;)
Also, it's not obvious to me that a Fallible unbox here can become and Infallible one instead.  Could we have a Fallible unbox before a TypeBarrier basically by coincidence?
Flags: needinfo?(hv1989)
(In reply to Boris Zbarsky [:bz] from comment #1)
> Also, it's not obvious to me that a Fallible unbox here can become and
> Infallible one instead.  Could we have a Fallible unbox before a TypeBarrier
> basically by coincidence?

Ok thinking more about this, there could indeed be problems when we do this for a Fallible unbox. (I'll adjust my comment in the other bug too). But it should work for Infallible and TypeBarrier.
Flags: needinfo?(hv1989)
So if we mutate the mode here, would we want to unsetGuard() etc?  Not sure where this code comes in the list of optimization passes.  :(
(In reply to Boris Zbarsky [:bz] from comment #3)
> So if we mutate the mode here, would we want to unsetGuard() etc?  Not sure
> where this code comes in the list of optimization passes.  :(

This is the last pass done on MIR and we don't allow any movements happening for the last few passes. So unsetGuard shouldn't be needed, since it won't buy us anything. Only the transformation to Infallible.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #8334908 - Flags: review?(hv1989) → review+
https://hg.mozilla.org/mozilla-central/rev/fa2587b098ba
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.