Add inline code paths for js-string:cast and js-string:test
Categories
(Core :: JavaScript: WebAssembly, task, P2)
Tracking
()
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.
Assignee | ||
Comment 1•6 months ago
|
||
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.
Assignee | ||
Comment 2•6 months ago
|
||
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.
Updated•6 months ago
|
Assignee | ||
Comment 3•5 months ago
|
||
Changing title to reflect the patch I want to land.
Comment 5•5 months ago
|
||
bugherder |
Description
•