Closed Bug 1413635 Opened 5 years ago Closed 5 years ago

Refactor AllocKind definition


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




Tracking Status
firefox58 --- fixed


(Reporter: jonco, Assigned: jonco)



(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]

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
Generate AllocKind enum automatically and include more information in the definition macro r=sfink
Give AllocKind enum a uint8_t base r=sfink
You need to log in before you can comment on or make changes to this bug.