Closed Bug 413345 Opened 18 years ago Closed 1 year ago

Replacing ParsedObjectBox with chunked lists

Categories

(Core :: JavaScript Engine, enhancement)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: igor, Unassigned)

References

Details

Attachments

(1 file)

[This is a spin-off from an initial prototype of patch for bug 406356. Since this is useful on its own, I prefer to have a separated bug for it.] Currently to root an object created during parsing the code allocates the special JSParsedObjectBox struct. The struct holds a pointer to the object plus extra 2 fields. The first field is for linking all the structs so the GC can trace the objects. The second field is for the emitter. But this mixing of the emitter and GC-tracing fields complicates the code and requires an extra level of indirection to access the object. So as an alternative I suggest to use separated lists for the emitter and GC rooting. This should simplify the code and, in fact, save memory as such lists can be implemented as a lists of chunks with each chunk holding few pointers. For example, currently the parser allocates 3*N words to put N objects on the sinle JSparseContext.rootList list. With 2 separated chunked lsists where each chunk holds 4 object pointers and one linking field, the space requrement would be ceil(N/4) * (4 + 1) * 2 or 2.5*N words. In addition the space allocated for the emitter list would be reused after compiling each top-level function in a script.
Is this still wanted?
(In reply to Ryan VanderMeulen from comment #2) > Is this still wanted? Probably - AFAIK the parser still uses a few list structures that could benefit from the optimization.
Assignee: igor → general
Assignee: general → nobody
Severity: normal → S3

Been 13 years - Engine has changed a lot since then.
Closing this, but please reopen if still needed.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WONTFIX

I confirm that this is WONTFIX. The parser no longer touches GC things.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: