Closed Bug 1413635 Opened 3 years ago Closed 3 years ago

Refactor AllocKind definition

Categories

(Core :: JavaScript: GC, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(2 files)

No description provided.
Some cleanup I noticed during the previous refactoring.

We can generate the AllocKind enum from the FOR_EACH_*_ALLOCKIND macros, although I did have to hardcode the first object alloc kind.  It's checked by a static assert so I think this is OK though.

I merged the background finalizable and nursery allocation flags into these macros too.
Attachment #8924247 - Flags: review?(sphink)
Give AllocKind a uint8_t base and remove casting to size_t.  I check that this didn't change the size of the arena header.
Attachment #8924255 - Flags: review?(sphink)
Comment on attachment 8924247 [details] [diff] [review]
bug1413635-generate-alloc-kind

Review of attachment 8924247 [details] [diff] [review]:
-----------------------------------------------------------------

Oh good. I never did this because I was scared off by all the different files involved, and I wasn't sure what was visible from where, and just punted.
Attachment #8924247 - Flags: review?(sphink) → review+
Attachment #8924255 - Flags: review?(sphink) → review+
(In reply to Jon Coppeard (:jonco) from comment #2)
> I check that this didn't change the size of the arena header.

Ah, this doesn't work on Windows.
(In reply to Jon Coppeard (:jonco) from comment #4)
I'll land this without the change to Arena to use AllocKind rather than size_t for the allocKind member.
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ec967bb54314
Generate AllocKind enum automatically and include more information in the definition macro r=sfink
https://hg.mozilla.org/integration/mozilla-inbound/rev/1d72b8f7f10a
Give AllocKind enum a uint8_t base r=sfink
https://hg.mozilla.org/mozilla-central/rev/ec967bb54314
https://hg.mozilla.org/mozilla-central/rev/1d72b8f7f10a
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.