Commit Graph

5348 Commits

Author SHA1 Message Date
Andrew McCreight
5b9c57b7a2 Bug 1301301, part 1 - Unify NoteJSObject and NoteJSScript into NoteJSChild. r=smaug
This will let my next patch pass in other GC things.

This should not change behavior in any important way.

MozReview-Commit-ID: FykviKKvQzI
2016-09-23 15:42:13 -07:00
Jan de Mooij
ff16d58af3 Backed out changeset aad183efb09a (bug 1303754) for regressions. 2016-09-23 09:50:47 +02:00
Terrence Cole
02f5e80db6 Bug 1245316 - Use Rooted<GCVector> to implement AutoVector; r=sfink
--HG--
extra : rebase_source : 24a7c4e21ea94820d94a4e8454044e4f1988365e
2016-09-22 17:01:38 -07:00
Ehsan Akhgari
f993ff03ab Bug 1297687 - Part 4: Specify an OriginAttribute for the XBL content's expanded principal; r=bholley 2016-09-22 13:27:58 -04:00
Ehsan Akhgari
e45aad00ec Bug 1297687 - Part 3: Ensure that the expanded principal of a sandbox has a sensible OriginAttributes; r=bholley
This patch allows specifying an OriginAttributes when creating a sandbox
using Components.utils.Sandbox() by specifying an originAttributes
member on the options dictionary.

If an OA is specified in this way, it is used for creating codebase
principals from the string arguments passed to the function.  Otherwise,
if one or more principals are passed in the array argument to Sandbox(),
the OA of the principal(s) is used to construct codebase principals from
the strings inside the array.  In this case, we check to make sure that
all of the passed principals have the same OA, otherwise we'll throw an
exception.

In case no explicit OA is specified and no principals are passed in the
array argument, we create the codebase principals using a default OA.
2016-09-22 13:27:51 -04:00
Steve Fink
3d7c5d34f5 Bug 1303461 - Limit Android stack size to 3/4 of the actual 1MB, r=jandem
--HG--
extra : rebase_source : fc0994289923f36c577dd97e1d5eb35747102e36
2016-09-19 10:08:18 -07:00
Benjamin Bouvier
b81b572a1c Bug 1303013: Account memory for wasm guard pages; r=njn, r=luke
MozReview-Commit-ID: BHS1UfgT1yf

--HG--
extra : rebase_source : 7fea9606f776a904870fdfb4bbb93e43fd4b0a44
2016-09-19 19:39:50 +02:00
Jan de Mooij
3b07adfba8 Bug 1303754 - Don't use the lazySource option for JSMs, so we can benefit from syntax parsing. r=bholley 2016-09-22 10:15:36 +02:00
Tom Schuster
2f144c36e0 Bug 1299593 - Disable Array.prototype.values outside Nightly. r=jorendorff, r=smaug
--HG--
extra : rebase_source : 976a15181c0d263b62094a1524b8a27cf7c1fc4d
2016-09-21 11:53:00 -04:00
Carsten "Tomcat" Book
23879d2b18 Merge mozilla-central to mozilla-inbound 2016-09-21 12:07:46 +02:00
Andi-Bogdan Postelnicu
c574b38335 Bug 1301333 - mark XPCJSContext::Initialize as initialisation function for XPCJSContext. r=bobbyholley
MozReview-Commit-ID: HYj244xg1VD
2016-09-16 15:00:52 +03:00
Andrew McCreight
51db16e7f5 Bug 1288909, part 4 - Use a strong reference to the set in ClassInfo2NativeSetMap. r=billm
Entries should end up getting cleared out from this table before the
value dies, so let's just make the reference strong so that any
mistakes will result in leaks and not use-after-frees.

Using smart pointer classes with PLDHashtable is a little
questionable, and I don't want to convert this one hash table to
nsTHashtable, so I use manual addref and release.

MozReview-Commit-ID: Kfg9veS6r11

--HG--
extra : rebase_source : 865ab48c2cf67546dd705cf79f8873efe695ac5c
2016-09-06 12:58:27 -07:00
Andrew McCreight
946ffa2384 Bug 1288909, part 3 - XPCWrappedNative:: and XPCWrappedNativeProto::Mark() don't do anything any more. r=billm
Also clean up some random comments for code that was deleted earlier.

MozReview-Commit-ID: 8JQx0FAH8wA

--HG--
extra : rebase_source : 614bda8caf0647ff0220986904ac6fb5fd4573a8
2016-08-05 13:56:14 -07:00
Andrew McCreight
58a9259670 Bug 1292694 - Don't skip marking at Shutdown due to fear of "bad locking problems". r=mrbkap
MozReview-Commit-ID: HetNpQR2s8Y

--HG--
extra : rebase_source : 727a86bcacf35c6f0ab68ba69d1860839cb27730
2016-08-05 15:19:41 -07:00
Andrew McCreight
93c15e825f Bug 1288909, part 2 - Remove a bunch of now-useless XPCNativeSet marking-related things. r=billm
MozReview-Commit-ID: 4YRn9Wx64a4

--HG--
extra : rebase_source : 7298dfd78142a1d544922fb5f78f7ca4a5562a6c
2016-07-27 16:38:42 -07:00
Andrew McCreight
bbaa5c3f54 Bug 1288909, part 1 - Implement refcounting of XPCNativeSet. r=billm
This patch is similar to bug 1288870.

Strong references:

- XPCCallContext::mSet: Like XPCNativeInterface, this only roots it
when |mState >= HAVE_NAME|, and again this only requires changing
SystemIsBeingShutDown().

- XPCWrappedNativeProto::mSet and XPCWrappedNative::mSet. These become
RefPtrs.

- stack: AutoMarkingNativeSetPtr become RefPtr<XPCNativeSet>. This
lets me eliminate some uses of AutoJSContext. This is the bulk of the
patch.

Weak references:

- mNativeSetMap. This reference gets cleared in the dtor. This
requires bug 1290239 to actually find the entry for removal.

- mClassInfo2NativeSetMap. The reference is in the value for this hash
table, and we don't have the key in the set dtor. Fortunately, the
only code that adds to this table is
XPCNativeSet::GetNewOrUsed(nsIClassInfo* classInfo), which in turn is
only called by GetNewOrUsed(nsIClassInfo* classInfo). This code
creates a new XPCWrappedNativeProto, which (with my patch) holds a
strong reference to the set that has been added to the table. This set
is never changed or released until the dtor for the proto, which calls
ClearCacheEntryForClassInfo(), removing the entry from the
hashtable. Thus, the lifetime of the set is always going to be longer
than the lifetime of the entry.

Other notes:

- Like XPCNativeInterface, this class uses placement |new| that
requires a special destruction function, which with my patch is hidden
away in the refcounting code.

- This patch delete a bunch of marking/sweeping code from
XPCJSRuntime::FinalizeCallback(), because the lifetimes are managed by
the refcounting now. Some of the marking code is left behind to be
cleaned up in a later patch.

- I didn't see any methods that had XPCNativeSet** outparams.

- MOZ_COUNT_{CTOR,DTOR}(XPCNativeSet) is not needed because it is now
refcounted.

MozReview-Commit-ID: 7oTorCwda1n

--HG--
extra : rebase_source : 0c477e18c405e4ea88393279cf8bea62c5b0f4c7
2016-07-27 16:38:30 -07:00
Bill McCloskey
a51047b439 Bug 1279086 - Allow multiple interrupt callbacks (r=dvander) 2016-09-16 20:33:49 -07:00
Wes Kocher
14c8653f72 Merge inbound to central, a=merge 2016-09-15 16:28:10 -07:00
Andrew McCreight
ac4b6dabc5 Bug 1300830 - Remove XPCJSRuntime::mDetachedWrappedNativeProtoMap. r=mrbkap
Nothing is ever added to this hash table.

MozReview-Commit-ID: 7gmlBZKNPOc

--HG--
extra : rebase_source : 9a14e405facedc8148c5dd8e363f98c691e23231
2016-09-07 11:49:38 -07:00
Jan de Mooij
7f794780e0 Bug 1302448 part 2 - Rename XPCJSRuntime to XPCJSContext. r=mrbkap
--HG--
rename : js/xpconnect/src/XPCJSRuntime.cpp => js/xpconnect/src/XPCJSContext.cpp
extra : rebase_source : e6b435ab1ca2739e340669195dff77c561ea573e
2016-09-14 15:48:17 +02:00
Jan de Mooij
a53986bf29 Bug 1302448 part 1 - Rename CycleCollectedJSRuntime to CycleCollectedJSContext. r=mccr8
--HG--
rename : xpcom/base/CycleCollectedJSRuntime.cpp => xpcom/base/CycleCollectedJSContext.cpp
rename : xpcom/base/CycleCollectedJSRuntime.h => xpcom/base/CycleCollectedJSContext.h
extra : rebase_source : 075214b5057f151520926715b6154e99ae80a0b3
2016-09-14 15:47:32 +02:00
Benjamin Bouvier
daec611782 Bug 1288778: Add a telemetry probe for usage of asm.js / wasm; r=luke, data-review=bsmedberg
MozReview-Commit-ID: D8yiiobompo

--HG--
extra : rebase_source : 889800ed00a5f05522bd8235491dfd0bee059f9a
extra : amend_source : 268b1d5b811e58d2748f9780992e4769432cb681
2016-09-08 16:07:15 +02:00
Zibi Braniecki
8ef8bb9efc Bug 1289340 - Expose Intl.DateTimeFormat.prototype.formatToParts. r=waldo
MozReview-Commit-ID: Ii7TqMDRzu4
2016-09-13 20:49:21 -07:00
Terrence Cole
6af2f7d660 Bug 1257387 - Move OOM callback annotation to the common runtime for workers; r=mccr8
--HG--
extra : rebase_source : 3278a5bc32ce245003b890fbfbbf4f32e3d42944
2016-09-13 10:57:07 -07:00
Nicholas Nethercote
8c9e80a613 Bug 1297300 - Add missing checks to GetSpec() calls in caps/ and js/. r=mrbkap.
This required making GetScriptLocation() fallible.

--HG--
extra : rebase_source : a678e86c443988897d88550bec1cd1d21c3e919e
2016-08-30 14:22:04 +10:00
Tooru Fujisawa
b2e122e612 Backed out changeset 8272530c90ef (bug 1276626) for bug 1284511 r=blassey 2016-09-09 00:45:40 +09:00
Tooru Fujisawa
cbdf488f5b Backed out changeset 2872d7dca33b (bug 1284511) r=blassey 2016-09-09 00:45:40 +09:00
Michael Layzell
e12728495c Bug 1018486 - Part 9: Changes to account for modifications to clang plugin, r=ehsan
MozReview-Commit-ID: EPQMbfHYxUK
2016-09-07 10:50:47 -04:00
Michael Layzell
36e08437d0 Bug 1018486 - Part 8: Various other changes, r=smaug
MozReview-Commit-ID: B0dsomkWgEk
2016-09-07 10:50:45 -04:00
Till Schneidereit
5f85932d39 Bug 1298597 - Properly handle the target Promise having been nuked in resolve/reject functions for xray'd Promises. r=jandem
MozReview-Commit-ID: EBAwzff9vOM
2016-09-05 14:48:38 +02:00
Tooru Fujisawa
382083077f Bug 1284511 - Fix slow script check to use elapsed time from last check. r=mrbkap 2016-09-03 09:51:15 +09:00
Wes Kocher
a2e7bd60fc Merge m-c to inbound, a=merge 2016-09-02 13:34:10 -07:00
Wes Kocher
a2ca4e17ce Backed out changeset 1e7eb0625d3e (bug 1297687) a=merge 2016-09-02 13:18:37 -07:00
Tom Schuster
b84fb2a919 Bug 1299321 - DOM test changes for Promise @@toStringTag. r=bz 2016-09-02 18:39:50 +02:00
Tom Schuster
55a65363a9 Bug 1299321 - Make DOM/Xray handle string values in JSPropertySpec. r=peterv 2016-09-02 18:39:50 +02:00
Boris Zbarsky
bd36520bb6 Bug 1302849 part 1. Remove the now-dead SCSecurityXrayXPCWN thing. r=mrbkap 2016-09-15 11:41:45 -04:00
Boris Zbarsky
0fd831e559 Bug 1302304. Remove IDL bits that reference nsIDOMMediaError; it's not needed anymore. r=bkelly 2016-09-15 11:41:35 -04:00
Nicholas Nethercote
b71747b2ac Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.

--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
2016-09-01 15:01:16 +10:00
Ehsan Akhgari
7d8261a6b9 Bug 1297687 - Use the OriginAttributes associated with a window principal when creating a Sandbox with an expanded principal; r=baku 2016-09-01 14:34:23 -04:00
André Bargull
96b7707bfe Bug 1121938 - Implement TypedArray.prototype.toString and .toLocaleString. r=waldo 2016-08-11 09:31:22 -07:00
Wes Kocher
cbdf3625fa Merge m-c to inbound, a=merge 2016-08-26 16:32:56 -07:00
Wes Kocher
f09e8fef1a Merge inbound to central, a=merge 2016-08-26 16:20:50 -07:00
Boris Zbarsky
6a73ce5a82 Bug 1295322 part 1. Make ThrowExceptionObject return void, instead of bool. r=bholley 2016-08-26 15:38:16 -04:00
Terrence Cole
dea2d7e2f4 Bug 1296484 - Automatically run a CC if COMPARTMENT_REVIVED GC ends mostly gray; r=jonco,r=mccr8
--HG--
extra : rebase_source : 94482f4c09e640ca9e0436316c992457dd5b9f61
2016-08-18 13:30:32 -07:00
Ryan VanderMeulen
e1fdfb3b73 Merge inbound to m-c. a=merge 2016-08-26 09:37:03 -04:00
Andrew McCreight
e1f78c53f2 Bug 1290239, part 2 - Add assertions about inserting into NativeSetMap. r=mrbkap
If we are inserting an XPCNativeSet into a NativeSetMap, and we failed
to find it, then the insertion should not have found some other set
there already.

Additionally in this case, the hash value of a XPCNativeSetKey for the
set we are inserting should be the same as the key we used to insert
the set into the map. If this property does not hold, then we can't
use Remove() to remove the set from the map. This condition would have
caught the error that part 1 fixes.

MozReview-Commit-ID: 23v37GzA4XV

--HG--
extra : rebase_source : 4dca7ffc436f53214eb2927bc1ff2f71927f7ac3
2016-07-29 13:19:57 -07:00
Andrew McCreight
8d254f9e91 Bug 1290239, part 1 - Compute the correct hash value for an XPCNativeSetKey when mBaseSet is null. r=mrbkap
The current hash function fails to take into account that all
XPCNativeSets have nsISupports as their first element.

MozReview-Commit-ID: 7B8TPVnaM7I

--HG--
extra : rebase_source : a357f88a7d54aa1c9f58b6d429d4a5bbaaa13e80
2016-07-29 11:41:48 -07:00
Andrew McCreight
dadb0e9351 Bug 1295684 - Make JSObject2WrappedJSMap infallible. r=mrbkap
We crash sometimes if we fail to add. We should always crash, because
we don't properly attempt to handle failure, and it would be nice to
get proper OOM-annotated crash reports.

MozReview-Commit-ID: EGgYxPdUSky

--HG--
extra : rebase_source : 92faf09c52452089b32cc430c04568b81e677f74
2016-08-16 11:12:00 -07:00
Wes Kocher
00bdbfd6e2 Backed out changeset bbd6bdd463b1 (bug 1296484) for asan leaks in XPCJSRuntime a=backout 2016-08-25 17:25:00 -07:00
Wes Kocher
50954c6f31 Merge m-c to autoland, a=merge 2016-08-25 17:15:05 -07:00