Closed Bug 2042855 Opened 5 months ago Closed 5 months ago

Simplify buffer allocator trace APIs by removing zone and owner parameters

Categories

(Core :: JavaScript: GC, task)

task

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(7 external files)

Currently functions like TraceBufferEdge take extra information compared to TraceEdge methods used for GC things. This information can be determined in other ways:

  • zone can be looked up from the BufferChunk for small and medium allocations
  • zone can be looked up from the LargeBuffer for large allocations if we make the large alloc map global rather than per-zone
  • owner is then only used to determine which heap the owner is in when tenuring; this can be passed via the TenuringTracer

This simplifies the buffer allocator tracing APIs and brings them much closer to existing tracing APIs.

Unrelated to these changes, but we can reduce the size of JSTracer from 48 to
40 bytes by reducing the size of enums and reordering the fields to avoid holes.

This moves the definitions of the lock classes outside BufferAllocator and
changes MaybeLock so that it can be forward declared elsewhere.

This creates a class to hold runtime-wide data for buffer allocators (which are
otherwise per-zone). The large alloc maps move to a single runtime-wide map.
This is only ever used for add/remove operations. We don't iterate it so the
fact that it may now have entries for many zones shouldn't affect anything.

This makes BufferAllocator::traceEdge into a static method that finds the
buffer allocator instance from the allocation itself. This uses a zone pointer
stored in the BufferChunk for small and medium allocations and the LargeBuffer
structure looked up in the runtime wide map for large allocations. The map
lookup was already needed so this doesn't add any overhead.

Now that we don't need to owner's zone for tracing it's only used for the
source cell's heap location when we are tenuring. We can pass that information
in the tenuring tracer and remove the owner paramter.

Now we can remove the owner parameter from the TraceEdge functions.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: