Closed Bug 1043888 Opened 11 years ago Closed 11 years ago

JS::GetGCThingZone and GetObjectZone don't take account of nursery objects

Categories

(Core :: JavaScript: GC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(1 file)

Spotted by jandem. These functions are defined in HeapAPI.h so they are public and are used in a couple of places, notably the cycle collector. Since we don't have the definition of JSObject here it seems they can only work for tenured objects. So we should put "tenured" in the name to make this clear and assert if they are passed nursery objects, or move them somewhere else and make them work properly (although they won't be inlined any more).
OS: Linux → All
Hardware: x86_64 → All
Patch to rename GetGCThingZone() to GetTenuredGCThingZone() and assert that its argument is tenured, as there's no way to make this work correctly for nursery objects since we don't have the type. I made GetObjectZone() work correctly for nursery objects since that was presumably the point of separating these out. I also renamed IsIncrementalBarrierNeededOnGCThing() to IsIncrementalBarrierNeededOnTenuredGCThing() to make it clear it expects not to be passed a nursery pointer, although the name is getting a bit long now.
Attachment #8462586 - Flags: review?(terrence)
Comment on attachment 8462586 [details] [diff] [review] bug1043888-zone-apis Review of attachment 8462586 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! That is clearer. I've been using the interfaces so closely, lately, that I didn't even notice the incorrect naming.
Attachment #8462586 - Flags: review?(terrence) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: