Provide a public API to allocate the underlying buffer for InstantiationStorage off-main-thread
Categories
(Core :: JavaScript Engine, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox117 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
Details
Attachments
(4 files)
The current off-thread API allocates vectors in CompilationGCOutput
(JS::InstantiationStorage
) and passes it to the main-thread via JS::FinishOffThreadStencil
out-parameter.
The equivalent needs to be supported for JS::FrontendContext
API, but without requiring tracing.
Possible solution would be the following:
- Add
Vector::reserve
variant that receives raw buffer and use it if it needs to allocate memory - Add a struct that holds the raw buffers
- Add public API that returns the new struct, reserved for the script data and scope data
- Add public API that moves the new struct's buffer to
JS::InstantiationStorage
Assignee | ||
Comment 1•2 years ago
|
||
actually, we don't need to use Vector
.
in all cases, the size of the collection is known at the beginning of the instantiation, and it doesn't change.
we can use raw buffer instead.
Assignee | ||
Comment 2•2 years ago
|
||
Also, JS::InstantiationStorage
doesn't have to wrap CompilationGCOutput
, but it need to wrap the underlying buffer by the new struct.
Assignee | ||
Comment 3•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D183459
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D183460
Assignee | ||
Comment 6•2 years ago
|
||
Depends on D183461
Comment 8•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/aed4882e9850
https://hg.mozilla.org/mozilla-central/rev/8cece5c78d43
https://hg.mozilla.org/mozilla-central/rev/b836986e6f89
https://hg.mozilla.org/mozilla-central/rev/65de67ceb4f8
Description
•