Open Bug 1442544 Opened 2 years ago Updated Last month
Guard Limit and Huge Mapped Size can potentially be much smaller on ARM64
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.
You need to log in before you can comment on or make changes to this bug.