IonMonkey: handle x[v + i] during bounds check hoisting

NEW
Unassigned

Status

()

Core
JavaScript Engine
5 years ago
3 years ago

People

(Reporter: bhackett, Unassigned)

Tracking

(Blocks: 2 bugs)

Other Branch
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [ion:t])

Attachments

(1 obsolete attachment)

(Reporter)

Description

5 years ago
Bounds check hoisting currently fails for accesses of the form x[v + i], when x and v are loop invariant.  Array traversals in autoranslated code will look like this, rather than the usual x[i], as x is a big typed array and v is the base address of some allocated subarray of x.
(Reporter)

Comment 1

5 years ago
Created attachment 639994 [details] [diff] [review]
patch
Assignee: general → bhackett1024
Attachment #639994 - Flags: review?(dvander)
Blocks: 650180
Comment on attachment 639994 [details] [diff] [review]
patch

Review of attachment 639994 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/ion/LICM.cpp
@@ +465,5 @@
>  
> +    // Check if lhs in the conditional matches the bounds check index, in
> +    // either the form (lhs + indexN) or (lhs + extra + indexN) for loop
> +    // invariant extra. The latter pattern is important for JS translated from
> +    // C/C++, where the accessed array is a giant typed array and y indicates

What does "y" refer to in this comment?

@@ +504,2 @@
>          return;
> +    } while (0);

Please separate out the above block into a separate function, since tryHoistBoundsCheck is getting pretty long.
Attachment #639994 - Flags: review?(dvander) → review+
(Reporter)

Updated

5 years ago
Attachment #639994 - Attachment is obsolete: true
Attachment #639994 - Flags: review+
(Reporter)

Updated

5 years ago
Assignee: bhackett1024 → general
Whiteboard: [ion:t]
(Assignee)

Updated

3 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.