Commit Graph

6103 Commits

Author SHA1 Message Date
Ehsan Akhgari
16939c371d Bug 1379351 - Improve some of the XPConnect hash routines; r=mccr8 2017-07-19 00:08:50 -04:00
Andrew McCreight
c77f1723be Bug 1381921, part 2 - Remove nsAXPCNativeCallContext. r=mrbkap
This class is no longer used.

MozReview-Commit-ID: Lv9AAd3OjIl

--HG--
extra : rebase_source : b37abc2c70a2a08b176d0504163c246b6ff3b8cf
2017-07-18 10:42:47 -07:00
Andrew McCreight
c00d64f6c6 Bug 1381921, part 1 - Remove nsIXPConnect::CurrentNativeCallContext. r=mrbkap
It is only called in a single place, and can't be called from JS, so
inline it and eliminate it.

MozReview-Commit-ID: DWfyfoO5Zht

--HG--
extra : rebase_source : 8a44719af22a4d8724449d6225f4bdd119d648c8
2017-07-18 10:36:05 -07:00
Sebastian Hengst
f96cc8c3fe Backed out changeset 5d9a6384bf51 (bug 1378207) for frequently timing out in devtools' browser_addons_debug_webextension_popup.js and browser_addons_remove.js on Windows. r=backout 2017-07-17 17:59:14 +02:00
Bobby Holley
3d704b608a Bug 1378207 - Stop bypassing the Xray layer when walking the prototype chain. v2 r=krizsa
MozReview-Commit-ID: AR2Sta2gWRk
2017-07-17 14:31:50 +02:00
Andrew McCreight
5de8ffcbf5 Bug 1379786, part 1 - Remove dead code related to the security manager. r=mrbkap
Also, one unused include of nsIProgrammingLanguage, which is unrelated.

MozReview-Commit-ID: LJf2NSwmaYG

--HG--
extra : rebase_source : 63dfca9185535dbfa695cf2f383d81a14ce423c0
2017-07-07 15:59:29 -07:00
Andrea Marchesini
50f9ea47a3 Bug 1350958 - Finish labeling ProxyReleaseEvent, r=billm 2017-07-14 08:49:22 +02:00
Marco Castelluccio
0f9d4e1985 Bug 1380665 - Define MOZ_CODE_COVERAGE for the entire tree. r=jmaher 2017-07-13 19:12:23 +02:00
Jon Coppeard
350ab58390 Bug 1380397 - Use PersistentRooted to implement XPCJSObjectHolder r=mccr8 2017-07-13 09:51:58 +01:00
Christoph Kerschbaumer
d11ba73bee Bug 1380249 - Convert tests within js/xpconnect to comply with new data: URI inheritance model. r=bholley 2017-07-13 08:18:59 +02:00
Jon Coppeard
3b4db1432d Bug 1377466 - Rename PokeGC and add a reason code for GCs triggered by this r=sfink 2017-07-11 17:17:17 +01:00
Boris Zbarsky
66481a7a29 Bug 1371259 part 9. Make UnwrapReflectorToISupports return already_AddRefed<nsISupports>. r=peterv
The main reason to not do this would be performance (avoiding the
addref/release), but there are two main mitigating factors:

1)  All calls to UnwrapReflectorToISupports that pass in a Web IDL object
    already do the addref (and in fact QI).  So this only affects the
    XPCWrappedNative case.

2)  The vast majority of the callers proceed to QI on the pointer anyway, and a
    second addref is cheap; it's the first addref after a CC that can be
    expensive on a cycle-collected object.

Going through the changes one by one:

* In GlobalObject::GetAsSupports, we do have a change that slightly slows down
  precisely in the XPCWrappedNative global case.  That's the message managers
  and the backstagepass.  And this really only affects calls to Web IDL statics
  from those globals.

* In UnwrapArgImpl we're talking about a Web IDL method taking an "external
  interface" type, and the UnwrapReflectorToISupports call is immediately
  followed by QI anyway.

* In UnwrapXPConnectImpl we're talking about the case when we have a
  non-WebIDL-object implementation of a Web IDL interface.  Again, this is the
  message manager globals, for EventTarget.  And we have a QI call immediately
  after the UnwrapReflectorToISupports.

* In the generated HasInstance hook for EventTarget we will be slightly slower
  when the LHS of the instanceof is an XPCWrappedNative.  And not much slower,
  because again there's an immediate QI.

* In InstallXBLField we're never going to have an XPCWrappedNative as thisObj;
  it's always an Element in practice.  So this is no more expensive than before.

* In sandbox's GetPrincipalOrSOP we now have an extra addref.  But it was
  followed by various QIs anyway.

* In XPCConvert::JSValToXPCException we have an extra addref if someone throws
  an XPCWrappedNative, which is fairly unlikely; our actual Exception objects
  are on Web IDL bindings.  Plus we have an immediate QI.

* In xpc::HasInstance we have an extra addred if the LHS of instanceof is an
  XPCWrappedNative.  But, again, there's an immediated QI after the
  UnwrapReflectorToISupports.

* In xpcJSWeakReference::Init we are likely doing an extra addref, but again
  immediately followed by QI.

I think it's worth making this change just to remove the footgun and that the
perf impact, if any, is pretty minimal.
2017-07-10 16:05:26 -04:00
Boris Zbarsky
9cdb2834a8 Bug 1371259 part 8. Get rid of nsIXPConnect::GetNativeOfWrapper. r=peterv
Most of these changes are just replacements of GetNativeOfWrapper with
UnwrapReflectorToISupports, which is all it did under the hood.

The other changes are as follows:

* In nsDOMClassInfo, we really care whether we have a window, so we can just
  UNWRAP_OBJECT to the Window interface, since Window is always on Web IDL
  bindings now.  Also, the weird compartment check hasn't been needed ever since
  GetNativeOfWrapper stopped returning things off the passed-in object's
  prototype chain (Firefox 22, bug 658909).
* The only use of do_QueryWrapper was to get a Window in nsDocument; again we
  can UNWRAP_OBJECT.
* In XPCJSRuntime, we again just want to check for a Window, so UNWRAP_OBJECT.
2017-07-10 16:05:25 -04:00
Boris Zbarsky
c524a4da7c Bug 1371259 part 7. Root the unwrapped object in XPCConvert code. r=mccr8 2017-07-10 16:05:25 -04:00
Boris Zbarsky
fa152ffab7 Bug 1371259 part 6. Root the unwrapped object in PRE_HELPER_STUB. r=mccr8 2017-07-10 16:05:25 -04:00
Boris Zbarsky
6761a93bcb Bug 1371259 part 5. Use a safer implementation of IsFileList. r=peterv 2017-07-10 16:05:25 -04:00
Boris Zbarsky
5c76874a46 Bug 1371259 part 3. Change UnwrapObject<> and the UNWRAP_OBJECT macro to allow passing in mutable object or value handles for the thing being unwrapped, and do so at various callsites. r=peterv
I did audit all UNWRAP_OBJECT callers to make sure that the lifetimes of all the
temporary Rooted or the RefPtrs they unwrap into are long enough.
2017-07-10 16:05:24 -04:00
Andrew McCreight
19c035f60e Bug 1379023, part 4 - Remove mSystemPrincipal fields from mozJSSubScriptLoader and mozJSComponentLoader. r=mrbkap
The lone remaining use is trivial.

MozReview-Commit-ID: Gx0K69ArMJ2

--HG--
extra : rebase_source : ff48484246aeed32f7fa7c03573ba994b097967e
2017-07-07 11:29:48 -07:00
Andrew McCreight
93029d4038 Bug 1379023, part 3 - Make WriteCachedScript assert about the system principal not require the argument. r=mrbkap
MozReview-Commit-ID: FRgjZ32ULqj

--HG--
extra : rebase_source : be20c846efd3a5d5ba52ca1f614a0b40775d5e01
2017-07-07 11:27:53 -07:00
Andrew McCreight
ef5af5fdf2 Bug 1379023, part 2 - Remove unused systemPrincipal argument to ReadCachedScript. r=mrbkap
MozReview-Commit-ID: D59LfiHXbXJ

--HG--
extra : rebase_source : 1f09e37f2c6ba7b2b0fa15fcacb932e3f9f8f7ab
2017-07-07 11:14:04 -07:00
Andrew McCreight
6ff67aafc2 Bug 1379023, part 1 - Directly compute if we're compiling in a content compartment in DoLoadSubScriptWithOptions. r=mrbkap
The existing code uses various intermediate objects, but the only
thing they are used for now is to figure out if the compartment we're
in has the system principal or not, so just compute that directly.

MozReview-Commit-ID: FMoWfAX8rGW

--HG--
extra : rebase_source : 385ab0e10a0c719155c48e3822e7844434f417f8
2017-07-06 16:30:44 -07:00
Jan de Mooij
db3fda15b3 Bug 1378740 - Share RegExpShareds across compartments within a zone. r=jonco 2017-07-06 16:40:39 +02:00
Phil Ringnalda
22cb9f77bb Merge m-c to m-i
MozReview-Commit-ID: H6zGgEm7oOM
2017-07-04 20:32:07 -07:00
Kris Maglione
9291c127d9 Bug 1371248: Avoid hangs when preloader cache flush is triggered during shutdown. r=erahm
MozReview-Commit-ID: FpW53d5TTCG

--HG--
extra : rebase_source : 28b5343d276e2a2422bb438ca25de87740f65d2c
2017-06-28 14:46:30 -07:00
Jan de Mooij
53de04c6f6 Bug 1375505 part 1 - Change iterator code to return JSObject* instead of returning bool + outparam. r=evilpie 2017-06-28 21:00:43 -07:00
Nathan Froyd
21dd68cb9e Bug 1376649 - extend lifetime of xpcshell's directory provider; r=ting
xpcshell has a custom directory provider that is passed in when XPCOM is
initialized.  XPCOM holds a reference to this directory provider, and
said reference is not released until XPCOM is shutdown.  Unfortunately,
the lifetime of the directory provider was not scoped properly, so it
would actually be destructed prior to shutting down XPCOM, resulting in
a stack use-after-free.

To avoid this problem, we need to move the provider so that its lifetime
outlives the call to both XPCOM init and shutdown.
2017-06-27 16:12:21 -04:00
Ting-Yu Chou
1b9d7682c6 Bug 1377815 - Remove redundant unwrapping in resolveOwnProperty() of XrayTraits and its subclasses. r=bholley
Removing the redundant unwrapping improves ~15% for the micro benchmark (bug
1348095 comment 3) on my desktop. Replace the parameter jsWrapper of
resolveOwnProperty() because it is not used.

MozReview-Commit-ID: ULHX8vyMrZ

--HG--
extra : rebase_source : b76e688f53722cfd24466668b68043366f25e917
2017-07-03 09:44:46 +08:00
Sebastian Hengst
8f7f288fac Backed out changeset 7e2f1f4713fc (bug 1371248) for asserting IsAcquired() && mOwningThread == PR_GetCurrentThread(), e.g. in browser_ext_browserAction_contextMenu.js. r=backout 2017-07-03 23:56:03 +02:00
Kris Maglione
a85cdee020 Bug 1371248: Avoid hangs when preloader cache flush is triggered during shutdown. r=erahm
MozReview-Commit-ID: FpW53d5TTCG

--HG--
extra : rebase_source : f7201ba0309675db292c1e1e7f4f21c04292d6f8
2017-06-28 14:46:30 -07:00
Bill McCloskey
f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Jan de Mooij
17f7476bee Bug 627220 part 1 - Remove unused Zone* argument from external string finalizers. r=sfink 2017-06-26 10:23:50 -07:00
Geoff Brown
9fd2e18b44 Bug 1255284 - Skip test_bug484459.xul on linux-opt for intermittent failures; r=me,test-only 2017-06-26 10:11:52 -06:00
Nicholas Nethercote
58786e1ea7 Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.

--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
2017-06-22 17:08:53 +10:00
Nicholas Nethercote
033f83145c Bug 1375387 - Reorder and section-ify GeckoProfiler.h. r=mstange.
This patch gives some structure and order to the profiler's API.

It also renames AutoProfilerRegister as AutoProfilerRegisterThread, to match
profiler_register_thread().
2017-06-22 14:28:47 +10:00
Nicholas Nethercote
4b364cf3f3 Bug 1375299 (part 1) - Reduce usage of MOZ_GECKO_PROFILER. r=mstange.
This patch reduces the differences between builds where the profiler is enabled
and those where the profiler is disabled. It does this by removing numerous
MOZ_GECKO_PROFILER checks.

These changes have the following consequences.

- Various functions and classes are now defined in all builds, and so can be
  used unconditionally: profiler_add_marker(), profiler_set_js_context(),
  profiler_clear_js_context(), profiler_get_pseudo_stack(), AutoProfilerLabel.
  (They are effectively no-ops in non-profiler builds, of course.)

- The no-op versions of PROFILER_* are now gone. The remaining versions are
  almost no-ops when the profiler isn't built.

--HG--
extra : rebase_source : 8fb5e8757600210c2f77865694d25162f0b7698a
2017-06-22 06:26:16 +10:00
Florian Quèze
66f6d259bc Bug 1374282 - script generated patch to remove Task.jsm calls, r=Mossop. 2017-06-22 12:51:42 +02:00
Carsten "Tomcat" Book
8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey
6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Florian Quèze
e8657ec4a4 Bug 1374759 - mozJSComponentLoader::LoadModule should add a pseudo stack frame showing which script is loaded, r=mstange. 2017-06-20 22:11:06 +02:00
Carsten "Tomcat" Book
ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey
4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Bevis Tseng
d1637b9c5a Bug 1372453 - Part 2: Name the caller of ProxyReleaseEvent. r=billm
MozReview-Commit-ID: LYhSWnZkq0i
2017-06-14 09:27:17 +08:00
Alex Gaynor
45abd268c3 Bug 1221148 - Allow passing blob:// URIs to mozIJSSubScriptLoader; r=smaug
This is useful for legacy addons as we increasingly lockdown filesystem access
in content processes.

MozReview-Commit-ID: AZbsSFpbIvt

--HG--
extra : rebase_source : 56dfe91ac9fbeb0bd48dc8a2f87ed6038e7521cc
2017-06-07 11:00:24 -04:00
Kris Maglione
9c02fdf113 Bug 1363301: Always provide live wrappers for ScriptSourceObjects. r=shu,bholley
MozReview-Commit-ID: LTNN66FywU4

--HG--
extra : rebase_source : 6fc6bd6077229fe511b02116b9e3f9eb1c99f2fa
2017-06-14 15:38:59 -07:00
Olli Pettay
2edc8a2488 bug 1358898, ensure AsyncFreeSnowWhite is run often enough, r=mccr8,nfroyd 2017-06-16 20:00:04 +03:00
Jan Beich
587d174016 Bug 1373096 - Unbreak --enable-warnings-as-errors build without GeckoProfiler after bug 1372901. r=mstange
MozReview-Commit-ID: ABh2bw5CbFm

--HG--
extra : rebase_source : 9ee7dd73d9a821722b4e9f21fa8a30e31bc907e8
2017-06-15 01:37:26 +00:00
Sebastian Hengst
1b26da1b2f merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-06-15 11:17:07 +02:00
Sebastian Hengst
20d16dadd3 merge mozilla-inbount to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 36YqbsnO3en
2017-06-15 11:11:30 +02:00
Florian Quèze
a5e2cbd774 Bug 1373047 - mozJSSubScriptLoader::LoadSubScript should add a pseudo stack frame showing which script is loaded, r=mstange. 2017-06-15 00:58:25 +02:00
Florian Quèze
fd8b6d1c71 Bug 1372901 - Add a pseudo stack frame showing which module is being imported by a Cu.import call, r=mstange. 2017-06-15 00:58:25 +02:00
Sebastian Hengst
c267095078 Backed out changeset 0ee807301e66 (bug 1358898) for crashing in test_add_task_run_next_test.js during Linux build. r=backout 2017-06-14 21:25:49 +02:00
Olli Pettay
48ebc09772 Bug 1358898, ensure AsyncFreeSnowWhite is run often enough, r=mccr8 2017-06-14 21:43:37 +03:00
Jan Keromnes
d14a6bb45e Bug 1372877 - Use nullptr in /js (clang-tidy: modernize-use-nullptr). r=nbp
--HG--
extra : rebase_source : cac11ab1f6be2dc44630aba992c2ce75d783fe66
2017-06-14 07:36:00 -04:00
Marco Castelluccio
42f83ca8dc Bug 1363469 - Define signal handlers to dump and reset coverage counters. r=froydnj,kanru
--HG--
extra : rebase_source : 8fa73f2bfd1eab95caee891d6d68090b58c3ba67
extra : histedit_source : 7b7c633ebecc71508e4c0a4d1161104a511869c5%2C61fefafbedb869fffddb8182d8bfac29108ee1bb
2017-06-14 09:50:44 +01:00
Jan de Mooij
bf6aed7a06 Bug 1370608 part 3 - Use JS_NewEnumerateStandardClasses outside js/src. r=bz 2017-06-14 10:39:11 +02:00
Jan de Mooij
83f290de99 Bug 1370608 part 1 - Move newEnumerate hook from ObjectOps to ClassOps. r=evilpie,bz 2017-06-14 10:37:44 +02:00
Peter Van der Beken
9b9495bf79 Bug 1252211 - Remove DOMCI for TreeSelection, XULCommandDispatcher and XULControllers. r=bz.
--HG--
extra : rebase_source : 5a24af4928dbd7754850c6e3ceff6646bfe58c93
2017-05-18 09:07:25 +02:00
Henri Sivonen
432653453a Bug 1261841 part 2 - Use encoding_rs instead of uconv. r=emk,mystor.
MozReview-Commit-ID: 15Y5GTX98bv
2017-06-13 13:23:23 +03:00
Carsten "Tomcat" Book
4a5a3d9f30 Backed out changeset 2c51cdd42834 (bug 1252211) for bustage 2017-06-13 12:20:33 +02:00
Carsten "Tomcat" Book
bd7620cf36 Merge mozilla-central to mozilla-inbound 2017-06-13 12:11:42 +02:00
Carsten "Tomcat" Book
d67ef71097 merge mozilla-inbound to mozilla-central a=merge 2017-06-13 12:09:48 +02:00
Bill McCloskey
0b17d548b6 Bug 1371119 - Remove watchdog observers in XPCJSContext destructor (r=mccr8)
MozReview-Commit-ID: 5tj1hbom6zR
2017-06-12 20:21:43 -07:00
Bill McCloskey
a134fb522b Bug 1371119 - Load JS prefs per context rather than per runtime (r=mccr8)
MozReview-Commit-ID: 4M1uEcIB0Mq
2017-06-12 20:21:43 -07:00
Andrew McCreight
b314f1f7d0 Bug 1372295 - Call SetLocationForGlobal in a single location in the loader. r=kmag
SetLocationForGlobal is called on globals created for JSMs to give
them a nice name for about:memory. Right now this is done in
ImportInto and LoadModule, but I think it makes more sense to set the
name once, right after the global is created. Calling GetSpec on aURI
seems to return the same spec we'd use in these two call sites. This
change makes it easier to label the shared JSM global nicely in bug
1186409.

MozReview-Commit-ID: 5qKMbzLEiuG

--HG--
extra : rebase_source : c5f104381187cf55a171916364fba527c44b4172
2017-06-12 10:45:52 -07:00
Ehsan Akhgari
3615b687a6 Bug 1361461 - Dispatch the compartment-nuking part of WindowDestroyedEvent to the idle queue; r=smaug 2017-06-08 09:49:49 -04:00
Carsten "Tomcat" Book
383edc0429 Backed out changeset 575e351a12af (bug 1361461) for causing frequent reftest assertion failures like Assertion failure: false (Ran out of memory while building cycle collector graph), at z:/build/build/src/xpcom/base/nsCycleCollector.cpp:929
--HG--
extra : rebase_source : d4b0d05b42656579e35efde2d676c2f8f0115299
2017-06-08 11:27:43 +02:00
Ehsan Akhgari
8e38408bd7 Bug 1361461 - Dispatch the compartment-nuking part of WindowDestroyedEvent to the idle queue; r=smaug 2017-06-07 21:49:03 -04:00
Ehsan Akhgari
3cc0bd4b17 Backout bug 1361461 due to potentially introducing some intermittent reftest failures 2017-06-07 13:01:24 -04:00
Ehsan Akhgari
db983a3ae9 Bug 1361461 - Dispatch the compartment-nuking part of WindowDestroyedEvent to the idle queue; r=smaug 2017-06-07 10:57:09 -04:00
Kris Maglione
bd72f4a6ff Bug 1366402: Use AutoMemMap helper in mozJSComponentLoader. r=mccr8
This helper is already being used in the script preloader, and encapsulates
all of the memory mapping and RAII logic used to do the same in the component
loader. Reusing it there allows us to remove a lot of redundant code.

This is applied on top of the patches for bug 989373 in order to avoid
conflicts.

MozReview-Commit-ID: AJ26qV4JLci

--HG--
extra : rebase_source : 88a338ef9a88ff0b775f3f31600f32892b932940
extra : amend_source : 8312eef5078b2782c872ae964c23c2adb54f5ef7
2017-05-20 12:20:35 -07:00
Ehsan Akhgari
3abec0f53d Bug 1370100 - Make browser_dead_object.js correctly wait for the window to be destroyed instead of relying on the scheduling of the corresponding event; r=kmag 2017-06-04 21:42:09 -04:00
Kris Maglione
e51750a9c4 Bug 1322235: Part 6 - Replace AddonPolicyService with a stub implementation in ExtensionPolicyService. r=mixedpuppy,zombie
This replaces the JS policy service stubs with a pure C++ version which
directly makes policy decisions based on active WebExtensionPolicy objects.

This is the first step in a larger refactoring, which will remove the
ExtensionManagement module entirely, and replace the current add-on policy
service with direct, non-virtual access to native WebExtensionPolicy objects.

It will also be followed by related changes to migrate the content script and
extension page matching to native code, based on the existing MatchPattern and
WebExtensionPolicy bindings.

MozReview-Commit-ID: 2MpbmXZGiPZ

--HG--
extra : rebase_source : 8b268618164b45605143e858665e592de829a6fa
2017-06-03 17:12:14 -07:00
Ehsan Akhgari
bcf998a848 Bug 1370101 - Make test_windowProxyDeadWrapper.html correctly wait for the window to be destroyed instead of relying on the scheduling of the corresponding event; r=kmag 2017-06-04 19:33:16 -04:00
Ehsan Akhgari
a621e63109 Bug 1368275 - Make test_nukeContentWindow.html correctly wait for the window to be destroyed instead of relying on the scheduling of the corresponding event; r=kmag 2017-06-03 12:20:27 -04:00
Ting-Yu Chou
2ac7ffc557 Bug 1363963 - Check whether there are expando object attached before trying to retrieve it. r=bholley
In most cases no expando object has ever been attached, we don't need to do a
lot of things and realize it in the last minute.

MozReview-Commit-ID: 5u9ivZQj5L8

--HG--
extra : rebase_source : 71405f978a7c832a6694206bf0410debe596967c
2017-05-26 10:04:40 +08:00
Peter Van der Beken
9d549d2f23 Bug 1252211 - Remove DOMCI for TreeSelection, XULCommandDispatcher and XULControllers. r=bz.
--HG--
extra : rebase_source : db24985f7e8f6d4ca4df13015d565ec0063ba355
extra : source : f361697cb50b47dc4db94a6730b6604ab69217f5
2017-05-18 09:07:25 +02:00
Florian Quèze
0adcd1d3e9 Bug 1358798 - add a test preventing us from loading scripts unintentionally during startup, r=mconley,mccr8. 2017-05-31 23:00:43 +02:00
Andrea Marchesini
d5b5f35f62 Bug 1369073 - Expose MessagePort/MessageChannel to xpcshell tests, r=bholley 2017-05-31 21:16:03 +02:00
Ehsan Akhgari
a01623a51a Bug 1368285 - Make test_nuke_webextension_wrappers.js correctly wait for the window to be destroyed instead of relying on the scheduling of the corresponding event; r=kmag 2017-05-31 09:31:47 -04:00
Ryan VanderMeulen
d3f265330e Merge m-c to autoland. a=merge 2017-05-25 16:44:01 -04:00
Jon Coppeard
e105bc74f0 Bug 1309651 - Record time taken by GC parallel tasks r=sfink data-r=bsmedberg 2017-05-25 10:35:54 -04:00
Andrew McCreight
1471488de6 Bug 1367521 - Fix misspellings of "delegate". r=dholbert
MozReview-Commit-ID: KqOnp8rpCZD

--HG--
extra : rebase_source : 90bf8965737a1e808a5d2305ad395bdc99102cd1
2017-05-24 10:43:11 -07:00
Ryan VanderMeulen
38a48a48ce Backed out 4 changesets (bug 816784) for intermittent GC crashes.
Backed out changeset 9a553b9dc922 (bug 816784)
Backed out changeset ac4a48a831ce (bug 816784)
Backed out changeset e80197b11567 (bug 816784)
Backed out changeset 7e8f428a3edf (bug 816784)
2017-05-24 12:07:07 -04:00
Ting-Yu Chou
6d83ca4000 Bug 816784 part 2 - Optimize NukeCrossCompartmentWrappers() to iterate only the targetting wrappers. r=jonco
Changed the type of argument |targetFilter| of NukeCrossCompartmentWrappers()
from CompartmentFilter to JSCompartment* because it is always a single target
compartment, and we can optimize the iteration not to iterate the outer map.

MozReview-Commit-ID: 7cDCgJI0H9z

--HG--
extra : rebase_source : 4973dfd4c3326bf48b78088979962e425e35030c
2017-05-03 13:56:54 +08:00
Chris H-C
7a3995e709 bug 1364503 - Allow GC/CC MAX_PAUSE collection in opt-out r=bsmedberg,mccr8
While we're here, also align their buckets and give them bug_numbers fields.

To change buckets for GC_MAX_PAUSE_MS we need to rename to _2. Because of
GC_MAX_PAUSE_MS' use as a historical perf metric, we need to leave it in-place
for now.

MozReview-Commit-ID: Cffo3q1pR5E

--HG--
extra : rebase_source : 9843ca718dea8694be8029530a0f8646352c5b37
2017-05-19 16:12:24 -04:00
Ting-Yu Chou
e11749eeba Bug 816784 part 2 - Optimize NukeCrossCompartmentWrappers() to iterate only the targetting wrappers. r=jonco
Changed the type of argument |targetFilter| of NukeCrossCompartmentWrappers()
from CompartmentFilter to JSCompartment* because it is always a single target
compartment, and we can optimize the iteration not to iterate the outer map.

MozReview-Commit-ID: 7cDCgJI0H9z

--HG--
extra : rebase_source : ee9341168a28b5e6f273c512b0562ee4ddc297bc
extra : source : e80197b115673f259293d112da61c8dd9edc121e
2017-05-03 13:56:54 +08:00
Olli Pettay
0d4ccffc95 Bug 1367164 - Use IdleDispatch for async snow white killer on main thread, r=mccr8 2017-05-23 17:04:18 -04:00
Kris Maglione
9c9dbaaaa3 Bug 1364974: Part 5 - Perform off-thread decode operations in chunks, rather than singly. r=shu
MozReview-Commit-ID: DapDuQ8rdTI

--HG--
extra : rebase_source : 5273199757af7e72c1396d1bc62a564c0d5adb0f
2017-05-16 19:42:12 -07:00
Kris Maglione
63c946826b Bug 1364974: Part 4 - Replace CachedScript::mStatus and related logic with original and final process sets. r=erahm
The current logic is fairly hard to follow, and fails to account for changes
in the set of processes a script needs to be executed in when deciding whether
to write a new cache file. These changes simplify that logic considerably,
increase the chances that we'll correctly pre-decode a script that's needed in
a given process during startup.

MozReview-Commit-ID: BvqjKU8FDHW

--HG--
extra : rebase_source : 132af63ee8f8df5b5d704580d40735c12ed74ed9
2017-05-22 23:01:39 -07:00
Jan Beich
f8cf3b18dd Bug 1373004 - Add missing #include for MOZ_THREAD_LOCAL. r=billm
MozReview-Commit-ID: FKlkgohI4fl

--HG--
extra : rebase_source : 39243d3426594c0c30d506d9237d07e28f878ca8
2017-06-14 18:35:57 +00:00
Bob Owen
035cf9bdc2 Bug 1339105 Part 1: Implement Windows Level 3 content process sandbox policy. r=jimm
MozReview-Commit-ID: L8wcVhdLvFe

--HG--
extra : source : c3fb60fbc32660719c1b8b06dc785abd4559d6c0
2017-05-22 20:41:27 +01:00
Wes Kocher
848c9aa744 Backed out 3 changesets (bug 1339105) for plugin process leaks a=backout
Backed out changeset 431267ab28de (bug 1339105)
Backed out changeset 445875fbf13b (bug 1339105)
Backed out changeset c3fb60fbc326 (bug 1339105)

MozReview-Commit-ID: 4HYUQbHHnox
2017-05-22 15:14:23 -07:00
Bob Owen
edf3a239b1 Bug 1339105 Part 1: Implement Windows Level 3 content process sandbox policy. r=jimm
MozReview-Commit-ID: L8wcVhdLvFe
2017-05-22 20:41:27 +01:00
Sebastian Hengst
89e33081c6 Backed out changeset 50bf4c923818 (bug 1339105) for Windows bustage: calling protected constructor of class 'nsAString' at sandboxBroker.cpp(208,11). r=backout on a CLOSED TREE 2017-05-22 16:16:16 +02:00
Bob Owen
f24abd4ac3 Bug 1339105 Part 1: Implement Windows Level 3 content process sandbox policy. r=jimm
MozReview-Commit-ID: L8wcVhdLvFe
2017-05-22 14:29:06 +01:00
Phil Ringnalda
c62e9f1e9d Merge m-c to autoland
MozReview-Commit-ID: 4PrtfU4e6kL
2017-05-21 13:17:22 -07:00
Kris Maglione
d82e509e37 Bug 1354733: Part 2 - Never rewrap dead wrappers. r=bholley
MozReview-Commit-ID: 2oSGtKe9pkI

--HG--
extra : rebase_source : 48fb1050ebfdf6e3c6f16cda13842b3e1eb4eb06
2017-05-20 11:51:05 -07:00
Kris Maglione
6960f047b8 Bug 1354733: Part 1 - Allow creating DeadObjectProxies directly. r=till
MozReview-Commit-ID: HnFgiRcA7l5

--HG--
extra : rebase_source : 0337ac2451f3a72ef3feae1d05fbf426fec21d4f
2017-05-20 11:54:51 -07:00
Andrew McCreight
1ed03a415f Bug 989373, part 8 - mLoaderGlobal is always null. r=kmag
This field can be eliminated for now.

MozReview-Commit-ID: 9xyxoTwBfXU

--HG--
extra : rebase_source : e71660452286d383ba9738e7c0f7e09ae134a01e
2017-05-15 15:51:20 -07:00
Andrew McCreight
016441faf0 Bug 989373, part 7 - Add new method to create a loader global. r=kmag
This makes the code a little nicer to read, and means there will be less code churn
if we later add back the ability to share globals.

The holder also gets changed to an actual JS object.

mLoaderGlobal is always null, but the simplification for that will be
made in a later patch.

MozReview-Commit-ID: 7Qg7JSgIxxm

--HG--
extra : rebase_source : 204339b998501c96af35b407ba672a11204956dc
2017-05-15 15:46:13 -07:00
Andrew McCreight
486eb7eb5a Bug 989373, part 6 - Rename |obj| to |thisObj| in PrepareObjectForLocation. r=kmag
The name obj is not very descriptive, and a later patch will add
another object to this method, so rename it to thisObj. thisObj is the
object we set properties on for a particular .jsm. With global
sharing, it will be different than the global.

MozReview-Commit-ID: 9TPqdbXKYXO

--HG--
extra : rebase_source : c1692bb4f2274f957e602d0e469a544ae9a97e6a
2017-05-18 13:18:53 -07:00
Andrew McCreight
df181e287e Bug 989373, part 5 - Eliminate |function| from subscript loader. r=kmag
Thanks to the previous patch, we never set any of the function
arguments, so they can be removed, and various code for running
functions can be deleted.

MozReview-Commit-ID: BTIIyDtBPMR

--HG--
extra : rebase_source : 944adf3ac8f1579639e631a478fc286e980972ab
2017-05-17 09:21:54 -07:00
Andrew McCreight
87bdd721ca Bug 989373, part 4 - Remove reuse global flag from subscript loader. r=kmag
FindTargetObject in DoLoadSubScriptWithOptions will always return a
global object, so the boolean values we pass around to determine if a
global was being reused will always be false. The next patch will
eliminate the various |function| arguments that are now unused.

MozReview-Commit-ID: GvPNFGluRub

--HG--
extra : rebase_source : 76a67f5523153a37942c2730388e62125ecf4390
2017-05-15 15:04:45 -07:00
Andrew McCreight
07e8c20289 Bug 989373, part 3 - |function| is always null in ObjectForLocation. r=kmag
With the changes in part 1, the local variable |function| is always
null in ObjectForLocation, which lets me remove a lot of dead
code. Additionally, in the second half of the function we know that
|script| is always non-null, because we return with a failure before
then if it isn't null.

In addition, with these changes WriteCachedFunction is no longer
called, so I removed it.

MozReview-Commit-ID: 60hEPi8S3H4

--HG--
extra : rebase_source : 69ea6110fb85d02d2f1c72c5675014aeebb2dee5
2017-05-15 15:00:46 -07:00
Andrew McCreight
05d8bb3c65 Bug 989373, part 1 - Remove pref for reusing globals with JSMs. r=kmag
Removing support for this preference means that mReuseLoaderGlobal
will always be false, which lets us eliminate that field, and remove a
lot of code.

This also means that false is always passed to
PrepareObjectForLocation for aReuseLoaderGlobal.

ReadCachedFunction is no longer used, so it is deleted.

MozReview-Commit-ID: 5JD24EYVcQf

--HG--
extra : rebase_source : 3b23b4b8d2b1a2f6a53223477afb4cb13b8a671c
2017-05-15 14:33:21 -07:00
Kris Maglione
341bdc643d Bug 1364934: Ignore cached scripts from content processes which were removed in a cache flush. r=erahm
MozReview-Commit-ID: AnmsM3WiZMX

--HG--
extra : rebase_source : 9c240099272cc1546dfe35764f130d5b6356f4e2
2017-05-17 22:55:14 -07:00
Andrew McCreight
21f4802365 Bug 1365417 - mozJSComponentLoader::FindTargetObject() is infallible. r=kmag
MozReview-Commit-ID: Iw4ke16CTKg

--HG--
extra : rebase_source : b2c6f5b0dec1849e1bd814ecdcde78b376ffb8ca
2017-05-16 14:27:50 -07:00
Andrew McCreight
f7b4214e05 Bug 1365760 - Fix two tiny issues in mozJSComponentLoader::ImportInto(). r=kmag
MozReview-Commit-ID: 84I37uRi11H

--HG--
extra : rebase_source : 144b88771956c29c5de58e75dd57aab5d6e2dc1f
2017-05-16 15:51:14 -07:00
Steve Fink
51871e1507 Bug 1364547 - Call the slice end callback for every slice, r=jonco
Currently, the final slice of an incremental GC only gets a GC_CYCLE_END callback, not a GC_SLICE_END callback. So if you are doing anything that expects to see all of the slices, you will be missing one.

Simplify the setup so that every GC is bracketed with CYCLE_BEGIN/END, and every slice is bracketed with SLICE_BEGIN/END, treating a nonincremental as a GC with a single slice (which it is for everything else.)

--HG--
extra : rebase_source : 8e21300819d517b3e35de14930f53b3ab737a44e
2017-05-15 08:06:24 -07:00
Boris Zbarsky
cba820b01b Bug 1189822 part 2. Remove the DOM proxy expando object hashtable in xpconnect. r=peterv 2017-05-17 00:52:53 -04:00
Mike Hommey
02a06f7958 Bug 1363992 - Remove support for making jemalloc4 the default. r=njn
--HG--
extra : rebase_source : 77e1c13aa329637d0ec875439d572ee06e6919fa
2017-05-11 13:16:00 +09:00
Andrew McCreight
6d13ed70db Bug 1363555 - Make IS_TEAROFF_CLASS into a function. r=mrbkap
Right now, it is a macro, which causes a warning with clang about
extraneous parentheses. Turning it into a function fixes that and is
also nicer.

MozReview-Commit-ID: KTPA9b6oeUu

--HG--
extra : rebase_source : ae063db5a4b5b14bc4a3a8f64adbbecfc897edd9
2017-05-09 15:34:02 -07:00
Andrew McCreight
f8742e48d2 Bug 1363544 - Call into nsXPConnect directly in the loader and XPCShellImpl. r=mrbkap
MozReview-Commit-ID: 7ZnHdAG1Jmk

--HG--
extra : rebase_source : ff79438edb136ba0e4127173608d605793e7e3b7
2017-05-09 14:08:15 -07:00
Kris Maglione
51f7df2898 Bug 1361900: Part 11 - Make sure new cache file is closed before renaming on Windows. r=me
MozReview-Commit-ID: KpJpId6eULt

--HG--
extra : rebase_source : c8552d69195d353b3ca6302cff03e5641ac49c07
2017-05-13 22:55:34 -07:00
Kris Maglione
3bc458e421 Bug 1361900: Part 10 - Replace linked lists with a single hashtable. r=erahm
MozReview-Commit-ID: 3qXnswsP6Z0

--HG--
extra : rebase_source : 289775a1e6ac452081fb2ec80346f803a51710c5
extra : source : 75b28187fa5ed70fafdd30565a12584b301b9104
2017-05-13 22:43:08 -07:00
Kris Maglione
a09d901e45 Bug 1361900: Part 9 - Sort scripts by initial load time before saving. r=erahm
MozReview-Commit-ID: 54UN2DVK4xM

--HG--
extra : rebase_source : 034c0020678d04d6087e3a40ab76499958ac748c
extra : source : 2a48f8b743d158bc744a776bd939c80a242e1446
2017-05-13 14:08:42 -07:00
Kris Maglione
24826fb52a Bug 1361900: Part 7 - Use the script preloader in content processes in subscript and component loaders. r=mccr8
MozReview-Commit-ID: 4b5XwORYlAz

--HG--
extra : rebase_source : 4e7f20d0fdd3fd45184b3185fac818bf9c032344
extra : source : 3c716b3b45417e45100d5480241921f44c601270
2017-04-30 21:53:49 -07:00
Kris Maglione
589a82d7ba Bug 1361900: Part 6 - Add content process support for the script preloader. r=erahm,gabor
MozReview-Commit-ID: 6hDQAI52bKC

--HG--
extra : rebase_source : 46e8d5ed5965e483fa4b0bd8f6f4403e0bb771dc
extra : source : 4227bcda00babd2d5980dca3b42cb4b467da38c4
2017-05-02 17:17:52 -07:00
Kris Maglione
e3992a28fd Bug 1361900: Part 5 - Add support for IPC FileDescriptors to AutoMemMap. r=erahm
MozReview-Commit-ID: 3HBuKLVNdWT

--HG--
extra : rebase_source : d1edbec1294e41f645c0515a523cf3df5e90af21
extra : source : 540ecb4c1f0fc25725375c7cc5a399a1d2bea5fe
2017-04-30 22:54:00 -07:00
Kris Maglione
fc0586811d Bug 1361900: Part 4 - Use a separate script cache for scripts loaded in the child process. r=erahm,gabor
MozReview-Commit-ID: EIdwmuTOl90

--HG--
extra : rebase_source : d2f6ba18a03cb54459e98b9d2ff03bc3d9567e83
extra : source : ad243db647c708b74859d73e8787b5b34897c140
2017-05-09 19:52:17 -07:00
Kris Maglione
10c8448c1a Bug 1361900: Part 3 - Add a helper script to decode and inspect script cache data. r=erahm
MozReview-Commit-ID: DOj7X46NaZ5

--HG--
extra : rebase_source : a937fb12c287861c2a2487ca4254050195a16a4d
extra : source : bd55bd27bb1e55e44fbe76786993b1657c2af944
2017-04-30 13:00:55 -07:00
Kris Maglione
a8eba3c140 Bug 1361900: Part 2 - Add process types field to cached script data. r=erahm
MozReview-Commit-ID: Gvh672XD0ar

--HG--
extra : rebase_source : 4391f60ab8f1eaa3df646f7acbc2652be2487f0c
extra : source : 39ffa8a7801a7807a1097ea2c9290c772cd54a9b
2017-05-03 17:21:31 -07:00
Sebastian Hengst
0bc683dcda Backed out changeset 39ffa8a7801a (bug 1361900) 2017-05-13 18:53:50 +02:00
Sebastian Hengst
20ecaf5c4c Backed out changeset bd55bd27bb1e (bug 1361900) 2017-05-13 18:53:45 +02:00
Sebastian Hengst
e1ddae17f8 Backed out changeset ad243db647c7 (bug 1361900) 2017-05-13 18:53:40 +02:00
Sebastian Hengst
185936c593 Backed out changeset 540ecb4c1f0f (bug 1361900) 2017-05-13 18:53:35 +02:00
Sebastian Hengst
0f6e08c578 Backed out changeset 4227bcda00ba (bug 1361900) 2017-05-13 18:53:30 +02:00
Sebastian Hengst
aa75233439 Backed out changeset 3c716b3b4541 (bug 1361900) 2017-05-13 18:53:25 +02:00
Sebastian Hengst
f2d93e36db Backed out changeset 2a48f8b743d1 (bug 1361900) 2017-05-13 18:53:15 +02:00
Sebastian Hengst
b5071f569a Backed out changeset 75b28187fa5e (bug 1361900) 2017-05-13 18:53:10 +02:00
Sebastian Hengst
68e5b1d383 Backed out changeset 9795dacd97e1 (bug 1361900) 2017-05-13 18:52:53 +02:00
Sebastian Hengst
9c58d83d6f Backed out changeset 8d47499f43b3 (bug 1361900) 2017-05-13 18:52:48 +02:00
Sebastian Hengst
f8b2c3d68c Backed out changeset 0b38ac21c7a5 (bug 1361900) 2017-05-13 18:52:25 +02:00
Sebastian Hengst
1e386fe967 Backed out changeset 23dc7b443bb0 (bug 1361900) 2017-05-13 18:51:57 +02:00
Kris Maglione
8d9a00892f Bug 1361900: Fix one last merge botch, and fix a false rooting hazard warning.
MozReview-Commit-ID: JpKYYEBpbQj

--HG--
extra : rebase_source : 5bbb462ed3255c631cc1c280359af8c9c2224239
extra : histedit_source : 444c4c02eb1a3ced85cef09f7b7a6e7f5b9235b5%2Cb16ca4316a1aabf5e5c1b8641a0e1818d815da76
2017-05-12 18:14:12 -07:00
Kris Maglione
40bbc14054 Bug 1361900: Follow-up: Fix order of execution issue. r=me
MozReview-Commit-ID: DcmTlzxskUj
2017-05-12 15:46:34 -07:00
Kris Maglione
26511894d2 Bug 1361900: Follow-up: Fix another rebase botch. r=me
MozReview-Commit-ID: BuvkimQCRDP
2017-05-12 15:17:25 -07:00
Kris Maglione
53cf532feb Bug 1361900: Follow-up: Fix rebase botch. r=me
MozReview-Commit-ID: 3KIbvGYhnlG
2017-05-12 14:59:34 -07:00
Kris Maglione
a4e4191399 Bug 1356826: Part 4 - Add Cu.isInAutomation and Cu.crashIfNotInAutomation helpers. r=bholley
MozReview-Commit-ID: ADqVqF2XraG

--HG--
extra : rebase_source : 5b4ff1ceb7f3123f585559a954e59291c91e5554
extra : source : c46fed6e4f6a928df2b06fca6b3f004fd4bb0cc7
2017-04-15 14:23:58 -07:00
Kris Maglione
23518f0244 Bug 1361900: Part 10 - Replace linked lists with a single hashtable. r=erahm
MozReview-Commit-ID: 3qXnswsP6Z0

--HG--
extra : rebase_source : 1edbf92171003d9ad2c4cfebabbb8a1d7f2d4e24
2017-05-03 16:57:31 -07:00
Kris Maglione
220b0239c3 Bug 1361900: Part 9 - Sort scripts by initial load time before saving. r=erahm
MozReview-Commit-ID: 54UN2DVK4xM

--HG--
extra : rebase_source : f7cb39eb05bb86a03a17b97cbe2cb9d8dd1008fe
2017-05-01 14:12:01 -07:00
Kris Maglione
4948d82519 Bug 1361900: Part 7 - Use the script preloader in content processes in subscript and component loaders. r=mccr8
MozReview-Commit-ID: 4b5XwORYlAz

--HG--
extra : rebase_source : a43936bc2eaaa87c24cc8933e54e99a9386e12e3
2017-04-30 21:53:49 -07:00
Kris Maglione
2a49ee963d Bug 1361900: Part 6 - Add content process support for the script preloader. r=erahm,gabor
MozReview-Commit-ID: 6hDQAI52bKC

--HG--
extra : rebase_source : a7a32c6ebca0ce1b6449030e33656a9d416e910e
2017-05-02 17:17:52 -07:00
Kris Maglione
d3eae9806f Bug 1361900: Part 5 - Add support for IPC FileDescriptors to AutoMemMap. r=erahm
MozReview-Commit-ID: 3HBuKLVNdWT

--HG--
extra : rebase_source : b5c331223808810c0dceeafccbbf7a2de7d98bc4
2017-04-30 22:54:00 -07:00
Kris Maglione
34e20a0617 Bug 1361900: Part 4 - Use a separate script cache for scripts loaded in the child process. r=erahm,gabor
MozReview-Commit-ID: EIdwmuTOl90

--HG--
extra : rebase_source : bce9efcd7b97c281bf4e17e30eed31e6e93c614a
2017-05-09 19:52:17 -07:00
Kris Maglione
c0f737d8d9 Bug 1361900: Part 3 - Add a helper script to decode and inspect script cache data. r=erahm
MozReview-Commit-ID: DOj7X46NaZ5

--HG--
extra : rebase_source : f974fa6dc5cf0316b463bc7d1c7f6cd4478c4b59
2017-04-30 13:00:55 -07:00
Kris Maglione
4b6d93f595 Bug 1361900: Part 2 - Add process types field to cached script data. r=erahm
MozReview-Commit-ID: Gvh672XD0ar

--HG--
extra : rebase_source : 022d4a8d3116ae1817189d1f03c3180087997487
2017-05-03 17:21:31 -07:00
Iris Hsiao
6559420d58 Backed out 15 changesets (bug 1358846, bug 1356826) for talos error. a=backout
Backed out changeset 96ea13bb00c5 (bug 1358846)
Backed out changeset b533d7f9b9c2 (bug 1358846)
Backed out changeset 7dcb80a051a3 (bug 1358846)
Backed out changeset 26825f1e33dd (bug 1358846)
Backed out changeset 98b57ff82a54 (bug 1358846)
Backed out changeset b9088593e34f (bug 1358846)
Backed out changeset cb2518673c56 (bug 1358846)
Backed out changeset 889c487a5d41 (bug 1358846)
Backed out changeset 459b36092b7a (bug 1356826)
Backed out changeset c861e23ec8ef (bug 1356826)
Backed out changeset d47998fa24cd (bug 1356826)
Backed out changeset b02e89c67132 (bug 1356826)
Backed out changeset c46fed6e4f6a (bug 1356826)
Backed out changeset 237268e3d9d2 (bug 1356826)
Backed out changeset 527435fc20db (bug 1356826)
2017-05-12 17:45:21 +08:00
Kris Maglione
602cb201f5 Bug 1356826: Part 4 - Add Cu.isInAutomation and Cu.crashIfNotInAutomation helpers. r=bholley
MozReview-Commit-ID: ADqVqF2XraG

--HG--
extra : rebase_source : ea5df06eb9162f9f8c5816f49fb44d9f41947126
2017-04-15 14:23:58 -07:00
Wes Kocher
1b5ad2c128 Merge inbound to central, a=merge
MozReview-Commit-ID: DfRZi0gKjit
2017-05-10 16:48:03 -07:00
Carsten "Tomcat" Book
455239782b Merge mozilla-central to mozilla-inbound 2017-05-10 15:30:44 +02:00
kedziorski.lukasz@gmail.com
f815a0af4b Bug 1359436 - Add leak checking to CycleCollectedJSContext and related classes. r=mccr8 2017-05-09 13:59:00 +02:00
Andrew McCreight
087c406acb Bug 1363538 - Remove some derelict testing code from XPCShellImpl.cpp. r=mrbkap
MozReview-Commit-ID: 96UyB317H0W

--HG--
extra : source : 0a74ed4854d784856f28cf48a422f4aa0763fd22
2017-05-09 14:35:23 -07:00
Alexandre Poirot
097e90a04c Bug 1363539 - Remove dependency on DevTools from test_onGarbageCollection.html. r=sfink
MozReview-Commit-ID: LQ8oCAyC7sF

--HG--
extra : rebase_source : 82284076bcff9fa34d7410b22ce90bb6182d3a09
2017-02-22 12:45:11 +01:00
Andrea Marchesini
1981f67eb3 Bug 1362119 - part 1 - Moving dom/base/Script{Loader,Element}.* in dom/script, r=ehsan
This patch does these things:

1. it moves nsScriptElement, nsScriptLoader, ScriptSettings, nsIScriptElement
   and nsIScriptLoaderObserver in dom/script
2. it renames nsScriptElement to mozilla::dom::ScriptElement
3. it renames nsScriptLaoder to mozilla::dom::ScriptLoader

--HG--
rename : dom/base/nsScriptElement.cpp => dom/script/ScriptElement.cpp
rename : dom/base/nsScriptElement.h => dom/script/ScriptElement.h
rename : dom/base/nsScriptLoader.cpp => dom/script/ScriptLoader.cpp
rename : dom/base/nsScriptLoader.h => dom/script/ScriptLoader.h
rename : dom/base/ScriptSettings.cpp => dom/script/ScriptSettings.cpp
rename : dom/base/ScriptSettings.h => dom/script/ScriptSettings.h
rename : dom/base/nsIScriptElement.h => dom/script/nsIScriptElement.h
rename : dom/base/nsIScriptLoaderObserver.idl => dom/script/nsIScriptLoaderObserver.idl
2017-05-08 08:24:22 +02:00
Carsten "Tomcat" Book
f0d6de60d7 Backed out changeset 5d77f6b14633 (bug 1362119) for android bustage in nsCCUncollectableMarker.cpp:500:7: error: 'TraceScriptHolder' is not a member of 'mozilla'
--HG--
rename : dom/script/ScriptSettings.cpp => dom/base/ScriptSettings.cpp
rename : dom/script/ScriptSettings.h => dom/base/ScriptSettings.h
rename : dom/script/nsIScriptElement.h => dom/base/nsIScriptElement.h
rename : dom/script/nsIScriptLoaderObserver.idl => dom/base/nsIScriptLoaderObserver.idl
rename : dom/script/ScriptElement.cpp => dom/base/nsScriptElement.cpp
rename : dom/script/ScriptElement.h => dom/base/nsScriptElement.h
rename : dom/script/ScriptLoader.cpp => dom/base/nsScriptLoader.cpp
rename : dom/script/ScriptLoader.h => dom/base/nsScriptLoader.h
2017-05-08 09:54:38 +02:00
Andrea Marchesini
7a4ef797cb Bug 1362119 - part 1 - Moving dom/base/Script{Loader,Element}.* in dom/script, r=ehsan
This patch does these things:

1. it moves nsScriptElement, nsScriptLoader, ScriptSettings, nsIScriptElement
   and nsIScriptLoaderObserver in dom/script
2. it renames nsScriptElement to mozilla::dom::ScriptElement
3. it renames nsScriptLaoder to mozilla::dom::ScriptLoader

--HG--
rename : dom/base/nsScriptElement.cpp => dom/script/ScriptElement.cpp
rename : dom/base/nsScriptElement.h => dom/script/ScriptElement.h
rename : dom/base/nsScriptLoader.cpp => dom/script/ScriptLoader.cpp
rename : dom/base/nsScriptLoader.h => dom/script/ScriptLoader.h
rename : dom/base/ScriptSettings.cpp => dom/script/ScriptSettings.cpp
rename : dom/base/ScriptSettings.h => dom/script/ScriptSettings.h
rename : dom/base/nsIScriptElement.h => dom/script/nsIScriptElement.h
rename : dom/base/nsIScriptLoaderObserver.idl => dom/script/nsIScriptLoaderObserver.idl
2017-05-08 08:24:22 +02:00
Kris Maglione
9c1bafbab4 Bug 1359653: Follow-up: Don't cache mochikit scripts as a temporary bustage workaround.
MozReview-Commit-ID: I4FcZWRKlWr

--HG--
extra : amend_source : c34f3bcb023b9063a4d1a53a6bb3873fdb499d1c
2017-05-06 14:41:22 -07:00
Kris Maglione
e8e5fe66b7 Bug 1359653: Part 9 - Observe "startupcache-invalidate" and flush the cache when received. r=erahm
Flushing the cache at startup is already handled automatically by the
AppStartup code, which removes the entire startupCache directory when
necessary. The add-on manager requires being able to flush the cache at
runtime, though, for the sake of updating bootstrapped add-ons.

MozReview-Commit-ID: LIdiNHrXYXu

--HG--
extra : source : 8f4637881ddc42a948c894e62c8486fe8677a938
extra : histedit_source : e69395a2b87b2b0edb394686ed6ee24731ba9fb8
2017-05-03 12:31:51 -07:00
Kris Maglione
6df68230e0 Bug 1359653: Part 6 - Use the script precompiler in the JS component loader and subscript loader. r=mccr8,shu
MozReview-Commit-ID: HMl0xbAARHK

--HG--
extra : source : a505dcbe8a02bf4b4f975e62cc2b651ef7eebdd0
extra : histedit_source : 288bbb8633d2296200abb66f359619785ac7d2d8
2017-05-03 22:06:33 -07:00
Kris Maglione
15e7adf3aa Bug 1359653: Part 5 - Pre-load scripts needed during startup in a background thread. r=shu,erahm
One of the things that I've noticed in profiling startup overhead is that,
even with the startup cache, we spend about 130ms just loading and decoding
scripts from the startup cache on my machine.

I think we should be able to do better than that by doing some of that work in
the background for scripts that we know we'll need during startup. With this
change, we seem to consistently save about 3-5% on non-e10s startup overhead
on talos. But there's a lot of room for tuning, and I think we get some
considerable improvement with a few ongoing tweeks.

Some notes about the approach:

- Setting up the off-thread compile is fairly expensive, since we need to
create a global object, and a lot of its built-in prototype objects for each
compile. So in order for there to be a performance improvement for OMT
compiles, the script has to be pretty large. Right now, the tipping point
seems to be about 20K.

  There's currently no easy way to improve the per-compile setup overhead, but
we should be able to combine the off-thread compiles for multiple smaller
scripts into a single operation without any additional per-script overhead.

- The time we spend setting up scripts for OMT compile is almost entirely
CPU-bound. That means that we have a chunk of about 20-50ms where we can
safely schedule thread-safe IO work during early startup, so if we schedule
some of our current synchronous IO operations on background threads during the
script cache setup, we basically get them for free, and can probably increase
the number of scripts we compile in the background.

- I went with an uncompressed mmap of the raw XDR data for a storage format.
That currently occupies about 5MB of disk space. Gzipped, it's ~1.2MB, so
compressing it might save some startup disk IO, but keeping it uncompressed
simplifies a lot of the OMT and even main thread decoding process, but, more
importantly:

- We currently don't use the startup cache in content processes, for a variety
of reasons. However, with this approach, I think we can safely store the
cached script data from a content process before we load any untrusted code
into it, and then share mmapped startup cache data between all content
processes. That should speed up content process startup *a lot*, and very
likely save memory, too. And:

- If we're especially concerned about saving per-process memory, and we keep
the cache data mapped for the lifetime of the JS runtime, I think that with
some effort we can probably share the static string data from scripts between
content processes, without any copying. Right now, it looks like for the main
process, there's about 1.5MB of string-ish data in the XDR dumps. It's
probably less for content processes, but if we could save .5MB per process
this way, it might make it easier to increase the number of content processes
we allow.

MozReview-Commit-ID: CVJahyNktKB

--HG--
extra : source : 1c7df945505930d2d86a076ee20807104324c8cc
extra : histedit_source : 75e193839edf727874f01b2a9f6852f6c1f087fb%2C3ce966d7dcf2bd0454a7d673d0467097456bd782
2017-05-06 12:24:22 -07:00
Sebastian Hengst
544da0524c Backed out changeset 1c7df9455059 (bug 1359653) 2017-05-06 11:02:23 +02:00
Sebastian Hengst
a71ff9882a Backed out changeset a505dcbe8a02 (bug 1359653) 2017-05-06 11:02:18 +02:00
Sebastian Hengst
0584d6d6d4 Backed out changeset 8f4637881ddc (bug 1359653) 2017-05-06 11:02:04 +02:00
Kris Maglione
c1b1876797 Bug 1359653: Part 9 - Observe "startupcache-invalidate" and flush the cache when received. r=erahm
Flushing the cache at startup is already handled automatically by the
AppStartup code, which removes the entire startupCache directory when
necessary. The add-on manager requires being able to flush the cache at
runtime, though, for the sake of updating bootstrapped add-ons.

MozReview-Commit-ID: LIdiNHrXYXu

--HG--
extra : rebase_source : e5b16490f47e20c78d081ad03dec02c6b2874fc3
extra : absorb_source : 6cd94504c8247f375161b2afdca5c61d59cf8f01
2017-05-03 12:31:51 -07:00
Kris Maglione
e1eeeaf349 Bug 1359653: Part 6 - Use the script precompiler in the JS component loader and subscript loader. r=mccr8,shu
MozReview-Commit-ID: HMl0xbAARHK

--HG--
extra : rebase_source : 257ac78f3438d67725b5c1630c214a1d0627193d
extra : absorb_source : e70948dbfa5517b1868cafe804a71248e57ef022
2017-05-03 22:06:33 -07:00
Kris Maglione
a4368ffba1 Bug 1359653: Part 5 - Pre-load scripts needed during startup in a background thread. r=shu,erahm
One of the things that I've noticed in profiling startup overhead is that,
even with the startup cache, we spend about 130ms just loading and decoding
scripts from the startup cache on my machine.

I think we should be able to do better than that by doing some of that work in
the background for scripts that we know we'll need during startup. With this
change, we seem to consistently save about 3-5% on non-e10s startup overhead
on talos. But there's a lot of room for tuning, and I think we get some
considerable improvement with a few ongoing tweeks.

Some notes about the approach:

- Setting up the off-thread compile is fairly expensive, since we need to
create a global object, and a lot of its built-in prototype objects for each
compile. So in order for there to be a performance improvement for OMT
compiles, the script has to be pretty large. Right now, the tipping point
seems to be about 20K.

  There's currently no easy way to improve the per-compile setup overhead, but
we should be able to combine the off-thread compiles for multiple smaller
scripts into a single operation without any additional per-script overhead.

- The time we spend setting up scripts for OMT compile is almost entirely
CPU-bound. That means that we have a chunk of about 20-50ms where we can
safely schedule thread-safe IO work during early startup, so if we schedule
some of our current synchronous IO operations on background threads during the
script cache setup, we basically get them for free, and can probably increase
the number of scripts we compile in the background.

- I went with an uncompressed mmap of the raw XDR data for a storage format.
That currently occupies about 5MB of disk space. Gzipped, it's ~1.2MB, so
compressing it might save some startup disk IO, but keeping it uncompressed
simplifies a lot of the OMT and even main thread decoding process, but, more
importantly:

- We currently don't use the startup cache in content processes, for a variety
of reasons. However, with this approach, I think we can safely store the
cached script data from a content process before we load any untrusted code
into it, and then share mmapped startup cache data between all content
processes. That should speed up content process startup *a lot*, and very
likely save memory, too. And:

- If we're especially concerned about saving per-process memory, and we keep
the cache data mapped for the lifetime of the JS runtime, I think that with
some effort we can probably share the static string data from scripts between
content processes, without any copying. Right now, it looks like for the main
process, there's about 1.5MB of string-ish data in the XDR dumps. It's
probably less for content processes, but if we could save .5MB per process
this way, it might make it easier to increase the number of content processes
we allow.

MozReview-Commit-ID: CVJahyNktKB

--HG--
extra : rebase_source : 2ec24c8b0000f9187a9bf4a096ee8d93403d7ab2
extra : absorb_source : bb9d799d664a03941447a294ac43c54f334ef6f5
2017-05-05 16:15:04 -07:00
André Bargull
11bb19e7da Bug 1359294 - Remove toLocaleLowerCase/toLocaleUpperCase callbacks in XPCLocale. r=Waldo
--HG--
extra : rebase_source : 711d5bfc896a48f63b6c825823ba5aef5c93413c
extra : histedit_source : 7a34417565cf6151c39d7c68c776505142098f24
2017-05-03 09:55:06 -07:00
Nathan Froyd
3261352ea3 Bug 1361514 - convert XPCLocaleObserver to NS_DECL_OWNINGTHREAD; r=gabor
The pattern we're using here has a name, so let's use that instead.
2017-05-03 11:48:54 -04:00
Sebastian Hengst
f4f104e7e0 merge mozilla-central to autoland. r=merge a=merge 2017-04-29 11:11:48 +02:00
Andrew Swan
f38ced1fc9 Bug 1354682 Add transform to XPCOMUtils.defineLazyPreferenceGetter r=kmag
MozReview-Commit-ID: Lm59IHMNcy9

--HG--
extra : rebase_source : 3250d759b1b9909bcc7564139a3d7066d8376b60
2017-04-28 22:39:13 -07:00
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
Geoff Brown
6eac32a3c5 Bug 1338809 - Build android xpcshell as position independent executable; r=glandium
This allows xpcshell-test to be run on Android 5.0 and greater at the
expense of Android 4.0: Run xpcshell on Android 4.1 and above.
2017-03-14 08:08:43 -06:00
Carsten "Tomcat" Book
dba578960e merge mozilla-inbound to mozilla-central a=merge 2017-03-14 14:23:03 +01:00
Chih-Yi Leu
ec60526d60 Bug 1315037 - Use NS_ENSURE_SUCCESS for nsresult diagnosis. r=erahm 2017-03-13 02:14:00 +01:00
Zibi Braniecki
f096c9aab9 Bug 1346674 - Migrate all uses of nsILocaleService::GetApplicationLocale to mozILocaleService::GetAppLocale. r=jfkthame
MozReview-Commit-ID: 2E7mj3yQnxB

--HG--
extra : rebase_source : 97ba5b1738b2f116ec75830ed1b23f279680035e
2017-03-12 20:39:22 -07:00
Andrew McCreight
634490d4bf Bug 1344527 - Give up in ReadScriptAsync if we can't create a promise. r=bholley
MozReview-Commit-ID: Hq4vJZmfDpc

--HG--
extra : rebase_source : f3544bfc559aee379f66972ce97764354b6aa658
2017-03-09 09:24:28 -08:00
Christian Holler
1965d4b2e1 Bug 1345906 - Add ReloadPrefsCallback for fuzzing.enabled pref. r=jandem
MozReview-Commit-ID: 5lNyaebmt1h

--HG--
extra : rebase_source : 331dcf55caaa662203a501e5d0fa16f692b61793
2017-03-09 16:47:34 +01:00
Wes Kocher
3842d8fcef Merge inbound to central, a=merge
MozReview-Commit-ID: 62e9XDudUlc
2017-03-08 17:07:55 -08:00
Shu-yu Guo
c91e65240b Bug 1108941 - Implement the per-global template literal registry. (r=arai,jonco) 2017-03-08 12:00:54 -08:00
Boris Zbarsky
2ab128503c Bug 1344443. Fix [[SetPrototypeOf]] on cross-origin objects to follow the spec. r=bholley,waldo
MozReview-Commit-ID: JI9fbQTS0PS
2017-03-08 03:14:38 -05:00
Carsten "Tomcat" Book
96fe421b34 Merge mozilla-central to autoland 2017-03-08 17:04:17 +01:00
David Teller
c1b5f21196 Bug 1343483 - Determine how long functions remain syntax-parsed before they are full-parsed;r=shu
In many cases, to speed up start, compiling a ScriptSource will not
compile the functions themselves, but will rather syntax-parse them
(to check for syntax errors), leaving full compilation for
later. However, if we find ourselves in a case in which the function
is needed almost immediately, we need to full-parse the function
immediately after the syntax-parse, which is wasteful.

This changeset intends to measure how often this happens, by exporting
through Telemetry the duration between the end of the syntax-parse and
the start of the full-parse for each function.

As a memory optimization, instead of storing a timestamp for the
syntax-parse of each function, we store a single timestamp for an
entire ScriptSource. This assumes that all functions of the
ScriptSource are syntax-parsed at approximately the same instant,
which should be mostly true for everything except perhaps `eval` and
`new Function`. Then, when time comes to delazify a function, we
simply determine the time elapsed since the ScriptSource was compiled.

Histogram JS_PARSER_COMPILE_LAZY_AFTER_MS starts at 10ms (anything
smaller is often not measurable) and stops at 10s (anything larger can
safely be said to be not wasteful).

MozReview-Commit-ID: 6Ycy2OIIiAt

--HG--
extra : rebase_source : 0ccd6f51189b3ad8056e9f39e267235d68f6e2db
2017-03-06 21:22:00 +01:00
Ehsan Akhgari
df3bce859e Bug 1344974 - Part 3: Speed up principal access checks in WrapperFactory::Rewrap() by eliminating virtual dispatch and inling; r=bholley 2017-03-07 00:29:44 -05:00
Ehsan Akhgari
3169d6c35c Bug 1340710 - Part 6: Store BasePrincipal::{mOriginNoSuffix,mOriginSuffix} as a pair of atoms; r=bholley
This has the nice side effect of making nsIPrincipal::GetOrigin() a bit faster
by avoiding computing the origin each time.
2017-03-06 22:27:53 -05:00
Ehsan Akhgari
65b2fe2b53 Bug 1343866 - Scope more nsCOMPtrs in XRE_XPCShellMain(); r=bsmedberg 2017-03-06 15:06:18 -05:00
Jan Varga
e161ee742d Bug 1311057 - Part 1: Remove support for packaged apps from asmjscache; r=luke 2017-03-06 18:38:40 +01:00
Jon Coppeard
82cbd987a2 Bug 1338623 - Add a slower but more exact gray marking check for checking correctness r=sfink r=mccr8 2017-03-02 10:22:47 +00:00
Ehsan Akhgari
4f4a529bd2 Bug 1342719 - Optimize away a virtual function call in AccessCheck::isChrome; r=bholley 2017-02-27 09:39:50 -05:00
Phil Ringnalda
ab84dcd8f5 Merge m-i to m-c, a=merge 2017-02-26 10:48:26 -08:00
Jan de Mooij
76f56574e3 Bug 1342439 part 1 - Replace macros to check for overrecursion with functions. r=luke 2017-02-25 16:07:56 +01:00
Masatoshi Kimura
7be7b11a1c Bug 1342144 - Remove version parameter from the type attribute of script elements. r=jmaher
This patch is generated by the following sed script:
find . ! -wholename '*/.hg*' -type f \( -iname '*.html' -o -iname '*.xhtml' -o -iname '*.xul' -o -iname '*.js' \) -exec sed -i -e 's/\(\(text\|application\)\/javascript\);version=1.[0-9]/\1/g' {} \;

MozReview-Commit-ID: AzhtdwJwVNg

--HG--
extra : rebase_source : e8f90249454c0779d926f87777f457352961748d
2017-02-23 06:10:07 +09:00
Olli Pettay
66be2f31cc Bug 1342244, try to avoid extra CompartmentPrivate::Get calls during Rewrap, r=bholley
--HG--
extra : rebase_source : 951f392a2d19a509ce951213686684cc326f4895
2017-02-24 15:03:38 +02:00
Kris Maglione
d1e03c1b46 Bug 1322273: Return DeadObjectProxy when wrapping for nuked compartment. r=bholley
MozReview-Commit-ID: V07P0eZvKO

--HG--
extra : rebase_source : 822441921b2b0a968a7dec5a532bba5535cb871b
extra : absorb_source : dd03f3197d5a4c09d228c2168726f9ae2408a7bb
extra : source : e74563742aafb580f88ef17f2121dd385e37755a
2017-02-22 19:11:52 -08:00
Kris Maglione
42bebe8564 Bug 1322273: Cut wrappers that point out of a browser compartment when nuking it. r=bholley
MozReview-Commit-ID: FLS3xRgih2u

--HG--
extra : rebase_source : ffae5590afe3efcb70cdda6386f5b1d71123943c
extra : absorb_source : 8b3db1348e793dabca338841dc18b6d9021c6ef8
2017-02-23 13:56:10 -08:00
Nicholas Nethercote
352554c8f6 Bug 1340928 (part 10) - Remove nested calls to profiler_{init,shutdown}(). r=mstange.
The profiler can currently handle nested calls to profiler_{init,shutdown}() --
only the first call to profiler_init() and the last call to profiler_shutdown()
do anything. And sure enough, we have the following.

- Outer init/shutdown pairs in XRE_main()/XRE_InitChildProcess() (via
  GeckoProfilerInitRAII).

- Inner init/shutdown pairs in NS_InitXPCOM2()/NS_InitMinimalXPCOM() (both shut
  down in ShutdownXPCOM()).

This is a bit silly, so the patch removes the inner pairs, and adds a
now-needed pair in XRE_XPCShellMain. This will allow gInitCount -- which tracks
the nesting depth -- to be removed in a future patch.

--HG--
extra : rebase_source : 7e8dc6ce81ce10269d2db6a7bf32852c396dba0e
2017-02-15 17:08:38 +11:00
Andrea Marchesini
e7a1e33581 Bug 1341250 - Moving nsExpandedPrincipal in separate files, r=qdot
--HG--
rename : caps/nsPrincipal.cpp => caps/nsExpandedPrincipal.cpp
rename : caps/nsPrincipal.h => caps/nsExpandedPrincipal.h
2017-02-22 10:01:43 +01:00
Sebastian Hengst
0ea43f8182 Backed out changeset f0886e3477a5 (bug 1341250) 2017-02-22 11:20:46 +01:00
Andrea Marchesini
c83982c31f Bug 1341250 - Moving nsExpandedPrincipal in separate files, r=qdot
--HG--
rename : caps/nsPrincipal.cpp => caps/nsExpandedPrincipal.cpp
rename : caps/nsPrincipal.h => caps/nsExpandedPrincipal.h
2017-02-22 10:01:43 +01:00
Sylvestre Ledru
39d7cd6467 no bug - Fix a misleading indentation
MozReview-Commit-ID: 4yvVRRxoxC8
2017-02-19 14:27:57 +01:00
Masatoshi Kimura
47d59c07d5 Bug 1338971 - Stop using non-standard JavaScript in AutoConfig files. r=mkaply
MozReview-Commit-ID: F2dDRHAw02S

--HG--
extra : rebase_source : ca74dd69aa51e4eb8d832161e05f98cc2b42df3c
2017-02-13 22:18:12 +09:00