Closed Bug 774075 Opened 13 years ago Closed 9 months ago

IonMonkey: eliminate redundant lower bound checks

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: evilpies, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [ion:t])

Attachments

(1 file)

For code like this we currently emit three lower bound checks. var n = 0; for (var i = 0; i < (a.length - 4); i++) { n = a[i] + a[i + 1] + a[i + 2]; } We should just more or less duplicate ion::EliminateRedundantBoundsChecks for MBoundsCheckLower.
Attached patch WIPSplinter Review
Pretty straight forward, just duplicated to the logic for MBoundsCheck in EliminateRedundantBoundsChecks the pass and adopted it for MBoundsCheckLower.
Assignee: general → evilpies
Status: NEW → ASSIGNED
Blocks: IonSpeed
No longer blocks: IonMonkey
Whiteboard: [ion:t]
I think Brian changed a lot of this stuff recently. Is this useful?
Hmm, I think this could be used to eliminate checks, but MBoundsCheckLower will only be introduced when we were able to hoist a check from the loop and thus the eliminated checks will always be in loop preheaders rather than the loop body.
This could be an easy fix.
Assignee: evilpies → general
Status: ASSIGNED → NEW
Assignee: general → nobody
Severity: normal → S3

Still relevant?

ion::EliminateRedundantBoundsChecks no longer exists. It looks to me like, at least in this case, range analysis already eliminates two of the three bounds checks. Combined with Brian's observation (which still seems to be true) that we only get these lower bounds checks when hoisting code outside of hot inner loops, and the general riskiness of messing around with bounds checks (from a security bug perspective), I think we can close this.

Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: