Closed Bug 1633741 Opened 3 months ago Closed 3 months ago

Add more helpers to js::TrailingArray

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(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 tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/41aa6a9b67e1
Inline DefaultInitializeElements into TrailingArray. r=jandem
https://hg.mozilla.org/integration/autoland/rev/666f5f689c8a
Use CheckedInt for js::ImmutableScriptData. r=jandem
https://hg.mozilla.org/integration/autoland/rev/04b81c9f1986
Use CheckedInt for js::{Runtime,Private}ScriptData. r=jandem
https://hg.mozilla.org/integration/autoland/rev/6fae33988db5
Add TrailingArray::numElements helper. r=jandem
Blocks: 1634167
You need to log in before you can comment on or make changes to this bug.