Closed Bug 1298878 Opened 9 years ago Closed 9 years ago

Don't store builtin constructors on the global in reserved slots

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
The global object uses 3 * JSProto_LIMIT slots to store the following values for each proto key: * The original constructor. * The prototype. * The current value of the property. The last one is problematic: using addProperty with an explicit slot like that turns all globals into dictionary mode objects. If we store these values in non-reserved slots, globals can be non-dictionary objects and we will share their Shape lineage within a zone (bug 1295967). Fortunately, these values don't have to be in reserved slots. I think we can use DefineProperty instead of obj->addDataProperty, that also lets us shrink the number of reserved slots.
Attachment #8786030 - Flags: review?(jwalden+bmo)
Comment on attachment 8786030 [details] [diff] [review] Patch Review of attachment 8786030 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/vm/GlobalObject.h @@ +67,5 @@ > /* > * Count of slots to store built-in constructors, prototypes, and initial > * visible properties for the constructors. > */ > + static const unsigned STANDARD_CLASS_SLOTS = JSProto_LIMIT * 2; I'll change the comment to something like: "Count of slots to store builtin prototypes and initial visible properties for the constructors."
Attachment #8786030 - Flags: review?(jwalden+bmo) → review+
Pushed by jandemooij@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/d128c9990a76 Don't store the actual builtin constructor properties on the global in reserved slots. r=Waldo
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
No longer depends on: 1332773
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: