Closed
Bug 639743
Opened 14 years ago
Closed 14 years ago
JM: clean up Executable{Pool,Allocator} some more
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(6 files)
2.07 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
3.97 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
2.03 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
3.20 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
3.16 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
1.90 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
Here is a stack of patches that smooth some rough edges off ExecutablePool
and ExecutableAllocator.
one:
- In ExecutableAllocator::create(), don't eagerly allocate the first pool,
let it happen lazily in poolForSize() instead. This makes
ExecutableAllocator::create() infallible, and so it can be changed to a
normal constructor.
two:
- Adds ExecutableAllocator::createPool(), which calls systemAlloc() instead
of ExecutablePool(). This makes ExecutablePool() infallible, which allows
Executable::create() to be dispensed with.
three:
- Moves roundUpAllocationSize() into ExecutableAllocator, possible thanks to
the above changes.
four:
- Renames the misspelt intializePageSize() as determinePageSize(), and make
it just return a value instead of doing an assignment.
five:
- Replaces JIT_ALLOCATOR_PAGE_SIZE with pageSize, which is already what it's
defined as. Replaces JIT_ALLOCATOR_LARGE_ALLOC_SIZE with the newly added
largeAllocSize. Make them both private.
six:
- Makes ExecutablePool()::addRef() private.
- Changes ~ExecutableAllocator() to call release() instead of destroy() on
the small allocation pools -- it should have the same effect as these
should be the last references. A boolean arg to release() is used to
assert this.
- Inlines destroy() now that there's only one caller of it.
After all these changes:
- Both classes have normal constructors (no create() methods required).
- The only public method in ExecutablePool is release().
- The only public methods in ExecutableAllocator are the constructor and
destructor, alloc(), and makeWritable/makeExecutable/cacheFlush().
Assignee | ||
Comment 1•14 years ago
|
||
Attachment #517649 -
Flags: review?(dvander)
Assignee | ||
Comment 2•14 years ago
|
||
Attachment #517650 -
Flags: review?(dvander)
Assignee | ||
Comment 3•14 years ago
|
||
Attachment #517651 -
Flags: review?(dvander)
Assignee | ||
Comment 4•14 years ago
|
||
Attachment #517652 -
Flags: review?(dvander)
Assignee | ||
Comment 5•14 years ago
|
||
Attachment #517653 -
Flags: review?(dvander)
Assignee | ||
Comment 6•14 years ago
|
||
Attachment #517654 -
Flags: review?(dvander)
Comment 7•14 years ago
|
||
I <3 njn-cleanup. That is all.
/be
Updated•14 years ago
|
Attachment #517649 -
Flags: review?(dvander) → review+
Updated•14 years ago
|
Attachment #517650 -
Flags: review?(dvander) → review+
Comment on attachment 517651 [details] [diff] [review]
patch 3
>+ size_t roundUpAllocationSize(size_t request, size_t granularity)
>+ {
Should this be static?
Attachment #517651 -
Flags: review?(dvander) → review+
Updated•14 years ago
|
Attachment #517652 -
Flags: review?(dvander) → review+
Updated•14 years ago
|
Attachment #517653 -
Flags: review?(dvander) → review+
Updated•14 years ago
|
Attachment #517654 -
Flags: review?(dvander) → review+
Assignee | ||
Comment 9•14 years ago
|
||
I changed roundUpAllocationSize() to be static:
http://hg.mozilla.org/tracemonkey/rev/5bfe25660c9e
http://hg.mozilla.org/tracemonkey/rev/504939f68ed2
http://hg.mozilla.org/tracemonkey/rev/03151dfd6663
http://hg.mozilla.org/tracemonkey/rev/5a256e0cd7b6
http://hg.mozilla.org/tracemonkey/rev/7c1b798a25fd
http://hg.mozilla.org/tracemonkey/rev/bb0dd1dcfada
Whiteboard: fixed-in-tracemonkey
Comment 10•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/5bfe25660c9e
http://hg.mozilla.org/mozilla-central/rev/504939f68ed2
http://hg.mozilla.org/mozilla-central/rev/03151dfd6663
http://hg.mozilla.org/mozilla-central/rev/5a256e0cd7b6
http://hg.mozilla.org/mozilla-central/rev/7c1b798a25fd
http://hg.mozilla.org/mozilla-central/rev/bb0dd1dcfada
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•