Closed Bug 534378 Opened 15 years ago Closed 10 years ago

eliminate guards that prevent overflows in otherwise dead expressions

Categories

(Core Graveyard :: Nanojit, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: gal, Unassigned)

References

Details

Attachments

(1 file)

The expression

a + b;

is dead code. If we record it, we will speculate for an integer addition if a and b are both integers, and emit a guard that checks that no overflow occurs. This expression will never be dead, because the guard keeps it alive. However, the guard serves no purpose. Nobody really uses the value.

The attached patch allows to flags guards as weak. I squirreled the weak flag into the GuardRecord for now. This should probably be encoded in the opcode instead (LIR_wxt/LIR_wxf?).

When assembling a weak guard, we check whether any part of the condition expression is already live. If not, we don't emit the guard.

This passes our tests and sunspider in a debug build. We get a recursion error in an OPT build on SS in controlflow-recursive. David .... help :)
Attached patch patchSplinter Review
Assignee: general → gal
Why not make all guards weak in this way?

Nit: s/weather/whether/.
If a guard checks a shape, we can't just eliminate it. The guarded expression has to be pure.
Actually the patch didn't do this. This is broken in TM tip.
Depends on: 534745
Depends on: 534749
No longer depends on: 534745
Depends on: 534745
Edwin, does Nanojit want this?
Assignee: gal → nobody
Component: JavaScript Engine → Nanojit
QA Contact: general → nanojit
Summary: TM: eliminate guards that prevent overflows in otherwise dead expressions → eliminate guards that prevent overflows in otherwise dead expressions
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.

Attachment

General

Created:
Updated:
Size: