Closed Bug 1442544 Opened 5 years ago Closed 8 months ago
[exploration] Wasm's Offset
Guard Limit and Huge Mapped Size can potentially be much smaller
48 bytes, text/x-phabricator-request
|Details | Review|
ARM64 is configured with WASM_HUGE_MEMORY but probably does not need a 6GB+64KB reservation. This requires some in-depth investigation of the memory access instructions on the platform, but LDR, which is likely typical, essentially has two reg+imm forms, one with a signed nine-bit offset (used for preindex/postindex) and one with an unsigned twelve-bit offset. The offsets are scaled by 4 or 8, so effectively we're looking at twelve-bit signed or fifteen-bit unsigned offsets. The main effect here would be to reduce pressure on the memory mappings; that might be beneficial as some operating systems have historically had fairly low per-process limits on the combined size of the mappings. Other than that, a smaller OffsetGuardLimit would tend to move the code that folds in the offset from MacroAssembler / Assembler (where BaseIndex is resolved) and into the compiler (where we perform an add with overflow check). Since large offsets will be handled in the MacroAssembler by moving a constant to a register and then performing a register+register load (without overflow checking per se but the arithmetic is performed in a 64-bit space so this is OK) it's probably more or less a wash, performance-wise - we could investigate.
Hardware: ARM64 → All
Summary: Wasm's OffsetGuardLimit and HugeMappedSize can potentially be much smaller on ARM64 → Wasm's OffsetGuardLimit and HugeMappedSize can potentially be much smaller
Type: enhancement → task
Summary: Wasm's OffsetGuardLimit and HugeMappedSize can potentially be much smaller → [exploration] Wasm's OffsetGuardLimit and HugeMappedSize can potentially be much smaller
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/b8931400a462 wasm: Drop offset guard reservation from 2GiB to 32MiB. r=jseward
You need to log in before you can comment on or make changes to this bug.