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

6242 Коммитов

Автор SHA1 Сообщение Дата
Robert Helmer 4e1a79dc01 Bug 1348981 - add Cu.readURI helper for sync file reading on startup r=kmag
MozReview-Commit-ID: 1yz25afCUDs

--HG--
extra : rebase_source : 549e28b7ceeb6556156d8f6e4d2a7470852d64c0
2017-09-19 12:13:08 -07:00
Sebastian Hengst 1d5497084d Backed out changeset 582d112281f9 (bug 1403366) 2017-10-04 01:27:07 +02:00
Sebastian Hengst 4be222f271 Backed out changeset f397bfb365e1 (bug 1348981) 2017-10-04 01:00:21 +02:00
Sebastian Hengst 3c14e73ba8 Backed out changeset 199b3fe8114f (bug 1348981) 2017-10-04 01:00:15 +02:00
Mike Hommey 3b34606aa6 Bug 1403366 - Stop requiring argv[0] for XRE_GetBinaryPath and the underlying BinaryPath::Get. r=froydnj
--HG--
extra : rebase_source : ac7bb0d7766fce5b6325c34c2868b26eec594e18
2017-09-28 10:37:27 +09:00
Robert Helmer 9ade6ed8ac Bug 1348981 - provide method to re-initialize URLPreloader for xpcshell tests r=kmag
MozReview-Commit-ID: rnjEJc1Uir

--HG--
extra : rebase_source : ee273d624c3d4a4ec21506574f1e203fce4b2d45
2017-09-21 11:24:14 -07:00
Robert Helmer 4c5dbf3bf6 Bug 1348981 - add Cu.readURI helper for sync file reading on startup r=kmag
MozReview-Commit-ID: 1yz25afCUDs

--HG--
extra : rebase_source : 549e28b7ceeb6556156d8f6e4d2a7470852d64c0
2017-09-19 12:13:08 -07:00
Sebastian Hengst 006ae28b0a Backed out changeset 3eb67e350f38 (bug 1403366) 2017-09-29 17:19:46 +02:00
Mike Hommey 31399bfad2 Bug 1403366 - Stop requiring argv[0] for XRE_GetBinaryPath and the underlying BinaryPath::Get. r=froydnj
--HG--
extra : rebase_source : f61fd84dcc801f84f4838d357c795ce07928a4e6
2017-09-28 10:37:27 +09:00
Blake Kaplan 205489b432 Bug 1396110 - Fix races during watchdog shutdown. r=billm
This patch also ensures that we won't accidentally try stopping slow scripts
when we're shutting down the watchdog manager.

MozReview-Commit-ID: EMb0enfivd8

--HG--
extra : rebase_source : b27205c4d593caa1c33534591686e85fba9f0d41
2017-09-20 15:23:28 -07:00
Kris Maglione 98d4287346 Bug 1402503: Part 1 - Fix slow script add-on ID detection. r=mixedpuppy
MozReview-Commit-ID: EYhOn2TQCq1

--HG--
extra : rebase_source : f7831fa04a8616109ff91d66a5dedf0b827527cb
extra : histedit_source : 20fa03b4f4970b872201d6f4feed7a08a98fa348
2017-09-25 10:52:11 -07:00
Chris Peterson e10b7338b7 Bug 1402666 - Part 2: Replace Replace(NS_LITERAL_CSTRING("")) with ReplaceLiteral(""). r=erahm
MozReview-Commit-ID: Ho2DHuomdi3

--HG--
extra : rebase_source : c2221823a8beea9f72810e5aec2231336dcb4622
extra : source : b8dcb71d823cf20014043bc5bde2052a974a98de
2017-09-15 19:27:59 -07:00
Wes Kocher acf8913934 Merge m-c to inbound, a=merge
MozReview-Commit-ID: IsbKCdZU2Ui
2017-09-26 17:14:31 -07:00
Wes Kocher 22a72df7fe Merge inbound to m-c a=merge
MozReview-Commit-ID: 6viJ4wRxLa8
2017-09-26 15:54:51 -07:00
Brian Hackett c021969355 Backed out changeset 072f8d4a9964 (bug 1355109) for causing crashes with various extensions. a=lizzard
--HG--
extra : source : 520e300d1266d19aea623eb723587acc03751d50
2017-09-26 14:12:25 -04:00
Jan de Mooij dbca189324 Bug 1153592 part 2 - Remove JSPROP_SHARED; ensure accessor props don't have slots. r=evilpie 2017-09-26 12:26:50 +02:00
Jan de Mooij 68e468c3ff Bug 1403136 - Clean up JSSetterOp code now that slotful setters are gone. r=evilpie 2017-09-26 22:26:40 +02:00
Andrew McCreight 1a24cc1d71 Bug 958643, part 6 - Remove some unused forward decls. r=krizsa
MozReview-Commit-ID: yMpU0hDUXP

--HG--
extra : rebase_source : 154cab1e7673490c824525e46a36ebd359872021
2017-09-20 12:02:47 -07:00
Andrew McCreight 75bb849fa3 Bug 958643, part 5 - Eliminate XPCJSObjectHolder. r=krizsa
It is now unused.

MozReview-Commit-ID: AzXW6qHdSOW

--HG--
extra : rebase_source : f60697cff778843c36a1e75f3e4f8779bc356d40
2017-09-20 10:26:16 -07:00
Andrew McCreight e61cf2cc18 Bug 958643, part 4 - Inline CreateHolderIfNeeded. r=krizsa
The last argument is always null, so we don't need this function any more.

MozReview-Commit-ID: 5YWMO9ywZK3

--HG--
extra : rebase_source : 56bce2611135bb1b30e7f8ad763e13f112d2395f
2017-09-20 10:21:59 -07:00
Andrew McCreight 13c3d91b7f Bug 958643, part 3 - Remove always-null second second argument to XPCConvert::NativeInterface2JSObject. r=krizsa
MozReview-Commit-ID: CQvJ1bZBLyS

--HG--
extra : rebase_source : 0da1274aa8d6b3584ac0103ddf8884e993887574
2017-09-20 10:20:48 -07:00
Andrew McCreight 8ee8721f0d Bug 958643, part 2 - Remove always-null last argument to NativeInterface2JSObject. r=krizsa
MozReview-Commit-ID: G9F6wlMWCl9

--HG--
extra : rebase_source : 313a40850965fc1a2488ef60deaf9d1cb2705806
2017-09-20 10:15:06 -07:00
Andrew McCreight 78601602bf Bug 958643, part 1 - Remove the unused nsXPConnect::WrapNativeHolder. r=krizsa
MozReview-Commit-ID: AOQYLS8FFrf

--HG--
extra : rebase_source : ce8f98c71d43f12235ead8280ba4ee0c84cb0238
2017-09-20 10:12:35 -07:00
Chris Peterson 98b2f2fcd6 Bug 870698 - Part 7: Replace Insert(NS_LITERAL_CSTRING("")) with InsertLiteral(""). r=erahm
The NS_LITERAL_CSTRING macro creates a temporary nsLiteralCString to encapsulate the string literal and its length, but AssignLiteral() can determine the string literal's length at compile-time without nsLiteralCString.

MozReview-Commit-ID: DbTW5Bhd9E1

--HG--
extra : rebase_source : b27f666e5ca832d814fb6846208474e1ec66e5f4
extra : source : 9ff4e11402a9a43ed90298a9c354b0164cf9414f
2017-09-07 18:15:42 -07:00
Chris Peterson a0c8081df4 Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm
MozReview-Commit-ID: G1GhyvD29WK

--HG--
extra : rebase_source : 115842c37a40041bdca7b4e1ff0a5680b02ced15
extra : source : 90bfff9c01d80086cdc17637f310e898fea295ea
2017-09-06 01:13:45 -07:00
Chris Peterson 45aa2a8e8e Bug 870698 - Part 2: Replace Append("") with AppendLiteral(""). r=erahm
MozReview-Commit-ID: CrkIP4iHP1U

--HG--
extra : rebase_source : 5dc4e91a3f1860773c199f1abf3f66479218834a
extra : intermediate-source : ba51cc79847f2b43ba616f4a5d2bbc6958ca9f6d
extra : source : 1fda2fa990cc918c748ffa14fcc5dbe13fe3bdc3
2017-09-03 22:14:11 -07:00
Chris Peterson 9f4c1f5278 Bug 870698 - Part 1: Replace Assign("") with AssignLiteral(""). r=erahm
MozReview-Commit-ID: A0u9PP49OW3

--HG--
extra : rebase_source : 7d5286959f510eb4b7df1b7e32d5b9b58719c48b
extra : intermediate-source : f552b4a78236c42bc09030b3eb008725a3edb9c8
extra : source : 26ac4a1014f6661a70e3bf9f552407e12c2c3981
2017-09-03 22:12:56 -07:00
Nicholas Nethercote e3c9cbb969 Bug 1401813 - Rename Null[C]String() as Void[C]String(). r=erahm.
XPCOM's string API doesn't have the notion of a "null string". But it does have
the notion of a "void string" (or "voided string"), and that's what these
functions are returning. So the names should reflect that.

--HG--
extra : rebase_source : 4e3f982e0873877174a08a25413595ff66f7d20e
2017-09-22 14:35:46 +10:00
Nicholas Nethercote 1aef116268 Bug 1401100 - Remove nsIMemoryReporterCallback. r=erahm.
nsIHandleReportCallback, typedef of nsIMemoryReporterCallback, has been the
preferred name for a long time and is used in most places. This patch removes
nsIMemoryReporterCallback.

--HG--
extra : rebase_source : c675076b4f98d93d96235dad890e31e0b0e6c277
2017-09-22 08:09:29 +10:00
Kris Maglione f37317cad0 Bug 1369533: Return dead wrappers rather than null for dead CallbackObject values. r=bz
We don't have access to an appropriate context to create the dead wrapper in
when the callback is nuked, so instead, this patch creates a new dead wrapper
in the caller compartment each time the property is accessed. This is the same
behavior we'd get when trying to re-wrap a cross-compartment dead wrapper, so
it's consistent with the way we handle these situations elsewhere.

MozReview-Commit-ID: 3cMeR4z8EOe

--HG--
extra : rebase_source : 7e8cf4a195ef64deb7677ce4ac9818d342815667
2017-09-04 17:21:06 -07:00
Andrew McCreight 767b21fb24 Bug 1176342, part 2 - De-COM the flags for InitClassesWithNewWrappedGlobal. r=mrbkap
MozReview-Commit-ID: 4QFtHPIzUd0

--HG--
extra : rebase_source : e7b8c4156be165c44ddb2e7be557e52438c63d42
2017-09-19 13:12:50 -07:00
Andrew McCreight 36eb42025b Bug 1176342, part 1 - De-COM InitClassesWithNewWrappedGlobal. r=mrbkap
MozReview-Commit-ID: EfRQW3QUXCG

--HG--
extra : rebase_source : 895694d28cc228cfb095639880738c84767e08a8
2017-09-18 16:35:39 -07:00
Blake Kaplan d5d500f633 Bug 1398396 - Initialize the locale stuff on runtimes instead of contexts. r=billm
MozReview-Commit-ID: Il9HAqYdTzK

--HG--
extra : rebase_source : 29a294c02bc2be1534766f33192854f51984883e
2017-09-11 15:46:14 -07:00
Jon Coppeard 1077972535 Bug 1396613 - Update the object moved hook to allow it to be called when tenuring nursery objects r=sfink r=mccr8 2017-09-19 12:31:30 +01:00
Andrew McCreight 292c80dfbd Bug 1400406 - js/xpconnect/moz.build contains a reference to a non-existent directory. r=gps
Also, MOZ_XPCTOOLS does not appear to be a thing any more.

MozReview-Commit-ID: 99BR9rl4EnD

--HG--
extra : rebase_source : 3712b7b2b180b583ca761cdc5d6ddf17728e8b74
2017-09-15 14:35:15 -07:00
Kris Maglione 9217c2da0e Bug 1399997: Part 3 - Update module environment tests with TODOs for shared module eval bindings. r=tcampbell
MozReview-Commit-ID: LVTNnN3HlKK

--HG--
extra : rebase_source : 79fffe7cd39ac8b27865cf9504fd9d1808b75198
2017-09-14 13:08:17 -07:00
Kris Maglione a70175c241 Bug 1398895: Part 2 - Ensure component loader initialization after user prefs load. r=mccr8
The script precompiler needs to begin its work very early in the startup
process in order to be effective. At the moment, this means before user
preferences are loaded. It also needs to be able to compile scripts into
the shared JSM global when that's in use, in order to avoid unnecessary script
clones.

Since we can't know whether global sharing is enabled by that point, instead,
we just always compile module scripts into the shared module global rather
than the XPC compillation scope.

This also changes the global sharing tests to make a failure to respect the
user preference value a fatal error.

MozReview-Commit-ID: G0NkSOl2vU9

--HG--
extra : rebase_source : 4b5e1b10c14dd5cc6609bc589310d12b44f830f5
2017-09-11 13:52:13 -07:00
Ryan VanderMeulen 277d6a438f Merge m-c to inbound. a=merge 2017-09-14 10:52:18 -04:00
Ted Campbell 9b5f5a54bb Bug 1398601 - Fix wunused-variable errors when MOZ_DIAGNOSTIC_ASSERT isn't available. a=RyanVM
MozReview-Commit-ID: 1kvKcQBqog9
2017-09-14 06:35:00 -04:00
Wes Kocher ff68b95b87 Merge inbound to central, a=merge
MozReview-Commit-ID: ClVRh99eIUo
2017-09-14 00:03:28 -07:00
Nicholas Nethercote abfa282e96 Bug 1399727 - Fix double-reporting of memory in ScriptPreloader. r=kmag.
DMD indicates double-reporting for mURL, indicating that it is shared.

--HG--
extra : rebase_source : b6e82cc3e4dbba9a59750b6be8117597034f23d7
2017-09-14 15:09:50 +10:00
Florian Quèze c3c302fe33 Bug 1398198 - browser_startup.js should show the stack when a JS file was loaded earlier than expected, r=felipe,mccr8. 2017-09-13 21:19:53 +02:00
Ted Campbell 21a47b7f15 Bug 1398601 - Add testcase for loading subscripts within a JSM r=kmag
MozReview-Commit-ID: I09eoUnQYCG

--HG--
extra : rebase_source : f423ba10de2fcd6034e6ee98e1dc0d99731ea882
2017-09-10 14:57:04 -04:00
Ted Campbell 8b2e8b3fe5 Bug 1398601 - Fix subscript loader when using JSM global sharing r=kmag
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.

MozReview-Commit-ID: 1ah5JUAZwBA

--HG--
extra : rebase_source : 45a3974cb80ede0cb3beea92f895679c5ea7aa4b
2017-09-10 14:23:32 -04:00
Ted Campbell 0388c3314f Bug 1398601 - Add global/non-syntactic prefix to subscript loader cache r=kmag
We want to be able to store scripts compiled with or without
non-syntactic support in cache when we toggle JSM global sharing. In
current code this script is cloned on execution, but with JSM global
sharing we have would hit assertions.

MozReview-Commit-ID: 2pVTTxLpx6S

--HG--
extra : rebase_source : b123de20f216161c408bba75c8c0fd81be0508df
2017-09-12 18:05:08 -04:00
Phil Ringnalda 606b8426bb Backed out 5 changesets (bug 1398601) for unexpected crashtest assertions
Backed out changeset b728872f4d9a (bug 1398601)
Backed out changeset 05957a92b1a5 (bug 1398601)
Backed out changeset f5c26c3407c0 (bug 1398601)
Backed out changeset eddc38b0afd0 (bug 1398601)
Backed out changeset 776a65d43a5e (bug 1398601)

MozReview-Commit-ID: 9lfUtdlZy7F
2017-09-12 20:11:49 -07:00
Ted Campbell df5f95b7e2 Bug 1398601 - Add testcase for loading subscripts within a JSM r=kmag
MozReview-Commit-ID: I09eoUnQYCG

--HG--
extra : rebase_source : e9f9efb194e2e6e9b18820e3535eeef47234ea4c
2017-09-10 14:57:04 -04:00
Ted Campbell 7845fe7c7a Bug 1398601 - Fix subscript loader when using JSM global sharing r=kmag
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.

MozReview-Commit-ID: 1ah5JUAZwBA

--HG--
extra : rebase_source : 202904e30b582c788ec440c406607ba98b8836e6
2017-09-10 14:23:32 -04:00
Ted Campbell eb7051b3b5 Bug 1398601 - Add global/non-syntactic prefix to subscript loader cache r=kmag
We want to be able to store scripts compiled with or without
non-syntactic support in cache when we toggle JSM global sharing. In
current code this script is cloned on execution, but with JSM global
sharing we have would hit assertions.

MozReview-Commit-ID: 2pVTTxLpx6S

--HG--
extra : rebase_source : 5913a43a2dfddf74187f08ab9c53babe377bd706
2017-09-12 18:05:08 -04:00
Jason Orendorff b311db1626 Bug 1363200 - JSAPI for realms: Split xpc::RealmPrivate from xpc::CompartmentPrivate. r=mrbkap
--HG--
extra : rebase_source : c4bc2da0e808f1ab7a4bfab407a61ef15d3785a5
extra : intermediate-source : a2cc554590772b94071af1df59fc62a6766a6924
extra : source : 0e7c0edaa224d2ccaa4d410fd89d859256b0dc67
2017-06-08 11:07:10 -05:00
Jason Orendorff ddaf859c55 Bug 1363200 - JSAPI for realms: Change a few XPConnect methods to take Realm arguments instead of JSCompartments. r=mrbkap
This also introduces JS::GetObjectRealmOrNull, which returns an object's realm,
or null if the object is a cross-compartment wrapper. In the new order,
wrappers can't have realms, since they must be shared across all realms in a
compartment. We're introducing this new function early (even though it's
*currently* possible to assign a realm to wrappers) in order to see in
advance if the possibility of returning null will cause problems.
(It looks like it won't.)

--HG--
extra : rebase_source : e55ebbbc4edf2a18ce267198928246592060e339
extra : source : d6bfce1187aa13dbfab03f9566ff7b05b6705e70
2017-06-28 12:31:53 -07:00
Sebastian Hengst ecf716b8bb merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: CmMBcpJapLy
2017-09-12 11:35:15 +02:00
Phil Ringnalda 7f896e1985 Backed out 4 changesets (bug 1398601) for Windows Marionette crashes @ ExecuteInExtensibleLexicalEnvironment
Backed out changeset 7aac2595bc17 (bug 1398601)
Backed out changeset 7a4bb5a1848a (bug 1398601)
Backed out changeset dd4af7998505 (bug 1398601)
Backed out changeset e9816be61b49 (bug 1398601)

MozReview-Commit-ID: LLJ99dkRQEg
2017-09-11 20:20:16 -07:00
Ted Campbell d09e551152 Bug 1398601 - Add testcase for loading subscripts within a JSM r=kmag
MozReview-Commit-ID: I09eoUnQYCG

--HG--
extra : rebase_source : b0950f8b5e98ee3bc52fa03067d904687feefcf5
2017-09-10 14:57:04 -04:00
Ted Campbell ff55566d27 Bug 1398601 - Fix subscript loader when using JSM global sharing r=kmag
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.

MozReview-Commit-ID: 1ah5JUAZwBA

--HG--
extra : rebase_source : 5fecf7dc61019431d67bcee4199e40a8278c8c64
2017-09-10 14:23:32 -04:00
Wes Kocher 05c4aba599 Merge m-c to autoland, a=merge CLOSED TREE
MozReview-Commit-ID: 2dRRh6JLTIL
2017-09-11 15:21:36 -07:00
Andrew McCreight f89c72edb7 Bug 1377587, part 2 - Rename ExposedPropertiesOnly to OpaqueWithSilentFailing. r=krizsa
This class doesn't have anything to do with __exposedProps__ any more,
so give it a more descriptive name. We'd still like to remove it
entirely eventually.

MozReview-Commit-ID: 87KCpG6f8rI

--HG--
extra : rebase_source : 98a51a6af0fc8446dbcd8efa083d6c79286279d3
2017-09-07 11:17:16 -07:00
Andrew McCreight 2b68b38709 Bug 1377587, part 1 - Always act like __exposedProps__ is missing. r=krizsa
This patch gently removes support for __exposedProps__ by changing
ExposedPropertiesOnly::check() to always return false, while still
failing silently in deny for some kinds of access.

The tests that I changed all involve testing the behavior with
__exposedProps__. I adjusted them to expect it to fail, or to adjust
the error message they get when they fail. That seemed better than
deleting them entirely.

Note that test_bug1065185.html had a bug, so that it never executed
the first case. I fixed that, and then fixed up the test to work when
__exposedProps__ is not supported.

This also removes various bits of the test framework that use
__exposedProps__, but don't actually need to.

MozReview-Commit-ID: 8fvkAmITmXY

--HG--
extra : rebase_source : ef7e2c55adc12511f17f3865ebb46c343875f0b3
2017-08-22 14:24:11 -07:00
Kris Maglione 1b2f22b34a Bug 1396366: Make sure the URLPreloader cache is only written once. r=erahm
MozReview-Commit-ID: FA1BPQ5c6nP

--HG--
extra : rebase_source : 68137a0378cfb2138144c8f53b6b25352c21233d
2017-09-08 13:44:32 -07:00
Jason Orendorff 51b4fbde26 Bug 1363200 - JSAPI for realms: Move XPCWrappedNativeScope::mIsAddonScope to CompartmentPrivate. r=mrbkap
--HG--
extra : rebase_source : e4407cea6fe0b1c87ed00c0c93123b43cb64ad69
2017-07-12 16:41:57 -05:00
Jason Orendorff ce74f6c158 Bug 1363200 - JSAPI for realms: Move mIsContentXBLScope to the CompartmentPrivate. r=mrbkap
In the new order, it will be a compartment-level bit rather than a
realm-level bit, so it does not belong on the Scope.

--HG--
extra : rebase_source : 44aa4620f7fd7f8d253c8c7f09bf8c97c00ff061
extra : source : 5a9c01720d7929e43aa70341d3821bfaa2479592
2017-07-12 15:00:47 -05:00
Jason Orendorff d438b03787 Bug 1363200 - JSAPI for realms: Clone hasInterposition bit from the scope to the CompartmentPrivate. r=mrbkap
The entire purpose of this patch is to support accessing this bit from
WrapperFactory (see the last hunk) without going through a particular
scope.

--HG--
extra : rebase_source : d2952e981f4b277e6ca565077c6e6d18c69c8df5
2017-06-27 11:06:42 -07:00
Nicholas Nethercote 50c7852f4d Bug 1397628 - Don't auto-atomize strings passed from script. r=kmag.
If you pass a string from script to an IDL method that takes an nsIAtom,
XPConnect will automagically atomize the string for you.

But nsIAtom is no longer scriptable (see the blockers for bug 1392883,
especially bug 1396694). So the code to convert can be removed.

--HG--
extra : rebase_source : af85fa48c1988348d3a9a81b05ed43403d3b730a
2017-09-07 14:37:56 +10:00
Kris Maglione 8c91f29845 Bug 1398499: Part 3 - Add Marionette tests for global sharing. r=mccr8
This tests both that the settings have the desired effect and that switching
between sharing enabled and sharing disabled without a startup cache flush
does not cause any issues.

Tests for user pref changes are currently non-fatal, since they're known not
to work reliably.

MozReview-Commit-ID: 1ZFwyiNf3da

--HG--
extra : rebase_source : c38bd92d2137c90f8c4d202b7009612b45ff4be9
2017-09-09 17:33:01 -07:00
Kris Maglione 60e49ffdd4 Bug 1398499: Part 2 - Add MOZ_LOADER_SHARE_GLOBAL env var to toggle global sharing. r=mccr8
User preference changes currently don't reliably take effect before component
loader initialization, which means they can't be used to write reliable tests.
Environment variables don't have this problem, so adding an environment
variable override makes testing much easier. It's also fairly convenient
during development, when we need to switch between different configurations
for testing.

MozReview-Commit-ID: 8PufRQNRnoU

--HG--
extra : rebase_source : c5ca2f3cb18a8398c95bbbf86e2cd27430f5161a
2017-09-09 14:59:45 -07:00
Kris Maglione 8b676de4b0 Bug 1398499: Part 1 - Use separate cache paths for shared/unshared scripts. r=mccr8
Scripts for use in shared globals need to be compiled for non-syntactic
scopes, while scripts for standalone globals should be compiled as global
scripts for better performance.

Since the startup cache and script preloader store scripts as they were
compiled in the last session, when global sharing settings may have been
different, it can lead to a mismatch, and a crash, due to loading the wrong
type of script.

Using a separate cache path for each type of script fixes this problem, since
it ensures that the cached script will always be of the type we expect.

MozReview-Commit-ID: DnNb2Xi6KeL

--HG--
extra : rebase_source : d2474d1da3f8e1066c21a7c65693ea09ec5b8074
2017-09-09 14:59:00 -07:00
Kris Maglione e872679b9f Bug 1381976: Part 2 - Cleanup private/protected members and mark class final. r=mccr8
MozReview-Commit-ID: Kn9NfKC4GL8

--HG--
extra : rebase_source : 521043472a824fbcc07288e030f9c36601082c20
2017-08-25 13:29:51 -07:00
Kris Maglione 3529438886 Bug 1381976: Part 1 - Use the shared module global for script pre-compilation. r=mccr8
When we pre-compile scripts for a different global than they are eventually
executed in, we need to clone them into the new global before we can execute
them, which can be expensive. This also prevents us from using lazy parsing,
since lazy functions are currently eagerly compiled when cloned.

Since the vast majority of the scripts compiled by the preloader are executed
in the shared modules scope, initially compiling them there removes a lot of
startup overhead. For the few that aren't, we don't lose anything by compiling
them in the shared module global, but we also don't gain anything over
compiling them in the XPConnect compilation scope.

MozReview-Commit-ID: CEh42BmIMhL

--HG--
extra : rebase_source : 93f639022375dd3f0b8e06533e829ce4089d46b7
2017-08-25 19:36:44 -07:00
Andrew McCreight 4105546375 Bug 1186409 - Check to make sure we don't set some weird XPConnect flags on the shared global. r=kmag
I added the predicate so people can't just start grabbing the loader
global and doing scary things with it.

MozReview-Commit-ID: HzPtMzEm0Ln

--HG--
extra : rebase_source : a0bed5901e54dd1e64c7ef233cd58cdfb1f136d4
2017-06-06 14:41:27 -07:00
Andrew McCreight 1f0b9dc34f Bug 1186409 - Use a single global for all JSMs. r=kmag
This patch adds a preference jsloader.shareGlobal that makes it so
that JSMs share a single global, in order to reduce memory usage. The
pref is disabled by default, and will be enabled in a later bug. Each
JSM gets its own NonSyntacticVariablesObject (NSVO), which is used for
top level variable bindings and as the value of |this| within the JSM.

For the module loader, the main change is setting up the shared
global, and the NSVO for each JSM. A number of files are blacklisted
from the shared global, because they do things to the global that
would interfer with other JSMs. This is detailed in
mozJSComponentLoader::ReuseGlobal().

MozReview-Commit-ID: 3qVAc1c5aMI

--HG--
extra : rebase_source : fe7e2672be8d09d6b7cec25e08cd464ff3cd6573
2017-07-18 14:47:27 -07:00
Ted Campbell 3d936e31cf Bug 1394490 - Javascript loader environments test. r=kmag
This are some unit tests to track regressions in the environment
behavior exposed to embeddings for various javascript loaders inside
Gecko.

MozReview-Commit-ID: 8pn56Skwbat
2017-09-06 13:43:55 -04:00
Kris Maglione e8446ea313 Bug 1396570: Null check getter/setter when JSPROP_GETTER/JSPROP_SETTER is set. r=bholley f=jandem
These flags don't guarantee that the getter and setter functions are defined.

MozReview-Commit-ID: GBcoRYoKHqL

--HG--
extra : rebase_source : 1234ec91cf05566a3130360b152bf2cb986ec1c3
2017-09-04 17:27:31 -07:00
Kris Maglione b3ba0520ee Bug 1396449: Part 1 - Use WebExtensionPolicy objects in extension content principals. r=krizsa
Going through the extension policy service rather than using
WebExtensionPolicy objects directly adds a lot of unnecessary overhead to
common operations on extension principals, and also makes the code more
complicated than it needs to be.

We also use weak references to policy objects here, since principals should
ideally lose as much of their elevated privileges as possible once the
extension instance that created them has been destroyed (which is something we
couldn't handle easily when we simply tracked ID strings).

MozReview-Commit-ID: KDNvVdvLkIt

--HG--
extra : rebase_source : 1b567919d2461bd0315d1a7d89f330cbd585f579
2017-09-05 11:04:43 -07:00
Kris Maglione f749e93f73 Bug 1363482: Part 6 - Add Cu.readFile helper to access the file preloader from JS. r=bholley
MozReview-Commit-ID: B7kSvhxbL4f

--HG--
extra : rebase_source : 3d9e11f6eba70e41786bf008eee8ec37ac4caec6
2017-08-31 17:02:06 -07:00
Kris Maglione c4a2fd3bfb Bug 1363482: Part 2 - Allow pre-loading file and JAR entry contents off-thread during startup. r=erahm
MozReview-Commit-ID: 8bKzYpXBQvT

--HG--
extra : rebase_source : 6750d471a0a39338b5145e2dab9d953b4c30a63f
2017-08-30 15:47:17 -07:00
Boris Zbarsky c395dbb95d Bug 1394598. Stop using a belt-and-suspenders opaque wrapper for eval and Function when they're being exposed by SpecialPowers. r=bholley 2017-09-01 16:30:57 -04:00
Sebastian Hengst 43bc951ac7 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: ES9rKhiQo10
2017-09-01 10:38:51 +02:00
Kris Maglione 6bad4f8ef7 Bug 1366511: Part 3 - Add mozilla::ToResult() to convert other result types to equivalent Result. r=nbp,ehsan
Also adds a mozilla/ResultExtensions.h header to define the appropriate
conversion functions for nsresult and PRResult. This is in a separate header
since those types are not available in Spidermonkey, and this is the pattern
other *Extensions.h headers follow.

Also removes equivalent NS_TRY macros and WrapNSResult inlines that served the
same purpose in existing code, and are no longer necessary.

MozReview-Commit-ID: A85PCAeyWhx

--HG--
extra : rebase_source : a5988ff770888f901dd0798e7717bcf6254460cd
2017-08-29 21:28:31 -07:00
Kris Maglione c9899cb3fa Bug 1366511: Part 2 - Allow autoconverting Err(nsresult) to nsresult. r=ehsan,nbp
This allows MOZ_TRY and MOZ_TRY_VAR to be transparently used in XPCOM methods
when compatible Result types are used.

Also removes a compatibility macro in SimpleChannel.cpp, and an identical
specialization in AddonManagerStartup, which are no longer necessary after
this change.

MozReview-Commit-ID: 94iNrPDJEnN

--HG--
extra : rebase_source : 24ad4a54cbd170eb04ded21794530e56b1dfbd82
2017-08-29 21:28:22 -07:00
Bevis Tseng 215842a23c Bug 1392500 - Name the users of setTimeout() in Timer.jsm. r=billm,mccr8
1. Make nsINamed queriable on WrappedJSHolder.
2. Identify callers via |Cu.generateXPCWrappedJS(aCallback).QueryInterface(Ci.nsINamed).name|.

--HG--
extra : amend_source : 5d4201059f66e46c869c30a963921b6f7b91c389
2017-08-24 14:56:18 +08:00
Blake Kaplan d383834094 Bug 1376507 - Handle a list of contexts instead of a single context. r=billm
This might be prematurely optimized as it uses two lists (one list of active
contexts and one list of inactive contexts) but I was really attracted by the
idea of being able to answer questions like "is any context active" by only
looking at a single context and not having to iterate the whole list every
time we needed to do anything.

It is really important that nobody touches any of the timestamps (or the
mActive member) outside of the Watchdog lock. I thought about trying to
encapsulate that data in its own class, but that felt like overkill. Let me
know if you disagree.

There are still a couple of uses of XPCJSContext::Get that probably need to be
stamped out, but I think doing so will depend on the details of how we map
JSContexts to XPCJSContext (and XPCJSRuntimes). I think that should wait for a
separate bug.

MozReview-Commit-ID: 9UZlh7Jutne

--HG--
extra : rebase_source : 039b50bc70547b03bc0724435de0a10a29fcf85e
2017-08-28 16:05:11 -07:00
Blake Kaplan 2c3b159a1a Bug 1376507 - Move state onto XPCJSContext. r=billm
The current code assumes it can store data about "the" XPCJSContext on the
WatchdogManager singleton. Once we have more than one XPCJSContext running
around, that won't be possible. This moves the needed data onto the
XPCJSContext itself and gives the WatchdogManager the proper context to
operate on.

MozReview-Commit-ID: AxyFKp9LmH3

--HG--
extra : rebase_source : 113e3b8986563016d43b25e753bde61f7af49291
2017-08-23 17:40:09 -07:00
Wes Kocher e31150aea5 Backed out 2 changesets (bug 1376507) for build bustage a=backout
Backed out changeset 266611b269cc (bug 1376507)
Backed out changeset 04ecce0d1392 (bug 1376507)

MozReview-Commit-ID: JC6tERhgDoS
2017-08-31 17:08:29 -07:00
Blake Kaplan c4cdfbe15a Bug 1376507 - Handle a list of contexts instead of a single context. r=billm
This might be prematurely optimized as it uses two lists (one list of active
contexts and one list of inactive contexts) but I was really attracted by the
idea of being able to answer questions like "is any context active" by only
looking at a single context and not having to iterate the whole list every
time we needed to do anything.

It is really important that nobody touches any of the timestamps (or the
mActive member) outside of the Watchdog lock. I thought about trying to
encapsulate that data in its own class, but that felt like overkill. Let me
know if you disagree.

There are still a couple of uses of XPCJSContext::Get that probably need to be
stamped out, but I think doing so will depend on the details of how we map
JSContexts to XPCJSContext (and XPCJSRuntimes). I think that should wait for a
separate bug.

MozReview-Commit-ID: 9UZlh7Jutne

--HG--
extra : rebase_source : a927511fbf5a7bbdb75f616b751ec3fb51e76903
2017-08-28 16:05:11 -07:00
Blake Kaplan 5c7a14294c Bug 1376507 - Move state onto XPCJSContext. r=billm
The current code assumes it can store data about "the" XPCJSContext on the
WatchdogManager singleton. Once we have more than one XPCJSContext running
around, that won't be possible. This moves the needed data onto the
XPCJSContext itself and gives the WatchdogManager the proper context to
operate on.

MozReview-Commit-ID: AxyFKp9LmH3

--HG--
extra : rebase_source : 113e3b8986563016d43b25e753bde61f7af49291
2017-08-23 17:40:09 -07:00
Kris Maglione fdbe5511ae Bug 1394556: Part 2 - Compile all JSM/module scripts in strict mode. r=Mossop
MozReview-Commit-ID: 5BLvaHEFCqv

--HG--
extra : rebase_source : f28cdc2acf5f0c26885feeb48105513f2bf6f5ef
extra : histedit_source : 1ead5f8843a091aa0beba4ccb26681ac2078e934
2017-08-28 11:39:06 -07:00
Jan de Mooij bc31f1ee31 Bug 1394835 part 1 - Spit JS_DefineProperty* APIs in separate data/accessor overloads. r=evilpie,bz 2017-08-30 15:35:06 +02:00
Masatoshi Kimura 452d3a0896 Bug 1098412 - Remove __iterator__ implementation. r=luke
MozReview-Commit-ID: 6qqSSrB4Vvh

--HG--
extra : rebase_source : b8e6ef46d6bae1aecfe3874d81bd537e506bdba3
2017-08-24 22:17:40 +09:00
Masatoshi Kimura 42afc8970b Bug 1098412 - Remove and update tests that use the legacy Iterator constructor. r=luke
MozReview-Commit-ID: G7q3ARzOYFf

--HG--
extra : rebase_source : d36ddf7abba4068d766d9f068f87616bdd316158
2017-08-24 22:45:53 +09:00
Jon Coppeard 00f55c5fed Bug 1376899 - Remove unused isZoneGC parameter from GC finalize callback r=sfink r=mccr8 2017-08-29 11:58:26 +01:00
Kris Maglione c5a2868365 Bug 1394467: Remove unused procompileScript method. r=mccr8
MozReview-Commit-ID: 6s2Nqtcd9uS

--HG--
extra : rebase_source : ec4f96e7281e3f72be01aeb8faa1c9b34a61f534
2017-08-28 09:21:46 -07:00
Jan de Mooij 3e1a11f41d Bug 1393790 part 1 - Remove JS_STUBGETTER and JS_STUBSETTER. r=jorendorff 2017-08-28 10:39:57 +02:00
Phil Ringnalda 6e0931231e Backed out changeset eca521df662f (bug 1388221) for browser_library_downloads.js, browser_library_infoBox.js and browser_library_search.js failures on OS X
MozReview-Commit-ID: CrYUAKCFCMK
2017-08-26 17:34:08 -07:00
Kris Maglione 46c134a432 Bug 1388221: Optimize defineLazyModuleGetter for already-loaded modules. r=florian
Creating and populating temporary export objects is fairly expensive. Defining
and then redefining lazy getters is sometimes even more expensive.

Caching the export objects from module imports, and immediately defining
properties from already-imported modules appears to save a considerable amount
of overhead at startup.

MozReview-Commit-ID: 2jR1i0WpIcw

--HG--
extra : rebase_source : d64e3380f290b12a004177be678abad88530bbc5
2017-08-09 13:13:25 -07:00
Wes Kocher 68149d6a59 Merge inbound to central, a=merge
MozReview-Commit-ID: 3N9jinnrmjb
2017-08-25 16:21:57 -07:00
Gabriele Svelto 7387dc791b Bug 1393435 - Remove unnecessary inclusions of the crash reporter header files; r=mconley
MozReview-Commit-ID: 3tdFDrTYql8

--HG--
extra : rebase_source : cc862688f19afb8a5cf8c7cf915a5d3d45f041b5
2017-08-07 14:10:02 +02:00
Jan de Mooij 0f2181d932 Bug 1393715 - Remove JSFUN_STUB_GSOPS and JS_FS. r=arai 2017-08-25 17:04:12 +02:00
Nicholas Nethercote 7e120ce35e Bug 1393636 (part 3) - Pass nsWindowSizes to more AddSizeOf*() functions. r=heycam.
This is a purely non-functional plumbing change. Instead of passing a
SizeOfState and an nsStyleSizes a bunch of places, we pass an nsWindowSizes,
which contains both of them.

This is a necessary precursor for the next patch.

MozReview-Commit-ID: Ek03wDM50rB

--HG--
extra : rebase_source : 7b05708bd21dc4e3812ea041647fa74bb413d0b9
2017-08-25 14:47:54 +10:00
Jan de Mooij a5de55dced Bug 1389510 part 3 - Remove getProperty/setProperty hooks from ClassOps. r=evilpie 2017-08-25 10:12:16 +02:00
Jan de Mooij 599d67d484 Bug 1389510 part 1 - Remove getProperty/setProperty hooks from XPConnect. r=mrbkap 2017-08-25 10:10:56 +02:00
Benjamin Bouvier b5407c81cc Bug 1391633: Remove the unused JSContext parameter in SetDocumentAndPageUseCounter; r=froydnj
MozReview-Commit-ID: KtVP5JgLIFC

--HG--
extra : rebase_source : 210f0a479cf0919e1d6e589a5857f43fb50fa8c5
extra : histedit_source : 2f08891b3dba80e117e3f5e4a0e0367b51e42606
2017-08-18 16:02:15 +02:00
Benjamin Bouvier e8f41447d2 Bug 1391633: Integrate use counters in the JavaScript engine; r=jonco, r=froydnj, data-review=francois
MozReview-Commit-ID: 1KOo0Zz0ccG

--HG--
extra : rebase_source : 1bdd89205a3d96f6d8314fc0cf08423b5c141cb6
extra : histedit_source : a000151b02c6423c967a72054b22679b08e25df9
2017-08-18 15:48:49 +02:00
Nicholas Nethercote f582d96b98 Bug 1390428 (part 9) - Remove nsXPIDLCString. r=erahm.
This is straightforward, with only two notable things.

- `#include "nsXPIDLString.h" is replaced with `#include "nsString.h"`
  throughout, because all nsXPIDLString.h did was include nsString.h. The
  exception is for files which already include nsString.h, in which case the
  patch just removes the nsXPIDLString.h inclusion.

- The patch removes the |xpidl_string| gtest, but improves the |voided| test to
  cover some of its ground, e.g. testing Adopt(nullptr).

--HG--
extra : rebase_source : 452cc4a08046a1adb1a8099a7e85a1917de5add8
2017-08-17 15:29:03 +10:00
Sebastian Hengst 142b3bf28b Backed out changeset 109e89a7d561 (bug 1391420) for busting Linux pgo builds. r=backout on a CLOSED TREE
--HG--
extra : amend_source : 6a4421254e4de31071785b73abdd1186638e31f2
2017-08-23 18:12:46 +02:00
David Major 8cb2cb650a Bug 1391420: Set NO_PGO on a bunch of binaries that we don't ship. r=ted 2017-08-23 11:10:39 -04:00
Andrew McCreight e9b051a4af Bug 1366896, part 2 - Add and use Cc.Initialize method. r=krizsa
MozReview-Commit-ID: Amqt9JsTMqG

--HG--
extra : rebase_source : dff173ed60a254fa449b2e85d71eee6cc7daba26
2017-05-24 14:12:11 -07:00
Andrew McCreight 0f344f2aed Bug 1366896, part 1 - Factor out initialize code and make initialize work with CIDs. r=krizsa
MozReview-Commit-ID: 3spZGOqlU1j

--HG--
extra : rebase_source : e346183b972ece2f4986091f36c3ecee13674832
2017-05-24 10:49:31 -07:00
Nicholas Nethercote 8a72cf2251 Bug 1390428 (part 2, attempt 2) - Remove more nsXPIDLCString local variables. r=erahm.
--HG--
extra : rebase_source : 69d58b0cfb56efc6b03d8e2d7be2ce3c3e6cd843
2017-08-21 20:01:27 +10:00
Kris Maglione 267cf409eb Bug 1356334: Part 6 - Allow completely terminating a slow content script sandbox. r=billm
MozReview-Commit-ID: 5CDLHrAeuDt

--HG--
extra : source : d832803270ac831fd760356f36e16ef2a2d6d45b
extra : histedit_source : 11b535e7924700b86747f2855ef33c9707db719a
2017-04-16 14:01:16 -07:00
Kris Maglione 6aef819287 Bug 1356334: Part 5 - Add add-on name to slow script messages. r=billm
MozReview-Commit-ID: 2nyDmoiBKp4

--HG--
extra : source : b83aea215a82d44bec7443b69e60feef32f5fb2c
extra : histedit_source : 5a94f13db992c197ebb49fbb8e6a91bb97288fb6
2017-08-17 20:17:51 -07:00
Kris Maglione faa8815613 Bug 1356334: Part 3 - Enforce a stricter slow script timeout for extension content scripts. r=billm
MozReview-Commit-ID: LLvPQn1x1Xj

--HG--
extra : source : 805c568069301ae91ead5780cdc118af73907229
extra : histedit_source : b188836d1dc3ad8021bf2d0b1c89aebedf2db185%2C8c7b51c9f4af4eb5ad67811c29b56c72b43fa31d
2017-08-18 11:04:55 -07:00
Ryan VanderMeulen 3fe1f45009 Backed out 8 changesets (bug 1356334) for frequent test_ext_contentscript_async_loading.html failures on Android debug on a CLOSED TREE.
Backed out changeset 9c677ebfdda0 (bug 1356334)
Backed out changeset 16b49fd1c38a (bug 1356334)
Backed out changeset 4f5bcd2b2dc6 (bug 1356334)
Backed out changeset d832803270ac (bug 1356334)
Backed out changeset b83aea215a82 (bug 1356334)
Backed out changeset b2a663ffd144 (bug 1356334)
Backed out changeset 805c56806930 (bug 1356334)
Backed out changeset 7c880eca810a (bug 1356334)
2017-08-18 11:32:18 -04:00
Ryan VanderMeulen 24c9581b48 Backed out changeset fbf0e8609abb (bug 1390428) for Windows clipboard test failures on a CLOSED TREE. 2017-08-18 10:58:47 -04:00
Lars T Hansen 1783392f5e Bug 1277562 - Part 16b: Implement javascript.options.wasm_ionjit. r=billm
--HG--
extra : rebase_source : 6956d4002670590667f83cf9f5f6a2f82df6ba84
2017-06-29 15:37:01 -07:00
Lars T Hansen 16a023dd8a Bug 1277562 - Part 5a: Change the meaning of the wasm-baseline switch. r=luke
--HG--
extra : rebase_source : 793eacb33d1901565d2b7b2e84501cc8917a4149
extra : source : 392b626dc954766ac5a077f4cad7ab489fd907aa
2017-02-02 13:22:40 +01:00
Nicholas Nethercote 5241bea863 Bug 1390428 (part 2) - Remove more nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is used in ways that rely on the implicit conversion
to |char*|. The patch uses get() and EqualsLiteral() calls to replace the
implicit conversions.
2017-08-16 13:58:55 +10:00
Kris Maglione bdbbf869dd Bug 1356334: Part 6 - Allow completely terminating a slow content script sandbox. r=billm
MozReview-Commit-ID: 5CDLHrAeuDt

--HG--
extra : rebase_source : 00f75b5be53e38d912b90b8fe777c5aa7ff135bf
2017-04-16 14:01:16 -07:00
Kris Maglione 2c6fe4f014 Bug 1356334: Part 5 - Add add-on name to slow script messages. r=billm
MozReview-Commit-ID: 2nyDmoiBKp4

--HG--
extra : rebase_source : 311d9ad486210e6d5fa3a06bb837d3597b9d2800
2017-08-11 22:11:25 -07:00
Kris Maglione b23753e90d Bug 1356334: Part 3 - Enforce a stricter slow script timeout for extension content scripts. r=billm
MozReview-Commit-ID: LLvPQn1x1Xj

--HG--
extra : rebase_source : d2b85e92c00faef8664b036be6236dd109074af4
2017-08-11 21:30:54 -07:00
Nicholas Nethercote 025461bde7 Bug 1390428 (part 1) - Remove many nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is only used in ways that nsCStrings can also be used
(i.e. no null checks or implicit conversions to |char*|).

In every case the patch trivially replaces the nsXPIDLCString with an
nsCString. (Also, there are a couple of unused nsXPIDLCString variables that
the patch simply removes.)
2017-08-16 13:58:35 +10:00
Carsten "Tomcat" Book eea1986e03 merge mozilla-inbound to mozilla-central a=merge 2017-08-16 11:23:24 +02:00
Jan de Mooij 9a7bf50e92 Bug 1390159 - Remove throw-on-set setProperty hooks on WrappedNatives. r=mrbkap 2017-08-16 09:01:56 +02:00
Jan de Mooij 503f557cde Bug 1390471 - Remove xpcshell's environment object. r=bholley 2017-08-16 09:00:44 +02:00
Wes Kocher 3945278423 Merge m-c to autoland, a=merge
MozReview-Commit-ID: D96bIJACwZe
2017-08-15 19:16:12 -07:00
Masatoshi Kimura 43dd1b22af Bug 1390106 - Stop using versioned scripts in js/xpconnect. r=mccr8
MozReview-Commit-ID: LP7bXQd7ahD

--HG--
extra : rebase_source : b0d3b9052d333698dbb1e6e6a0da9556fe60a91b
2017-08-14 20:45:14 +09:00
Bill McCloskey 268004b056 Bug 1382172 - Compute names for all JS-implemented XPCOM objects (r=mrbkap)
MozReview-Commit-ID: 4kPbqOpGYnq
2017-08-14 22:42:42 -07:00
Phil Ringnalda 6bfeb0577d Backed out changeset c0c52209c8f2 (bug 1382172) for static build bustage
CLOSED TREE

MozReview-Commit-ID: 9GzjXjoIrp5
2017-08-14 22:23:57 -07:00
Kris Maglione 7da155b917 Bug 1389847: Don't add caller location to sandbox name if an explicit name is provided. r=krizsa
MozReview-Commit-ID: KOGrrMurs6X

--HG--
extra : rebase_source : ec9bae4b7a40f7916a813905346f124e62516b9a
2017-08-12 16:01:00 -07:00
Bill McCloskey 96944ff355 Bug 1382172 - Compute names for all JS-implemented XPCOM objects (r=mrbkap)
MozReview-Commit-ID: 4kPbqOpGYnq
2017-08-14 21:10:14 -07:00
Nicholas Nethercote 57c26c9834 Bug 1387956 - Overhaul ComputedValues measurement, and add style structs measurement. r=bholley.
This patch moves measurement of ComputedValues objects from Rust to C++.
Measurement now happens (a) via DOM elements and (b) remaining elements via
the frame tree. Likewise for the style structs hanging off ComputedValues
objects.

Here is an example of the output.

> ├──27,600,448 B (26.49%) -- active/window(https://en.wikipedia.org/wiki/Barack_Obama)
> │  ├──12,772,544 B (12.26%) -- layout
> │  │  ├───4,483,744 B (04.30%) -- frames
> │  │  │   ├──1,653,552 B (01.59%) ── nsInlineFrame
> │  │  │   ├──1,415,760 B (01.36%) ── nsTextFrame
> │  │  │   ├────431,376 B (00.41%) ── nsBlockFrame
> │  │  │   ├────340,560 B (00.33%) ── nsHTMLScrollFrame
> │  │  │   ├────302,544 B (00.29%) ── nsContinuingTextFrame
> │  │  │   ├────156,408 B (00.15%) ── nsBulletFrame
> │  │  │   ├─────73,024 B (00.07%) ── nsPlaceholderFrame
> │  │  │   ├─────27,656 B (00.03%) ── sundries
> │  │  │   ├─────23,520 B (00.02%) ── nsTableCellFrame
> │  │  │   ├─────16,704 B (00.02%) ── nsImageFrame
> │  │  │   ├─────15,488 B (00.01%) ── nsTableRowFrame
> │  │  │   ├─────13,776 B (00.01%) ── nsTableColFrame
> │  │  │   └─────13,376 B (00.01%) ── nsTableFrame
> │  │  ├───3,412,192 B (03.28%) -- servo-style-structs
> │  │  │   ├──1,288,224 B (01.24%) ── Display
> │  │  │   ├────742,400 B (00.71%) ── Position
> │  │  │   ├────308,736 B (00.30%) ── Font
> │  │  │   ├────226,512 B (00.22%) ── Background
> │  │  │   ├────218,304 B (00.21%) ── TextReset
> │  │  │   ├────214,896 B (00.21%) ── Text
> │  │  │   ├────130,560 B (00.13%) ── Border
> │  │  │   ├─────81,408 B (00.08%) ── UIReset
> │  │  │   ├─────61,440 B (00.06%) ── Padding
> │  │  │   ├─────38,176 B (00.04%) ── UserInterface
> │  │  │   ├─────29,232 B (00.03%) ── Margin
> │  │  │   ├─────21,824 B (00.02%) ── sundries
> │  │  │   ├─────20,080 B (00.02%) ── Color
> │  │  │   ├─────20,080 B (00.02%) ── Column
> │  │  │   └─────10,320 B (00.01%) ── Effects
> │  │  ├───2,227,680 B (02.14%) -- computed-values
> │  │  │   ├──1,182,928 B (01.14%) ── non-dom
> │  │  │   └──1,044,752 B (01.00%) ── dom
> │  │  ├───1,500,016 B (01.44%) ── text-runs
> │  │  ├─────492,640 B (00.47%) ── line-boxes
> │  │  ├─────326,688 B (00.31%) ── frame-properties
> │  │  ├─────301,760 B (00.29%) ── pres-shell
> │  │  ├──────27,648 B (00.03%) ── pres-contexts
> │  │  └─────────176 B (00.00%) ── style-sets

The 'servo-style-structs' and 'computed-values' sub-trees are new. (Prior to
this patch, ComputedValues under DOM elements were tallied under the the
'dom/element-nodes' sub-tree, and ComputedValues not under DOM element were
ignored.) 'servo-style-structs/sundries' aggregates all the style structs that
are smaller than 8 KiB.

Other notable things done by the patch are as follows.

- It significantly changes the signatures of the methods measuring nsINode and
  its subclasses, in order to handle the tallying of style structs separately
  from element-nodes. Likewise for nsIFrame.

- It renames the 'layout/style-structs' sub-tree as
  'layout/gecko-style-structs', to clearly distinguish it from the new
  'layout/servo-style-structs' sub-tree.

- It adds some FFI functions to access various Rust-side data structures from
  C++ code.

- There is a nasty hack used twice to measure Arcs, by stepping backwards from
  an interior pointer to a base pointer. It works, but I want to replace it
  with something better eventually. The "XXX WARNING" comments have details.

- It makes DMD print a line to the console if it sees a pointer it doesn't
  recognise. This is useful for detecting when we are measuring an interior
  pointer instead of a base pointer, which is bad but easy to do when Arcs are
  involved.

- It removes the Rust code for measuring CVs, because it's now all done on the
  C++ side.

MozReview-Commit-ID: BKebACLKtCi

--HG--
extra : rebase_source : 4d9a8c6b198a0ff025b811759a6bfa9f33a260ba
2017-08-11 16:37:33 +10:00
Kris Maglione de735e278f Bug 1388631: Don't call generateQI for every defineLazyPreferenceGetter call. r=mixedpuppy
MozReview-Commit-ID: 9n8VyXFM7bc

--HG--
extra : rebase_source : 30241e57a35d731a46ce8d5e69f876bb32340011
2017-08-08 23:19:06 -07:00
Kris Maglione 947fb7cb28 Bug 1388215: Part 1 - Add defineLazyModuleGetters and defineLazyServiceGetters methods. r=florian
MozReview-Commit-ID: 8sAjBlRzoYS

--HG--
extra : rebase_source : 32c7dde0feda5c21fd016b240966314bd0241fa5
2017-08-09 13:06:43 -07:00
Tooru Fujisawa e0722b91b6 Bug 1352312 - Enable Async Iteration. r=till 2017-08-15 20:18:00 +09:00
Bobby Holley 26bc5a86f4 Bug 1378207 - Stop bypassing the Xray layer when walking the prototype chain. r=krizsa 2017-07-17 12:26:34 +02:00
Nicholas Nethercote 1a6f1a62fa Bug 1387381 - Remove nsXPIDLString local variables. r=erahm.
nsXPIDLStrings are marked as VOIDED upon initialization. Most of these local
nsXPIDLString variables are immediately set via getter_Copies(), which will
either assign a string value (using Adopt()) or do SetIsVoid(). These can be
trivially converted to nsString, which will get the same treatment.

The patch suitably converts the remaining nsXPIDLString local variable as well.

--HG--
extra : rebase_source : 5fff9f2c6844559198f601853f8db08564add7d5
2017-08-08 16:07:55 +10:00
Jason Orendorff b3552cd3fb Bug 1363200 - JSAPI for realms: Move SetAddonCallInterposition to the CompartmentPrivate. r=bholley
--HG--
extra : rebase_source : d34087913dd18aeaf8908f4391bed14d0c6790f3
2017-06-27 08:07:27 -07:00
Jason Orendorff 4e0c34d1c3 Bug 1363200 - JSAPI for realms: JS::SetDestroyRealmCallback. r=sfink
--HG--
extra : rebase_source : ad62e332bab6c31db2c98581163b1ca5fe8103f0
extra : intermediate-source : 0f72e0175f55a309ea4bc70240347e6659174af4
extra : source : ac9c7e04c174c8b2e4ca0e533a8a2838d293f700
2017-05-23 16:35:31 -05:00
Jason Orendorff 5df09661ff Bug 1363200 - JSAPI for realms: JS_SetVersionForCompartment() -> JS::SetVersionForCurrentRealm(). r=sfink
--HG--
extra : rebase_source : 8b0d53210fe827a648251395e038cb7b9eb616e9
2017-05-22 14:40:13 -05:00
Jason Orendorff 8399e3ecd5 Bug 1363200 - JSAPI for realms: JS_SetRealmNameCallback. r=sfink
--HG--
extra : rebase_source : d0a8f51761998c80a226cb6232ce920c67689234
2017-05-22 14:09:05 -05:00
Henry Chang af3b11c151 Bug 1375277 - New safebrowsing threat type "POTENTIALLY_HARMFUL_APPLICATION" introduced by v4. r=francois
As our threattype-listname conversion design, "goog-harmful-proto" is allocated
for this new threat type. This threat type is mainly for mobile.

MozReview-Commit-ID: G9GbgmHHHfp

--HG--
extra : rebase_source : 0681fcd9322b94451a86eafe57bf1ccc4b89db30
extra : intermediate-source : 28b0502d9add81beeae58a2c33f9fd5839d4d544
extra : source : 646f02f15131aa98ad37015b0a641304a3271796
2017-07-27 15:37:57 +08:00
Masatoshi Kimura 436186d6f8 Bug 1387791 - Remove [deprecated] Components.reportError. r=bholley
MozReview-Commit-ID: CCqFQid7ZDi

--HG--
extra : rebase_source : bce691e8a83d3a2837fbf28f44f5390aae2c2716
2017-08-06 11:04:11 +09:00
Andrew McCreight 8085e87bc3 Bug 379797 - Various dump() methods should check browser.dom.window.dump.enabled. r=krizsa
Checking this pref to avoid log spam in opt builds, in sandboxes, JS
components, and whatever uses nsFrameMessageManager's dump method.

This does mean that on Windows in an opt build when a debugger is
present a debug string will no longer be printed unless the pref is
set, but I think that is consistent with the non-Windows behavior.

MozReview-Commit-ID: FWLAzBRVhlx

--HG--
extra : rebase_source : cc5669f422729788f1ebc300d4450290913a3055
2017-08-02 11:56:33 -07:00
Makoto Kato ffdcdb04c6 Bug 676965 - Turn on test_localeCompare.js on Android since we use ICU. r=gandalf
We should turn on test_localeCompare.js again on Android since we use ICU.

MozReview-Commit-ID: 1H0DsKpWkId

--HG--
extra : rebase_source : d29564bfd20ee6fbc2eadf2f4b80066efc3deef0
extra : histedit_source : 294c17ea1736f196aca7aa969203428e6792625e
2017-08-02 17:21:03 +09:00
Kris Maglione f87ef7bd44 Remove unused lazy imports. r=trivial (no bug)
MozReview-Commit-ID: rqUFJw7Wsb

--HG--
extra : rebase_source : cdda5d87fe33bdb9dacc1846fd67f3cb4154f230
2017-08-02 21:09:38 -07:00
Jim Blandy dcfc353eae Bug 1383161 - Return a dead wrapper when asked to wrap a dead WindowProxy object. r=kmag 2017-07-28 15:16:21 -07:00
Kris Maglione 37a0f65e57 Bug 1385822 - Don't save new scripts from child process after cache flush. r=erahm
MozReview-Commit-ID: GKInmHvwVMP
2017-07-31 14:30:51 -07:00
Andrew McCreight 5eecb0df0a Bug 1385474 - Avoid QIing for NoteXPCOMRoot. r=smaug
This callback is only used in very limited ways, so just require that
the caller pass in the canonical supports pointer, plus the
participant. This probably won't affect performance much.

MozReview-Commit-ID: CsThzFsKyYx

--HG--
extra : rebase_source : 9595b1d75fc45bc5ee6d932a840e98b5d760cb78
2017-07-28 16:11:03 -07:00
Till Schneidereit ab76cf2fd7 Bug 1272697 - Part 2: Add runtime pref to enable streams. r=jonco,baku
MozReview-Commit-ID: FJMAxbtD3Uy
2017-07-29 16:47:12 +02:00
Marco Castelluccio 5e9eca95f5 Bug 1357517 - Remove Preferences.jsm usage from XPCOMUtils.jsm. r=kmag
--HG--
extra : rebase_source : f69e4b2e5b11d302546e73fa6f16c17b3bb68318
2017-07-28 23:04:47 +02:00
Sebastian Hengst 6389867b7c Backed out changeset 1d87b1dc4ce2 (bug 1272697) for failing mochitest test_interfaces.html for 'ByteLengthQueuingStrategy' and wpts, e.g. general.dedicatedworker.html. r=backout on a CLOSED TREE 2017-07-28 20:20:50 +02:00
Till Schneidereit dec687b07c Bug 1272697 - Part 2: Add runtime pref to enable streams. r=baku,jonco
MozReview-Commit-ID: 5OSxbcd3jQB
2017-07-28 17:48:12 +02:00
Carsten "Tomcat" Book 139661e8e4 Merge mozilla-central to mozilla-inbound 2017-07-28 15:25:58 +02:00
Carsten "Tomcat" Book 892bedca2e merge mozilla-inbound to mozilla-central a=merge 2017-07-28 15:24:39 +02:00
Sylvestre Ledru d48480a951 Bug 1384848 - Remove dead code in XPCConvert.cpp r=mrbkap
MozReview-Commit-ID: EncsNyW5Qxx
2017-07-28 14:05:27 +02:00
Sebastian Hengst 9077ac8886 Backed out changeset a57d8f30d1bf (bug 1383982) for build bustage at nsGlobalWindow.cpp:13826: 'class nsWindowSizes' has no member named 'mMallocSizeOf'. r=backout 2017-07-28 09:50:48 +02:00
Nicholas Nethercote 5c3abe8aab Bug 1383982 - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
All the SizeOf{In,Ex}cludingThis() functions take a MallocSizeOf function
which measures memory blocks. This patch introduces a new type, SizeOfState,
which includes a MallocSizeOf function *and* a table of already-measured
pointers, called SeenPtrs. This gives us a general mechanism to measure
graph-like data structures, by recording which nodes have already been
measured. (This approach is used in a number of existing reporters, but not in
a uniform fashion.)

The patch also converts the window memory reporting to use SizeOfState in a lot
of places, all the way through to the measurement of Elements. This is a
precursor for bug 1383977 which will measure Stylo elements, which involve
Arcs.

The patch also converts the existing mAlreadyMeasuredOrphanTrees table in the
OrphanReporter to use the new mechanism.

--HG--
extra : rebase_source : 2c23285f8b6c3b667560a9d14014efc4633aed51
2017-07-28 15:03:44 +10:00
Nicholas Nethercote 49eb219ff5 Bug 1383982 (attempt 2) - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
--HG--
extra : rebase_source : 7075f9570a4262158351ce9ac3ca8360ea4d5394
2017-07-28 20:10:04 +10:00
Sylvestre Ledru a4376d5dd4 Bug 1384848 - Remove dead code in XPCConvert.cpp r=mrbkap
MozReview-Commit-ID: D6kCUtqfIwo

--HG--
extra : rebase_source : 539ce1a925fa42b74007189708287ee74324261a
2017-07-27 09:43:06 +02:00
Julian Seward 408d24da56 Bug 1382563 - Remove ns*String::AssignWithConversion. r=erahm.
This patch replaces four functions of the name AssignWithConversion which
are essentially wrappers around CopyASCIItoUTF16 and LossyCopyUTF16toASCII
with direct calls to the latter two functions.  The replaced functions are:

  void nsCString::AssignWithConversion( const nsAString& aData )
  void nsString::AssignWithConversion( const nsACString& aData )

  void nsTString_CharT::AssignWithConversion(
                            const incompatible_char_type* aData,
                            int32_t aLength = -1);

The last of the three exists inside the double-included nsTString* world and
so describes two functions, giving four in total.

This has two advantages:

* it removes code

* at the call points, it makes clear (from the replacement name) which
  conversion is being carried out.  The generic name "AssignWithConversion"
  doesn't make that obvious -- one had to infer it from the types.

The patch also removes two commented out lines from
editor/composer/nsComposerCommands.cpp, that appear to be related.  They are
at top level, where they would never have compiled.  They look like
leftovers from some previous change.

--HG--
extra : rebase_source : fb47bf450771c3c9ee3341dd14520f5da69ec4f5
2017-07-24 19:23:52 +02:00
Carsten "Tomcat" Book d360d49d2a merge mozilla-inbound to mozilla-central a=merge 2017-07-27 10:57:25 +02:00
Bevis Tseng a7505864a8 Bug 1378930 - Part 2: Remove the aName parameter from SchedulerGroup/DocGroup/DispatcherTrait. r=billm
--HG--
extra : rebase_source : 11319e568a51d16754a6a9990f76c35c86c2bda7
2017-07-26 16:13:35 +08:00
Kartikaya Gupta ba4b3b9101 Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv

--HG--
extra : rebase_source : 009ea39eb4dac1c927aa03e4f97d8ab673de8a0e
2017-07-26 16:03:57 -04:00
Kris Maglione 09fd6d1778 Bug 1382329: Part 4 - Hold mMonitor while accessing scripts in the write thread. r=erahm
MozReview-Commit-ID: 66se8G27sqQ

--HG--
extra : rebase_source : 4fc09a04b4ebee937f614f9f271404ca20ab2c01
2017-07-19 14:16:56 -07:00
Kris Maglione f4d43b3b71 Bug 1382329: Part 3 - Wait for pending parse tasks to finish before freeing scripts. r=erahm,nbp
Off-thread parse tasks depend on the memory allocated by the main-thread
script preloader, so that memory needs to be kept alive until they finish. In
normal use cases, this is guaranteed, but when the browser shuts down very
quickly (as sometimes happens in tests), or we invalidate the startup caches
in the middle of the startup process, they can sometimes be freed too early.

MozReview-Commit-ID: GQmkVbWgTH9

--HG--
extra : rebase_source : 523fb559f3d71f16be11ae275ab1f6ea3900eff8
2017-07-25 15:23:12 -07:00
Kris Maglione d3ebec307a Bug 1382329: Part 2 - Eagerly encode scripts for the startup cache. r=erahm,nbp
MozReview-Commit-ID: JqCqQZ2rO2z

--HG--
extra : rebase_source : 14874cae551f10f091461c9e9b1d9a48c99afc2b
2017-07-19 12:44:17 -07:00
Kris Maglione 4c48c5dab8 Bug 1382329: Part 1 - Enable lazy source whenever compiling for the preloader. r=mccr8,nbp
In general, we always want to compile with lazy source whenever we intend to
store code in the startup bytecode cache. Currently, we only do so when the
main StartupCache is available (which is only in the parent process), even if
we'll be storing code in the ScriptPreloader cache.

The main side-effect of this is that scripts which are used in a content
process do not use lazy source, but *do* use lazy parsing. And since we need
to clone pre-loaded scripts into their target compartment before executing, we
end up eagerly compiling those lazy functions on the main thread as soon as we
execute the script, in order to clone them. And this causes two side-effects
of its own:

1) It's terrible for startup performance.

2) It creates new scope chains which didn't exist when the clone began, and
which are likely responsible for bug 1367896.

MozReview-Commit-ID: 6lZLb68zitp

--HG--
extra : rebase_source : 2f2bc11d0123fd7e14c2a5e716a764e7ab8ded46
2017-07-19 11:57:18 -07:00
Nicholas Nethercote 53662318c9 Bug 1381727 (part 1) - Remove JS_smprintf_free(). r=sfink.
Because it's just a wrapper for js_free().

Furthermore, JS_smprintf() and friends return a JS::UniqueChars, which is also
wired up to free with js_free(). So having the indirection via
JS_smprintf_free() obfuscates things.

--HG--
extra : rebase_source : 1db80199dc801a2684fffe2a5fd5349a42c6941b
2017-07-25 09:09:23 +10:00
Olli Pettay 866053df7a Bug 1384215 - Try to run deferred deletion more likely during idle time, r=mccr8
--HG--
extra : rebase_source : 0dd6ec9641e323959a454d812a9d2f15b1d02982
2017-07-25 22:22:12 +03:00
Kris Maglione cd5c5d6f7f Bug 1383215: Part 5 - Update tests that relied on loading the same JSM from multiple URLs.
MozReview-Commit-ID: KEXGiMrauH7

--HG--
extra : rebase_source : c1b5a1e22c00bdc42cc7cdfae2f4718248c7965d
extra : histedit_source : 968e9daffc7505853aac4b892178f27c3386aec1
2017-07-21 18:01:42 -07:00
Kris Maglione 0fefc0e8c0 Bug 1383215: Part 4 - Use location string as key in modules map. r=mccr8
Using the unmolested module location string as the cache key removes a huge
chunk of overhead when loading cached modules.

This also ensures that multiple URLs are not used to load the same module,
which would result in it being loaded more than once in the new regime

MozReview-Commit-ID: BAWoOJQSTc1

--HG--
extra : rebase_source : e5b295a498caf76e60efec4d174e558e9e55d77b
extra : histedit_source : dd683966b30090b5702264c2903e6050be0e4137
2017-07-24 20:32:42 -07:00
Kris Maglione 5e494303a2 Bug 1383215: Part 3 - Use scache::ResolveURI to resolve module URIs. r=mccr8
Since we now usually load modules from one of the startup caches, we usually
have no need to ever actually create a channel in order to load them.
Resolving the URIs directly is much cheaper in the normal case.

MozReview-Commit-ID: 8W8RMHRnyBa

--HG--
extra : rebase_source : 073ae92c3dc53e86084c1daa1ccfe720ade634c6
extra : histedit_source : cf6cc2b025a839e39aa48bf412ee3a273b549bbe
2017-07-21 15:42:38 -07:00
Kris Maglione 8f6455242f Bug 1383215: Part 1 - Don't resolve module URIs to files when already cached. r=mccr8
MozReview-Commit-ID: KBhXhcJkRjp

--HG--
extra : rebase_source : f5d9852dfa0bbda11d7ceee080bcde7e779c6312
extra : histedit_source : 151752f049ff9e6b2b73de51cbcef0d1d4f31906
2017-07-21 15:11:02 -07:00
Yoshi Huang 7036b3761f Bug 1382531 - Part 1: rewrite crashtest for data: URI is unique opaque origin. r=smaug 2017-07-25 09:56:02 +08:00
Georg Fritzsche 09d533dae9 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-24 09:52:26 -04:00
Florian Quèze d31ab0dd40 Bug 1381853 - Make defineLazyScriptGetter support lazy loading scripts exposing several symbols to the global scope, r=mconley,Mossop. 2017-07-23 00:17:56 +02:00
Florian Quèze 892a7dff17 Bug 1381853 - add defineLazyScriptGetter on XPCOMUtils.jsm, r=mconley. 2017-07-23 00:17:54 +02:00
Wes Kocher d45eb771f0 Merge m-c to inbound, a=merge
MozReview-Commit-ID: Ah48RzFU8Mt
2017-07-21 18:20:46 -07:00
Kris Maglione 2ed607e9ac Bug 1382904: Optimize XPCOMUtils.generateQI. r=florian
XPCOMUtils.generateQI is called a lot, and the current implementation is
especially inefficient. It relies on calling the stringification slow path
twice for each interface ID, which begins to add up fast given how often it's
called.

MozReview-Commit-ID: 2O87wBVMA2G

--HG--
extra : rebase_source : b3d43fbe77990e82702491a58d59c4e439d3d2f8
2017-07-20 18:38:14 -07:00
Brian Hackett a2b14f72a0 Bug 1355109 - Add IC for property reads on xrays, r=jandem,bz.
--HG--
extra : rebase_source : bc62ebf7f9c6fc006e95ede93087370ad7120303
2017-07-21 07:49:53 -07:00
Christoph Kerschbaumer a34dfc464b Bug 1382815 - Convert more tests within js/xpconnect to comply with new data: URI inheritance model. r=smaug 2017-07-21 10:28:47 +02:00
Sebastian Hengst 838439065a Backed out changeset e3825e35e2e2 (bug 1366294) for crashing various tests with [@ TelemetryHistogram::DeInitializeGlobalState()], e.g. in bc's browser_permission_dismiss.js. r=backout on a CLOSED TREE 2017-07-21 15:21:49 +02:00
Georg Fritzsche e6a136758b 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-21 08:41:44 -04:00
Ryan VanderMeulen d229288071 Merge m-c to autoland. a=merge
CLOSED TREE

--HG--
extra : amend_source : 2ab51304cc7df444f22c3aac001a1aba61faee3a
2017-07-21 09:42:41 -04:00
Ehsan Akhgari 33114ba370 Bug 1382324 - Improve SpiderMonkey's pointer hashing function for pointers to neighboring memory locations; r=jandem
This is very similar to the fix to bug 1379282 for the XPCOM hashtables.
2017-07-20 12:23:07 -04:00
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
Boris Zbarsky 58c5f32380 Bug 1381408. Make cross-origin-exposed non-symbol properties enumerable. r=bholley
The list of exposed properties can be gotten via
Object.getOwnPropertyNames/Symbols already, so there's nothing to be won from
the non-enumerability.

The web platform test changes are backports of
https://github.com/w3c/web-platform-tests/pull/6538 and
https://github.com/w3c/web-platform-tests/pull/6571 and
https://github.com/w3c/web-platform-tests/pull/6583

The js/xpconnect/tests/mochitest/*crossOriginObject* tests being removed are
just older versions of the web platfrom test.
2017-07-19 11:47:39 -04: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
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