Closed
Bug 919349
Opened 11 years ago
Closed 11 years ago
JS debugger: remove uses of 'delete' that put objects in dictionary mode gratuitously
Categories
(DevTools :: Debugger, defect)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 27
People
(Reporter: jimb, Assigned: jimb)
Details
Attachments
(1 file)
2.47 KB,
patch
|
dcamp
:
review+
|
Details | Diff | Splinter Review |
The built-in JavaScript debugger code uses 'delete' in several places in a way that wastes memory; those uses could be replaced with assignments that set the given properties to 'null' or 'undefined'.
Deleting properties from objects puts them in 'dictionary mode'. Objects in dictionary mode do not share shape metadata with other similar objects. For objects being used as hash tables, this is fine; such sharing would not be helpful anyway. But for an object of which the program will use only a small, fixed vocabulary of properties, sharing that metadata can save memory, and enable optimizations like inline caches. If the intention is simply to help the GC free the property's referent, it's better to simply set the property to 'null' or 'undefined'.
Assignee | ||
Comment 1•11 years ago
|
||
Updated•11 years ago
|
Attachment #808350 -
Flags: review?(dcamp) → review+
Updated•11 years ago
|
Priority: -- → P3
Assignee | ||
Comment 2•11 years ago
|
||
Priority: P3 → --
Comment 3•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 27
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•