Commit Graph

5732 Commits

Author SHA1 Message Date
Phil Ringnalda
f8d5e6ddf9 Backed out 3 changesets (bug 1354682) for sessionstore browser-chrome bustage
CLOSED TREE

Backed out changeset 55405fd328f9 (bug 1354682)
Backed out changeset 56b8122e64a3 (bug 1354682)
Backed out changeset 9374009a95e5 (bug 1354682)

MozReview-Commit-ID: BNVhwID8NwD
2017-04-28 20:24:34 -07:00
Andrew Swan
46e486f880 Bug 1354682 Add transform to XPCOMUtils.defineLazyPreferenceGetter r=kmag
MozReview-Commit-ID: Lm59IHMNcy9

--HG--
extra : rebase_source : 796d9b0b7a6bf94782ebeeaf35d237176687c0ac
2017-04-28 16:10:44 -07:00
Jan de Mooij
f480e9ecdf Bug 1237504 - Refactor proxy slot layout to allow proxies to have more than 2 slots. r=bz,jonco
The patch makes the following proxy changes:

* The number of slots in ProxyValueArray is now dynamic and depends on the number of reserved slots we get from the Class.
* "Extra slots" was renamed to "Reserved slots" to make this clearer.
* All proxy Classes now have 2 reserved slots, but it should be easy to change that for proxy Classes that need more than 2 slots.
* Proxies now store a pointer to these slots and this means GetReservedSlot and SetReservedSlot can be used on proxies as well. We no longer need GetReservedOrProxyPrivateSlot and SetReservedOrProxyPrivateSlot.

And some changes to make DOM Proxies work with this:

* We now store the C++ object in the first reserved slot (DOM_OBJECT_SLOT) instead of in the proxy's private slot. This is pretty nice because it matches what we do for non-proxy DOM objects.
* We now store the expando in the proxy's private slot so I removed GetDOMProxyExpandoSlot and changed the IC code to get the expando from the private slot instead.
2017-04-28 14:12:28 +02:00
Bill McCloskey
9862d9c932 Bug 1359245 - Remove some tracing callbacks at shutdown (r=mccr8)
When we just had CycleCollectedJSContext (and no CycleCollectedJSRuntime) a
weird thing happened at shutdown:
1. We would call JS_DestroyContext from ~CycleCollectedJSContext. By that time,
   the ~XPCJSContext destructor had already finished.
2. Destroying the context runs a final GC. That GC would call back into various
   GC callbacks, such as TraceBlackJS and TraceGrayJS.
3. These callbacks would do a virtual method call:
   http://searchfox.org/mozilla-central/rev/876c7dd30586f9c6f9c99ef7444f2d73c7acfe7c/xpcom/base/CycleCollectedJSRuntime.cpp#791
4. Normally this method call would call into
   XPCContext::TraceNativeBlackRoots. However, C++ changes the vtable for an
   object during destruction. So we would only call CycleCollectedJSContext's
   version of TraceNativeBlackRoots, which is empty. So we never traced anything.

When I moved this code into the runtime, we actually do call into
XPCJSRuntime::TraceNativeBlackRoots at that time. So the behavior changed, and
that was causing crashes once I nulled out the TLS as you asked. So I removed
these callbacks for the last GC.

MozReview-Commit-ID: 3do13bjpwQj
2017-04-27 15:34:46 -07:00
Bill McCloskey
1d5c5ef48b Bug 1359245 - Keep a linked list of CycleCollectedJSContexts in the runtime (r=mccr8)
This patch keeps a list of all the cooperatively scheduled contexts that are
linked to a runtime. In places where we need to iterate over all contexts (for
GC, specifically), it iterates over the list.

MozReview-Commit-ID: 3pKJX78f2l0
2017-04-27 15:34:46 -07:00
Bill McCloskey
267ad1f2b0 Bug 1359245 - Initial support for cooperative contexts (r=mccr8)
This patch adds initial support for cooperatively scheduled
CycleCollectedJSContexts.

MozReview-Commit-ID: 5pfPubHUanL
2017-04-27 15:34:46 -07:00
Bill McCloskey
11b1f07146 Bug 1359245 - Get rid of CycleCollectedJSRuntime::MainContext (r=mccr8)
This is another method that assumes one context per runtime. This patch
eliminates the method.

MozReview-Commit-ID: JHcQ1nyiHSP
2017-04-27 15:34:46 -07:00
Bill McCloskey
1e5747d0b4 Bug 1359245 - Eliminate nsXPConnect::mContext (r=mccr8)
This field assumes there is one XPCJSContext globally (i.e., per nsXPConnect
instance). This patch eliminates the field by using different paths to
reach the context.

MozReview-Commit-ID: FjR6cTZ5QfZ
2017-04-27 15:34:46 -07:00
Bill McCloskey
133ed14a85 Bug 1359245 - Eliminate some XPCJSContext::Get() usage (r=mccr8)
XPCJSContext::Get() now does a TLS lookup, which is a little more expensive
than looking up a global variable. This patch removes as many of the TLS
lookups as possible.

MozReview-Commit-ID: GsqzJn55Lya
2017-04-27 15:34:46 -07:00
Bill McCloskey
3e774f9f8a Bug 1359245 - Eliminate nsXPConnect::GetContextInstance() (r=mccr8)
This method assumes there is one global XPCJSContext. This patch eliminates
uses of it.

MozReview-Commit-ID: L2AkBGh5TnC
2017-04-27 15:34:46 -07:00
Bill McCloskey
51147a69b6 Bug 1359245 - Use TLS to return XPCJSContext::Get() (r=mccr8)
Once we have multiple XPCJSContext's, we may have to figure out which one we're
using with TLS. A later patch tries to remove as many of these TLS lookups
as possible so that performance doesn't suffer.

MozReview-Commit-ID: 50uHpDLZmUH
2017-04-27 15:34:46 -07:00
Wes Kocher
c90904f9bf Merge inbound to central, a=merge CLOSED TREE
MozReview-Commit-ID: 9HQViJrDT6S
2017-04-26 17:30:31 -07:00
Tom Tromey
3e96a70858 Bug 1334278 - have FormatStackDump return UniqueChars; r=froydnj
Change FormatStackDump to return UniqueChars and fix up the users.  This
removes a bit more manual memory management.

MozReview-Commit-ID: 60GBgeS4rzg

--HG--
extra : rebase_source : 15060321f567816ca434cdf1ef816d8322ceefff
2017-04-21 12:47:06 -06:00
Jon Coppeard
eb3c9870bf Bug 1352430 - Add barrier to wrapper cache to clear dying objects that have not yet been finalized r=bz r=sfink
* * *
Code review followup

--HG--
extra : rebase_source : 10c1fd603c2dd1ac2ff5770ae9aec2e9131681ce
2017-04-26 11:18:39 +01:00
Jon Coppeard
f67bc06071 Bug 1352430 - Update XPConnect sweeping to handle incrementally finalized objects r=mccr8 r=sfink
--HG--
extra : rebase_source : 10c974bedd003cf23de9e32ad7ae202441c92db9
2017-04-26 11:18:13 +01:00
Jon Coppeard
8c75ba5bbb Bug 1352430 - Update the GC finalize callback to communicate the new state r=sfink r=mccr8
--HG--
extra : rebase_source : ebd661eee50bbf48f21c12e6a1c6df9015f81beb
2017-04-26 10:57:08 +01:00
Carsten "Tomcat" Book
68e9a2dfd5 Merge mozilla-central to mozilla-inbound 2017-04-26 09:04:59 +02:00
Nicholas Nethercote
bc1d6a21a2 Bug 1358320 - Make TimeStamp::ProcessCreation()'s outparam optional. r=gsvelto.
TimeStamp::ProcessCreations()'s aIsInconsistent outparam is ignored by the
majority of its caller. This patch makes it optional. Notably, this makes
ProcessCreation() easier to use in a constructor's initializer list.
2017-04-26 14:55:54 +10:00
Wes Kocher
5e8bdb175d Merge inbound to m-c a=merge
MozReview-Commit-ID: A85cs7Yriqj
2017-04-25 13:53:00 -07:00
Jon Coppeard
d7e0c83dcc Bug 1359001 - Make AutoAssertGCCallback a no-op in opt builds r=sfink 2017-04-25 10:56:34 +01:00
Aryeh Gregor
af57d2df0f Bug 1251198 - Remove various obsolete events from document.createEvent r=smaug
Other browsers do not support any of these (IIRC), telemetry reports
essentially zero usage, and supporting them is contrary to the DOM spec.

Notes on specific events:

CommandEvent and SimpleGestureEvent: These are not supposed to be
web-exposed APIs, so I hid the interfaces from web content too
(necessary to avoid test_all_synthetic_events.html failures).

DataContainerEvent: This was a non-standard substitute for CustomEvent
that seemed to have only one user, so I removed it entirely and switched
the user (MozillaFileLogger.js) to CustomEvent.

ScrollAreaEvent: This is entirely non-standard, but we apparently expose
it deliberately to web content, so I didn't see any reason to remove it
from createEvent.

SimpleGestureEvent and XULCommandEvent: Can still be created from
createEvent(), but not by content.

TimeEvent: This is still in because it has no constructor, so there's no
other way to create it.  Ideally we'd update the SMIL spec to add a
constructor.  I did remove TimeEvents.

MozReview-Commit-ID: 7Yi2oCl9SM2

--HG--
extra : rebase_source : 199ab921acfc531b8b85e77f90fcd799b03c887b
2017-04-20 15:45:37 +03:00
Tom Tromey
bcbdcb14bb Bug 1334278 - change JS_smprintf to return UniqueChars; r=froydnj
This changes JS_smprintf to return UniqueChars, rather than relying on
manual memory management.

MozReview-Commit-ID: ENjQJODYdD1

--HG--
extra : rebase_source : 4c8ad4719dce205a7ef25e41eca25c5af793bb47
2017-03-03 15:10:11 -07:00
Jan de Mooij
113e7692b5 Bug 1358047 - Move Baseline CacheIR code map from JitCompartment to JitZone. r=djvj 2017-04-24 12:41:04 +02:00
Wes Kocher
d973551173 Merge inbound to central, a=merge
MozReview-Commit-ID: FHfhKIIlItM
2017-04-21 17:30:43 -07:00
Zibi Braniecki
61ac53ebb8 Bug 1358543 - Only set new locale callbacks in xpc_LocalizeContext if they're not set. r=smaug
With changes introduced in bug 1356066 I made the xpc_LocalizeContext be
called on each app locale change to update the default locale in each context.

Unfortunately, this function is also assigning the locale callbacks and
with my change it started doing it on each language change.

In this patch I'm first checking if we do have XPCLocaleCallbacks for the
given context and only if we don't, I assign them.

MozReview-Commit-ID: 7AiCsJfKBID

--HG--
extra : rebase_source : 1efe65895759ffc07e0047d063a405d757cb1092
2017-04-21 09:49:42 -07:00
Hannes Verschore
e8f7043d0b Bug 1319746: Add a memory reporter for CFGGraph on BaselineScript, r=njn 2017-04-21 19:37:06 +02:00
Hannes Verschore
31296801c2 Bug 1334409 - TraceLogging: Add memory reporter for TraceLogging, r=njn 2017-04-21 19:37:04 +02:00
Cervantes Yu
cc5836fbae Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
NS_SetCurrentThreadName() is added as an alternative to PR_SetCurrentThreadName()
inside libxul. The thread names are collected in the form of crash annotation to
be processed on socorro.

MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
Chris Peterson
eea325c79d Bug 1356843 - Fix -Wcomma warnings in js/. r=jorendorff
clang's -Wcomma warning warns about suspicious use of the comma operator such as between two statements or to call a function for side effects within an expression.

js/src/builtin/MapObject.cpp:786:48 [-Wcomma] possible misuse of comma operator here
js/src/builtin/MapObject.cpp:1371:48 [-Wcomma] possible misuse of comma operator here
js/src/builtin/RegExp.cpp:1266:62 [-Wcomma] possible misuse of comma operator here
js/src/jit/x64/BaseAssembler-x64.h:624:99 [-Wcomma] possible misuse of comma operator here
js/src/jsarray.cpp:2416:27 [-Wcomma] possible misuse of comma operator here
js/src/jscompartment.cpp:120:48 [-Wcomma] possible misuse of comma operator here
js/src/jsstr.cpp:3346:14 [-Wcomma] possible misuse of comma operator here
js/xpconnect/src/XPCWrappedNativeJSOps.cpp:316:71 [-Wcomma] possible misuse of comma operator here

MozReview-Commit-ID: BbT4otUXczV

--HG--
extra : rebase_source : b232d10b5280c567f8fe390fcb56012b78da580a
2017-04-09 21:15:01 -07:00
Wes Kocher
cb8ce82cca Merge inbound to m-c a=merge 2017-04-19 17:10:04 -07:00
Kris Maglione
32d79e3539 Bug 1356810: Follow-up: Fix xpcshell test for async subscript return value.
MozReview-Commit-ID: 2lgw8KzvjBT

--HG--
extra : rebase_source : db0dfd6eaf3dc32f56b25ba319dd797ec1b7b06a
2017-04-19 12:07:52 -07:00
Andrew McCreight
30fb73cef2 Bug 1357828 - Remove B2G-specific code from mozJSComponentLoader::ReallyInit(). r=mrbkap
MozReview-Commit-ID: I0h6Y9VQETJ

--HG--
extra : rebase_source : 87b885ae6eff09b5a7b6b5d1ad5e36d433814bba
2017-04-19 10:33:04 -07:00
Kris Maglione
fe513a5fbc Bug 1356810: Use noScriptRval option by default for loadSubScript. r=billm
MozReview-Commit-ID: 50QVvrG4lzV

--HG--
extra : rebase_source : 357d4a4fb03e96efb74de2c5669d4da40ffa618e
2017-04-15 09:32:34 -07:00
Eric Rahm
d96cdc6174 Bug 1357585 - Stop inheriting from PRCList in XPCWrappedNativeScope. r=bholley
XPCWrappedNativeScope inherits from PRCList, but is never used in a PRCList.

MozReview-Commit-ID: CGqxwHEleFx
2017-04-19 11:14:49 -07:00
Carsten "Tomcat" Book
e2b810f97e Merge mozilla-central to mozilla-inbound 2017-04-19 10:49:57 +02:00
Zibi Braniecki
abdb6cbf08 Bug 1356066 - JS_SetDefaultLocale should be updated on intl:app-locales-changed. r=shu,smaug
MozReview-Commit-ID: wDftiQLfax

--HG--
extra : rebase_source : 6080b5aa72bac7712e0a62275c260731aee7db00
2017-04-17 17:41:52 -07:00
Carsten "Tomcat" Book
bb87f43c09 merge mozilla-inbound to mozilla-central a=merge 2017-04-18 10:21:31 +02:00
Luke Wagner
c39bb259da Bug 1356631 - Change LargeAllocationCallback to be process-wide (r=mccr8)
This is necessary to allow helper threads to attempt large allocations and recover from fragmentation situations with the LargeAllocationFailureCallback.

MozReview-Commit-ID: AyA3pbXcaYy

--HG--
extra : rebase_source : 7a5feb779b690ec7f123481e76f2390c850dac91
2017-04-17 21:19:54 -05:00
Sebastian Hengst
8bd051237a merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: JpAhOPjgvkF
2017-04-15 19:59:24 +02:00
Florian Queze
4c6a68d1c9 Bug 1355161 - script-generated patch to replace .{currentThread,mainThread}.dispatch(..., Ci.nsIThread.DISPATCH_NORMAL) with .dispatchToMainThread(...), r=froydnj. 2017-04-14 18:29:12 +02:00
Andrew McCreight
39d3aedd82 Bug 1356666, part 4 - Use handles as arguments in mozJSSubscriptLoader. r=mrbkap
MozReview-Commit-ID: 9fClU6BIWfT

--HG--
extra : rebase_source : 0f255542a13fd1fdad3a950892694bc8684c0ac0
2017-04-14 14:38:51 -07:00
Andrew McCreight
f5c9d2bf30 Bug 1356666, part 3 - Mark some functions in mozJSSubscriptLoader static. r=mrbkap
MozReview-Commit-ID: 7JsyR6B84Gz

--HG--
extra : rebase_source : 05aecd963e0d5e997613306cfc0ea158b68a0902
2017-04-14 14:33:17 -07:00
Andrew McCreight
adaea5fbec Bug 1356666, part 2 - Fix some style issues in mozJSSubScriptLoader. r=mrbkap
mSystemPrincipal is an nsCOMPtr so it does not need to be explicitly
initialized.

Fields don't have to be lined up.

Empty function bodies don't need to be commented as such.

The blank line at the start of mozJSComponentLoader.cpp prevents Emacs
from using the mode line.

MozReview-Commit-ID: 7Az1x8jmxTI

--HG--
extra : rebase_source : 2d818074d82f9a6b1041983efd7a81bde9870619
2017-04-14 14:13:19 -07:00
Andrew McCreight
ec4172c47a Bug 1356666, part 1 - Rename target_obj to targetObj in mozJSSubscriptLoader. r=mrbkap
MozReview-Commit-ID: 89WugjhzPLk

--HG--
extra : rebase_source : 0cdfc9702bed43e5712096082ca9daba755834b3
2017-04-14 14:10:40 -07:00
Andrew McCreight
7125a27450 Bug 1356799, part 4 - Remove unused argument to ReadScript. r=mrbkap
MozReview-Commit-ID: I5Jf0Fan7VN

--HG--
extra : rebase_source : d0818725171c7d020dc4226282d053ac43565abe
2017-04-14 16:43:08 -07:00
Andrew McCreight
fcd6a8a00e Bug 1356799, part 3 - Handlify the target argument to ReadScript{,Async}. r=mrbkap
MozReview-Commit-ID: GOodGQ647qI

--HG--
extra : rebase_source : ab53decffb8193837223e01b205bae9d94cc17bb
2017-04-14 16:35:34 -07:00
Andrew McCreight
ad47781af1 Bug 1356799, part 2 - Don't use JS:: for handle types in subscript loader. r=mrbkap
Also, be consistent with the rest of the code and use a handle
typedef in one place.

MozReview-Commit-ID: KY3cnLemoUl

--HG--
extra : rebase_source : 4c3ae2750c868b5401a686dd164adbd04b45a0b5
2017-04-15 06:47:07 -07:00
Andrew McCreight
b38f79c2ac Bug 1356799, part 1 - Use one line per arg for methods with many args in subscript loader. r=mrbkap
MozReview-Commit-ID: BPZp6I0LSBH

--HG--
extra : rebase_source : 635c21fdb76a6fc78f41348a01c95d4428262e9d
2017-04-15 06:44:35 -07:00
Bill McCloskey
207af130a2 Bug 1343396 - Split CycledCollectedJSContext and XPCJSContext into separate context and runtime classes (r=mccr8)
To run JS in separate cooperative threads, we need to split up per-thread state
from per-runtime state. This patch does that for XPConnect.

MozReview-Commit-ID: 407SlJ7nR6v
2017-04-18 17:01:04 -07:00
Dan Banner
cdf987089d Bug 1107904 - Remove packed.js and references to it as it is unused. r=standard8
MozReview-Commit-ID: K5TLF92pHq4

--HG--
extra : rebase_source : 295bf325a07fa8ec4c55a8babf5418588308dca6
2017-04-12 11:10:00 +01:00
Andrew McCreight
fe0bcc3a40 Bug 1338272 - Require that the return value of MaybeSetPendingException is used. r=bz
Most of the time, the return value of this method should be checked,
because behavior should depend on whether or not an exception is
thrown. However, if it is called immediately after a throw it doesn't
need to be checked because it will always return true. bz said there
is no public API that lets you assume there is an exception because it
would be "too easy to misuse".

MozReview-Commit-ID: CqyicBbcNjW

--HG--
extra : rebase_source : a5b74ba88a927a90d491ceb8f0b750a67f62b0f4
2017-02-14 16:17:02 -08:00
Kris Maglione
d1ada5659d Bug 1353150: Add tests for chrome Xray named element property access. r=bz
MozReview-Commit-ID: 3Wyr8mkgE2c
2017-04-06 21:32:47 -07:00
Bill McCloskey
172e502215 Revert "Bug 1340719 - Throw an exception if accessing Xray from wrong docgroup (r=bholley)"
This reverts commit ff10f4faedd42f13ed2899cf4ea05c47411aba95.
2017-04-07 14:23:06 -07:00
Jan de Mooij
546f01e711 Bug 1353758 - Move the external string cache into the JS engine and improve it. r=arai,bz
--HG--
extra : rebase_source : 6d57d70a837bbb284a2db889df34b886ae398a3f
2017-04-07 10:40:29 +02:00
Carsten "Tomcat" Book
207b516e89 merge mozilla-inbound to mozilla-central a=merge 2017-04-06 12:50:50 +02:00
Andrew McCreight
1b37fc293a Bug 1353580 - Remove support for !HAVE_PR_MEMMAP in mozJSComponentLoader. r=mrbkap
This was only ever used for BeOS and OS2, which have likely long ago
stopped working for other reasons.

MozReview-Commit-ID: AT1jNEB1ydY

--HG--
extra : rebase_source : 8ab13e574c57f0ea96158af86e01ea8f22f6bff7
2017-04-04 16:53:56 -07:00
Bill McCloskey
27169c8483 Bug 1353565 - Label snow white killer as SystemGroup (r=mccr8)
MozReview-Commit-ID: Hta7RGdZgNJ
2017-04-05 13:29:34 -07:00
Bill McCloskey
fcdb251c4b Bug 1340719 - Throw an exception if accessing Xray from wrong docgroup (r=bholley)
MozReview-Commit-ID: BBrRsk3KvGb
2017-04-05 13:26:20 -07:00
Florian Queze
37ff4fc7cc Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Sebastian Hengst
159215e6f4 Backed out changeset 18d45aa984d6 (bug 1355161) 2017-04-14 23:39:23 +02:00
Sebastian Hengst
a07223d699 Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
Florian Queze
95d4d20c17 Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Florian Queze
a363fb8c8b Bug 1355161 - script-generated patch to replace .{currentThread,mainThread}.dispatch(..., Ci.nsIThread.DISPATCH_NORMAL) with .dispatchToMainThread(...), r=froydnj. 2017-04-14 18:29:12 +02:00
David Teller
1d9102358f Bug 1305950 - Extend XPCOMUtils.defineLazyPreferenceGetter to be informed upon preference change. r=billm
This is a pretty common use case of preferences.

MozReview-Commit-ID: 7tkdylPZxpY

--HG--
extra : transplant_source : %86%21%C1oXw%07%BB%C6.%CE%C5S%B6%E0%26%8Be%9A%E1
extra : histedit_source : 072f778d7959fa8c0f5838077116b7b9d87c5157
2016-09-28 16:33:20 +02:00
Tooru Fujisawa
61524c3df7 Bug 1352323 - Add JS_NewMaybeExternalString function that creates either an external string or returns a static string. r=jandem 2017-04-04 15:45:49 +09:00
Eric Rahm
572d67e180 Bug 1351831 - Build more xpconnect code in unified sources. r=bholley
These files were being excluding because we thought they used plarena.h, but it
turns out they did not. A few tweaks needed to be made to clarify whether we
wanted to use mozilla::UniquePtr or js::UniquePtr.

MozReview-Commit-ID: 1su5dO3rR0T
2017-03-31 15:21:27 -07:00
Ryan VanderMeulen
75e7e911b8 Backed out changeset 42ea3fb4b694 (bug 1351831) for Windows bustage. 2017-03-31 14:58:03 -04:00
Eric Rahm
9afbcd5a22 Bug 1351831 - Build more xpconnect code in unified sources. r=bholley
These files were being excluding because we thought they used plarena.h, but it
turns out they did not. A few tweaks needed to be made to clarify whether we
wanted to use mozilla::UniquePtr or js::UniquePtr.

MozReview-Commit-ID: 1su5dO3rR0T
2017-03-31 11:00:11 -07:00
Phil Ringnalda
4cb08c4110 Backed out 2 changesets (bug 1351831, bug 1351820) for Windows build bustage
CLOSED TREE

Backed out changeset 91c2f1592df1 (bug 1351831)
Backed out changeset f825bdbb2ece (bug 1351820)
2017-03-30 19:21:06 -07:00
Eric Rahm
02c3c2e880 Bug 1351831 - Build more xpconnect code in unified sources. r=bholley
These files were being excluding because we thought they used plarena.h, but it
turns out they did not. A few tweaks needed to be made to clarify whether we
wanted to use mozilla::UniquePtr or js::UniquePtr.

MozReview-Commit-ID: 1su5dO3rR0T
2017-03-30 18:32:18 -07:00
Christoph Diehl
5fb70d9869 Bug 1351708 - Fix Preferences::UnregisterCallback typo for fuzzing.enabled. r=froydnj
--HG--
extra : rebase_source : 29ed27d7019c08df775c48b116dffee7e6468af4
2017-03-29 08:20:00 -04:00
Jon Coppeard
0c82b7b16d Bug 1322539 - Call ExposeObjectToActiveJS on the targets of xray wrappers r=sfink 2017-03-29 10:53:12 +01:00
Tooru Fujisawa
76239ccf41 Bug 1331092 - Part 12: Disable Async Iteration in chrome or add-ons code. r=shu 2017-03-29 17:15:13 +09:00
Makoto Kato
d0560ad81c Bug 943283 - Use NS_CopyNativeToUnicode instead of nsIUnicodeDecoder. r=jfkthame
By bug 1346674, we don't use NSILOCALE_* for unicode conversion in XPC/JS.  So we should use NS_CopyNativeToUnicode to get a rid of nsIPlatformCharset.

MozReview-Commit-ID: Kp2jijN8On9
2017-03-28 18:07:36 +09:00
Jon Coppeard
973692b373 Bug 1345177 - Make RegExpShared a GC thing r=sfink 2017-03-27 10:38:29 +01:00
Boris Zbarsky
491fa25872 Bug 1218437. Need to check that the value is an object before we try to UNWRAP_OBJECT it to check whether it's an Exception. r=qdot
MozReview-Commit-ID: 8lwCoilRz49
2017-03-27 14:50:41 -04:00
Jon Coppeard
1376c2700e Backed out changesets e66f564d9749 and 0380d914ad39 (bug 1345177) for rooting hazards 2017-03-27 11:09:54 +01:00
Jon Coppeard
f7a6438226 Bug 1345177 - Make RegExpShared a GC thing r=sfink 2017-03-27 10:38:29 +01:00
Kris Maglione
9accf0b687 Bug 1349989: Correctly handle errors for OMT-compiled scripts. r=shu
MozReview-Commit-ID: 3FpoUmu9ijI

--HG--
extra : rebase_source : 666fb25c1a36b14f28bd61f0622143b063b3759e
2017-03-23 22:13:07 -07:00
Boris Zbarsky
e786ca31c0 Bug 1348095 part 3. Cache the proto of an Xray on its holder, so we don't have to keep re-wrapping it. r=bholley
MozReview-Commit-ID: I78AoSB3TNW
2017-03-23 03:06:25 -04:00
Boris Zbarsky
e2c99615af Bug 1348095 part 2. Give all the Xray holders a JSClass that has a slot for caching a prototype. r=bholley
MozReview-Commit-ID: ID9vMG3iJfZ
2017-03-23 03:06:25 -04:00
Boris Zbarsky
ab35f8679e Bug 1348095 part 1. Remove the unused reserved slots from the XPCWN xray holder. r=bholley
MozReview-Commit-ID: 5IRrE8EmL9A
2017-03-23 03:06:25 -04:00
Carsten "Tomcat" Book
9b6d088496 merge autoland to mozilla-central a=merge
--HG--
rename : browser/components/preferences/in-content/tests/browser_advanced_siteData.js => browser/components/preferences/in-content-old/tests/browser_advanced_siteData.js
rename : dom/media/mediasink/DecodedAudioDataSink.cpp => dom/media/mediasink/AudioSink.cpp
2017-03-23 13:42:40 +01:00
Jon Coppeard
e4d62401f0 Bug 1341044 - Rename the GC's 'zone group' concept to 'sweep group' r=sfink 2017-03-22 17:30:50 +00:00
Andrea Marchesini
1fd1bc3935 Bug 1343933 - Renaming Principal classes - part 2 - NullPrincipal, r=qdot
--HG--
rename : caps/nsNullPrincipal.cpp => caps/NullPrincipal.cpp
rename : caps/nsNullPrincipal.h => caps/NullPrincipal.h
rename : caps/nsNullPrincipalURI.cpp => caps/NullPrincipalURI.cpp
rename : caps/nsNullPrincipalURI.h => caps/NullPrincipalURI.h
2017-03-22 11:38:40 +01:00
Andrea Marchesini
68207654f2 Bug 1343933 - Renaming Principal classes - part 1 - ExpandedPrincipal, r=qdot
--HG--
rename : caps/nsExpandedPrincipal.cpp => caps/ExpandedPrincipal.cpp
rename : caps/nsExpandedPrincipal.h => caps/ExpandedPrincipal.h
2017-03-22 11:38:17 +01:00
Boris Zbarsky
ec233151ac Bug 1348331 part 2. Switch Preferences::RegisterCallback/RegisterCallbackAndCall consumers that want prefix matches to the new RefisterPrefixCallback(AndCall) APIs. r=froydnj,padenot
MozReview-Commit-ID: 2ebVZO4fN6i
2017-03-21 14:59:02 -04:00
Zibi Braniecki
f2ed37fd2f Bug 1349470 - Use OS locale for unicode conversions for Date.toLocaleFormat. r=m_kato
MozReview-Commit-ID: KGYGRqtHOvJ

--HG--
extra : rebase_source : 307b778792a1e21e7e270a3932104049eac1b213
2017-03-22 09:10:18 -07:00
Kris Maglione
31f241c6ca Bug 1333990: Follow-up: Return before wrapping result value on error. r=bz
MozReview-Commit-ID: AwGVr3gjzd0

--HG--
extra : rebase_source : 4987a60520941665b9fc6c0242d7f34ce43a060b
2017-03-17 14:34:55 -07:00
Kris Maglione
b3d00ca35b Bug 1333990: Follow-up: Use safer conversion functions when creating error message JS strings. r=bz
MozReview-Commit-ID: FimoWFIgUxL

--HG--
extra : rebase_source : 7b9193ac1c12dc96b269ee3dea167edc4051669f
2017-03-17 16:53:04 -07:00
Kris Maglione
f446374619 Bug 1333990: Follow-up: Add cycle collection and comments where unnecessary. r=bz
MozReview-Commit-ID: 70omvafFFFH

--HG--
extra : rebase_source : 4815476110a4eaf071241c3d98fc579c4d3f6dd5
2017-03-17 13:54:32 -07:00
Carsten "Tomcat" Book
3e0a5441c6 Merge mozilla-central to mozilla-inbound 2017-03-17 14:55:15 +01:00
Kris Maglione
aaaea39c13 Bug 1333990: Part 1b - Add tests for script precompiler. r=shu
MozReview-Commit-ID: DVFFdyzY6Kn

--HG--
extra : rebase_source : d41324f18ee2c13e98f94ecec3af73e67da873ea
2017-03-16 16:55:59 -07:00
Kris Maglione
437f4e37d4 Bug 1333990: Part 1a - Add an async script pre-loading utility. r=billm,shu
MozReview-Commit-ID: 4vJF2drLeHS

--HG--
extra : rebase_source : 8adaa22d6d91ac6ef1804cf4c8d5698cf304b141
2017-03-16 19:10:40 -07:00
Boris Zbarsky
c63be1e971 Bug 1347706. Update to spec change for [[SetPrototypeOf]] on cross-origin objects. It should return true if null is passed. r=bholley
MozReview-Commit-ID: 42je5yfBRee
2017-03-16 17:43:49 -04:00
Makoto Kato
20cb071f24 Bug 1347431 - Skip some xpcshell tests that is failure on Android without ENABLE_INTL_API. r=snorp
Sicne some tests doesn't work with --with-intl-api=no, we should skip it on Android

MozReview-Commit-ID: IjlH3aQdiqb

--HG--
extra : rebase_source : ac6d91bf291f6268ea29bcb29180b2f5197e012c
2017-03-16 12:54:25 +09:00
Blake Kaplan
18b64f8d42 Bug 1208957 - No need for a condvar for thread shutdown. r=billm
Now that we join on the thread exiting, we no longer need to have the thread
explicitly tell us it's shutting down.

MozReview-Commit-ID: LycPjUvyeX

--HG--
extra : rebase_source : 7b3d21c3d8de73a1ed511c7d6efefe2a73b2e02a
2017-03-14 23:36:02 -07:00
Blake Kaplan
9f2cfeccc4 Bug 1208957 - Join the watchdog thread to avoid shutdown races. r=billm
MozReview-Commit-ID: FlnPO2fJWVu

--HG--
extra : rebase_source : f7465994db184b21b4e0159c1b4ca3509c071f5b
2017-03-14 23:27:21 -07:00
Nicholas Nethercote
8876b32323 Bug 1345262 (part 5) - Fix how JS sampling is started/stopped by the profiler. r=mstange,djvj.
Currently, JS sampling has major problems.

- JS sampling is enabled for all JS threads from the thread that runs
  locked_profiler_start() -- currently only the main thread -- but the JS
  engine can't handle enabling from off-thread, and asserts. This makes
  profiling workers impossible in a debug build.

- No JS thread will be JS sampled unless enableJSSampling() is called, but that
  only happens in locked_profiler_start(). That means any worker threads
  created while the profiler is active won't be JS sampled.

- Only the thread that runs locked_profiler_stop() -- currently only the main
  thread -- ever calls disableJSSampling(). This means that worker threads that
  start being JS sampled never stop being JS sampled.

This patch fixes these three problems in the following ways.

- locked_profiler_start() now sets a flag in PseudoStack that indicates
  JS sampling is desired, but doesn't directly enable it. Instead, the JS
  thread polls that flag and enables JS sampling itself when it sees the flag
  is set. The polling is done by the interrupt callback. There was already a
  flag of this sort (mJSSampling) but the new one is better.

  This required adding a call to profiler_js_operation_callback() to the
  InterruptCallback() in XPCJSContext.cpp. (In comparison, the
  InterruptCallback() in dom/workers/RuntimeService.cpp already had such a
  call.)

- RegisterCurrentThread() now requests JS sampling of a JS thread when the
  profiler is active, the thread is being profiled, and JS sampling is enabled.

- locked_profiler_stop() now calls stopJSSampling() on all live threads.

The patch makes the following smaller changes as well.

- Renames profiler_js_operation_callback() as profiler_js_interrupt_callback(),
  because "interrupt callback" is the standard name (viz.
  JS_AddInterruptCallback()).

- Calls js::RegisterContextProfilingEventMarker() with nullptr when stopping
  JS sampling, so that ProfilerJSEventMarker won't fire unnecessarily.

- Some minor formatting changes.

--HG--
extra : rebase_source : 372f94c963a9e5b2493389892499b1ca205ebc2f
2017-03-10 09:04:23 +11:00
Nicholas Nethercote
d8023679e3 Bug 1345262 (part 2) - Add profiler_{set,clear}_js_context(). r=mstange.
PseudoContext::sampleContext() is always called immediately after
profiler_get_pseudo_stack(). This patch introduces profiler_set_js_context()
and profiler_clear_js_context(), which replace the profiler_get_pseudo_stack()
+ sampleContext() pairs. This takes us a step closer to not having to export
PseudoStack outside the profiler.

--HG--
extra : rebase_source : 8558d1600eafd395cc696d31f3d21fb52a1a74b0
2017-03-09 17:06:35 +11:00