Commit Graph

679 Commits

Author SHA1 Message Date
Wes Kocher
ddcb39034b Backed out changeset f8d33a975228 (bug 1295197) for being a possible cause of crashtest assertions CLOSED TREE 2016-08-16 11:22:23 -07:00
Nathan Froyd
c54d2b067c Bug 1295197 - use non-null-checked operator new in xpcom/; r=erahm
The standard placement new function is declared to not throw, which
means that, per spec, a null check on its result is required.  There are
a number of places throughout xpcom/ where we know that we are passing
non-null pointers to placement new (and receiving them as a return
value), and we are therefore doing useless work performing these null
checks.

Therefore, we should be using an operator new overload that doesn't
require the null check.  MFBT has just such an overload, so use that.
2016-08-16 17:05:39 -04:00
Alexandre Lissy
b2834a3543 Bug 1284674 - Remove NUWA r=cyu
MozReview-Commit-ID: GyMRNzOBKw6
2016-08-02 14:54:00 +02:00
Jan de Mooij
7c3e2f8f9a Bug 1283855 part 28 - Make more GC APIs take JSContext instead of JSRuntime. r=terrence 2016-07-07 09:56:09 +02:00
Jan de Mooij
a3ac62d76c Bug 1283855 part 27 - Make more GC APIs take JSContext instead of JSRuntime. r=jonco 2016-07-07 09:55:45 +02:00
Jan de Mooij
43c0eb9efc Bug 1283855 part 26 - Make more GC APIs take JSContext instead of JSRuntime. r=terrence,mccr8 2016-07-07 09:55:41 +02:00
Andrew McCreight
20728e5bd5 Bug 1278796, part 5 - Move InitNextPointers into the PurpleBlock ctor. r=smaug
This makes sure that it will always happen, and should placate static
analyses.
2016-06-10 09:17:58 -07:00
Andrew McCreight
38bed32f89 Bug 1278796, part 4 - Move InitNextPointers out of InitBlocks. r=smaug
This clears the way for the next patch.
2016-06-10 09:17:58 -07:00
Andrew McCreight
9e94a26b37 Bug 1278796, part 3 - Inline StartBlock. r=smaug
This method doesn't do much, and in a later patch it will do even
less.
2016-06-10 09:17:57 -07:00
Andrew McCreight
e39c012d26 Bug 1278796, part 2 - Initialize PurpleBlock next pointers in a method. r=smaug 2016-06-10 09:17:57 -07:00
Andrew McCreight
bca609cbb2 Bug 1278796, part 1 - Inline |entries| in StartBlock. r=smaug
It is used inconsistently, which is confusing. A later patch will move
these into a PurpleBlock method, so the length shouldn't be an issue.
2016-06-10 09:17:57 -07:00
Nicholas Nethercote
074a942f60 Bug 1276837 (part 2) - Rename the CC Block structs. r=mccr8.
nsCycleCollector.cpp has three different structs named "Block", which makes it
hard to read. This patch renames them as EdgeBlock, NodeBlock, and PurpleBlock.
2016-06-01 09:18:33 +10:00
Nicholas Nethercote
28ce382aeb Bug 1276837 (part 1) - Shrink NodePool::Block. r=mccr8.
15% of our "small" OOM crashes are allocations of this struct. Halving its size
will hopefully help reduce that.
2016-06-01 09:13:21 +10:00
Andrew McCreight
f3f014ebc2 Bug 1271848, part 2 - Annotate invalid refcount crashes with CC participant information. r=smaug 2016-05-12 10:54:33 -07:00
Eric Rahm
97abe4ed0b Bug 1268215 - Make CCGraphBuilder::AddNode fallible. r=mccr8 2016-05-05 13:54:18 -07:00
Shu-yu Guo
0c817ecf96 Bug 1268805 - Implement PrivateGCThingValue. (r=terrence) 2016-04-29 18:10:07 -07:00
Sebastian Hengst
0467658ce8 Backed out 2 changesets (bug 1268805) for build bustage. r=backout on a CLOSED TREE
Backed out changeset b8a517eb7c6b (bug 1268805)
Backed out changeset 31075a760b2e (bug 1268805)
2016-04-30 00:52:59 +02:00
Shu-yu Guo
d297719d93 Bug 1268805 - Implement PrivateGCThingValue. (r=terrence) 2016-04-29 15:12:13 -07:00
Kyle Huey
1f6993705a Bug 1263311: Part 3 - s/nsCancelableRunnable/CancelableRunnable/g. r=froydnj 2016-04-11 11:40:06 -07:00
Wes Kocher
dd9b334d33 Backed out 3 changesets (bug 1263311) for Windows build failures in ServiceWorkerPrivate.cpp CLOSED TREE
Backed out changeset 0434a548e1fe (bug 1263311)
Backed out changeset 60b1be29446c (bug 1263311)
Backed out changeset 18132498bc40 (bug 1263311)

MozReview-Commit-ID: LPEa05QobdQ
2016-04-11 12:50:56 -07:00
Kyle Huey
7a575c886c Bug 1263311: Part 3 - s/nsCancelableRunnable/CancelableRunnable/g. r=froydnj 2016-04-11 11:40:06 -07:00
Nicholas Nethercote
53a4e4a5b5 Bug 1253085 - Remove the |PLDHashTable*| argument from PLDHash{HashKey,MatchEntry}. r=froydnj.
This is easy because it's never needed.
2016-03-16 15:33:44 +11:00
Peter Van der Beken
d0a0cd2810 Bug 1255223 - Null crash when logging weak maps. r=mccr8. 2016-03-04 23:11:37 +01:00
Jonathan Watt
4a8970eed6 Bug 1253094, part 9 - Stop using DebugOnly for class/struct members in xpcom/. r=froydnj
MozReview-Commit-ID: ACYMR37DGU9
2016-02-26 15:52:08 +00:00
Bogdan Postelnicu
435311ea50 Bug 1250134 - assert mJSRuntime when IsGrayJS() is true. r=mccr8
MozReview-Commit-ID: B5046aj61jx
2016-02-23 09:28:52 +02:00
Olli Pettay
efd454cc23 Bug 1249451 - nsCycleCollector::ScanRoots may cause some unexpected purple buffer usage, r=mccr8 2016-02-19 20:17:25 +02:00
Carsten "Tomcat" Book
76e50b15db Backed out changeset dc704cb50a24 (bug 1249451) for bustage 2016-02-19 14:18:37 +01:00
Olli Pettay
c1ad0c222b Bug 1249451 - nsCycleCollector::ScanRoots may cause some unexpected purple buffer usage, r=mccr8 2016-02-19 13:09:20 +02:00
Andrew McCreight
f84e7d971f Bug 1052793, part 1 - Do per-zone GC for CC_WAITING triggers. r=smaug 2016-02-18 15:21:48 -08:00
Chris Pearce
d97e9085a6 Bug 1200514 - Run remaining stable state runnables after final cycle collection. r=froydnj,mccr8 2016-01-13 11:37:57 +13:00
Tom Tromey
2177f7ad7f Bug 757969 - use __thread in ThreadLocal; r=froydnj 2016-01-22 10:33:44 -07:00
Nicholas Nethercote
c8eab93d34 Bug 1237169 (follow-up) - Fix static analysis bustage. r=me. 2016-01-06 15:31:46 -08:00
Nicholas Nethercote
7bce317411 Bug 1237169 - Remove some unused parameters in and around xpcom/base/. r=mccr8. 2016-01-05 19:32:28 -08:00
Olli Pettay
4771877f66 Bug 1120016 - Allocate short lived JS wrappers in the Nursery, r=mccr8,terrence 2015-12-31 15:21:49 +02:00
Wes Kocher
b6dde9f28a Backed out changeset 0d55a6e4e98e (bug 1120016) for 980 b2g hazards 2015-12-30 16:34:18 -08:00
Olli Pettay
ed8008ccd2 Bug 1120016 - Allocate short lived JS wrappers in the Nursery, r=mccr8,terrence 2015-12-30 19:16:13 +02:00
Nick Fitzgerald
56b8e139fb Bug 1225618 - Do not capture stacks for cycle collection timeline markers; r=vporof 2015-11-23 16:50:56 +01:00
Nathan Froyd
4e6d8f6705 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
2015-10-18 01:24:48 -04:00
Andrew McCreight
5d041e8902 Bug 1208157, part 2 - Make the fields of nsCycleCollector private. r=smaug
These are accidentally exposed by the NS_DECL.
2015-09-25 10:43:21 -07:00
Andrew McCreight
b08c720e18 Bug 1208157, part 1 - Add and use nsCycleCollector::IsIdle() predicate. r=smaug 2015-09-25 10:43:21 -07:00
Andrew McCreight
e5eec3fba6 Bug 1202670 - Move most of nsCycleCollector::RemoveObjectFromGraph into CCGraph. r=smaug 2015-09-25 10:43:21 -07:00
Mike Hommey
f64c5cadc8 Bug 1203840 - Trigger dirty pages purge after CC. r=njn,r=smaug,r=mccr8
Jemalloc 4 purges dirty pages regularly during free() when the ratio of dirty
pages compared to active pages is higher than 1 << lg_dirty_mult.  We set
lg_dirty_mult in jemalloc_config to limit RSS usage, but it also has an impact
on performance.

