Closed Bug 1633425 Opened 9 months ago Closed 9 months ago

Cleanup the IonScript data structure

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(6 files)

This is a complex data structure with ten different trailing arrays. We can clean it up similar to what we did for ImmutableScriptData.

  • Introduce a js::TrailingArray mixin class to share the offsetToPointer related helpers.
  • Cleanup IonScript using this.
  • Add CodegenSafepointIndex to avoid wasted space in SafepointIndex that is stored in the IonScript. This also simplifies the code.

This saves 8-bytes per SafepointIndex and 32-bytes per IonScript.

This is used during codegen only so we can simplify the SafepointIndex that
is stored in the IonScript. The resolve method is replaced by a constructor
from CodegenSafepointIndex to SafepointIndex.

This type is a mixin with helper methods for casting and initializing arrays
that follow a struct in the same allocation. Use this for existing JitScript,
PrivateScriptData, RuntimeScriptData, ImmutableScriptData types.

Depends on D72671

Also initialize more of the required fields in the constructor directly
instead of the New method.

Depends on D72672

Order the trailing arrays by descending alignment requirements and use a
similar approach to JitScript for computing sizes and initializing.

Depends on D72673

Use helper methods to access the size and length of each trailing array.
We shave 40 bytes off each IonScript by using the difference between two
arrays to compute size rather than storing a dedicated size field.

Depends on D72674

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cfb27a4b9c64
Add js::jit::CodegenSafepointIndex type. r=jandem
https://hg.mozilla.org/integration/autoland/rev/e09970404687
Add js::TrailingArray type for script data structures. r=jandem
https://hg.mozilla.org/integration/autoland/rev/b73154f817cd
Use field initializers for js::jit::IonScript. r=jandem
https://hg.mozilla.org/integration/autoland/rev/6158f69d21c7
Reorder IonScript arrays to avoid padding. r=jandem
https://hg.mozilla.org/integration/autoland/rev/5d3704bf89d5
Use offsets to delimit arrays in IonScript. r=jandem
https://hg.mozilla.org/integration/autoland/rev/338977019069
Cleanup IonScript parameter name mismatches. r=jandem
Blocks: 1633741
You need to log in before you can comment on or make changes to this bug.