Commit Graph

6454 Commits

Author SHA1 Message Date
Markus Stange
423ce68542 Bug 1462784 - Relabel various other stuff as being OTHER. r=njn
Any more specific work that is happening in these methods will have its own
specific category labeling in that specific code. The instances touched in this
patch are more on the outside and don't really know what kind of code is going
to be running inside.

MozReview-Commit-ID: 47NO1DZzkdH

--HG--
extra : rebase_source : 344c380ddaaf42a1fd820a26b762c61ee9e2d524
2018-05-18 17:58:43 -04:00
Csoregi Natalia
fc2ed6e92a Backed out 18 changesets (bug 1462784) for ESlint failure on FlameGraph.js:1297. CLOSED TREE
Backed out changeset 79556798ff9f (bug 1462784)
Backed out changeset 88321efb673b (bug 1462784)
Backed out changeset 7880f9dc7023 (bug 1462784)
Backed out changeset 71fe35fd1f7e (bug 1462784)
Backed out changeset a543b94b049a (bug 1462784)
Backed out changeset d1ca8b0f2221 (bug 1462784)
Backed out changeset 68eabfbf3c16 (bug 1462784)
Backed out changeset 34e71c789903 (bug 1462784)
Backed out changeset 6fe79d1ca1bd (bug 1462784)
Backed out changeset e5ad2e525ea9 (bug 1462784)
Backed out changeset 329645ff1e23 (bug 1462784)
Backed out changeset e09c38853172 (bug 1462784)
Backed out changeset 0663d1a6d2da (bug 1462784)
Backed out changeset 106967fc29d2 (bug 1462784)
Backed out changeset 99b4a433a8e5 (bug 1462784)
Backed out changeset 1d38a4cf5a4a (bug 1462784)
Backed out changeset 692017229de6 (bug 1462784)
Backed out changeset c2911a626671 (bug 1462784)
2018-06-01 23:42:00 +03:00
Markus Stange
3f54b9a3dd Bug 1462784 - Relabel various other stuff as being OTHER. r=njn
Any more specific work that is happening in these methods will have its own
specific category labeling in that specific code. The instances touched in this
patch are more on the outside and don't really know what kind of code is going
to be running inside.

MozReview-Commit-ID: 47NO1DZzkdH

--HG--
extra : rebase_source : f807c14bf6a592e0c651e15b63d1e7d63e4b0159
2018-05-18 17:58:43 -04:00
Noemi Erli
7bfa96a42b Backed out 4 changesets (bug 1464909) for failures in devtools/client/performance/test/unit/test_tree-model-08.js r=mstange on a CLOSED TREE
Backed out changeset 119c2055e002 (bug 1464909)
Backed out changeset 562aeeced55b (bug 1464909)
Backed out changeset c1e1d74ad27e (bug 1464909)
Backed out changeset 11670c51f572 (bug 1464909)
2018-06-01 01:23:49 +03:00
Noemi Erli
1fd69fa2bc Backed out 18 changesets (bug 1462784) for failures in devtools/client/performance/test/unit/test_tree-model-08.js on a CLOSED TREE
Backed out changeset a74d36598442 (bug 1462784)
Backed out changeset c8192175f360 (bug 1462784)
Backed out changeset cde492240e99 (bug 1462784)
Backed out changeset 8c8d30fa406c (bug 1462784)
Backed out changeset ad3802ffb780 (bug 1462784)
Backed out changeset 2fe10732076c (bug 1462784)
Backed out changeset 268a72b7c3c4 (bug 1462784)
Backed out changeset 4055eb6c3bc6 (bug 1462784)
Backed out changeset 3901070e2e60 (bug 1462784)
Backed out changeset 2faf787fbbdf (bug 1462784)
Backed out changeset 8f06963c7c6f (bug 1462784)
Backed out changeset 036e6f64e224 (bug 1462784)
Backed out changeset e670f156a603 (bug 1462784)
Backed out changeset cd39588aece4 (bug 1462784)
Backed out changeset 2ac65d100fa2 (bug 1462784)
Backed out changeset ea05ff70a51d (bug 1462784)
Backed out changeset 8a06c0ba42f7 (bug 1462784)
Backed out changeset 52ed9a039ad2 (bug 1462784)
2018-06-01 01:06:29 +03:00
Noemi Erli
614b78ae36 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-06-01 00:58:09 +03:00
Markus Stange
76dc63b77e Bug 1464909 - Add the "GC / CC" category to AsyncFreeSnowWhite::Run. r=smaug
MozReview-Commit-ID: KEZUstzTHhn

--HG--
extra : rebase_source : 6db5ea2c5ca4e8d1802a0c71915bfe1d2dbf7326
2018-05-31 14:08:24 -04:00
Markus Stange
d80822de42 Bug 1462784 - Relabel various other stuff as being OTHER. r=njn
Any more specific work that is happening in these methods will have its own
specific category labeling in that specific code. The instances touched in this
patch are more on the outside and don't really know what kind of code is going
to be running inside.

MozReview-Commit-ID: 47NO1DZzkdH

--HG--
extra : rebase_source : 35362bc94068103367f46b23a14cb3831cd86990
2018-05-18 17:58:43 -04:00
Noemi Erli
8e2471b6cb Backed out 8 changesets (bug 1458375) for Mochitest leaks on a CLOSED TREE
Backed out changeset 30a743401670 (bug 1458375)
Backed out changeset ae969e1cebfb (bug 1458375)
Backed out changeset 1fb76b9b6f82 (bug 1458375)
Backed out changeset 868da3a1b94a (bug 1458375)
Backed out changeset bd2cba9dfb3d (bug 1458375)
Backed out changeset 715850ae92a1 (bug 1458375)
Backed out changeset cfe8da250de7 (bug 1458375)
Backed out changeset 2968c0a21410 (bug 1458375)
2018-05-31 22:38:48 +03:00
Mike Conley
7c11f30a6f Bug 1458375 - Make ScriptPreloader stop recording after browser-idle-startup-tasks-finished. r=kmag
The ScriptPreloader stopped recording before browser-delayed-startup-finished before, but there
are other scripts (both in the parent and content processes) that might run soon after that we
also want to cache. This increases the probability that those scripts are noted by the
ScriptPreloader cache.

MozReview-Commit-ID: KiBEVvuqQkA

--HG--
extra : rebase_source : 4c1bffa882b0641f93260867ac8a4334b1269e99
2018-05-29 12:55:21 -04:00
Steve Fink
0680fed494 Bug 1464266 - Rename GCForReason to NonIncrementalGC, r=jonco
--HG--
extra : topic : GCForReason
extra : rebase_source : e81bf7bb8ca0824f8b63f25a46ccbe26c4002325
2018-05-24 16:19:18 -07:00
Jan de Mooij
45e968b1dd Bug 1464134 part 8 - Make IterateHeapUnbarriered and related code use realms instead of compartments. r=jonco 2018-05-30 20:14:19 +02:00
Jan de Mooij
732a7c63d6 Bug 1464134 part 7 - Replace GetAnyCompartmentInZone with GetAnyRealmInZone. r=luke 2018-05-30 20:14:19 +02:00
Jan de Mooij
f3fe2d13d4 Bug 1465472 - Remove the atoms realm/compartment. r=jonco
Some of the less trivial changes:

* When we allocated a symbol, we used the atom realm's RNG to create a hash code [0]. Instead of this I added a RNG for this to the runtime.

* IsCompilingWasm returned true if the JitContext's realm is nullptr, but that's now also true when we initialize the trampolines stored in the atoms zone. To fix that I added a CompileZone* to JitContext, in addition to the CompileRuntime and CompileRealm, and we now check the zone instead of the realm in IsCompilingWasm.

* JSContext::hasEnteredRealm is only called in DEBUG builds so I made hasEnteredRealm and enterRealmDepth_ #ifdef DEBUG.
2018-05-31 12:53:26 +02:00
Jan de Mooij
37e765587c Bug 1464374 part 7 - Use GetRealmPrincipals in GetCompartmentName. r=luke
This will become GetRealmName at some point.
2018-05-31 11:28:49 +02:00
Jan de Mooij
1edb6a4c17 Bug 1464374 part 6 - Use GetRealmPrincipals in Scriptability constructor. r=bz 2018-05-31 11:28:49 +02:00
Boris Zbarsky
89366855ba Bug 1455676 part 1. Make it possible to importGlobalProperties Node. r=qdot 2018-05-29 22:58:47 -04:00
Boris Zbarsky
69db48b9c0 Bug 1047514. Re-enable the test_getWebIDLCaller test on Android. r=kmag 2018-05-29 13:38:53 -04:00
Tom Schuster
30cc5c7f25 Bug 1465039 - Rename Array.prototype.flatten to Array.prototype.flat. r=anba
--HG--
extra : rebase_source : aa2aa39508dd22d7e380e1996d559bf03d7478eb
2018-05-29 13:23:06 +02:00
Peter Van der Beken
0a2e4b8cb7 Bug 1146316 - Remove nsWrapperCache::SetIsNotDOMBinding and IsDOMBinding(). r=bz.
--HG--
extra : rebase_source : cd36e7afb4f6ebcd042ea40d9403546a683375ad
2018-04-05 17:22:41 +02:00
Peter Van der Beken
6e33f1d567 Bug 1146316 - Preserve the wrapper of sandboxes, so that we never try to call WrapObject on them. r=bz.
--HG--
extra : rebase_source : 00519dbe00d048000b2febdcd69e9232a79b5388
2018-04-11 11:52:13 +02:00
Boris Zbarsky
ed3c958547 Bug 1463889 part 1. Switch nsPIDOMWindowOuter::GetFrames to returning an nsDOMWindowList. r=qdot 2018-05-24 23:32:19 -04:00
Kris Maglione
ed0d691f13 Bug 1461012: Add CC optimizations for PrecompiledScript objects. r=mccr8
Tracing the script members held alive by PrecompiledScript objects can be
expensive, especially for large scripts. It would be nice if we could avoid
tracing them when possible.

