Closed Bug 520293 Opened 15 years ago Closed 9 years ago

GC should compress obj->dslots if it gets too fragmented in a dictionary-mode object

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: gal, Assigned: gal)

References

Details

Attachments

(1 file)

If we delete anything but the last slot, we don't shrink freeslot. If it is indeed the last slot, we do shrink back freeslot, which requires us to check for SLOT_IN_SCOPE after the getter/setter.
Attached patch patchSplinter Review
Assignee: general → gal
This patch stops recycling the last slot, which is worse than what we do right now. We should first add a way to GC slots, and then we can drop the instant recycling.
We don't want to recycle no slots, even if we suck by recycling only the last slot on delete and re-add.

GC'ing slots would not relieve the post-getter/setter-call code from having to validate slot in scope, somehow. Perhaps it could just check for a GC having run by sampling gcNumber, but that is pessimistic.

The current code was written to optimize more by checking more precisely that slot is still in scope *and* if so, that no one deleted any property in the runtime (this is still suboptimal but better given delete's burstiness and rarity).

But whatever happens, a getter or setter could indeed invalidate the slot to be updated with the result of the get or set (setters can change the value they are given, in our API). There's no avoiding a check here just by bloating dslots.

GC'ing slots would be great, can we morph this bug into that.

/be
(In reply to comment #3)
> GC'ing slots would be great, can we morph this bug into that.

IOW, the summary of this bug is invalid. We need to morph this bug or close it.

/be
Recycling slots is patched in bug 535629. Re-summarizing this bug as promised in comment 4.

/be
Depends on: 535629
Summary: Make sure freeslot always grows, in which case we can avoid SLOT_IN_SCOPE checks → GC should compress obj->dslots if it gets too fragmented in a dictionary-mode object
This is so old now, it's clearly not going anywhere.
Status: NEW → RESOLVED
Closed: 9 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: