IonMonkey: Specialize Math.round and Math.floor with double return type

RESOLVED FIXED in mozilla27

Status

()

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jandem, Assigned: jandem)

Tracking

(Blocks: 1 bug)

unspecified
mozilla27
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 809190 [details] [diff] [review]
Patch

A double return type is pretty common: Math.round(-0.2) => -0

This patch uses callWithABI for Math.floor/Math.round with double return type.

A shell version of the test in bug 919992 improves from 920 to 617 ms.
Attachment #809190 - Flags: review?(bhackett1024)
Comment on attachment 809190 [details] [diff] [review]
Patch

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

Looks good, though I'm curious what perf would be if we had handling for rounding double -> double in inline code when the result is either an int32 double or -0 (and calling the round builtin on other doubles), I saw that pattern once before (on kraken?).
Attachment #809190 - Flags: review?(bhackett1024) → review+
(Assignee)

Comment 2

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/abfcc2be169d

(In reply to Brian Hackett (:bhackett) from comment #1)
> Looks good, though I'm curious what perf would be if we had handling for
> rounding double -> double in inline code when the result is either an int32
> double or -0 (and calling the round builtin on other doubles), I saw that
> pattern once before (on kraken?).

Yeah indeed. Bug 919992 is not gated on JS though so I went with the simplest fix for now. Some Kraken crypto tests do this, will see how much this patch helps there. If it's a noticeable win I will file a bug to inline more.
https://hg.mozilla.org/mozilla-central/rev/abfcc2be169d
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.