Closed Bug 1431096 Opened 6 years ago Closed 6 years ago

Add index masking when loading int/unit strings

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
These are power-of-two constants and that's nice because it means we only have to and32() the index after the branch. The patch adds MacroAssembler::boundsCheck32PowerOfTwo for this.
Attachment #8943263 - Flags: review?(nicolas.b.pierron)
Comment on attachment 8943263 [details] [diff] [review]
Patch

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

::: js/src/jit/MacroAssembler.cpp
@@ +3484,5 @@
>  
> +void
> +MacroAssembler::boundsCheck32PowerOfTwo(Register index, uint32_t length, Label* failure)
> +{
> +    MOZ_ASSERT(mozilla::IsPowerOfTwo(length));

Thanks!
Attachment #8943263 - Flags: review?(nicolas.b.pierron) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/01f9f3fdc1f9
Use Spectre index masking when loading int/unit strings. r=nbp
https://hg.mozilla.org/mozilla-central/rev/01f9f3fdc1f9
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: