Closed Bug 1817476 Opened 2 years ago Closed 1 year ago

Define WASM_SUPPORTS_HUGE_MEMORY for more 64-bit architectures

Categories

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

task

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: rhunt, Assigned: bvisness, NeedInfo)

References

Details

Attachments

(2 files)

WASM_SUPPORTS_HUGE_MEMORY is only enabled for two specific 64-bit architectures. I don't know of any reason this cannot be enabled for any 64-bit architecture. We should relax this for RISC-V 64, MIPS64. etc.

[1 ] https://searchfox.org/mozilla-central/source/js/src/js-config.mozbuild#10

Ben, can you take a look at this as you were in this area recently?

Assignee: nobody → ben

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:bvisness, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.

Flags: needinfo?(rhunt)
Flags: needinfo?(ben)
Flags: needinfo?(rhunt)
Flags: needinfo?(ben)

The WebAssembly engine in SpiderMonkey has the ability to remove bounds check from memory accesses by reserving a large enough region of virtual memory for each wasm memory. Internally this is called 'huge memory'.

Ben and I discovered that this was disabled for RISC-V and LoongArch64, and we don't think there is any reason that needs to be the case. I'm needinfo'ing the maintainers of these backends just in case they think there's some reason they should be excluded. The main effect on code generation is that we no longer omit bounds checks. If you don't think there's an issue, let me know and we'll land this patch to enable it on these platforms.

Flags: needinfo?(yahan)
Flags: needinfo?(zhaojiazhong-hf)

Thanks for your information, I found several jit-tests failed on loong64 with wasm huge memory, I will have a look at it.

Flags: needinfo?(zhaojiazhong-hf)
Depends on: 1826069
Attachment #9332299 - Attachment description: WIP: Bug 1817476 - [riscv64]Enable wasm huge memories → Bug 1817476 - [riscv64]Enable wasm huge memories.r=jandem
Pushed by rhunt@eqrion.net: https://hg.mozilla.org/integration/autoland/rev/9c8f07cdcc5f [riscv64]Enable wasm huge memories.r=rhunt
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: