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)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla51
| Tracking | Status | |
|---|---|---|
| firefox51 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(1 file)
|
9.91 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter 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)
| Assignee | ||
Comment 1•9 years ago
|
||
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."
Updated•9 years ago
|
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
Comment 3•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in
before you can comment on or make changes to this bug.
Description
•