Closed Bug 1319746 Opened 7 years ago Closed 7 years ago

Add a memory reporter for CFGGraph on BaselineScript

Categories

(Core :: JavaScript Engine: JIT, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: h4writer, Assigned: h4writer)

References

Details

Attachments

(1 file)

We can now add a CFGGraph on a BaselineScript. But we never remove it. We should at least report this memory! Add a memory reporter to see how much memory this takes.
Depends on: 1310155
Priority: -- → P3
I think that is all that is needed to add this memory reporter?
Assignee: nobody → hv1989
Attachment #8857897 - Flags: review?(n.nethercote)
Comment on attachment 8857897 [details] [diff] [review]
Add memory reporter

Review of attachment 8857897 [details] [diff] [review]:
-----------------------------------------------------------------

So CFGSpace already had a sizeOfExcludingThis() function, but it wasn't being used? Huh, that's a little surprising. Oh well, it comes in useful now.

::: js/src/vm/TypeInference.cpp
@@ +4490,5 @@
>      *typePool += types.typeLifoAlloc().sizeOfExcludingThis(mallocSizeOf);
>      if (jitZone()) {
>          *baselineStubsOptimized +=
>              jitZone()->optimizedStubSpace()->sizeOfExcludingThis(mallocSizeOf);
> +        *cachedCFG += jitZone()->cfgSpace()->sizeOfExcludingThis(mallocSizeOf);

Normally '->' is paired with 'sizeOfIncludingThis' instead of 'sizeOfExcludingThis'. But in this case the code is correct.

Can you add a comment above the baselineStubsOptimized line like this: "// These functions return pointers to struct that are embedded within JitZone, which is why we use sizeOfExcludingThis()."
Attachment #8857897 - Flags: review?(n.nethercote) → review+
Pushed by hv1989@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cef3dd72d444
Add a memory reporter for CFGGraph on BaselineScript, r=njn
https://hg.mozilla.org/mozilla-central/rev/cef3dd72d444
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: