Closed Bug 921954 Opened 6 years ago Closed 6 years ago

Clean up type inference memory reporting

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: njn, Assigned: njn)

Details

Attachments

(1 file)

The type inference memory reporting is messy.
This patch cleans up a bunch of stuff.

- It removes TypeInferenceSizes, which was more trouble than it was worth.

- It puts sizeOfFoo() functions in more appropriate places, so that objects are
  measuring themselves.  Examples:
  - JSCompartment::addSizeOfTypeInferenceData() --> TypeCompartment::addSizeOfExcludingThis()
  - AddSizeOfScriptTypeInferenceData() --> TypeScript::sizeOfIncludingThis()

  (Note that the 11 line body of AddSizeOfScriptTypeInferenceData() was
  functionally equivalent to its last line!)

- It fixes a big inefficiency:  JSCompartment::addSizeOfTypeInferenceData() was
  measuring the size of type scripts, which required iterating over every
  script in the *zone* and ignoring all those that weren't in the relevant
  compartment.  Instead we now just do the measurement from the JSTRACE_SCRIPT
  case in StatsCellCallback().

- Const-ifies a few functions.

- Reorders reporting code in XPCJSRuntime.cpp to match the field order in
  CompartmentStats.
Attachment #811838 - Flags: review?(bhackett1024)
Attachment #811838 - Flags: review?(bhackett1024) → review+
https://hg.mozilla.org/mozilla-central/rev/613810e31754
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.