Closed
Bug 1004790
Opened 10 years ago
Closed 10 years ago
Split off a new class FreeList from FreeSpan
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla32
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(2 files)
18.43 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
9.58 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
FreeSpan is really two types -- some of the operations are only relevant if it's a freeLists[] value, and some of the operations are only relevant if it's not. So we should split them.
Assignee | ||
Comment 1•10 years ago
|
||
This patch creates a new class, FreeList, which inherits from FreeSpan. It moves several of the methods from FreeSpan to FreeList. The moved methods have the following minimal changes: - allocate/infallibleAllocate use the new setHead() method. - isSameNonEmptySpan() now takes a reference instead of a pointer, and the callers had their (this,argument) pair switched.
Attachment #8416195 -
Flags: review?(wmccloskey)
Assignee | ||
Comment 2•10 years ago
|
||
This patch changes FreeList from "is a FreeSpan" to "has a FreeSpan". This makes clearer the fact that there isn't that much overlap between the two classes -- the only methods present in both classes are isEmpty() and arenaAddress(). It also allows FreeList's data to be encapsulated (i.e. private). The patch also adds some extra assertions, and does other minor clean-ups, such as removing initAsEmpty's never-used optional parameter. To make sure that there was no remaining code that cast FreeList to FreeSpan or vice versa (or anything else like that) I temporarily added some extra fields before FreeList::head, and this flushed out a couple of places I'd missed.
Attachment #8416196 -
Flags: review?(wmccloskey)
Comment on attachment 8416195 [details] [diff] [review] (part 1) - Split off a new class FreeList from FreeSpan. Review of attachment 8416195 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/gc/Heap.h @@ +388,5 @@ > + * initialization so to allocate we simply return the first thing in the > + * arena and set the free list to point to the second. > + */ > + MOZ_ALWAYS_INLINE void *allocateFromNewArena(uintptr_t arenaAddr, size_t firstThingOffset, > + size_t thingSize) { Can you indent this line over one more? It's broken from before.
Attachment #8416195 -
Flags: review?(wmccloskey) → review+
Attachment #8416196 -
Flags: review?(wmccloskey) → review+
Assignee | ||
Comment 4•10 years ago
|
||
> Can you indent this line over one more? It's broken from before. I did that in the second patch. Try server looks good: https://tbpl.mozilla.org/?tree=Try&rev=ae49f493005a
Assignee | ||
Comment 5•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/21332f87ca19 https://hg.mozilla.org/integration/mozilla-inbound/rev/41ae09162dd7
Comment 6•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/21332f87ca19 https://hg.mozilla.org/mozilla-central/rev/41ae09162dd7
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in
before you can comment on or make changes to this bug.
Description
•