Closed Bug 561003 Opened 14 years ago Closed 10 years ago

nanojit: distinguish between expression-guards and statement-guards

Categories

(Core Graveyard :: Nanojit, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: n.nethercote, Unassigned)

References

Details

We currently have two kinds of guards:

- Statement-guards:  x, xt, xf, xtbl, xbarrier
- Expression-guards: addxovi, subxovi, mulxovi

The main difference is that expression-guards produce a value, and can be removed if that value is dead.  Both kinds can be CSE'd.

But the distinction isn't clear in the code, and there are some minor bugs and sub-optimalities as a result.

- I should add isStmtGuard() and isExprGuard().

- In LiveTable::retire() we have an isGuard() call, I think it should be isStmtGuard().  Actually, that whole expression should probably just be isStmt(), although maybe we also have to allow for calls that are statements and return a value.

- In live(), 'exits' won't include live expression-guards.  It should.

- StackFilter is overly conservative with respect to expression-guards -- an expression-guard could be dead but StackFilter will not know this and so ensure the VM state is up-to-date before it.  I don't see how to avoid this, it's a chicken-and-egg situation -- StackFilter can increase the amount of code that is dead, and dead code removal can remove expression-guards that would allow more VM updates to be removed.  Hmm.

Nb: if anyone likes the names 'guard-expressions' and 'guard-statements' better, speak up.
Blocks: 560994
No longer blocks: 560994
Blocks: 560994
(In reply to comment #0)
> 
> - In LiveTable::retire() we have an isGuard() call, I think it should be
> isStmtGuard().  Actually, that whole expression should probably just be
> isStmt(), although maybe we also have to allow for calls that are statements
> and return a value.

It has since been removed, so this is no longer a problem.

> - StackFilter is overly conservative with respect to expression-guards -- an
> expression-guard could be dead but StackFilter will not know this and so ensure
> the VM state is up-to-date before it.  I don't see how to avoid this, it's a
> chicken-and-egg situation -- StackFilter can increase the amount of code that
> is dead, and dead code removal can remove expression-guards that would allow
> more VM updates to be removed.  Hmm.

That's incorrect:  with the new accurate isLive() in place, StackFilter can accurately judge whether an expression-guard is live or not, so long as the liveness determination is guaranteed to be up-to-date.  See bug 563277.

> - In live(), 'exits' won't include live expression-guards.  It should.

That's still true, and the only thing left in this bug to fix.
Assignee: nnethercote → nobody
Status: ASSIGNED → NEW
Product: Core → Core Graveyard
Nanojit has been dead for several years. Its Bugzilla component has been moved to the graveyard (bug 984276).

I checked all the open bugs. They're all uninteresting, so I'm WONTFIXing them all. Apologies for the bugspam.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.