So instead of enforcing a high ratio to force more pages being purged, we keep
jemalloc's default ratio of 8, and force a regular purge of all dirty pages,
after cycle collection.

Keeping jemalloc's default ratio avoids cycle-collection-triggered purge to
have to go through really all dirty pages when there are a lot, in which case
the normal jemalloc purge during free() will already have kicked in. It also
takes care of everything that doesn't run the cycle collector still having
a level of purge, like plugins in the plugin-container.

At the same time, since jemalloc_purge_freed_pages does nothing with jemalloc 4,
repurpose the MEMORY_FREE_PURGED_PAGES_MS telemetry probe to track the time
spent in this cycle-collector-triggered purge.
2015-09-20 17:43:43 +09:00
Andrew McCreight
281bd0fafb Bug 1205348 - Always do shutdown CCs when NS_FREE_PERMANENT_DATA is defined. r=smaug 2015-09-16 10:10:00 +02:00
Nicholas Nethercote
829edf1dcd Bug 1121760 (part 6) - Move all remaining PL_DHash*() functions into PLDHashTable. r=poiru. 2015-09-14 14:23:47 -07:00
Nicholas Nethercote
3bbd89a422 Bug 1121760 (part 2) - Remove PL_DHashTableAdd(). r=poiru. 2015-09-14 14:23:12 -07:00
Nicholas Nethercote
f9fdfba566 Bug 1121760 (part 1) - Remove PL_DHashTableSearch(). r=poiru. 2015-05-21 00:34:25 -07:00
Nicholas Nethercote
f437608d1a Bug 1202526 (part 8) - Use PLDHashTable::RemoveEntry() in the cycle collector. r=mccr8.
This avoids repeating the hash table search in order to remove a CC graph
entry, which is good because it's a common operation.
2015-09-07 21:15:32 -07:00
Andrew McCreight
d0367942b5 Bug 1200795, part 2 - Add memory reporting for CCGraph::mPtrToNodeMap. r=njn 2015-09-04 09:45:44 -07:00
Andrew McCreight
13a193098f Bug 1200795, part 1 - Eliminate excessive detail from cycle collector graph memory reporting. r=njn 2015-09-04 09:45:44 -07:00
Terrence Cole
58827ba017 Bug 1193032 - Part 2: Make unlimited SliceBudget initialization explicit; r=ehoogeveen,r=mccr8 2015-08-11 08:42:24 -07:00