Closed Bug 1016130 Opened 11 years ago Closed 7 years ago

Store proxy handler in the object class

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 966518

People

(Reporter: bhackett1024, Unassigned)

Details

Attachments

(1 file)

Attached patch patchSplinter Review
Proxy handlers are not created on demand, so it seems to make more sense to store them as part of the Class than in instance objects. This is more efficient in memory usage but more importantly this is the main step in removing all predefined slots in proxies. If proxies don't have any predefined slots then they can be used in more cases, particularly (hopefully) for typed objects, the only remaining non-native non-proxy class. The attached patch makes this change. It's generally straightforward, except for wrapper renewing. The tests we do to decide whether we can reuse wrappers when e.g. nuking a compartment don't really apply when there can be many classes for the various wrappers, and it's not clear to me what the purpose of these tests is.
Attachment #8428928 - Flags: review?(wmccloskey)
Is this different from bug 966518?
And if not, does it have the static initializer issues that bug was trying to avoid?
(In reply to Boris Zbarsky [:bz] from comment #2) > And if not, does it have the static initializer issues that bug was trying > to avoid? This does look much the same, why did progress in that bug stall? This bug doesn't change the behavior of proxy handlers at all, unlike that stuff. I don't see anything about static initializers in that bug. This does add more js::Class global variables, though there wouldn't be any new constructors or anything that run at startup.
> why did progress in that bug stall? Eric?
Flags: needinfo?(efaustbmo)
There was a GC issue in bug 966518. It looks like this patch has the same problem. Let's all three of us talk about it tomorrow. We really need to make progress on this. The issue is that the SetClassAndProto call when renewing wrappers can cause us to trigger a write barrier on an object that's supposed to be dead. The code is really hairy here. Given that Eric and Brian have both run into it, I think it might be time to consider a better fix.
(In reply to Bill McCloskey (:billm) from comment #5) > There was a GC issue in bug 966518. It looks like this patch has the same > problem. Let's all three of us talk about it tomorrow. We really need to > make progress on this. > > The issue is that the SetClassAndProto call when renewing wrappers can cause > us to trigger a write barrier on an object that's supposed to be dead. The > code is really hairy here. Given that Eric and Brian have both run into it, > I think it might be time to consider a better fix. If that went away, and we could cleanly replace shapes, I could resurrect this patch set really easily. I don't really care who does it, but I agree it needs to be done.
Flags: needinfo?(efaustbmo)
Comment on attachment 8428928 [details] [diff] [review] patch It sounds like we're going with Eric's patch.
Attachment #8428928 - Flags: review?(wmccloskey)
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: