Commit Graph

66117 Commits

Author SHA1 Message Date
Nicholas Nethercote
6f95417fb4 Bug 1478879 - Remove Range/Enum use in XPConnect. r=mccr8
--HG--
extra : rebase_source : 2117904e70e05e318e2b13a5653f029dfdbed851
2018-07-31 10:31:00 +10:00
Nicholas Nethercote
93bbf0be8b Bug 1478879 - Remove Range/Enum use in devtools/. r=sfink
--HG--
extra : rebase_source : 6ebdd04529e347cc47235355e952f6d59b796383
2018-07-31 10:31:00 +10:00
Nicholas Nethercote
66663fc5fa Bug 1478879 - Remove Range/Enum use in testHashTable.cpp. r=luke
--HG--
extra : rebase_source : 0c1b07d4bbac889c686d95ce0d1182835cb119a6
2018-07-27 12:18:50 +10:00
Nicholas Nethercote
f97954cf65 Bug 1478879 - Remove zero-arg constructor for Range. r=luke
It's only used by InlineTable::Range, and can be avoided by using
mozilla::Maybe.

This also means Range::mTable can be changed from a pointer to a reference,
like Enum::mTable.

--HG--
extra : rebase_source : 35eb5b0bede361c2c765652e1e4c952f128702ef
2018-07-31 10:23:03 +10:00
Nicholas Nethercote
6141e31ef4 Bug 1479954 - Rename Hash{Set,Map}::sizeOf{In,Ex}cludingThis(). r=luke
In PLDHashTable the equivalent functions have a "Shallow" prefix, which makes
it clear that they don't measure things hanging off the table. This patch makes
mozilla::Hash{Set,Map} do likewise.

MozReview-Commit-ID: 3kwCJynhW7d

--HG--
extra : rebase_source : 9c03d11f376a9fd4cfd5cfcdc0c446c00633b210
2018-08-01 09:57:52 +10:00
Ted Campbell
4de97d560b Bug 1480233 - Define compacting GC support in AllocKind.h. r=sfink
MozReview-Commit-ID: H1D21Xv21Ya
2018-08-01 20:28:56 -04:00
dvarga
956d57e7f2 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-08-02 01:26:29 +03:00
dvarga
e487e6e564 Merge inbound to mozilla-central. a=merge 2018-08-02 01:09:38 +03:00
Andreea Pavel
67ce5df76f Backed out 6 changesets (bug 1478499) for failing spidermonkey pkg
Backed out changeset 9dee6a08a2dd (bug 1478499)
Backed out changeset 3982c14a834e (bug 1478499)
Backed out changeset 6f6e562e2013 (bug 1478499)
Backed out changeset 03f68a47b89e (bug 1478499)
Backed out changeset 237dc169f486 (bug 1478499)
Backed out changeset 3f72358d338a (bug 1478499)
2018-08-01 22:22:41 +03:00
Chris Manchester
8f4e7ae4ec Bug 1478499 - Specify the symbol version script for js with SYMBOLS_FILE. r=mshal
To make this work correctly we need to start respecting SYMBOLS_FILE under
js/src, so we start setting GCC_USE_GNU_LD in js/src/config.status to get
this wired up.

MozReview-Commit-ID: HYahjev0VUo

--HG--
extra : rebase_source : 4bba5fbb1b3689854796ece928219293cfc63d19
2018-07-31 16:10:39 -07:00
Chris Manchester
493ea8dbbd Bug 1478499 - Move symbol version script generation for js shared library to moz.build. r=mshal
MozReview-Commit-ID: JF3dtk0ybw2

--HG--
extra : rebase_source : b04a5dae91f8a22f5871c9d0cbc38b83171fe90d
2018-07-31 15:29:42 -07:00
Chris Manchester
6957b72f3f Bug 1478499 - Use JS_LIBRARY_NAME rather than LIBRARY_NAME when versioning js symbols. r=mshal
MozReview-Commit-ID: HkpddK16VG

--HG--
extra : rebase_source : e0e4fe58e6728f151d6f3108fbed984c2245d9b8
2018-07-31 15:17:48 -07:00
Tom Schuster
beccfd4a6a Bug 1473523 - Don't attach SetDenseElement IC when a typed array is on the proto chain. r=anba
--HG--
extra : rebase_source : 2dfbd19f53444bc3b62bc08b45bcd8fc8cd48dce
2018-07-19 22:05:05 +02:00
Tom Schuster
06c42340c3 Bug 1473523 - Implement typed array [[Set]] as a separate function. r=jorendorff
--HG--
extra : rebase_source : d1b3c9eb12e4a85891299f309f8fc12081dabe1a
2018-07-25 14:24:50 +02:00
Jon Coppeard
1cf260e716 Bug 1475228 - Add JSMallocAllocPolicy to let gecko allocate data structures using the JS heap r=jandem 2018-07-17 14:30:23 +01:00
Jon Coppeard
827b83bae3 Bug 1475228 - Allow construction of a SourceBufferHolder from a UniquePtr r=jandem r=kmag 2018-07-17 14:30:23 +01:00
Jon Coppeard
4ff436874c Bug 1475228 - Make asynchronous compile APIs take SourceBufferHolders r=jandem 2018-07-17 14:30:23 +01:00
Jon Coppeard
ec2af16383 Bug 1475228 - Make synchronous compile APIs take SourceBufferHolders exclusively r=jandem r=fitzgen 2018-07-17 14:30:22 +01:00
agashlin@mozilla.com
a95f425a9e bug 1397297, make SnowWhite freeing more incremental, r=smaug
--HG--
extra : rebase_source : b5082f8753039358177bf99116966b0e51959169
2018-08-01 12:20:03 +03:00
Jan de Mooij
84036b8de4 Bug 1474272 part 4 - Stop using js::GetGlobalForObjectCrossCompartment in xpc::NativeGlobal. r=bholley 2018-08-01 11:25:50 +02:00
Jan de Mooij
cf8288afe6 Bug 1474272 part 3 - Call AssertHeapIsIdleOrIterating instead of AssertHeapIsIdle in JS::GetNonCCWObjectGlobal. r=jonco 2018-08-01 11:25:50 +02:00
Jan de Mooij
73ec31509e Bug 1474272 part 2 - Use more precise types in Promise code and add some assertions. r=bz 2018-08-01 11:25:49 +02:00
Philip Chimento
ae07b742a8 Bug 1458382 - Repeat GCC bug workaround in another place. r=sstangl 2018-07-27 12:31:30 -04:00
Paul Bone
7e1a1e1400 Bug 1479360 - Share and optimize bump-pointer allocation code r=sfink
--HG--
extra : rebase_source : d1fed866371f8ff6698e2d8dbf103199778fe1d4
extra : histedit_source : aa09c06e71b94e0f59b787795d2b760f81830d42%2C76fa097963924f79e13187c2dfa9dcf6a46f491d
2018-08-01 14:51:40 +10:00
Tooru Fujisawa
1208955167 Bug 1478854 - Disable tests for uncomplete JSScript and inner LazyScript in ccov. r=nbp 2018-08-01 11:20:02 +09:00
Paul Bone
bd066354c6 Bug 1478902 Part 3 - Add assertions to JIT nursery strings allocation r=nbp,sfink
--HG--
extra : rebase_source : 102914ae75616d8989b91dfdb3bacee14356033a
2018-07-31 15:37:26 +10:00
Paul Bone
9133f15f25 Bug 1478902 Part 2 - Nursery strings allocation code uses the wrong pointer r=sfink
Some of the allocation code here uses the wrong pointer for the strings
nursery position.  The bug is benign because the nursery is shared.

--HG--
extra : rebase_source : 27a14aa077d8de6e616d26759aa4e8e0a6bb5bb9
2018-07-30 14:35:11 +10:00
Paul Bone
bf12405840 Bug 1478902 Part 1 - Improve types in nursery allocation r=nbp
--HG--
extra : rebase_source : 9d50285d4f28483a2089f7b2e760faceb37aa33c
extra : source : 2278d3706d90e92511c4bd6942afa8987e9ad54f
2018-07-30 14:35:51 +10:00
Bogdan Tara
eb256a84b2 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-08-01 01:07:12 +03:00
Bogdan Tara
9c44097a0d Merge inbound to mozilla-central. a=merge 2018-08-01 00:58:55 +03:00
Nika Layzell
7fa88ded1b Bug 1474369 - Part 8: Rename from Sequence to Array in xpidl, r=mccr8
Summary:
This more closely matches the C++ names, and reflects the fact that the
reflected type is not WebIDL's mozilla::dom::Sequence. The reasoning behind this
type difference is for ergonomics, due to xpidl only being exposed to internal
JS code.

Depends On D2335

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1474369

Differential Revision: https://phabricator.services.mozilla.com/D2337
2018-07-31 17:53:03 -04:00
Nika Layzell
cb71d3b003 Bug 1474369 - Part 7: Rename [array] to LegacyArray within xpt and xpidl, r=mccr8
Summary:
This is done so we can use Array as the name for the new nsTArray-based
type, rather than having to come up with a new name.

LegacyArray was chosen as the [array] attribute is now effectively deprecated,
and we'd like to remove it ASAP.

Depends On D2334

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1474369

Differential Revision: https://phabricator.services.mozilla.com/D2335
2018-07-31 17:53:03 -04:00
Nika Layzell
f900f5239d Bug 1474369 - Part 6: Use RefPtr for Array<T> of interface and WebIDL types, r=mccr8
Summary:
This means that using these types involves many fewer footguns, while not
requiring any changes to the actual XPConnect implementation!

Depends on D2111

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1474369

Differential Revision: https://phabricator.services.mozilla.com/D2334
2018-07-31 17:53:03 -04:00
Nika Layzell
5b6ca0e475 Bug 1475409 - Part 3: Make the different categories of types in xptinfo more explicit, r=mccr8
Summary:
This should make it more clear which types have which behaviours, and should
make it easier to add new types without forgetting to handle a special case
somewhere.

Depends On D2114

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1475409

Differential Revision: https://phabricator.services.mozilla.com/D2115
2018-07-31 17:53:02 -04:00
Nika Layzell
985488cb0f Bug 1475409 - Part 2: Be more explicit about the type of nsXPTType::Tag(), r=mccr8
This will get us both more clarity as to what types are, but also will improve switch exhaustiveness checks.

Summary: Depends On D2113

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1475409

Differential Revision: https://phabricator.services.mozilla.com/D2114
2018-07-31 17:53:02 -04:00
Nika Layzell
2cb67382dc Bug 1475409 - Part 1: Remove nsXPTType::TagPart(), r=mccr8
Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1475409

Differential Revision: https://phabricator.services.mozilla.com/D2113
2018-07-31 17:53:02 -04:00
Nika Layzell
cd11b005fc Bug 1474369 - Part 5: Add tests for new Sequence<T> types, r=mccr8
Summary: Depends On D2110

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1474369

Differential Revision: https://phabricator.services.mozilla.com/D2111
2018-07-31 17:53:01 -04:00
Nika Layzell
d4c9b9edf4 Bug 1474369 - Part 4: Add support for Sequence<T> types to xpidl and XPConnect, r=mccr8
Summary:
This patch adds support for the `Sequence<T>` type. This is largely a
straightforward type propagation patch, but there are a few notable things:

 1. We allow `[iid_is(x)] Sequence<nsQIResult>`, so Sequence can be Dependent.

 2. `Sequence<T>` is reflected into C++ as a `nsTArray<T>`, which is different
    than WebIDL's `mozilla::dom::Sequence<T>` type. This decision was made for
    general ergonomics reasons, as `nsTArray<T>` is more prevailent throughout
    the codebase, and lengths in this case cannot be controlled by content, as
    XPConnect is only exposed to Chrome JS.

 3. Owned pointers in `Sequence<T>` are not reflected as their owned
    counterparts. For example, `Sequence<nsISupports>` is reflected as
    `nsTArray<nsISupports*>` rather than `nsTArray<RefPtr<nsISupports>>`. This
    was done to avoid depending on `RefPtr<T>` and `T*` having the same
    in-memory representation, however if that is considered an acceptable
    dependency, it would be nice to support that.

 4. We also don't reflect singly-owned pointers as their owned counterparts. For
    example, `nsTArray<nsIIDPtr>` would be reflected as `nsTArray<nsIID*>`
    rather than `nsTArray<mozilla::UniquePtr<nsIID>>`. If we are willing to
    depend on `mozilla::UniquePtr<T>`'s in-memory representation, we could also
    do this, however.

 5. There are no restrictions on what types can appear inside of a `Sequence<T>`
    or what can appear inside an `[array] T`. We may want to add restrictions
    either at the xpidl level or in XPConnect.

Depends On D2109

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1474369

Differential Revision: https://phabricator.services.mozilla.com/D2110
2018-07-31 17:53:01 -04:00
Nika Layzell
71fd37e0c9 Bug 1474369 - Part 2: Make JSArray2Native and NativeArray2JS more generic, so they can be used with Sequence<T>, r=mccr8
Summary:
The background logic for handling lists of XPConnect values is similar between
`[array] T` and `Sequence<T>`. The major differences are with regard to how
native length is determined, how 'null' and 'undefined' are handled, and how
native buffer allocation is handled.