Most of the time, when PrecompiledScripts are alive, they're held alive by
black roots, and have black JS wrappers. In those cases, there's no chance of
them creating garbage cycles, and we can just mark their script children
black.

MozReview-Commit-ID: KnkJfznJZBx

--HG--
extra : rebase_source : da0da30265c3f752c9aba177bf510937a743e49e
2018-05-11 15:57:31 -07:00
Tom Schuster
937d9326cd Bug 1453916 - Allow canvas extraction from webextension content-script even with resistFingerprinting turned on. r=kmag,bz
--HG--
extra : rebase_source : d67c589e8819407bb5acc4378d029288dd9295be
2018-05-14 20:49:32 +02:00
Kris Maglione
8134b33e89 Bug 1462964: Remove obsolete nsIDOMBlob interface. r=bz
MozReview-Commit-ID: 2HIlaSrvfBe

--HG--
extra : rebase_source : 944a6244dbfe1f0a37dd34a041d1329624a86f93
extra : histedit_source : d7859be664fed00f8504e40969480d3af3d674e7%2C4456b502db338bd06823654306e47c2583101396
2018-05-21 17:32:44 -07:00
Jan de Mooij
f820ec7afa Bug 1461938 part 5 - Some atoms compartment/realm related changes. r=jonco 2018-05-18 15:18:23 +02:00
Jan de Mooij
575aec161b Bug 1461677 - Rename compartment to realm in the memory reporting code. r=njn 2018-05-17 16:15:18 +02:00
Jan de Mooij
17f3983d0f Bug 1461605 part 1 - Rename CompartmentOptions to RealmOptions. r=luke,bz 2018-05-17 10:59:45 +02:00
Kris Maglione
166dab340b Bug 1461062: Follow-up: Fix rebase bustage. r=bustage CLOSED TREE
MozReview-Commit-ID: 2fjL5eCL2xP

--HG--
extra : amend_source : 1fef859835028292ca163d840a61077bf05fcc06
2018-05-16 19:07:01 -07:00
Ciure Andrei
eab785689c Backed out 2 changesets (bug 1458043) for dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway_inproc.html failures a=backout
Backed out changeset 0b5c103fcb70 (bug 1458043)
Backed out changeset 51cdd0595094 (bug 1458043)
2018-05-17 00:54:04 +03:00
Jan de Mooij
80e44e8003 Bug 1461292 part 1 - Rename JSAutoCompartment to JSAutoRealm. r=bz,luke 2018-05-16 10:53:16 +02:00
Felipe Gomes
fd0a264b26 Bug 1457988 - Implement XPCOMUtils.defineLazyProxy. r=kmag
This implements a new kind of lazy getter in XPCOMUtils that creates an object (implemented as a JS Proxy) that is resilient to be passed around as references to other functions, and will only evaluate the getter when it really needs to be used
2018-05-15 19:49:17 -03:00
Peter Van der Beken
d73809b86f Bug 1453011 - Remove PostCreatePrototype. r=bz.
--HG--
extra : rebase_source : 6c096b964e43a3460a092b0f0b1ed9b512fd98c9
2018-03-22 11:31:05 +01:00
Peter Van der Beken
33304e70f6 Bug 1453011 - Remove some unused nsIXPCScriptable flags. r=bz.
--HG--
extra : rebase_source : bd116870762e7b9b0fcae558039c3522acb30009
2018-03-22 10:37:43 +01:00
Peter Van der Beken
1cd3ab60da Bug 1453011 - Remove nsXPCClassInfo. r=bz.
--HG--
extra : rebase_source : 4f137f69ad8613c149a25260c3ceeb029b823117
2018-03-22 09:42:21 +01:00
Peter Van der Beken
ddfc4b6022 Bug 1452981 - Remove qsObjectHelper. r=bz.
--HG--
extra : rebase_source : f87d70c72bd720cd57377b4b70fdf8ecec590086
2018-05-02 11:47:02 +02:00
Nika Layzell
84d0194704 Bug 1458043 - Part 1: Stop converting promises to nsISupports in xpconnect, r=bz 2018-05-14 17:55:58 -04:00
Nika Layzell
3043db4105 Bug 1457972 - Part 10: Make sure to allocate ExtendedVal inline, r=froydnj 2018-05-14 17:55:57 -04:00
Nika Layzell
70dbf079a4 Bug 1457972 - Part 9: Allow passing invalid values to xpidl arrays for compat reasons, r=mccr8
This one sucks. I found out when running tests that we exploit some edge
case behaviour in our tests where passing an invalid value to an xpidl
array parameter will be passed as an empty array...

I figured that just respecting this behaviour for now is the easiest
approach, but we will probably want to fix it in the future.
2018-05-14 17:55:57 -04:00
Nika Layzell
656ad38909 Bug 1457972 - Part 8: Remove external consumers of XPCConvert::NativeArray2JS/JSArray2Native, r=mccr8
Current XPIDL native arrays currently also require a custom entry point. With
the new arraylen parameter we can handle them in JSData2Native/NativeData2JS. As
these methods are more complex and don't share logic with an existing codepath,
I keep them in external helper methods.
2018-05-14 17:55:57 -04:00
Nika Layzell
3efaead212 Bug 1457972 - Part 7: Eliminate XPCConvert::NativeStringWithSize2JS/JSStringWithSize2Native, r=mccr8
XPIDL supports explicitly sized string types. These types currently have to be
handled by a separate entry point into XPCConvert, and don't share any logic
with the implicitly sized string types.

If we just add an array length parameter to the basic JSData2Native and
NativeData2JS methods we can handle them in the same place as every other type.

This also allows us to share a lot of code with non-sized string types, which is
nice :-).
2018-05-14 17:55:56 -04:00
Nika Layzell
e97495d7b3 Bug 1457972 - Part 5: Use modern JS APIs to root jsval temporaries in XPConnect, r=mccr8
When a jsval passed from JS code it needs to be stored in a nsXPTCVariant
object. This object is not rooted by default, as it is stored in some
C++-allocated memory. Currently, we root the values by adding a custom root
using the `js::AddRawValueRoot` API, which is deprecated, and only used by this
code and ErrorResult.

This also has the unfortunate effect that we cannot support XPCOM arrays of
jsvals, as we cannot root all of the values in the array using this API.

Fortunately, the JS engine has a better rooting API which we can use here
instead. I make the call context a custom rooter, like the SequenceRooter type
from WebIDL, and make sure to note every jsval when tracing, both in arrays and
as direct values.

This should allow us to avoid some hashtable operations with roots when
performing XPConnect calls, and remove a consumer of this gross legacy API.

In addition it allows us to support arrays. This will be even more useful in the
future when I add support for sequence<T> (which is a nsTArray<T>) to xpidl and
xpconnect.
2018-05-14 17:55:55 -04:00
Nika Layzell
e2240ec5a2 Bug 1457972 - Part 4: Remove dipper types, r=mccr8
In XPConnect, native values are passed around within nsXPTCMiniVariant objects.
an [nsXPTCMiniVariant] contains 64-bits of data in a union type.

nsXPTCMiniVariant values are created by the platform-specific glue code and
passed into XPConnect proper when calling from C++ into JS.

When calling from JS into C++, we instead create nsXPTCVariant objects and pass
them into the glue code. These objects have extra information in addition to the
nsXPTCMiniVariant: namely they also have a `type` field with the type stored in
the variant, space for flags, and a `ptr` field which is passed over IPC instead
of the inner nsXPTCMiniVariant when a flag (`PTR_IS_DATA`) is set.

The JSValue type in XPConnect is always passed as a pointer to a JSValue object,
both for in parameters and out parameters. This is handled by making the JSValue
type be unconditionally flagged as [`IsIndirect()`] This flag is also used for
all types of outparameters.

When the `IsIndirect()` flag is set, it means that the actual data is stored in
the nsXPTCVariant's val field, and it sets the flag to tell the glue code to
instead pass the `ptr` field (which is always pointing to the `val` field for
[legacy reasons]) into the C++ code.

In contrast "dipper" is a different and super weird flag. Currently only the
string class types (nsACString & nsAString) are marked as "dipper". A "dipper"
type is always passed as an "in" type (and thus always passed "directly"), even
when it's actually an out parameter.

XPConnect treats these types as though they are pointer types (nsAString*). This
means that there is no space in the nsXPTCVariant to store the actual nsAString
types when passing from JS into C++, so these values have to be allocated by a
different mechanism (in the current code, there is a size 2 buffer for each
string type in the context and once that buffer is exceeded, we heap allocate
the nsString values).

In effect, the current state looks something like this:
+------------+---------------------+---------------------+
| type       | out (xpt/native)    | in (xpt/native)     |
+------------+---------------------+---------------------+
| TD_INT32   | indirect (int32_t*) | direct (int32_t)    |
+------------+---------------------+---------------------+
| TD_JSVAL   | indirect (JSValue*) | indirect (JSValue*) |
+------------+---------------------+---------------------+
| TD_ASTRING | direct (nsAString*) | direct (nsAString*) |
+------------+---------------------+---------------------+

This patch ensures there is enough space in the nsXPTCVariant to fit the
nsString value, and switches string class types to being unconditionally
indirect instead of using the dipper system. This allows us to delete a ton of
dipper-specific code, and unify the indirect and string class codepaths.

This only affects the size of nsXPTCVariant objects, and does not affect
nsXPTCMiniVariant objects. nsXPTCVariant objects are never allocated by the
platform-specific binding code, rather, they are allocated in an AutoTArray on
the stack as part of the CallMethodHelper object.

The size increase is a total of 1 word, so 4 bytes in 32-bit builds, and 8 bytes
in 64-bit builds, which is ignorable for stack allocated objects.

[nsXPTCMiniVariant]: https://searchfox.org/mozilla-central/rev/eb6c5214a63e20a3fff455e92c876287a8d2e188/xpcom/reflect/xptcall/xptcall.h#20-47
[`IsIndirect()`]: https://searchfox.org/mozilla-central/rev/c0d81882c7941c4ff13a50603e37095cdab0d1ea/xpcom/reflect/xptinfo/xptinfo.h#371
[legacy reasons]: https://searchfox.org/mozilla-central/rev/eb6c5214a63e20a3fff455e92c876287a8d2e188/xpcom/reflect/xptcall/xptcall.h#66-79
2018-05-14 17:55:55 -04:00
Nika Layzell
f20e777cdb Bug 1457972 - Part 2: Remove unused code paths in xpconnect, r=mccr8
Thanks to the changes in the previous patch, we had some unused code which we
can get rid of. This patch just cleans stuff up a bit.
2018-05-14 17:55:54 -04:00
Nika Layzell
73efb8abf3 Bug 1457972 - Part 1: Unify xpconnect cleanup codepaths, r=mccr8
It used to be that in XPConnect there were many different pieces of code for
each place where we may need to clean up some untyped values based on their
nsXPTType information. This was a mess, and meant that every time you needed to
add a new data type you'd have to find every one of these places and add support
for your new type to them.

In fact, this was bad enough that it appears that I missed some places when
adding my webidl support! Which means that in some edge cases we may clean up
one of these values incorrectly D:!

This patch adds a new unified method which performs the cleanup by looking at a
nsXPTType object. The idea is that this function takes a void* which is actually
a T* where T is a value of the nsXPTType parmaeter. It clears the value behind
the pointer to a valid state such that free-ing the memory would not cause any
leaks. e.g. it free(...)s owned pointers and sets the pointer to `nullptr`, and
truncates nsA[C]String values such that they reference the static empty string.

I also modify every one of these custom cleanup codepaths to instead call into
this unified cleanup method.

This also involved some simplification of helper methods in order to make the
implementation cleaner.
2018-05-14 17:55:54 -04:00
Nika Layzell
9c090cb316 Bug 1455217 - Part 2: Add support for promises to XPCConvert, r=mccr8 2018-05-14 17:55:53 -04:00
Jon Coppeard
0924042900 Bug 1456774 - Remove linear search for finished parse task and type off thread parse token r=jandem r=baku 2018-05-10 14:51:14 +01:00
Ciure Andrei
de05fd66c8 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-05-09 02:02:05 +03:00
Mark Banner
9c03ace970 Bug 1458235 - Fix various cases where Assert.ok or Assert.equal have been called wrongly. r=Gijs
MozReview-Commit-ID: Br3lKpKNVQJ

--HG--
extra : rebase_source : 972c69ecf63bb522b0f368e3c388f4eff558bbe3
2018-05-01 22:15:43 +01:00
Chris Peterson
71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00