Closed Bug 1723565 Opened 3 years ago Closed 3 years ago

Simplify GC allocation functions a little

Categories

(Core :: JavaScript: GC, task)

task

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox92 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(3 files)

At the moment there is some complexity around our allocation functions:

  • there's sepcializations for the string allocation functions and it's not obvious why they're needed
  • we template the allocation implementations on the type and I think this is unnecessary

Currently there's some strangeness about AllocateString with its
specializations for fat inline strings. If we make MapTypeToFinailzeKind work
for all dervied types we can make this generic. I also had to move this to
AllocKind.h so we can see it here.

Secondly, AllocateStringImpl doesn't really do much with its template type
argument so we can remove this and just pass in the size an alloc kind.

This returns a gc::AllocKind so let's rename it to something more obvious.

Depends on D121541

We can remove the type template from the tenured allocation function too along
the same lines as the first patch.

Depends on D121542

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b57d2918ed0a
Simplify GC string allocation functions r=sfink
https://hg.mozilla.org/integration/autoland/rev/946746faed17
Rename MapTypeToFinalizeKind to MapTypeToAllocKind r=sfink
https://hg.mozilla.org/integration/autoland/rev/005ac67674b1
Simplify tenured allocation function r=sfink
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: