Make ObjLiteralStencil initialization in BytecodeEmitter more robust
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: tcampbell, Assigned: arai)
References
Details
Attachments
(1 file)
As pointed out in Bug 1657353 review process, the filling in the ObjLiteralStencil
in-place in the compilationInfo is a bit of a footgun if there ever was a resize of the vector. Refactoring the code so that compilationInfo isn't available to the parts filling in the stencil would help here.
Another option would be to build on stack and then move to the array, but the ObjLiteralStencil
is ~224B right now so this isn't very ideal.
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
To achieve bug 1678449, ObjLiteralStencil
shouldn't contain Vector
:
- use stack-allocated
ObjLiteralWriter
when emitting object - when putting it into stencil, copy the code into
LifoAlloc
, and put the pointer intoObjLiteralStencil
, withSpan
it will solve this bug at the same time.
Assignee | ||
Comment 2•4 years ago
|
||
ObjLiteralStencil doesn't have to be writable, and the cost of Vector handling
is problematic when decoding.
Decoupled ObjLiteralWriter from ObjLiteralStencil and now ObjLiteralStencil
has a Span that points memory block inside LifoAlloc.
While compiling, the data is copied from ObjLiteralWriter's Vector to LifoAlloc,
and while decoding, the memory is copied from XDR buffer to LifoAlloc.
Depends on D99051
Comment 4•4 years ago
|
||
bugherder |
Description
•