Closed Bug 1876154 Opened 1 year ago Closed 5 months ago

Add inline code paths for js-string:cast and js-string:test

Categories

(Core :: JavaScript: WebAssembly, task, P2)

task

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: rhunt, Assigned: rhunt)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The whole point of the proposal is to allow emitting inline code for these operations. Right now we just do instance method calls. We should fix this, at least for charCodeAt but probably others too.

Looking at the Google Sheets calc worker, I see they are importing the following:

  (import "wasm:js-string" "fromCharCodeArray" (func (;139;) (type 5544)))
  (import "wasm:js-string" "fromCodePoint" (func (;140;) (type 5545)))
  (import "wasm:js-string" "concat" (func (;141;) (type 5546)))
  (import "wasm:js-string" "intoCharCodeArray" (func (;142;) (type 5547)))
  (import "wasm:js-string" "equals" (func (;143;) (type 5516)))
  (import "wasm:js-string" "compare" (func (;144;) (type 5516)))
  (import "wasm:js-string" "length" (func (;145;) (type 5513)))
  (import "wasm:js-string" "charCodeAt" (func (;146;) (type 5521)))
  (import "wasm:js-string" "substring" (func (;147;) (type 5548)))

Of these, equals, length and charCodeAt are the hottest and easiest to implement an inline path for. compare is also up there.

First step to inline code generation is recognizing a call to an
import with builtins enabled as actually being a call to a builtin
that can be optimized. This commit does this by delegating these
calls to the builtin machinery. A second step will be to expand
the builtin machinery to do inline code generation.

The meaningful change is that a call to a builtin went from:
  - import call -> builtin func -> instance method func
  - import call -> instance method func

The test for js-string-builtins was tweaked to exercise this path.
Assignee: nobody → rhunt
Status: NEW → ASSIGNED

Changing title to reflect the patch I want to land.

Summary: Add inline code paths for js-string-builtins → Add inline code paths for js-string:cast and js-string:test
Pushed by rhunt@eqrion.net: https://hg.mozilla.org/integration/autoland/rev/f0fa6e8dc5f0 wasm: Recognize calls to builtin imports, add inline path for cast/test. r=yury
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: