Open Bug 563305 Opened 15 years ago Updated 2 years ago

jsgc.cpp: replace handcrafted GC chunk layout with a real struct

Categories

(Core :: JavaScript Engine, defect)

Other Branch
x86
Linux
defect

Tracking

()

ASSIGNED

People

(Reporter: jseward, Assigned: jseward)

References

Details

Attachments

(1 file)

In jsgc.cpp, the basic representation of the heap centers around 'gc chunks', which contain a number of JSGCArenas and supporting data. This is described in a bit comment at jsgc.cpp:142. For unclear reasons, although every other data structure has a real C++ definition, this one doesn't. Consequently the code that manipulates it is hard to follow and contains by-hand address arithmetic and bit twiddling that we'd normally expect the compiler to do for us. Hence: give a proper struct definition, GCChunk, and use its fields in the obvious way, rather than manual address arithmetic, where possible. A possible followup tidying is would be to change JSRuntime::gcChunks from a vector of JSGCChunkInfo*s to a vector of GCChunk*s.
Attached patch patch, v1Splinter Review
In C++ you can use just "GCChunk" rather than "struct GCChunk" when referring to it, AIUI.
Blocks: 551477
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: