Граф коммитов

164 Коммитов

Автор SHA1 Сообщение Дата
Terrence Cole 0716d4888f Bug 1199843 - Part 3: Strongly type JS::TraceChildren; r=jonco r=mccr8
--HG--
extra : rebase_source : c779897338dc4b73dca98517acb8d0eef7e0d7a5
2015-09-02 11:34:36 -07:00
Kyle Huey e5b6091772 Bug 1195755: Don't assert recursion depth sanity on Mac, because there is none. r=me
--HG--
extra : rebase_source : 6c0c24ead27200b30302828dea22c50219c79a2c
2015-08-21 19:56:56 -07:00
Kyle Huey 76e3009ab8 Bug 1179909: Refactor stable state handling. r=smaug
This is motivated by three separate but related problems:

1. Our concept of recursion depth is broken for things that run from AfterProcessNextEvent observers (e.g. Promises). We decrement the recursionDepth counter before firing observers, so a Promise callback running at the lowest event loop depth has a recursion depth of 0 (whereas a regular nsIRunnable would be 1). This is a problem because it's impossible to distinguish a Promise running after a sync XHR's onreadystatechange handler from a top-level event (since the former runs with depth 2 - 1 = 1, and the latter runs with just 1).

2. The nsIThreadObserver mechanism that is used by a lot of code to run "after" the current event is a poor fit for anything that runs script. First, the order the observers fire in is the order they were added, not anything fixed by spec. Additionally, running script can cause the event loop to spin, which is a big source of pain here (bholley has some nasty bug caused by this).

3. We run Promises from different points in the code for workers and main thread. The latter runs from XPConnect's nsIThreadObserver callbacks, while the former runs from a hardcoded call to run Promises in the worker event loop. What workers do is particularly problematic because it means we can't get the right recursion depth no matter what we do to nsThread.

The solve this, this patch does the following:

1. Consolidate some handling of microtasks and all handling of stable state from appshell and WorkerPrivate into CycleCollectedJSRuntime.
2. Make the recursionDepth counter only available to CycleCollectedJSRuntime (and its consumers) and remove it from the nsIThreadInternal and nsIThreadObserver APIs.
3. Adjust the recursionDepth counter so that microtasks run with the recursionDepth of the task they are associated with.
4. Introduce the concept of metastable state to replace appshell's RunBeforeNextEvent. Metastable state is reached after every microtask or task is completed. This provides the semantics that bent and I want for IndexedDB, where transactions autocommit at the end of a microtask and do not "spill" from one microtask into a subsequent microtask. This differs from appshell's RunBeforeNextEvent in two ways:
a) It fires between microtasks, which was the motivation for starting this.
b) It no longer ensures that we're at the same event loop depth in the native event queue. bent decided we don't care about this.
5. Reorder stable state to happen after microtasks such as Promises, per HTML. Right now we call the regular thread observers, including appshell, before the main thread observer (XPConnect), so stable state tasks happen before microtasks.
2015-08-11 06:10:46 -07:00
Nicholas Nethercote d98d14fa1e Bug 1189156 (part 4) - Don't use enumeration style for nsBaseHashtable::SizeOf{In,Ex}cludingThis(). r=erahm,jfkthame.
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)

--HG--
extra : rebase_source : f98420176f50990bbc5a25e35788328154cfeb00
2015-07-30 21:19:57 -07:00
Ryan VanderMeulen fb6b2747d5 Bug 1180017 - Fix up the badly-horked backout and re-land.
CLOSED TREE

--HG--
extra : amend_source : 0b7ac18429b248cf05cfe33f6b2f6efdf1602c38
extra : histedit_source : bdb11dafa100809ec17491e5711fb0b507e023c6%2C5e4134650a804859dc8b3078688fa4655052263f
2015-07-29 12:31:47 -04:00
Jim Blandy 4e8fc0bdcb Bug 1180017 - Give GCCellPtr is<T> and to<T> methods, replacing isFoo and toFoo methods. Fix callers. r=terrence 2015-07-03 15:06:23 -07:00
Carsten "Tomcat" Book 25a2a75a56 Backed out changeset 465793bc6fcf (bug 1180017) for suspicion of causing bug 1188799 2015-07-29 15:27:12 +02:00
Jim Blandy ff7cc06ef6 Bug 1180017: Give GCCellPtr is<T> and as<T> methods, replacing isFoo and toFoo methods. Fix callers. r=terrence
--HG--
extra : rebase_source : 4a381c5d8427ad2995426e65c69af1597b1557c2
2015-07-07 09:52:01 -07:00
Kyle Huey ee4f5ba9fb Bug 1185470: Remove 'Get' prefixes from hashtable iterator methods. r=froydnj 2015-07-20 20:21:28 +08:00
Andrew McCreight 807cd2fbe2 Bug 1182318 - Part 2: Remove Closure from CycleCollectedJSRuntime. r=smaug
Closure is now just a wrapper around a single boolean, so instead pass a pointer to the boolean.
2015-07-14 08:01:00 -04:00
Andrew McCreight ee6ab85145 Bug 1182318 - Part 1: Remove Closure::mCb. r=smaug
This field no longer needs to be passed in the closure thanks to the iterator.
2015-07-14 08:01:00 -04:00
Nicholas Nethercote 70347ce8c5 Bug 1181445 (part 10) - Use nsBaseHashTable::Iterator in CycleCollectedJSRuntime. r=mccr8.
--HG--
extra : rebase_source : 04841562dbe03e48b37c941b540ade0c493ba4e6
2015-07-09 16:54:59 -07:00
Jan de Mooij 976586cb5f Bug 1177825 - Remove JSVAL_* constants. r=evilpie 2015-06-29 18:36:44 -07:00
Andrew McCreight e7103d0010 Bug 1174796 - Make sure ReleaseNow releases everything. r=smaug 2015-06-16 14:19:07 -07:00
Terrence Cole 7afa7dfb04 Bug 1173889 - Strongly type the CallbackTracer dispatch function; r=jonco, r=mccr8
--HG--
extra : rebase_source : 413319f0701f8e92b8fc1c79a51f4a09c2c5cd39
2015-06-11 10:03:33 -07:00
Eric Rahm ae0305135a Bug 1171722 - Part 4: Don't warn if DebuggerOnGCRunnable::Enqueue fails during shutdown. r=mccr8 2015-06-10 21:31:35 -07:00
Terrence Cole 5dd32db8cf Bug 1169086 - Use virtual dispatch to implement callback tracer; r=jonco, r=mccr8
--HG--
extra : rebase_source : 8da1af998621319f7a0112f1870080dd8835063e
2015-05-28 16:35:08 -07:00
Terrence Cole 7b5343e7f9 Bug 1169692 - Use virtual dispatch in WeakMapTracer instead of function pointers; r=sfink, r=mccr8 2015-06-01 13:14:11 -07:00
Ryan VanderMeulen 2e35b1209f Merge inbound to m-c. a=merge 2015-05-29 09:32:46 -04:00
Andrew McCreight addc4dacac Bug 1155303 - Add telemetry for async DeferredFinalize max pause. r=smaug 2015-05-18 11:54:00 -04:00
Yanis Sellami 4562d9ef59 Bug 967031 - Rename DumpHeapComplete to DumpHeap; r=terrence 2015-05-22 11:22:56 +02:00
Terrence Cole c01ef51c2d Bug 1167453 - Rename JSGCTraceKind and make it a C++11 enum class; r=jonco
--HG--
extra : rebase_source : 7dbeee0826fa20477ed227c9d336fdfe6de6ffd2
2015-05-22 10:40:24 -07:00
Terrence Cole 161a4c26ba Bug 1164602 - Replace js::NullPtr and JS::NullPtr with nullptr_t; r=sfink 2015-05-13 14:07:34 -07:00
Boris Zbarsky b8ba520783 Bug 1087330. Make the data structure we use for our promise microtask queue have O(1) first element removal, not O(N). r=khuey 2015-05-01 22:33:01 -04:00
Nick Fitzgerald b3ed721b3e Bug 1158257 - Gecko should always provide SpiderMonkey with a debuggerMallocSizeOf; r=mccr8 2015-04-27 10:58:24 -07:00
Brian Hackett 12ce37a8a6 Bug 1155033 - Handle cyclic or deep ObjectGroup tracing chains during cycle collection, r=terrence. 2015-04-24 18:22:15 -06:00
Nick Fitzgerald d67ed8553a Bug 1150253 - Part 2: Gecko should provide a callback for SpiderMonkey to
enqueue the onGarbageCollection hook runnable; r=mccr8
2015-04-22 09:43:02 -07:00
Terrence Cole 5f83d02dfb Bug 1153959 - Use RAII to manage tracing details; r=jonco
--HG--
extra : rebase_source : 9b53b4106e369e62f6d7503a619da89559bd9c02
2015-04-10 13:33:56 -07:00
Andrew McCreight e674d4f8f3 Bug 1154403 - Reduce incremental finalize slice time to 5ms. r=smaug
--HG--
extra : rebase_source : a7aba3cdad11a7e7e1ab4986a99eeaec5390d3a5
2015-04-15 08:04:00 +02:00
David Rajchenbach-Teller b08ce98d2a Bug 1083361 - Exposing a PromiseDebugging API to monitor uncaught DOM Promise. r=bz
--HG--
extra : rebase_source : cba2fc37d263d431c3008739a89a4fe47d10b7da
2015-04-10 17:27:57 +02:00
Terrence Cole dd4ddb761b Bug 1135985 - Split callback and marking tracers completely; r=jonco, r=mccr8
--HG--
extra : rebase_source : b2e435ebf64ec0bac42af7a8f0968578599fd67b
2015-02-25 13:11:37 -08:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Daniel Holbert 082fd9cd7f Bug 1142841: Convert all nsRefPtr<nsIRunnable> to nsCOMPtr<nsIRunnable>. r=ehsan
This patch was generated by a script.  Here's the source of the script for
future reference:

find . \( -iname "*.cpp" -o -iname "*.h" \) | \
  xargs -n 1 sed -i "s/nsRefPtr<nsIRunnable>/nsCOMPtr<nsIRunnable>/g"
2015-03-17 09:29:17 -07:00
Andrew McCreight b1093185b2 Bug 1114804 - Make ISupports use the standard deferred finalizer code. r=peterv 2015-03-10 08:35:47 -07:00
Boris Zbarsky 05aaddd360 Bug 1131805 part 1. Remove remaining JS_GetParent and js::GetObjectParent uses in Gecko. r=bholley 2015-03-06 16:33:31 -05:00
Boris Zbarsky 8346b9dfaf Bug 928336. Make defining unforgeable properties on objects faster by just copying them from an unforgeable holder object. r=peterv 2015-03-03 21:01:58 -05:00
Andrew McCreight aec1aac3c6 Bug 1125005 - Change the reentrance assertion in IncrementalFinalizeRunnable to a warning. r=smaug 2015-02-06 09:54:21 -08:00
Andrew McCreight 82f576b6d9 Bug 1118044, part 2 - Use GCCellPtr in NoteJSChild. r=smaug,terrence
Also, strongly type the JS_TraceShapeCycleCollectorChildren function, and add an
isShape() method to GCCellPtr.
2015-01-08 15:30:54 -08:00
Andrew McCreight 37e6ea860b Bug 1118044, part 1 - Use GCCellPtr in CycleCollectedJSRuntime::TraverseGCThing. r=smaug 2015-01-08 15:30:54 -08:00
Andrew McCreight c9b9054838 Backout bug 1052793 for exposing bad decommitting behavior for compartmental GCs. 2015-01-08 09:54:13 -08:00
Jon Coppeard 0b1dcc49a2 Bug 1099152 - Make external GC APIs take invocation kind as a parameter r=terrence r=mccr8 2015-01-02 17:19:43 +00:00
Steven Michaud 1569a5d591 Bug 997908 - crash in ReleaseSliceNow(unsigned int, void*) accessing memory at 0x5a5a5a5a5a5a5a5a, another test patch. r=continuation 2014-12-19 17:26:13 -06:00
Terrence Cole 20e03ef2a5 Bug 1105069 - Part 17: Convert xpc_IsGrayGCThing to GCCellPtr; r=mccr8, j=jonco
--HG--
extra : rebase_source : 9fdc5ac9ca8de9c12a399532db7e77bc34abb7da
2014-12-05 09:38:34 -08:00
Terrence Cole e4a4d0c7fa Bug 1105069 - Part 14: Convert NoteJSChild to GCCellPtr; r=mccr8, r=jonco
--HG--
extra : rebase_source : 2338e0a57779401f9bc4744bc2fa59a4b31d76bf
2014-12-05 09:38:34 -08:00
Andrew McCreight 9d83b26756 Bug 1052793 - Do per-zone GC for CC_WAITING triggers. r=smaug 2014-12-13 21:17:35 -08:00
Terrence Cole c74065a925 Bug 1105069 - Part 12: Convert VisitGrayWrapperTargets to GCCellPtr; r=jonco, r=mccr8
--HG--
extra : rebase_source : e74a8a70f5110cb64787fa3ef9669819f0d24c85
2014-12-05 09:38:33 -08:00
Terrence Cole 81bda611c6 Bug 1105069 - Part 11: Convert UnmarkGrayGCThingRecursively to GCCellPtr; r=jonco, r=mccr8
--HG--
extra : rebase_source : da3b54ac1300838bbe66dbd74af89ff56302ba23
2014-12-05 09:38:33 -08:00
Terrence Cole b3fb25bc3f Bug 1105069 - Part 10: Convert NoteWeakMapping to GCCellPtr; r=jonco, r=mccr8
--HG--
extra : rebase_source : b660a676c03c4a0bbdc521a6401a2a619543aa2a
2014-12-05 09:38:32 -08:00
Terrence Cole ac87e752c8 Bug 1105069 - Part 9: Strongly type NoteWeakMapChildrenTracer; r=mccr8
--HG--
extra : rebase_source : d9022b88da99b7c8df01cc222cd98f83ed795ecb
2014-12-05 09:38:32 -08:00
Terrence Cole 1bb5471d19 Bug 1105069 - Part 8: Remove implicit cast from GCCellPtr to js::gc::Cell*; r=jonco, r=mccr8
--HG--
extra : rebase_source : 0dfb2314f5d20770b7b92fa9fde23cb6c41f20d8
2014-12-01 22:34:25 -08:00