Closed Bug 1922981 Opened 1 year ago Closed 1 year ago

Portable Baseline: upstream enhancements from Bytecode Alliance tree

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: cfallin, Assigned: cfallin)

References

Details

Attachments

(39 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

This bug tracks upstreaming of a bunch of enhancements that I've made in our mozilla-central tree in Bytecode Alliance to the Portable Baseline tier as a result of AOT JS compilation work.

Assignee: nobody → chris
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

These patches correspond roughly to this PR, minus a bit of additional perf work that I'll include with subsequent patches. Two additional bugs with patchsets will be coming later: ahead-of-time ICs, and (fairly minimal) alternative macro definitions for using weval intrinsics, corresponding to this and this PR, respectively. Happy to talk further to give whatever context is needed!

Blocks: 1855321
Severity: -- → N/A
Priority: -- → P3

Here's a clean try run of all PBL-related builds.

(I see mozilla-central is under a freeze till Oct 28, per Lando; I'll plan to land these patches then.)

Pushed by chris@cfallin.org: https://hg.mozilla.org/integration/autoland/rev/24392001f2ff part 1 / 39: PBL: store explicit unwinding FP in stack state. r=jandem https://hg.mozilla.org/integration/autoland/rev/f515f9e3de50 part 2 / 39: PBL: switch to setInterpreterFieldsForPrologue when pushing a frame (slightly more efficient). r=jandem https://hg.mozilla.org/integration/autoland/rev/d02c608be41d part 3 / 39: PBL: extra tracing on exit-frame push, for debugging. r=jandem https://hg.mozilla.org/integration/autoland/rev/39d33d85af51 part 4 / 39: PBL: move CacheIRReader into ICInterpretOps. r=jandem https://hg.mozilla.org/integration/autoland/rev/9d7f1fd6abf8 part 5 / 39: PBL: add config options for computed goto dispatch, interrupt checks and coverage accounting. r=jandem https://hg.mozilla.org/integration/autoland/rev/4665ed76d114 part 6 / 39: PBL: use FAIL_IC() macro. r=jandem https://hg.mozilla.org/integration/autoland/rev/20439cddd679 part 7 / 39: PBL: switch ICs to a bundled ICCtx state input. r=jandem https://hg.mozilla.org/integration/autoland/rev/cb19774187c2 part 8 / 39: PBL: fix PREDICT_NEXT: actually set the cacheop. r=jandem https://hg.mozilla.org/integration/autoland/rev/c56200677d6a part 9 / 39: PBL: wrap IC register accesses in macros. r=jandem https://hg.mozilla.org/integration/autoland/rev/0c67e51a1b88 part 10 / 39: PBL: cache stubInfo in IC interpreter. r=jandem https://hg.mozilla.org/integration/autoland/rev/da5bb3f58204 part 11 / 39: PBL: cache cstub in IC interpreter. r=jandem https://hg.mozilla.org/integration/autoland/rev/df37447f85cd part 12 / 39: PBL: keep tags explicitly (separated from unboxed values) in IC interpreter. r=jandem https://hg.mozilla.org/integration/autoland/rev/2c9e84ba3f35 part 13 / 39: PBL: split out SpreadCall ICs (do not share with Call). r=jandem https://hg.mozilla.org/integration/autoland/rev/c7861b2c10ce part 14 / 39: PBL: rename Typeof to TypeOf in IC macros, to match other parts of codebase. r=jandem https://hg.mozilla.org/integration/autoland/rev/dd198b304c31 part 15 / 39: PBL: return actual return value from ICs, using magic sentinel to signal errors in-band. r=jandem https://hg.mozilla.org/integration/autoland/rev/3698acfedaa6 part 16 / 39: PBL: switch IC signature to pass arg0/arg1 and stub as regular args. r=jandem https://hg.mozilla.org/integration/autoland/rev/325d14fad0f7 part 17 / 39: PBL: do not carry PC into VMFrame; set it in baseline frame when invoking an IC. r=jandem https://hg.mozilla.org/integration/autoland/rev/15058abcf799 part 18 / 39: PBL: make ICs tail-call rather than using an outer loop at IC site. r=jandem https://hg.mozilla.org/integration/autoland/rev/88c57d015ccd part 19 / 39: PBL: add some new cache-op implementations. r=jandem https://hg.mozilla.org/integration/autoland/rev/039238121cc6 part 20 / 39: PBL: add remainder of CacheOps used by Octane. r=jandem https://hg.mozilla.org/integration/autoland/rev/1cd6c76dc1eb part 21 / 39: PBL: switch to uniform indirect-call interface to all ICs including fallbacks. r=jandem https://hg.mozilla.org/integration/autoland/rev/44bdf426899e part 22 / 39: PBL: restarts in main interpreter function, to allow for fastpath/slowpath specializations. r=jandem https://hg.mozilla.org/integration/autoland/rev/da868bd3e22d part 23 / 39: PBL: fix clang-format with labels on block starts by using empty statements (;). r=jandem https://hg.mozilla.org/integration/autoland/rev/8be250297b57 part 24 / 39: PBL: support constructor and arg-underflow calls in ICs. r=jandem https://hg.mozilla.org/integration/autoland/rev/111d8d00980c part 25 / 39: PBL: add implementations of CallScriptedGetter/Setter and CallBoundScriptedFunction. r=jandem https://hg.mozilla.org/integration/autoland/rev/33315e7f69e9 part 26 / 39: PBL: replace raw stack accesses in JS interpreter with macros. r=jandem https://hg.mozilla.org/integration/autoland/rev/072e3809b58f part 27 / 39: PBL: switch to using script local in frame rather than explicit local rooted value. r=jandem https://hg.mozilla.org/integration/autoland/rev/7a413af98134 part 28 / 39: PBL: use stack manager in ctx; and make stack init decrement sp only once. r=jandem https://hg.mozilla.org/integration/autoland/rev/2a378d9c1015 part 29 / 39: PBL: make hybrid-ICs setting template-specializable, and define a default that we will configure later. r=jandem https://hg.mozilla.org/integration/autoland/rev/fcfa2f52b561 part 30 / 39: PBL: update some hybrid ICs logic. r=jandem https://hg.mozilla.org/integration/autoland/rev/19568232b5fb part 31 / 39: PBL: exclude async/generator functions entirely (they cannot resume anyway). r=jandem https://hg.mozilla.org/integration/autoland/rev/a325b671fdad part 32 / 39: PBL: miscellaneous changes from overall diff. r=jandem https://hg.mozilla.org/integration/autoland/rev/0ad2da72931c part 33 / 39: PBL: cache icEntry in local. r=jandem https://hg.mozilla.org/integration/autoland/rev/a697dcea2b4a part 34 / 39: PBL: put PC updates behind a macro to allow for related state to update. r=jandem https://hg.mozilla.org/integration/autoland/rev/b5d33aec040b part 35 / 39: PBL: modify GetElem hybrid IC impl a bit. r=jandem https://hg.mozilla.org/integration/autoland/rev/3e8cbbf6cde4 part 36 / 39: PBL: avoid call fastpath when constructing with a non-constructor. r=jandem https://hg.mozilla.org/integration/autoland/rev/96c933c4a6b4 part 37 / 39: PBL: cache resumeOffsets and argsObjAliasesFormals. r=jandem https://hg.mozilla.org/integration/autoland/rev/84a7084ddb01 part 38 / 39: PBL: remove redundant isd update. r=jandem https://hg.mozilla.org/integration/autoland/rev/78570d4daeb3 part 39 / 39: PBL: adjust some ops to use macros for locals. r=jandem https://hg.mozilla.org/integration/autoland/rev/fe5bd85dc88a apply code formatting via Lando
Regressions: 1927520

Backed out for causing js::pbl::GetPortableFallbackStub(js::jit::BaselineICFallbackKind related Linux build bustages

Flags: needinfo?(chris)

Sorry about that! I Lando's a patch on the regression bug 1927520, but with the backout here I'll get a clean try-run to verify then lando this plus the fix atomically.

Flags: needinfo?(chris)

Here's a clean try run of this patchset plus bug 1927520, with PBL and non-PBL builds of SpiderMonkey (native and WASI), as well as full Gecko. Will now attempt a re-land.

Pushed by chris@cfallin.org: https://hg.mozilla.org/integration/autoland/rev/a1efa3ece133 part 1 / 39: PBL: store explicit unwinding FP in stack state. r=jandem https://hg.mozilla.org/integration/autoland/rev/f5307a014e97 part 2 / 39: PBL: switch to setInterpreterFieldsForPrologue when pushing a frame (slightly more efficient). r=jandem https://hg.mozilla.org/integration/autoland/rev/bc4dd73a68d6 part 3 / 39: PBL: extra tracing on exit-frame push, for debugging. r=jandem https://hg.mozilla.org/integration/autoland/rev/3979bfd4ef07 part 4 / 39: PBL: move CacheIRReader into ICInterpretOps. r=jandem https://hg.mozilla.org/integration/autoland/rev/679022bfd0ad part 5 / 39: PBL: add config options for computed goto dispatch, interrupt checks and coverage accounting. r=jandem https://hg.mozilla.org/integration/autoland/rev/1195697a2ec9 part 6 / 39: PBL: use FAIL_IC() macro. r=jandem https://hg.mozilla.org/integration/autoland/rev/0297d18ecf43 part 7 / 39: PBL: switch ICs to a bundled ICCtx state input. r=jandem https://hg.mozilla.org/integration/autoland/rev/dacb88d92a66 part 8 / 39: PBL: fix PREDICT_NEXT: actually set the cacheop. r=jandem https://hg.mozilla.org/integration/autoland/rev/66446f8e0700 part 9 / 39: PBL: wrap IC register accesses in macros. r=jandem https://hg.mozilla.org/integration/autoland/rev/e16d9bc25ccf part 10 / 39: PBL: cache stubInfo in IC interpreter. r=jandem https://hg.mozilla.org/integration/autoland/rev/fb5e07b3c185 part 11 / 39: PBL: cache cstub in IC interpreter. r=jandem https://hg.mozilla.org/integration/autoland/rev/dd9825db5c99 part 12 / 39: PBL: keep tags explicitly (separated from unboxed values) in IC interpreter. r=jandem https://hg.mozilla.org/integration/autoland/rev/5dc731cb0075 part 13 / 39: PBL: split out SpreadCall ICs (do not share with Call). r=jandem https://hg.mozilla.org/integration/autoland/rev/4162c095a8eb part 14 / 39: PBL: rename Typeof to TypeOf in IC macros, to match other parts of codebase. r=jandem https://hg.mozilla.org/integration/autoland/rev/15d3f559c1c5 part 15 / 39: PBL: return actual return value from ICs, using magic sentinel to signal errors in-band. r=jandem https://hg.mozilla.org/integration/autoland/rev/cc45431be76f part 16 / 39: PBL: switch IC signature to pass arg0/arg1 and stub as regular args. r=jandem https://hg.mozilla.org/integration/autoland/rev/13e3c40520df part 17 / 39: PBL: do not carry PC into VMFrame; set it in baseline frame when invoking an IC. r=jandem https://hg.mozilla.org/integration/autoland/rev/3f781942562c part 18 / 39: PBL: make ICs tail-call rather than using an outer loop at IC site. r=jandem https://hg.mozilla.org/integration/autoland/rev/7a0574d9c6ae part 19 / 39: PBL: add some new cache-op implementations. r=jandem https://hg.mozilla.org/integration/autoland/rev/be2a9f87bc93 part 20 / 39: PBL: add remainder of CacheOps used by Octane. r=jandem https://hg.mozilla.org/integration/autoland/rev/f478cd0c125d part 21 / 39: PBL: switch to uniform indirect-call interface to all ICs including fallbacks. r=jandem https://hg.mozilla.org/integration/autoland/rev/f945855aec96 part 22 / 39: PBL: restarts in main interpreter function, to allow for fastpath/slowpath specializations. r=jandem https://hg.mozilla.org/integration/autoland/rev/c2c1d293aac0 part 23 / 39: PBL: fix clang-format with labels on block starts by using empty statements (;). r=jandem https://hg.mozilla.org/integration/autoland/rev/197debe2b3c1 part 24 / 39: PBL: support constructor and arg-underflow calls in ICs. r=jandem https://hg.mozilla.org/integration/autoland/rev/a2013be7569e part 25 / 39: PBL: add implementations of CallScriptedGetter/Setter and CallBoundScriptedFunction. r=jandem https://hg.mozilla.org/integration/autoland/rev/315cd1400a6d part 26 / 39: PBL: replace raw stack accesses in JS interpreter with macros. r=jandem https://hg.mozilla.org/integration/autoland/rev/89ab1137ee33 part 27 / 39: PBL: switch to using script local in frame rather than explicit local rooted value. r=jandem https://hg.mozilla.org/integration/autoland/rev/11f049c90890 part 28 / 39: PBL: use stack manager in ctx; and make stack init decrement sp only once. r=jandem https://hg.mozilla.org/integration/autoland/rev/2c2e41fb6786 part 29 / 39: PBL: make hybrid-ICs setting template-specializable, and define a default that we will configure later. r=jandem https://hg.mozilla.org/integration/autoland/rev/f70a59d028fe part 30 / 39: PBL: update some hybrid ICs logic. r=jandem https://hg.mozilla.org/integration/autoland/rev/e5c3fa528adc part 31 / 39: PBL: exclude async/generator functions entirely (they cannot resume anyway). r=jandem https://hg.mozilla.org/integration/autoland/rev/4d77deacf293 part 32 / 39: PBL: miscellaneous changes from overall diff. r=jandem https://hg.mozilla.org/integration/autoland/rev/1bac23e61cb0 part 33 / 39: PBL: cache icEntry in local. r=jandem https://hg.mozilla.org/integration/autoland/rev/3a4309907aea part 34 / 39: PBL: put PC updates behind a macro to allow for related state to update. r=jandem https://hg.mozilla.org/integration/autoland/rev/5b1933d6b877 part 35 / 39: PBL: modify GetElem hybrid IC impl a bit. r=jandem https://hg.mozilla.org/integration/autoland/rev/155704edc7cd part 36 / 39: PBL: avoid call fastpath when constructing with a non-constructor. r=jandem https://hg.mozilla.org/integration/autoland/rev/8ed18a0c7c2d part 37 / 39: PBL: cache resumeOffsets and argsObjAliasesFormals. r=jandem https://hg.mozilla.org/integration/autoland/rev/594591ca88d2 part 38 / 39: PBL: remove redundant isd update. r=jandem https://hg.mozilla.org/integration/autoland/rev/9b5c776a1eaa part 39 / 39: PBL: adjust some ops to use macros for locals. r=jandem https://hg.mozilla.org/integration/autoland/rev/55ce0c50d8f2 1927520: apply code formatting via Lando

https://hg.mozilla.org/mozilla-central/rev/a1efa3ece133
https://hg.mozilla.org/mozilla-central/rev/f5307a014e97
https://hg.mozilla.org/mozilla-central/rev/bc4dd73a68d6
https://hg.mozilla.org/mozilla-central/rev/3979bfd4ef07
https://hg.mozilla.org/mozilla-central/rev/679022bfd0ad
https://hg.mozilla.org/mozilla-central/rev/1195697a2ec9
https://hg.mozilla.org/mozilla-central/rev/0297d18ecf43
https://hg.mozilla.org/mozilla-central/rev/dacb88d92a66
https://hg.mozilla.org/mozilla-central/rev/66446f8e0700
https://hg.mozilla.org/mozilla-central/rev/e16d9bc25ccf
https://hg.mozilla.org/mozilla-central/rev/fb5e07b3c185
https://hg.mozilla.org/mozilla-central/rev/dd9825db5c99
https://hg.mozilla.org/mozilla-central/rev/5dc731cb0075
https://hg.mozilla.org/mozilla-central/rev/4162c095a8eb
https://hg.mozilla.org/mozilla-central/rev/15d3f559c1c5
https://hg.mozilla.org/mozilla-central/rev/cc45431be76f
https://hg.mozilla.org/mozilla-central/rev/13e3c40520df
https://hg.mozilla.org/mozilla-central/rev/3f781942562c
https://hg.mozilla.org/mozilla-central/rev/7a0574d9c6ae
https://hg.mozilla.org/mozilla-central/rev/be2a9f87bc93
https://hg.mozilla.org/mozilla-central/rev/f478cd0c125d
https://hg.mozilla.org/mozilla-central/rev/f945855aec96
https://hg.mozilla.org/mozilla-central/rev/c2c1d293aac0
https://hg.mozilla.org/mozilla-central/rev/197debe2b3c1
https://hg.mozilla.org/mozilla-central/rev/a2013be7569e
https://hg.mozilla.org/mozilla-central/rev/315cd1400a6d
https://hg.mozilla.org/mozilla-central/rev/89ab1137ee33
https://hg.mozilla.org/mozilla-central/rev/11f049c90890
https://hg.mozilla.org/mozilla-central/rev/2c2e41fb6786
https://hg.mozilla.org/mozilla-central/rev/f70a59d028fe
https://hg.mozilla.org/mozilla-central/rev/e5c3fa528adc
https://hg.mozilla.org/mozilla-central/rev/4d77deacf293
https://hg.mozilla.org/mozilla-central/rev/1bac23e61cb0
https://hg.mozilla.org/mozilla-central/rev/3a4309907aea
https://hg.mozilla.org/mozilla-central/rev/5b1933d6b877
https://hg.mozilla.org/mozilla-central/rev/155704edc7cd
https://hg.mozilla.org/mozilla-central/rev/8ed18a0c7c2d
https://hg.mozilla.org/mozilla-central/rev/594591ca88d2
https://hg.mozilla.org/mozilla-central/rev/9b5c776a1eaa
https://hg.mozilla.org/mozilla-central/rev/55ce0c50d8f2

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch

Jan, is there something worth mentioning in our release notes for this landing? Thanks

Flags: needinfo?(jdemooij)

(In reply to Pascal Chevrel:pascalc from comment #49)

Jan, is there something worth mentioning in our release notes for this landing? Thanks

No because this isn't code we're building or using in Firefox (at this point).

Flags: needinfo?(jdemooij)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: