Closed Bug 699210 Opened 13 years ago Closed 13 years ago

Add memory reporter for base shapes

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This is a new kind of GC thing added for object-shrink, and should be counted in about:memory.
Attached patch patchSplinter Review
Assignee: general → bhackett1024
Attachment #571435 - Flags: review?(nnethercote)
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-
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
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.
This was merged ages ago.
Blocks: DarkMatter
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: