Closed Bug 632629 Opened 13 years ago Closed 13 years ago

JM: change ExecutablePool to only hold a single chunk

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(1 file)

Bug 631106 identified that although ExecutablePool has the infrastructure to
hold multiple chunks of memory (in the confusingly called "m_pools" vector),
the way it's used means that this vector always holds a single chunk...
except for the fact that there's an off-by-one error in Executable::alloc()
which means that a second chunk is occasionally allocated even when the
requested number of bytes would have fit in the first chunk.

This patch:
- Changes the chunks vector into a chunk scalar.

- Renames ExecutableAllocator::alloc() as fetch(), to match the fact that
  it's not actually doing an allocation, but just handing over the address
  of a previous poolForSize() call that actually does the allocation.  This

- fetch() is also infallible, so all call sites had their NULL checks
  removed.
 
- ExecutableAllocator is now a friend of ExecutablePool, as it's the only
  other code that needs to see its internals, and most of ExecutablePool's
  fields were privatized.

- Puts ExecutablePool's member decls/defns in a more sensible order.

- Fixes a couple of incorrect comments in jstracer.cpp.

This is a post-4.0 change.
Attachment #510854 - Flags: review?(dvander)
Attachment #510854 - Flags: review?(dvander)
This change isn't valid on ARM due to constant pools.  See bug 631106 comment 4.  Sigh.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: