Closed Bug 1657614 Opened 4 years ago Closed 4 years ago

Make ObjLiteralStencil initialization in BytecodeEmitter more robust

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
85 Branch
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.

See Also: → 1657353
Blocks: stencil-backlog
No longer blocks: 1605101

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 into ObjLiteralStencil, with Span
    it will solve this bug at the same time.
Assignee: nobody → arai.unmht
Blocks: 1678449
No longer blocks: stencil-backlog
Status: NEW → ASSIGNED
Priority: P2 → P1

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

Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/aad18f232c51 Decouple ObjLiteralWriter and ObjLiteralStencil. r=nbp
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: