Closed Bug 1977854 Opened 1 year ago Closed 9 months ago

Initial implementation of wasm custom page sizes

Categories

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

task

Tracking

()

RESOLVED FIXED
148 Branch
Tracking Status
firefox148 --- fixed

People

(Reporter: wingo, Assigned: wingo)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(12 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

Working bug for implementation of custom page sizes.

Assignee: nobody → wingo
Status: NEW → ASSIGNED

This will free up the name wasm::PageSize, to allow us to represent tiny
pages.

No more public constructors for wasm::Pages; instead there are static
methods. Leads to lots of PageSize::Standard everywhere; with custom
page sizes, these sizes will come from the memory descriptor.

Also add an assert to bounds-check elimination for the time being.

Severity: -- → N/A
Priority: -- → P3
Attachment #9501326 - Attachment description: Bug 1977854 - Wasm custom page sizes part 2: decoding of page sizes. r=rhunt → Bug 1977854 - Wasm custom page sizes part 2: decoding of page sizes. r=rhunt

Supporting tiny page sizes requires a number of changes to Wasm memory
allocation and bounds checks:

  • Memories with tiny page size are allocated to the closest system page
    size.
  • Bounds have granularity smaller than the page size, so guard pages
    cannot be used, so offsets must always be checked.
  • Similarly, access size must be accounted for. We handle this by
    storing a bounds check limit for each access size.
  • Tiny page sizes disable huge memory, and also prevent bounds
    check elimination.

Tiny pages are unsupported in Ion in this commit.

This is needed for custom page sizes proposal abbreviation syntax for memories.
Updating this removes the need for the unicode-width patch, so that is removed
as well. Also updates wasm-smith dependency in gluesmith in order to avoid
dependency duplication.

This change also affects how some custom page size tests are parsed, which is
why this commit also modifies some of those tests.

Attachment #9517931 - Attachment description: WIP: Bug 1977854 - Wasm custom page sizes part 4: add import check for page size → Bug 1977854 - Wasm custom page sizes part 4: add import check for page size
Attachment #9517930 - Attachment description: WIP: Bug 1977854 - Wasm custom page sizes part 3: initial support for tiny pages in Baseline → Bug 1977854 - Wasm custom page sizes part 3: initial support for tiny pages in Baseline
Attachment #9517932 - Attachment description: WIP: Bug 1977854 - Wasm custom page sizes part 5: update wast to 0.225.0 from 0.219.0 → Bug 1977854 - Wasm custom page sizes part 5: update wast to 0.225.0 from 0.219.0
Attachment #9517933 - Attachment description: WIP: Bug 1977854 - Wasm custom page sizes part 6: add spec tests from proposal → Bug 1977854 - Wasm custom page sizes part 6: add spec tests from proposal
Attachment #9501321 - Attachment description: Bug 1977854 - Add PageSize enum type, use it to define StandardPageSize r=rhunt → Bug 1977854 - Add PageSize enum type, use it to define StandardPageSizeBytes r=rhunt
Pushed by bvisness@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5b01474e6d9b https://hg.mozilla.org/integration/autoland/rev/1fbbf046370a Remove a couple page-size-related definitions. r=rhunt,bvisness https://github.com/mozilla-firefox/firefox/commit/8823c6f33424 https://hg.mozilla.org/integration/autoland/rev/e05626dc99c8 Rename wasm::PageSize to wasm::StandardPageSize r=rhunt,bvisness https://github.com/mozilla-firefox/firefox/commit/e5f94075691d https://hg.mozilla.org/integration/autoland/rev/f1b4e02fb916 Add PageSize enum type, use it to define StandardPageSizeBytes r=rhunt,bvisness https://github.com/mozilla-firefox/firefox/commit/5fca0dd3b214 https://hg.mozilla.org/integration/autoland/rev/115b6310b494 Add PageSize to wasm::Pages. r=rhunt,bvisness https://github.com/mozilla-firefox/firefox/commit/f49212e6d506 https://hg.mozilla.org/integration/autoland/rev/df83ffaa9ee8 Add PageSize to wasm::Limits. r=rhunt,bvisness https://github.com/mozilla-firefox/firefox/commit/f77375ba41ac https://hg.mozilla.org/integration/autoland/rev/871a99fd0ee0 Add PageSize to array buffers. r=rhunt,bvisness https://github.com/mozilla-firefox/firefox/commit/338cdae51c4d https://hg.mozilla.org/integration/autoland/rev/176c533fb8f0 Wasm custom page sizes part 1: add flag/config. r=rhunt,bvisness https://github.com/mozilla-firefox/firefox/commit/a548794c3bff https://hg.mozilla.org/integration/autoland/rev/3528291711dc Wasm custom page sizes part 2: decoding of page sizes. r=rhunt,bvisness https://github.com/mozilla-firefox/firefox/commit/7950242da0f6 https://hg.mozilla.org/integration/autoland/rev/d4db9613d1b1 Wasm custom page sizes part 3: initial support for tiny pages in Baseline r=bvisness https://github.com/mozilla-firefox/firefox/commit/f9df4b9ecac2 https://hg.mozilla.org/integration/autoland/rev/674c9ce5649f Wasm custom page sizes part 4: add import check for page size r=rhunt,bvisness https://github.com/mozilla-firefox/firefox/commit/8e1c3e467481 https://hg.mozilla.org/integration/autoland/rev/9652ca25eaf3 Wasm custom page sizes part 5: update wast to 0.225.0 from 0.219.0 r=rhunt,supply-chain-reviewers,bvisness https://github.com/mozilla-firefox/firefox/commit/14e953f61591 https://hg.mozilla.org/integration/autoland/rev/9e859347ff12 Wasm custom page sizes part 6: add spec tests from proposal r=rhunt,bvisness
Regressions: 2005350
Regressions: 2006119
QA Whiteboard: [qa-triage-done-c149/b148]
Regressions: 2010402
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: