Commit Graph

354 Commits

Author SHA1 Message Date
Nicholas Nethercote
b9e0d05f7e Bug 934321 - Add MemoryMultiReporter, a helper class that reduces some boilerplate, and convert all existing multi-reporters to use it. r=wchen.
--HG--
extra : rebase_source : a6110c3558c571b7908b63e8cc7ca21103098d0d
2013-11-06 14:58:20 +11:00
Benoit Jacob
0e5debd55a Bug 934568 - Make cycle collector OOM assertions fatal in debug builds. r=mccr8 2013-10-27 07:51:31 -04:00
Jonas Finnemann Jensen
698b895a6f Bug 902587 - Part 2A: Refactor late-write-checks as client of IO Interposer. r=BenWa
--HG--
rename : xpcom/build/mozPoisonWrite.h => xpcom/build/LateWriteChecks.h
rename : xpcom/build/mozPoisonWrite.h => xpcom/build/PoisonIOInterposer.h
rename : xpcom/build/mozPoisonWriteBase.cpp => xpcom/build/PoisonIOInterposerBase.cpp
rename : xpcom/build/mozPoisonWriteMac.cpp => xpcom/build/PoisonIOInterposerMac.cpp
rename : xpcom/build/mozPoisonWriteWin.cpp => xpcom/build/PoisonIOInterposerWin.cpp
2013-11-05 07:45:20 -05:00
Andrew McCreight
ab63e479c1 Bug 928647 - Remove CycleCollectedRuntime::mObjectToUnlink. r=smaug 2013-10-19 08:59:10 -07:00
Olli Pettay
129aa70c07 Bug 927813 - Some micro-optimizations for Suspect, r=mccr8 2013-10-17 17:05:13 +03:00
Birunthan Mohanathas
c09e07a17c Bug 784739 - Switch from NULL to nullptr in xpcom/ (1/3); r=ehsan 2013-10-10 16:41:00 -04:00
Thinker Lee ext:(%2C%20Cervantes%20Yu%20%3Ccyu%40mozilla.com%3E)
025fc12dba Bug 771765 - Support template content process, part 6: support re-creation of the threads created in the template process. r=khuey, r=jorendorff
The threads that are frozen/recreated include:
* ImageBridgeChildThread.
* Image decoding thread pool.
* IPC thread (checkpointed, but not frozen).
* GC Helper thread.
* XPC runtime watchdog thread.
* Socket transport service thread/thread pool.
* Memory pressure watcher.
* Timer thread.
* DOM promise worker.
2013-06-03 18:14:42 +08:00
Andrew McCreight
23fcdadf9b Bug 915488 - Make CC participant's Root, Unroot and Unlink methods infallible. r=smaug 2013-09-11 18:57:53 -07:00
Ehsan Akhgari
a2c0c65e43 Bug 917885 - Minimize the #includes in xpcom/base; r=bsmedberg 2013-09-19 14:29:31 -04:00
Ehsan Akhgari
9b717619cf Backed out changeset a8d6973e5743 (bug 917885) because I pushed the wrong patch 2013-09-19 14:27:35 -04:00
Ehsan Akhgari
dc575f6de1 Bug 917885 - Minimize the #includes in xpcom/base; r=bsmedberg 2013-09-19 14:12:56 -04:00
Nicholas Nethercote
fd238cabbe Bug 910517 (3rd attempt) - Remove nsIMemoryReporter, and rename nsIMemoryMultiReporter as nsIMemoryReporter. r=mmcr8.
--HG--
rename : content/canvas/src/WebGLMemoryMultiReporterWrapper.h => content/canvas/src/WebGLMemoryReporterWrapper.h
extra : rebase_source : 2b2a1b2667d6562fcf803ec48b4a8c10fdd519a3
2013-08-27 16:24:51 -07:00
Andrew McCreight
e696bd7ef8 Bug 913666, part 5 - Rename aListener to aManualListener. r=smaug
The name "aListener" is not very descriptive, and with the previous patch, it is only
used to pass in a manually-specified listener that was passed in to CycleCollectNow,
so rename things.
2013-09-10 16:33:41 -07:00
Andrew McCreight
f0278c3e2d Bug 913666, part 4 - Sink free floating code from nsCycleCollector::Collect into BeginCollection. r=smaug
The hg diff for this commit is terrible, but all it is doing is taking the code
in nsCycleCollector::Collect from after PrepareForCollection through BeginCollection
and moving it into BeginCollection.
2013-09-10 16:33:41 -07:00
Andrew McCreight
cb66bb7e69 Bug 913666, part 3 - Sink cycle collector listener selection into Collect. r=smaug
Move the two places we check global flags to decide if we want to use a listener, even if we
aren't passed in one.  A later patch renames aListener to aForcedListener to make it less
confusing.
2013-09-10 16:33:40 -07:00
Andrew McCreight
2851755cfd Bug 913666, part 2 - Log cycle collector garbage at the same time we log roots. r=smaug
There's no reason to wait until CollectWhite to record what is garbage, and with incremental CC
we'll get more accurate logging by logging right away, rather than waiting until later when an
object may have gone away for some other reason.
2013-09-10 16:33:40 -07:00
Andrew McCreight
77e29a7283 Bug 913666, part 1 - Move cycle collector root logging into ScanRoots. r=smaug 2013-09-10 16:33:39 -07:00
Andrew McCreight
4864cf7795 Bug 913881, part 6 - Measure weak map representations in the cycle collector graph. r=njn
Contrary to the comment here, I'm pretty sure this needs to be measured. mWeakMaps
is an array of little structs. Of course, in practice I doubt this amounts to anything.
2013-09-10 08:56:36 -07:00
Andrew McCreight
78ec0916e5 Bug 913881, part 5 - Assert for freeing snow white during cycle collector scanning. r=smaug
If you call FreeSnowWhite when scanning is true, then objects that get released won't be added to the purple buffer, and you can get leaks.
2013-09-10 08:56:36 -07:00
Andrew McCreight
bbb89961cd Bug 913881, part 4 - Change nsCycleCollector::ClearGraph to GCGraph::Clear. r=smaug
There's no reason I can see to have this in nsCC instead of GCGraph.
2013-09-10 08:56:36 -07:00
Andrew McCreight
7bfbfc66c2 Bug 913881, part 3 - Fix argument name for GCGraphBuilder::AddNode. r=smaug 2013-09-10 08:56:35 -07:00
Andrew McCreight
bdf5847bcf Bug 913881, part 2 - Make a bunch of nsCycleCollector methods private. r=smaug 2013-09-10 08:56:35 -07:00
Andrew McCreight
01ac3fd277 Bug 913881, part 1 - Remove unused method nsCycleCollector::Runtime. r=smaug 2013-09-10 08:56:35 -07:00
Andrew McCreight
c4d62e9716 Bug 913527, part 3 - Check for collection in progress in Collect. r=smaug
Moving this to the top level simplifies dealing with PrepareForCollection a bit.
2013-09-10 08:56:34 -07:00
Andrew McCreight
fd080f6291 Bug 913527, part 2 - Remove empty CC graph optimization. r=smaug
This looks like a dubious optimization to skip most of a CC when the graph
is empty, dating from the dawn of the CC, but I doubt it is ever triggered
nowadays.
2013-09-10 08:56:34 -07:00
Andrew McCreight
bd3a15bbd8 Bug 913527, part 1 - Get rid of FinishCollection. r=smaug
This can just be inlined now, with the cleanup parts moved into CleanupAfterCollection.
2013-09-10 08:56:34 -07:00
Andrew McCreight
505b1bb607 Bug 911829 - Separate main thread and worker cycle collector telemetry. r=smaug 2013-09-10 08:29:45 -07:00
Kyle Huey
6a6c67829f Bug 911258: Part 4 - Refactor exception implementations. r=bz 2013-09-08 20:28:50 -07:00
Andrew McCreight
8540b73640 Bug 913130, part 4 - Replace body of ShutdownCollect loop with Collect. r=smaug 2013-09-06 16:17:53 -07:00
Andrew McCreight
02324cc201 Bug 913130, part 3 - Run {PrepareFor,CleanupAfter} every iteration of ShutdownCollect. r=smaug 2013-09-06 16:17:03 -07:00
Andrew McCreight
7f4070d8f7 Bug 913130, part 2 - Give Collect and ShutdownCollect more consistent ordering. r=smaug 2013-09-06 16:16:45 -07:00
Andrew McCreight
e744a3daaf Bug 913130, part 1 - Modify nsCycleCollector::Collect to allow it to be used at shutdown. r=smaug 2013-09-06 16:15:10 -07:00
Andrew McCreight
00502fc5df Bug 913080 - Make GCGraphBuilder's hash table initialization infallible. r=smaug 2013-09-06 13:42:27 -07:00
Andrew McCreight
6270d16652 Bug 911233, part 3 - Add more CheckThreadSafety calls to the cycle collector. r=khuey 2013-09-06 13:41:42 -07:00
Andrew McCreight
e5949c39b3 Bug 911233, part 2 - Inline SelectPurple. r=smaug 2013-09-06 13:41:11 -07:00
Andrew McCreight
4b10c300b9 Bug 911233, part 1 - Minor cycle collector cleanups. r=smaug 2013-09-06 13:40:34 -07:00
Andrew McCreight
3228f67147 Bug 883920 - use templates for {Hold,Drop}JSObjects. r=peterv 2013-08-16 13:10:17 -07:00
Olli Pettay
83abfe1558 Bug 910797, make Event.isTrusted to work in workers, r=khuey 2013-08-30 12:47:19 +03:00
Landry Breuil
33dc057d00 Bug 905920 - Fix build on platforms without SPS profiler r=khuey 2013-08-20 13:48:22 +02:00
Andrew McCreight
20aa3460cc Bug 903524 - Rename TestJSHolder to IsJSHolder. r=smaug 2013-08-15 10:29:02 -07:00
Kyle Huey
8ef412bec4 Bug 901630: Remove support for the cc thread. r=mccr8 2013-08-13 10:45:32 -07:00
Andrew McCreight
6964c7f625 Bug 901756 - Fix a few nits in nsCycleCollector.cpp r=khuey
Remove an unused forward declaration, and an unused field
2013-08-05 17:04:47 -07:00
Kyle Huey
c9d1557bdb Bug 845545: Part 4 - Create a worker implementation of CycleCollectedJSRuntime. r=mccr8,bent 2013-08-03 16:55:40 -07:00
Kyle Huey
46d249128b Bug 845545: Part 3 - Give the CycleCollectedJSRuntime more control over
SnowWhite. r=smaug
2013-08-03 16:55:39 -07:00
Kyle Huey
b09945aa3b Bug 845545: Part 1 - Fix heap dumping to work off the main thread. r=mccr8 2013-08-03 16:55:39 -07:00
Andrew McCreight
5e1d19701e Bug 887903 - Non-fatally assert when nsDeque fails due to OOM during scanning in CC. r=smaug 2013-05-28 17:42:13 -07:00
Ehsan Akhgari
085494b95d Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo
This patch was mostly generated by running the following scripts on the codebase, with some
manual changes made afterwards:

