Closed Bug 1743357 Opened 6 months ago Closed 6 months ago

Investigate "owned borrow" for ExtensibleCompilationStencil from CompilationStencil

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: arai, Assigned: arai)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

Currently, if we want to get an on-heap CompilationStencil instance from ExtensibleCompilationStencil either on-stack or on-heap, we allocate CompilationStencil on heap and then do CompilationStencil::steal.

This performs the following:

  1. copy primitive fields
  2. steal LifoAlloc instance
  3. copy on-heap vector content into LifoAlloc
  4. steal SharedDataContainer, StencilModuleMetadata, and StencilAsmJSContainer

then, "3. copy on-heap vector ..." isn't something negligible.

if CompilationStencil can own on-heap ExtensibleCompilationStencil, we can do the following instead:

  1. if the ExtensibleCompilationStencil is on stack, allocate ExtensibleCompilationStencil on heap with move ctor
  2. store the on-heap ExtensibleCompilationStencil in CompilationStencil's field with UniquePtr
  3. borrow ExtensibleCompilationStencil data from CompilationStencil, in the same way as BorrowingCompilationStencil ctor

This doesn't perform any "copy vector" thing, and can be faster

Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Blocks: 1734098
Blocks: 1742639
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/e12b7066c4e9
Part 1: Add support for owned-borrow for CompilationStencil. r=nbp
https://hg.mozilla.org/integration/autoland/rev/d47f1ad1c6ad
Part 2: Use owned-borrow CompilationStencil. r=nbp
https://hg.mozilla.org/integration/autoland/rev/86a37f4b3eea
Part 3: Remove CompilationStencil::steal. r=nbp
Severity: -- → S3
Priority: -- → P1
Severity: S3 → N/A
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
Blocks: 1743736
Regressions: 1744473
You need to log in before you can comment on or make changes to this bug.