Commit Graph

4377 Commits

Author SHA1 Message Date
Andrew McCreight
51944f0ae4 Bug 1381919 - Remove most of the xpcIJSModuleLoader interface. r=kmag
People only use these methods via Cu, so remove them from this
interface. Also, ban anybody from implementing this interface in JS
(though I can't imagine anybody trying), and eliminate a variant of
mozJSComponentLoader::ImportInto that is never called.

MozReview-Commit-ID: Kok5ksXiK5a

--HG--
extra : rebase_source : ef7237953404fd1b75e8e1118b9fc4e2235ff187
2017-07-17 17:11:06 -07:00
Wes Kocher
f361e1638d Backed out 13 changesets (bug 1366294) for leaking base::Histogram::FactoryGet a=backout CLOSED TREE
Backed out changeset f2d79c13799a (bug 1366294)
Backed out changeset b722d638f6ed (bug 1366294)
Backed out changeset aee317b1445d (bug 1366294)
Backed out changeset 14f9f9521d4f (bug 1366294)
Backed out changeset beb5f00c4b19 (bug 1366294)
Backed out changeset 72635bc1ba25 (bug 1366294)
Backed out changeset c387459a798b (bug 1366294)
Backed out changeset 476daf9a5846 (bug 1366294)
Backed out changeset e7ce6a06c131 (bug 1366294)
Backed out changeset 1cc736607aab (bug 1366294)
Backed out changeset 175c3ccb0015 (bug 1366294)
Backed out changeset 96b594816a21 (bug 1366294)
Backed out changeset 57400dd449ad (bug 1366294)

MozReview-Commit-ID: J6PyVMGwJ74
2017-07-19 12:49:46 -07:00
Georg Fritzsche
2932617587 Bug 1366294 - Part 1 - Remove base::StatisticsRecorder. r=chutten
The Chromium IPC histogram code used the StatisticsRecorder object for storage.
This is keyed by histogram name, which doesn't match our storage reality anymore.
Instead we use a name to refer to a set of histogram instances that record data from different processes, as well as separating session and subsession data.
Consequently we need to rewrite this storage, which means StatisticsRecorder is not used anymore.

MozReview-Commit-ID: 1LC7YubpKaD
2017-07-19 14:26:56 -04:00
Jon Coppeard
4056892ff5 Bug 1381777 - Record how long we went over the time budget r=sfink data-r=bsmedberg 2017-07-19 09:37:18 +01:00
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
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
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
Jan de Mooij
db3fda15b3 Bug 1378740 - Share RegExpShareds across compartments within a zone. r=jonco 2017-07-06 16:40:39 +02: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
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
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
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
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
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
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
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
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
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
Andrea Marchesini
d5b5f35f62 Bug 1369073 - Expose MessagePort/MessageChannel to xpcshell tests, r=bholley 2017-05-31 21:16:03 +02: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
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
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
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
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
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
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
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
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
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
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
Jon Coppeard
d7e0c83dcc Bug 1359001 - Make AutoAssertGCCallback a no-op in opt builds r=sfink 2017-04-25 10:56:34 +01: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
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
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
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
Sebastian Hengst
1828ea89ca Backed out changeset 7fdcabdbb675 (bug 1024669) for failing mda, GTest and talos jobs. r=backout on a CLOSED TREE 2017-04-10 19:05:44 +02:00
Cervantes Yu
364e524eca Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
Carsten "Tomcat" Book
02ddc23c74 Backed out changeset 7a52d887bcea (bug 1024669) for bustage 2017-04-10 11:43:49 +02:00
Cervantes Yu
ece1ce1a7d Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08: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
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
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
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
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
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
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
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
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
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 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
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
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
Tom Tromey
d2667a2b27 Bug 1060419 - make AppendPrintf and nsPrintfCString use Printf.h, r=froydnj
MozReview-Commit-ID: 2E8FoiNxU8L

--HG--
extra : rebase_source : 810ac727bef0751f24edea18c52e0ec170bf367d
2016-12-14 09:32:21 -07:00
Tom Tromey
9ab784cd84 Bug 1060419 - make XPC_Log_print use VsprintfLiteral, r=froydnj
MozReview-Commit-ID: 9ruECevHqfs

--HG--
extra : rebase_source : 7b4ed9315952404f7ea75246da614e0ce67a3cd6
2016-12-09 10:18:04 -10:00
Andrea Marchesini
3043646e52 Bug 1339871 - Splitting dom/file/File.{h,cpp}, r=smaug
--HG--
rename : dom/file/File.cpp => dom/file/BaseBlobImpl.cpp
rename : dom/file/File.h => dom/file/BaseBlobImpl.h
rename : dom/file/File.cpp => dom/file/Blob.cpp
rename : dom/file/File.h => dom/file/Blob.h
rename : dom/file/File.cpp => dom/file/BlobImpl.cpp
rename : dom/file/File.h => dom/file/BlobImpl.h
rename : dom/file/File.cpp => dom/file/EmptyBlobImpl.cpp
rename : dom/file/File.h => dom/file/EmptyBlobImpl.h
rename : dom/file/File.cpp => dom/file/FileBlobImpl.cpp
rename : dom/file/File.h => dom/file/FileBlobImpl.h
rename : dom/file/File.cpp => dom/file/MemoryBlobImpl.cpp
rename : dom/file/File.h => dom/file/MemoryBlobImpl.h
rename : dom/file/File.cpp => dom/file/StreamBlobImpl.cpp
rename : dom/file/File.h => dom/file/StreamBlobImpl.h
rename : dom/file/File.h => dom/file/StringBlobImpl.h
rename : dom/file/File.h => dom/file/TemporaryBlobImpl.h
2017-02-16 18:26:38 +01:00
Bill McCloskey
194043ae97 Bug 1339289 - Give names to a lot of common runnables (r=ehsan)
MozReview-Commit-ID: 5IdvK6kgoAW
2017-02-15 12:30:01 -08:00
Tooru Fujisawa
918d55e6ea Bug 1283712 - Part 7: Add nsIScriptErrorNote and nsIScriptError.notes. r=bholley 2017-02-15 23:53:06 +09:00
Tooru Fujisawa
b025ee6d4e Bug 1283712 - Part 6: Add xpc::ErrorBase, xpc::ErrorNote, and xpc::ErrorReport.mNotes. r=bholley 2017-02-15 23:53:06 +09:00
Wes Kocher
415dbf1a26 Merge m-c to autoland, a=merge
MozReview-Commit-ID: JuiEcsYYLS3
2017-02-13 17:08:00 -08:00
Luca Greco
1470d15357 Bug 1329731 - Add moz-extension to the principals immune to script policy. r=bholley
MozReview-Commit-ID: FAn2Cq5Lz5O

--HG--
extra : rebase_source : 8d89707f91747946d98e473983345d6a5857ea89
2017-01-17 13:54:03 +01:00
Brian Hackett
01a649c197 Bug 1337112 - Remove links from JSRuntime to its single context and zone group, r=jandem,jonco.
--HG--
extra : rebase_source : ebf319af724d5f829cdf5c2386dc82d49be89989
2017-02-10 16:47:50 -07:00
Tom Schuster
39312086de Bug 1339036 - Rename JSTYPE_VOID to JSTYPE_UNDEFINED. r=arai 2017-02-13 17:26:16 +01:00
Jon Coppeard
46c6dced28 Bug 1338614 - Refactor incremental barrier APIs and make them call the read barrier r=sfink 2017-02-13 11:11:09 +00:00
Zibi Braniecki
b8f991e41b Bug 1335983 - Migrate nsCollation::CreateCollection to use LocaleService::GetAppLocale. r=jfkthame
MozReview-Commit-ID: 5GEnL7Kihpj

--HG--
extra : rebase_source : 413d880035b49da82db0530379425d31ac31a82e
2017-02-07 12:52:03 -08:00
Wes Kocher
a9ce32d9a5 Backed out 2 changesets (bug 1335983) for build bustage a=backout
Backed out changeset 5a9559ded976 (bug 1335983)
Backed out changeset de2b0d90e2da (bug 1335983)

MozReview-Commit-ID: 377KQDU1QqJ
2017-02-07 12:34:30 -08:00
Zibi Braniecki
6d98bad59d Bug 1335983 - Migrate nsCollation::CreateCollection to use LocaleService::GetAppLocale. r=jfkthame
MozReview-Commit-ID: bJVrVj2dAS

--HG--
extra : rebase_source : f3a28e003415f0c58462a73b5fd987455e102fc5
2017-02-06 14:57:09 -08:00
Hannes Verschore
65f3d3c7f2 Bug 1331414: Adding javascript.options.jit.full_debug_checks in about:config for people that want to use debug builds for surfing with less slowdown, r=jandem 2017-02-01 22:05:14 +01:00
Jon Coppeard
5c43c1ac3b Bug 1332745 - Split runtime-wide pointer udpates from per-zone updates in compacting GC r=sfink 2017-02-02 16:17:28 +00:00
Sebastian Hengst
e855f7f79d Backed out changeset dbf9a55f1101 (bug 1331414) for unused variable 'fullJitDebugChecks' at XPCJSContext.cpp:1452. r=backout 2017-02-01 22:26:23 +01:00
Hannes Verschore
f48573af0c Bug 1331414: Adding javascript.options.jit.full_debug_checks in about:config for people that want to use debug builds for surfing with less slowdown, r=jandem 2017-02-01 22:05:14 +01:00
Boris Zbarsky
970a120fb5 Bug 1335368 part 21. Get rid of some IsCallerChrome usage in XPConnect. r=bholley 2017-02-01 15:43:59 -05:00
Boris Zbarsky
1f816c60cf Bug 1335368 part 12. Remove the use of IsCallerChrome in FetchRequest. r=bkelly 2017-02-01 15:43:37 -05:00
Boris Zbarsky
c41740271d Bug 1334537. Make sure to clear out our external string cache if the length doesn't match, since our length no longer needs to match our stringbuffer. r=froydnj
Without this change, we could do a "short" get of a string (e.g. from
XMLHttpRequest), then do another get that returns the same stringbuffer but a
longer length.  But we wouldn't notice, hit our cache, and return the same,
too-short, external string.  The site would not see the new data it should have
seen.
2017-02-01 15:29:47 -05:00
Brian Hackett
8033ed29a8 Bug 1324002 - Mark atoms separately in each zone, r=jonco,mccr8,peterv.
--HG--
extra : rebase_source : 53cf4fa94f122a991c2adbd7bae3714de4391bb4
2017-01-30 06:31:47 -07:00
Boris Zbarsky
ecfa536932 Bug 1332713 part 3. Implement a version of XrayAwareCalleeGlobal that works for specialized getters. r=bholley
The problem is that JSJitGetterInfo doesn't contain a callee.  So we can't use
xpc::XrayAwareCalleeGlobal in a specialized getter, because we don't have our
callee function available.
2017-01-27 18:53:36 -05:00
Tooru Fujisawa
ddd36fec56 Bug 1332245 - Move nsScriptError from js/xpconnect to dom/bindings. r=bz
--HG--
rename : js/xpconnect/idl/nsIScriptError.idl => dom/bindings/nsIScriptError.idl
rename : js/xpconnect/src/nsScriptError.cpp => dom/bindings/nsScriptError.cpp
rename : js/xpconnect/src/nsScriptErrorWithStack.cpp => dom/bindings/nsScriptErrorWithStack.cpp
2017-01-28 00:42:47 +09:00
Wes Kocher
8fa84ca644 Merge inbound to central, a=merge
MozReview-Commit-ID: BZgxmhS6OtM
2017-01-26 16:19:05 -08:00
Jan de Mooij
1ea46b80dd Bug 1330593 part 1 - Allow non-flat external strings. r=jwalden,bz 2017-01-26 18:40:41 +01:00
Christian Holler
4dc29b3b09 Bug 1332361 - Expose TestingFunctions to content in FUZZING builds. r=jandem.
MozReview-Commit-ID: HA0oodPzAeS

--HG--
extra : rebase_source : 896f4d9465b8bd2a5655dec63165f893b0f0f5df
2017-01-25 13:39:54 +01:00
Nicholas Nethercote
22b6d342d7 Bug 1333296 (part 1) - Rename MOZ_ENABLE_PROFILER_SPS as MOZ_GECKO_PROFILER. r=mstange,glandium.
--HG--
extra : rebase_source : 223f3a17f009645369be503392cc1f0cea7f19a1
2017-01-24 14:15:12 +11:00
Nicholas Nethercote
bf48aecf29 Bug 1332172 - Remove XPC_MAP_WANT_*. r=mccr8.
nsIXPCScriptable flags handling in xpc_map_end.h is a bit of a mess.

- Half the flags relate to whether various functions are defined (PreCreate,
  GetProperty, etc). These are set using the XPC_MAP_WANT_* macros;
  for each one xpc_map_end.h  inserts the corresponding flag using the
  preprocessor (see XPC_MAP_CLASSNAME::GetScriptableFlags()).

- The other half of the flags relate to other things (IS_GLOBAL_OBJECT,
  DONT_REFLECT_INTERFACE_NAMES, etc). These are set using the XPC_MAP_FLAGS
  macro.

Having two similar but different mechanisms to set the flags for a class is
confusing. (Indeed, until recently we had some classes where a single flag was
redundantly specified via both mechanisms.) Note also that the classes done in
dom/base/nsIDOMClassInfo.h also specify all the flags in a single value,
similar to how XPC_MAP_FLAGS works.

This patch removes the XPC_MAP_WANT_* macros. All flags are now set
via XPC_MAP_FLAGS. This is a significant simplification to xpc_map_end.h and
all the places that use it.

The downside of this change is that I had to change the flag constants from
class constants (i.e. nsIXPCScriptable::FOO) to macros (i.e.
NSIXPCSCRIPTABLE_FOO) because they need to be used in #if statements like this
in xpc_map_end.h:

  #if !((XPC_MAP_FLAGS) & NSIXPCSCRIPTABLE_WANT_PRECREATE)

and you can't use a '::'-qualified name inside a #if. I think this downside is
outweighed by the simplification described above.

Overall the patch removes 80 lines of code.

--HG--
extra : rebase_source : 6d5c341d0deba8f1529d81c17bb8819e09620b05
2017-01-23 13:33:58 +11:00
Nicholas Nethercote
12647a7223 Bug 1332577 (part 7) - Rename mozilla_get_pseudo_stack() as profiler_get_pseudo_stack(). r=mstange.
This makes it consistent with other profiler functions.

--HG--
extra : rebase_source : 1e52acdc448691b8859bb147a0c70b198b432fe2
2017-01-20 15:07:05 +11:00
Nicholas Nethercote
b1100b7e94 Bug 1330904 - Remove XPCNativeScriptableCreateInfo. r=mccr8.
XPCNativeScriptableCreateInfo is now a very thin wrapper around
nsIXPCScriptable. Removing it simplifies things quite a bit.

Note especially the change to GatherScriptableCreateInfo(), which is a
confusing function. Previously its fourth argument was never touched it was
called, but it did have a return value. Now the fourth argument is touched and
effectively replaces that return value, and the function now returns void.
* * *
Bug 1330904 - fixups. r=mccr8.

I will fold this into the previous patch before landing.

--HG--
extra : rebase_source : 22e7fd0c44dd7c4174f8edf3e1d3ae362bf95757
2017-01-13 11:26:02 +11:00
Boris Zbarsky
3293a4cd98 Bug 1330759 part 3. Add a "stringbuffer we own" mode to DOMString. r=froydnj
We're going to need it because we're going to add a consumer that cannot in fact
promise that its stringbuffer reference will outlive the DOMString.
2017-01-18 22:20:14 -05:00
Boris Zbarsky
ced1c6138f Bug 1330759 part 2. Fix XPCConvert::JSData2Native to not share an external string stringbuffer if it would create a non-null-terminated string. r=froydnj 2017-01-18 22:20:14 -05:00
Kris Maglione
e51f27d8cb Bug 1273251: Part 1 - Mark nuked sandboxes as nuked and non-scriptable. r=bholley
MozReview-Commit-ID: tq9nExa1P7

--HG--
extra : rebase_source : 3c0e856335b8585457e2679b30177bd1df9ac6bb
2017-01-12 14:47:38 -08:00
Nicholas Nethercote
3bbc82eb80 Bug 1329846 (follow-up) - Fix bustage. r=bustage. 2017-01-13 11:28:49 +11:00
Nicholas Nethercote
7a8872808f Bug 1329846 (part 2) - Remove NATIVE_HAS_FLAG. r=mccr8.
It's only used in three places, and it no longer makes the code more readable.

--HG--
extra : rebase_source : 1d66cc542dda8d66a72d567f271fcab60c2d92c4
2017-01-11 07:40:19 +11:00
Nicholas Nethercote
e3685c4266 Bug 1329846 (part 1) - Remove XPCNativeScriptableInfo. r=mccr8.
XPCNativeScriptableInfo is now a very thin wrapper around nsIXPCScriptable, and
it uses manual memory management. Removing it simplifies things quite a bit.

In particular, when setting XPCWrappedNative::mScriptable in
XPCWrappedNative::WrapNewGlobal() and XPCWrappedNative::Init() we no longer
have to worry about sharing the XPCNativeScriptableInfo object with the proto.
And XPCWrappedNative::{Init,Destroy}() have similar simplifications.

--HG--
extra : rebase_source : e58eb28f1574224a8e8badf25fcfa25e5a5b8ad8
2017-01-10 12:47:57 +11:00
Andrea Marchesini
359ae91eac Bug 1328653 - Merging all the various *OriginAttributes to just one, r=huseby 2017-01-12 17:38:48 +01:00
Ehsan Akhgari
cfca13cda1 Bug 1330188 - Add hidden prefs for adjusting the baseline and ion JIT thresholds; r=sstangl 2017-01-11 14:55:04 +08:00
Nicholas Nethercote
c7018d9f7d Bug 1325542 - Remove XPCNativeScriptableFlags. r=mccr8.
WantFoo() and the similar methods remain, but they've been moved from
XPCNativeScriptableFlags to nsIXPCScriptable.

One consequence of this change is that in places where we used to get the flags
from an XPCNativeScriptableCreateInfo we now need a null check on the
nsIXPCScriptable. (This isn't true when getting flags from
XPCNativeScriptableInfo, however, because nsIXPCScriptable is always non-null
within that type.)

--HG--
extra : rebase_source : 3d1e1d1c313b4629bb2e337cc2fb7c0d1092ed99
2016-12-23 16:14:32 +11:00
Nicholas Nethercote
2fde95af84 Bug 1324330 (part 4) - Remove some unused functions. r=mccr8.
--HG--
extra : rebase_source : 093a6ae13879deafc070ffa658d5822dc310cf88
2016-12-23 08:30:29 +11:00
Nicholas Nethercote
d7a51c9a2f Bug 1324330 (part 3) - Don't mix |Cant| and |Cannot| in function names in XPCWrappedNativeJSOps.cpp. r=mccr8.
Use |Cannot| consistently.

--HG--
extra : rebase_source : dfef428a88953a01dcaca866d82d6277ac779c8d
2016-12-23 08:30:27 +11:00
Nicholas Nethercote
47b78b17ae Bug 1324330 (part 2) - Make XPC_MAP_FLAGS non-optional when using xpc_map_end.h. r=mccr8.
I'd like to remove XPC_MAP_WANT_* altogether and use XPC_MAP_FLAGS for all the
nsIXPCScriptable flag setting, but I haven't worked out how to handle the
method definitions in xpc_map_end.h yet. In the meantime, it seems good to make
the flag setting more consistent and explicit.

In particular, the three "Module" classes have "#define XPC_MAP_WANT_CALL" and
"#define XPC_MAP_FLAGS nsIXPCScriptable::WANT_CALL" which both have the same
effect. The patch removes the latter, to make them consistent with other
classes.

--HG--
extra : rebase_source : 3119e895809bb14e63f61e4e440c84e16cc4c5f9
2016-12-23 08:30:22 +11:00
Markus Stange
4bdc4ca0fb Bug 1323100 - Register most of the remaining threadfunc threads with the profiler. r=froydnj
As far as I can tell, this covers all the remaining threads which we start
using PR_CreateThread, except the ones that are created inside NSPR or NSS,
and except for the Shutdown Watchdog thread in nsTerminator.cpp and the
CacheIO thread. The Shutdown Watchdog thread stays alive past leak detection
during shutdown (by design), so we'd report leaks if we profiled it. The
CacheIO thread seems to stay alive past shutdown leak detection sometimes as
well.

This adds a AutoProfilerRegister stack class for easy registering and
unregistering. There are a few places where we still call
profiler_register_thread() and profiler_unregister_thread() manually, either
because registration happens conditionally, or because there is a variable that
gets put on the stack before the AutoProfilerRegister (e.g. a dynamically
generated thread name). AutoProfilerRegister needs to be the first object on
the stack because it uses its own `this` pointer as the stack top address.

MozReview-Commit-ID: 3vwhS55Yzt

--HG--
extra : rebase_source : 56dd27282e7bd09a7e7dc7ca09ccfe3a0198e7af
2017-01-05 16:34:26 +01:00
Olli Pettay
d4f2be7cde Bug 1326507, rename Traverse to TraverseNative, r=mccr8
--HG--
extra : rebase_source : cb10292c2b9685855a6027a0377d10f168bbcbf6
2017-01-03 21:50:10 +02:00
Olli Pettay
0364dbc792 Bug 1326507, remove NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS, r=mccr8
--HG--
extra : rebase_source : 3ae1207308de120b7299b13ecaa95dd1612b3459
2017-01-03 21:47:55 +02:00