This patch modifies the JSArray2Native function to make it generic over an
allocation strategy function, which can be implemented for each of `[array] T`
and `Sequence<T>`. The function takes in a `uint32_t*` pointer, pointing at the
computed length of the JS array. The callback can then allocate the correct
backing buffer, and optionally modify the length to copy.

The NativeArray2JS function is also modified to make it directly take a pointer
to the native buffer rather than determining it from a pointer to an `[array] T`
parameter.

Depends On D2105

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1474369

Differential Revision: https://phabricator.services.mozilla.com/D2106
2018-07-31 17:53:00 -04:00
Nika Layzell
5ee2c61291 Bug 1474369 - Part 1: Clean up value initialization codepaths in XPConnect, r=mccr8
Summary:
A goal of the Sequence<T> work is to allow using more complex types within lists
in XPConnect. For example, we ideally want to support `Sequence<AString>`,
rather than requiring people to use the unergonomic 'wstring' type.

These types require initialization before they can be read into. Currently this
initialization for parameters is directly handled by XPCWrappedNative's
CallMethodHelper object.

This patch introduces a new function to the `xpc` namespace to initialize a
specific value from an uninitialized state to a safe state.

Reviewers: mccr8!

Tags: #secure-revision

Bug #: 1474369

Differential Revision: https://phabricator.services.mozilla.com/D2105
2018-07-31 17:53:00 -04:00
Nika Layzell
95fd91c8e3 Bug 1471726 - Part 2: Add basic tests for jsval array codegen, r=mccr8 2018-07-31 17:52:59 -04:00
Bogdan Tara
642f18b262 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-07-31 21:32:12 +03:00
Gijs Kruitbosch
dcbec7c8b6 Bug 1478404 - remove _xpcom_categories annotations as they're dead code, r=florian
Support for the _xpcom_categories property was removed in Bug 568691,
but we left a bunch of consumers behind, and it's been cargo-culted a bit more.
We should remove the remaining remnants.

Differential Revision: https://phabricator.services.mozilla.com/D2429

--HG--
extra : moz-landing-system : lando
2018-07-31 17:39:25 +00:00
Jon Coppeard
79f79d4af0 Bug 1479388 - Move most WeakMap inline method definitions into a separate header r=sfink 2018-07-31 10:06:06 +01:00
shindli
bd8a5ade23 Backed out changeset e988c40d5519 (bug 1479388) for spidermonkey bustages in /builds/worker/workspace/build/src/js/src/vm/Debugger-inl on a CLOSED TREE 2018-07-31 11:56:47 +03:00
Jon Coppeard
e0ec59962b Bug 1479388 - Move most WeakMap inline method definitions into a separate header r=sfink 2018-07-31 09:50:08 +01:00
Jan de Mooij
0868c2088f Bug 1479363 part 9 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in js/src. r=luke 2018-07-31 08:37:48 +02:00
Jan de Mooij
fa4de44430 Bug 1479363 part 8 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in js/xpconnect/wrapper. r=bholley 2018-07-31 08:37:38 +02:00
Jan de Mooij
43f54ada0c Bug 1479363 part 7 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in js/xpconnect/src. r=mrbkap 2018-07-31 08:37:26 +02:00
Nicholas Nethercote
b85493f609 Bug 1477626 - Move js::Hash{Set,Map} into MFBT. r=Waldo
The main change is that the patch copies js/public/HashTable.h to
mfbt/HashTable.h, and then changes it as follows.

- Changes `js` namespaces to `mozilla` (and removes some now-unnecessary
  `mozilla::` qualifiers).

- Changes the default AllocPolicy from the SpiderMonkey-specific
  `TempAllocPolicy` to the generic `MallocAllocPolicy`.

- Adds `#include "AllocPolicy.h"` (like mfbt/Vector.h).

- Changes `JS_DEBUG` use to `DEBUG`.

- Minor comment updates, as necessary.

js/public/HashTable.h is now tiny, holding just a few renamings of things from
the `mozilla` namespace into the `js` namespace to minimize churn elsewhere.
(Those renamings keep `TempAllocPolicy` as the default AllocPolicy for
js::Hash{Set,Map}.)

Also, various template specializations had to be moved from the `js` namespace
to the `mozilla` namespace to avoid compile errors.

MozReview-Commit-ID: GS9Qn9YeYDA

--HG--
rename : js/public/HashTable.h => mfbt/HashTable.h
2018-07-26 20:15:49 +10:00