Closed Bug 919889 Opened 6 years ago Closed 6 years ago

Clean up MemoryMetrics

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: njn, Assigned: njn)

References

Details

(Whiteboard: [js:t])

Attachments

(5 files, 2 obsolete files)

While working on bug 918207 I've made a bunch of clean-ups to MemoryMetrics that can be landed separately.  Most importantly, I'm going to use macros to make all the size manipulations less error-prone.
Blocks: 918207
It's particularly nice that this lets me remove the special-casing in
check_spidermonkey_style.py.
Attachment #809655 - Flags: review?(luke)
This is a better place for it, as the "measured separately" comment indicates.
Attachment #809658 - Flags: review?(luke)
The new comment at the top of MemoryMetrics.h explains in more detail what this
patch is doing.

I don't like the presence of the |dummy| members, but I can't see a better way
to do it.  If only initializer lists used terminators instead of separators.

(A non-macro-y way to do this would be to have an array of size_t in each class
and use named indices to index into that array.  But I can't see how to encode
the {Is,Not}LiveGCThing characteristic into such an array.)
Attachment #809659 - Flags: review?(luke)
Whoops, this is the correct part 4.
Attachment #809661 - Flags: review?(luke)
Attachment #809659 - Attachment is obsolete: true
Attachment #809659 - Flags: review?(luke)
While I'm here, why not upload part 2 as well?  Gah.
Attachment #809663 - Flags: review?(luke)
Attachment #809655 - Flags: review?(luke) → review+
Attachment #809658 - Flags: review?(luke) → review+
Attachment #809661 - Flags: review?(luke) → review+
Comment on attachment 809662 [details] [diff] [review]
(part 5) - Use macros to eliminate repetitive, error-prone code in MemoryMetrics.{h,cpp}.

Nice
Attachment #809662 - Flags: review?(luke) → review+
Attachment #809663 - Flags: review?(luke) → review+
--HG--
rename : js/src/jsmemorymetrics.cpp => js/src/vm/MemoryMetrics.cpp
Attachment #8364704 - Flags: feedback?(n.nethercote)
Attachment #8364704 - Flags: feedback?(n.nethercote) → feedback+
Attachment #8364704 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.