Closed Bug 1863435 Opened 6 months ago Closed 2 months ago

Faster allocation of small GC arrays

Categories

(Core :: JavaScript: WebAssembly, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: bvisness, Assigned: bvisness)

References

Details

Attachments

(7 files, 1 obsolete file)

We currently malloc storage for all GC arrays and use instance calls for all allocations. We can speed this up using techniques like we now use for structs - some amount of inline data storage on WasmArrayObject, and a JIT allocation path for small nursery allocations.

Severity: -- → N/A
Priority: -- → P2

On arm64, breakpoints occur before the instruction pointer moves to the next instruction. Stepping from this point just triggers the breakpoint again. However, if a breakpoint occurs with code 0xf000, lldb will manually advance past the breakpoint so stepping works as expected.

This only implements the internal storage and does not allocate arrays via JIT.

Depends on D196633

Depends on D196637

We currently do the rather strange process of building stack map info
in a vector, then creating a StackMap, then copying the information over.
This is particularly strange now that we store multiple kinds of entries
in our stack maps. We always know the size of the stack map anyway, so
this patch removes the vectors and builds the information in the stack
map directly.

However, the vector did serve the helpful purpose of avoiding memory
allocation in the common case of a small StackMap with no refs, which
does not need to be stored. StackMap has therefore been updated with new
APIs to help avoid memory allocation until actually necessary.

Depends on D196638

Attachment #9369013 - Attachment description: WIP: Bug 1863435: Use better breakpoint code for arm64 → WIP: Bug 1863435: Use better breakpoint code for arm64. r=mgaudet
Attachment #9369014 - Attachment description: WIP: Bug 1863435: Implement inline data storage in gc arrays → WIP: Bug 1863435: Implement inline data storage in gc arrays. r=rhunt
Attachment #9369015 - Attachment description: WIP: Bug 1863435: JIT allocation of gc arrays via Ion → WIP: Bug 1863435: JIT allocation of gc arrays via Ion. r=rhunt,jonco
Attachment #9369016 - Attachment description: WIP: Bug 1863435: JIT allocation of gc arrays via baseline → WIP: Bug 1863435: JIT allocation of gc arrays via baseline. r=rhunt
Attachment #9369017 - Attachment description: WIP: Bug 1863435: Read and write array elements using proper scaled indexes → WIP: Bug 1863435: Read and write array elements using proper scaled indexes. r=rhunt,jseward
Attachment #9369018 - Attachment description: WIP: Bug 1863435: Make array data pointers never null → WIP: Bug 1863435: Make array data pointers never null. r=rhunt
Attachment #9369313 - Attachment description: WIP: Bug 1863435: Remove wasm::StackMapBoolVector. → WIP: Bug 1863435: Remove wasm::StackMapBoolVector. r=rhunt
See Also: → 1802287
Attachment #9369018 - Attachment is obsolete: true
Duplicate of this bug: 1802287
Attachment #9369013 - Attachment description: WIP: Bug 1863435: Use better breakpoint code for arm64. r=mgaudet → Bug 1863435: Use better breakpoint code for arm64. r=mgaudet
Attachment #9369014 - Attachment description: WIP: Bug 1863435: Implement inline data storage in gc arrays. r=rhunt → Bug 1863435: Implement inline data storage in gc arrays. r=rhunt,jonco
Attachment #9369015 - Attachment description: WIP: Bug 1863435: JIT allocation of gc arrays via Ion. r=rhunt,jonco → Bug 1863435: JIT allocation of gc arrays via Ion. r=rhunt,jonco
Attachment #9369016 - Attachment description: WIP: Bug 1863435: JIT allocation of gc arrays via baseline. r=rhunt → Bug 1863435: JIT allocation of gc arrays via baseline. r=rhunt
Attachment #9369017 - Attachment description: WIP: Bug 1863435: Read and write array elements using proper scaled indexes. r=rhunt,jseward → Bug 1863435: Read and write array elements using proper scaled indexes. r=rhunt,jseward
Attachment #9369313 - Attachment description: WIP: Bug 1863435: Remove wasm::StackMapBoolVector. r=rhunt → Bug 1863435: Remove wasm::StackMapBoolVector. r=rhunt

Zero-length arrays are disallowed by the C++ spec. The TrailingArray mixin
is a UB-free way of achieving the same data layout.

Pushed by bvisness@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a06e0e423e3d
Use better breakpoint code for arm64. r=mgaudet
https://hg.mozilla.org/integration/autoland/rev/e11d865508b4
Convert wasm struct objects to use TrailingArray. r=jonco
https://hg.mozilla.org/integration/autoland/rev/536bba21f186
Implement inline data storage in gc arrays. r=rhunt,jonco
https://hg.mozilla.org/integration/autoland/rev/0ed7433a0a3b
JIT allocation of gc arrays via Ion. r=rhunt,jonco
https://hg.mozilla.org/integration/autoland/rev/57c4fd85b686
JIT allocation of gc arrays via baseline. r=rhunt
https://hg.mozilla.org/integration/autoland/rev/63ad7de808ca
Read and write array elements using proper scaled indexes. r=rhunt,jseward
https://hg.mozilla.org/integration/autoland/rev/fcafc196f2ce
Remove wasm::StackMapBoolVector. r=rhunt
See Also: 1802287
Depends on: 1799856
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: