Closed Bug 1633741 Opened 2 years ago Closed 2 years ago

Add more helpers to js::TrailingArray


(Core :: JavaScript Engine: JIT, task, P3)




Tracking Status
firefox77 --- fixed


(Reporter: tcampbell, Assigned: tcampbell)




(4 files)

The js::TrailingArray type was added to hold common helper methods for structures with complex trailing data.

There are more things to generalize:

  • Use Checked<Offset> in instances missing it
  • Add a helper for computing array length. We can overload templates that size and integer to cover the existing uses. This could assert it divides cleanly too.

Cleanup the allocation of trailing arrays to use CheckedInt and follow the
example of JitScript. Remove some static_asserts that made arrays harder to
change and instead rely on the existing MOZ_ASSERT in initElements.

Depends on D72941

This gives more readability to (end - start) / sizeof(T) computations to
cleanup the IonScript data type.

Depends on D72943

Blocks: 1633893
Attachment #9144123 - Attachment description: Bug 1633741 - Inline DefaultInitializeElements into TrailingArary. r?jandem → Bug 1633741 - Inline DefaultInitializeElements into TrailingArray. r?jandem
Pushed by
Inline DefaultInitializeElements into TrailingArray. r=jandem
Use CheckedInt for js::ImmutableScriptData. r=jandem
Use CheckedInt for js::{Runtime,Private}ScriptData. r=jandem
Add TrailingArray::numElements helper. r=jandem
Blocks: 1634167
You need to log in before you can comment on or make changes to this bug.