# static_assert.sh
#!/bin/bash
# Command to convert an NSPR integer type to the equivalent standard integer type

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.mm" \) | \
    xargs -n 1 `dirname $0`/assert_replacer.py #sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_STATIC_ASSERT static_assert
hg rev --no-backup mfbt/Assertions.h \
                   media/webrtc/signaling/src/sipcc/core/includes/ccapi.h \
                   modules/libmar/src/mar_private.h \
                   modules/libmar/src/mar.h


# assert_replacer.py
#!/usr/bin/python

import sys
import re

pattern = re.compile(r"\bMOZ_STATIC_ASSERT\b")

def replaceInPlace(fname):
  print fname
  f = open(fname, "rw+")
  lines = f.readlines()
  for i in range(0, len(lines)):
    while True:
      index = re.search(pattern, lines[i])
      if index != None:
        index = index.start()
        lines[i] = lines[i][0:index] + "static_assert" + lines[i][index+len("MOZ_STATIC_ASSERT"):]
        for j in range(i + 1, len(lines)):
          if lines[j].find("                 ", index) == index:
            lines[j] = lines[j][0:index] + lines[j][index+4:]
          else:
            break
      else:
        break
  f.seek(0, 0)
  f.truncate()
  f.write("".join(lines))
  f.close()

argc = len(sys.argv)
for i in range(1, argc):
  replaceInPlace(sys.argv[i])

--HG--
extra : rebase_source : 4b4a4047d82f2c205b9fad8d56dfc3f1afc0b045
2013-07-18 13:59:53 -04:00
Ehsan Akhgari
3717325909 Bug 872127 - Part 2: Replace mozilla/StandardInteger.h with stdint.h; r=Waldo,ted 2013-07-30 10:25:31 -04:00
Olli Pettay
26e794eac5 Bug 897433 - Telemetry for SnowWhite and more async SnowWhite freeing (patch v4), r=mccr8 2013-07-27 13:48:45 +03:00
Andrew McCreight
57bd584860 Bug 692226 - Record weak map entries in the cycle collector log. r=smaug 2013-07-26 08:12:51 -07:00