The flag is now used to guard against both cases teleporting has to watch out
for: proto changes and shadowed properties.
This lets us get rid of dictionary conversions and reshaping for ReshapeForShadowedProp.
Differential D118361
Bug 1717438 part 3 - Use the InvalidatedTeleporting flag also for shadowed properties. r?tcampbell! jandem on Jun 21 2021, 2:49 PM. Authored by Tags Referenced Files
Subscribers None
Details
The flag is now used to guard against both cases teleporting has to watch out This lets us get rid of dictionary conversions and reshaping for ReshapeForShadowedProp.
Diff Detail
Event TimelineComment Actions This is a pretty nice cleanup. Since you have the simple flag now, I wonder if it makes sense to expose as a testing function so that we can write a few tests to show this behaviour (and we don't even need JITs). One impact of this change is that shadowing the ObjectPrototype will now cause future accesses to common properties to not use teleporting anymore. This was always the can for SetProto invalidations, but now is expanded to shadowing. In practice, I think the avoidance of dictionary mode here outweighs this, and the invalidation flag has much more gradual JIT impact. A potential thing we could do if we are concerned about in-the-wild behaviour is to capture telemetry when tearing down the realm about if ObjectPrototype has set the flag. Comment Actions Testing function is a good idea, I posted D119063. Regarding Object.prototype: it helps that we only check the flag on the holder object. I don't think Object.prototype has very hot properties except for toString and hasOwnProperty, so hopefully it would still be okay if we happen to invalidate teleporting for it.
|