Closed
Bug 699210
Opened 13 years ago
Closed 13 years ago
Add memory reporter for base shapes
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bhackett1024, Assigned: bhackett1024)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
5.76 KB,
patch
|
n.nethercote
:
review-
|
Details | Diff | Splinter Review |
This is a new kind of GC thing added for object-shrink, and should be counted in about:memory.
Assignee | ||
Comment 1•13 years ago
|
||
Assignee: general → bhackett1024
Attachment #571435 -
Flags: review?(nnethercote)
Assignee | ||
Comment 2•13 years ago
|
||
Comment 3•13 years ago
|
||
Comment on attachment 571435 [details] [diff] [review]
patch
Review of attachment 571435 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/xpconnect/src/XPCJSRuntime.cpp
@@ +1342,5 @@
> + case JSTRACE_BASE_SHAPE:
> + {
> + curr->gcHeapShapesBase += thingSize;
> + break;
> + }
There's a big bug here -- the PropertyTable has moved to the BaseShape, but you're still counting it through the Shape, which means that you'll multiply-count every PropertyTable that belongs to a shared BaseShape. You should move Shape::sizeOfPropertyTable() to BaseShape.
And once you've done that, does it still make sense to have the tree-tables vs. dict-tables distinction? I guess it depends if every BaseShape clearly belongs to only tree or dict shapes. I don't know if that's the case, but I don't see a BaseShape::inDictionary().
Attachment #571435 -
Flags: review?(nnethercote) → review-
Assignee | ||
Comment 4•13 years ago
|
||
Each base shape that has a property table is owned by the referring shape --- if two shapes have the same base shape then that base shape has no property table. So there should be no double counting.
http://hg.mozilla.org/projects/jaegermonkey/file/tip/js/src/jsscope.h#l295
Comment 5•13 years ago
|
||
Good to hear there's no double-counting. Can you move sizeOfPropertyTable() into BaseShape anyway? It's only used for memory reporting, and it makes it more obvious what's going on.
Comment 6•13 years ago
|
||
This was merged ages ago.
You need to log in
before you can comment on or make changes to this bug.
Description
•