Closed Bug 865153 Opened 13 years ago Closed 13 years ago

IonMonkey: RestartLoop isn't done correctly

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: h4writer, Unassigned)

References

Details

Attachments

(2 files)

Decoder found that we were looking to values on MBasicBlocks that weren't set on the following testcase: function testMonitorIntrinsic() { var N = 2; var p = new ParallelArray([N,N], function () 0); for (var i = 0; i < 3; i++) { for (var j = 0; j < 2; j++) { p.get(i).get(j); } } } testMonitorIntrinsic(); The issue is when compiling self-hosted:2909 in IM we need to restart the loop. When restarting a loop, the information about blocks isn't totally wiped out. And some of the supposedly removed blocks remain accessible! In this case the uses of the phis in the loopheader aren't removed! I've added a simple patch to assert when this happens. To make it easier to spot when this bug is fixed...
Blocks: 804676
All instructions in the loop header's block, and all instructions and phis in removed blocks should be removed by RestartLoop, which is supposed to remove all the uses of the loop header phis. Which uses are remaining?
Attached patch patchSplinter Review
This removes resume points when marking blocks dead, in addition to phis and instructions as are already done. Adds bookkeeping to keep track of resume points in blocks, which was not previously done. I weakened the assertion in domIndex() as it is firing on an unrelated jit-test (basic/bug666448.js) which also presumably has unreachable blocks not handled by the dominator analysis.
Attachment #741618 - Flags: review?(hv1989)
Comment on attachment 741618 [details] [diff] [review] patch Review of attachment 741618 [details] [diff] [review]: ----------------------------------------------------------------- Nice! Shouldn't need a second review, but just answer my question and add the r? flag again. ::: js/src/ion/IonBuilder.cpp @@ +1746,2 @@ > header->discardAllInstructions(); > + header->discardAllResumePoints(false); Add /* discardEntry */ in front of false ::: js/src/ion/MIRGraph.cpp @@ +207,5 @@ > info_(info), > stackPosition_(info_.firstStackSlot()), > lastIns_(NULL), > pc_(pc), > + domIndex_(uint32_t(-1)), This can get removed, since you use markAsDead and asserts on !isDead() @@ +300,1 @@ > } I don't really get what this does and why? When would we want to have an entry resumepoint that has a parent resumepoint but all it's operands are cleared? @@ +644,5 @@ > } > > void > +MBasicBlock::discardAllResumePoints(bool discardEntry) > +{ I think it would make sense to default this to "true"
Attachment #741618 - Flags: review?(hv1989)
(In reply to Hannes Verschore [:h4writer] from comment #3) > I don't really get what this does and why? When would we want to have an > entry resumepoint that has a parent resumepoint but all it's operands are > cleared? The entry resume point here has not had its operands initialized, and the caller is not guaranteed to initialize them properly (and in at least one case will not). Having the operands initialized is necessary for walking the list of resume points and removing the uses of them, as otherwise that walk will read garbage.
Attachment #741618 - Flags: review?(hv1989)
(In reply to Brian Hackett (:bhackett) from comment #4) > The entry resume point here has not had its operands initialized, and the > caller is not guaranteed to initialize them properly (and in at least one > case will not). Having the operands initialized is necessary for walking > the list of resume points and removing the uses of them, as otherwise that > walk will read garbage. Could you add a little explanation in the code about that?
Attachment #741618 - Flags: review?(hv1989) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: