Closed Bug 1802497 Opened 2 years ago Closed 2 years ago

Inline Number.prototype.toString when an explicit base argument is present

Categories

(Core :: JavaScript Engine: JIT, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

Number.prototype.toString is currently only inlined when no base argument is present. Supporting the case when base is present saves about 2'300'000 VM calls in JetStream2 (most calls are from the "string-unpack-code-SP" sub-benchmark) and 950'000 calls in Speedometer2.

The next part adds a new cpp-file, which changes unified bundles. Without this
change we'll then get a "visibility does not match previous declaratio" error.

Depends on D163093

This makes it easier to reuse this struct in part 4.

Depends on D163094

Add unsigned, high-word, 32-bit multiplication in preparation for the next part.

Depends on D163095

A constant base argument is the most common case, so optimise this case even further.

Depends on D163096

Supporting this case saves about 2'300'000 VM calls in JetStream2 and
950'000 VM calls in Speedometer2.

The new Int32ToStringWithBaseResult CacheIR op is transpiled into the two MIR
instructions MGuardInt32Range and MInt32ToStringWithBase. In most cases the
base argument is a constant, which enables to fold MGuardInt32Range away and
also allows to make MInt32ToStringWithBase a non-guard instruction.

Depends on D163097

Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/e6ef9da4fc75 Part 1: Add missing MOZ_EXPORT for ARM simulator functions. r=jandem https://hg.mozilla.org/integration/autoland/rev/6127b176c167 Part 2: Move ReciprocalMulConstants into a separate file. r=jandem https://hg.mozilla.org/integration/autoland/rev/0779bc41e5cb Part 3: Add MacroAssembler::mulhu32(). r=jandem https://hg.mozilla.org/integration/autoland/rev/bc80bb7696b9 Part 4: Add MacroAssembler method for int32 to string conversion with base. r=jandem https://hg.mozilla.org/integration/autoland/rev/27a6631f4fa2 Part 5: Inline Number.prototype.toString when an explicit "base" argument is present. r=jandem

Thanks. Just a simple unified build issue.

Flags: needinfo?(andrebargull)
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/a03d2f77f487 Part 1: Add missing MOZ_EXPORT for ARM simulator functions. r=jandem https://hg.mozilla.org/integration/autoland/rev/cb0c2d593207 Part 2: Move ReciprocalMulConstants into a separate file. r=jandem https://hg.mozilla.org/integration/autoland/rev/9d73d3ace1c9 Part 3: Add MacroAssembler::mulhu32(). r=jandem https://hg.mozilla.org/integration/autoland/rev/b82f4d2c161d Part 4: Add MacroAssembler method for int32 to string conversion with base. r=jandem https://hg.mozilla.org/integration/autoland/rev/1c95cd727056 Part 5: Inline Number.prototype.toString when an explicit "base" argument is present. r=jandem
Severity: -- → N/A
Priority: -- → P1
Regressions: 1803539
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: