Closed Bug 1802172 Opened 1 year ago Closed 1 year ago

CyclicModuleFields structure wastes space

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(2 files)

As arai commented during code review for bug 1795524, the use of several Maybe<> fields in this structure is inefficient. Packing all the flags together in one place would make better use of memory.

This reduces the size from 184 to 160 bytes on 64 bit. and from 128 to 104
bytes on 32 bit builds.

As suggsted in code review for the previous patch, it's clearer and less
error-prone to provide getters and setters for module fields which are
represented using more than one field in the structure.

This patch changes the operation of ModuleObject::maybeAsyncEvaluatingPostOrder
to return Nothing() after the post order is cleared, rather than the magic
value ASYNC_EVALUATING_POST_ORDER_CLEARED. This doesn't make any difference to
the modules system itself but required some changes to test code expectations.

Depends on D162869

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e81e696cc5a0
Pack the CyclicModuleFields structure r=arai
https://hg.mozilla.org/integration/autoland/rev/e54e77856ace
Refactor CyclicModuleFields to provide getters and setters for some fields r=arai
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: