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

55 Коммитов

Автор SHA1 Сообщение Дата
Barret Rennie 9d33bd810d Bug 1289211 - Rename InfallibleTArray to nsTArray in xpcom/ r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D36970

--HG--
extra : moz-landing-system : lando
2019-07-10 03:33:59 +00:00
Sylvestre Ledru 03c8e8c2dd Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-05 21:41:42 +00:00
Csoregi Natalia ba58e936bd Backed out changeset 4ad80127f89f (bug 1519636) for bustage on MarkupMap.h and nsAccessibilityService.cpp. CLOSED TREE 2019-04-05 09:48:19 +03:00
Sylvestre Ledru d1c1878603 Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-04 21:36:16 +00:00
Narcis Beleuzu 24dbe577a5 Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE 2019-04-05 00:27:56 +03:00
Sylvestre Ledru 399dbd28fe Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-04 20:12:23 +00:00
Cameron McCormack eedb6aebd4 Bug 1538081 - Part 3: Add operator<<(ostream&) definitions for a few common types. r=froydnj,gerald
Depends on D25023

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

--HG--
extra : moz-landing-system : lando
2019-03-30 04:26:26 +00:00
Ciure Andrei 615006146b Backed out 4 changesets (bug 1538081) for causing BaseElf.cpp bustages CLOSED TREE
Backed out changeset ced61a86c74c (bug 1538081)
Backed out changeset d6d331abbf0e (bug 1538081)
Backed out changeset 26df801e44db (bug 1538081)
Backed out changeset 113ac188a69e (bug 1538081)
2019-03-30 03:02:15 +02:00
Cameron McCormack 91e3ec9952 Bug 1538081 - Part 3: Add operator<<(ostream&) definitions for a few common types. r=froydnj,gerald
Depends on D25023

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

--HG--
extra : moz-landing-system : lando
2019-03-30 00:21:24 +00:00
Jon Coppeard e16c189b22 Bug 1306008 - Replace ObjectPtr with JS::Heap<JSObject*> r=sfink
Heap<JSObject*> is now equivalent to ObjectPtr so we can remove the latter.

Differential Revision: https://phabricator.services.mozilla.com/D25084
2019-03-27 16:26:22 +00:00
Doug Thayer b172543596 Bug 1441308 - Core renderroot splitting changes r=kats,sotaro
This is a large patch that contains all of the core changes for
renderroot splitting.

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

--HG--
extra : moz-landing-system : lando
2019-03-22 18:28:42 +00:00
Ciure Andrei 3de853018a Backed out 7 changesets (bug 1441308)for causing webrender build bustages CLOSED TREE
Backed out changeset 1764701d11d1 (bug 1441308)
Backed out changeset 32f7793dfd1a (bug 1441308)
Backed out changeset d8b4d6ec9b40 (bug 1441308)
Backed out changeset e2f83e4816dd (bug 1441308)
Backed out changeset baee8ada680f (bug 1441308)
Backed out changeset c09a51622e98 (bug 1441308)
Backed out changeset 737807563dd5 (bug 1441308)
2019-03-22 10:52:44 +02:00
Doug Thayer 5b3a0454a4 Bug 1441308 - Core renderroot splitting changes r=kats,sotaro
This is a large patch that contains all of the core changes for
renderroot splitting.

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

--HG--
extra : moz-landing-system : lando
2019-03-22 03:15:14 +00:00
Nathan Froyd c14951813a Bug 1523948 - avoid bounds checks in nsTArray binary search methods; r=erahm
We already take steps in `IndexOf` to avoid bounds checks--by using
direct pointer accesses--and we should do the same thing for binary
searches as well.
2019-01-30 17:26:27 -05:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Nathan Froyd 28aa04a6d1 Bug 1483699 - part 2 - make InsertSlotsAt error checking more thorough; r=mccr8
I don't know what the existing code was trying to do, but it certainly
wasn't clear, and possibly not correct.
2018-10-08 10:39:44 -04:00
Nathan Froyd 1e6d9316da Bug 1483699 - part 1 - add overflow checks for extending arrays; r=mccr8 2018-10-08 10:39:44 -04:00
Gerald Squelart bad49db9b0 Bug 1479996 - Combine nsTArray::IndexOf and element access into lambda-friendly functions - r=froydnj
In many places, nsTArray::IndexOf is followed by accessing that element
(hopefully with `Elements() + index`, which skips unnecessary bounds checks.)
But this pattern introduces operations that could be avoided:
- IndexOf converts the address of the found element into an index,
- The caller must test for a special `NoIndex` value,
- On success, accesses convert that index back into the original address.

This patch introduces new 'ApplyIf...' functions that combine all these
operations in a more efficient ensemble: If the sought element is found, it is
passed by reference to a given callable object (usually a lambda); if not
found, another callable is invoked.
Depending on what they need, the first callable may take one of these parameter
lists: (), (size_t), (maybe-const elem_type&), (size_t, maybe-const elem_type&).
On top of removing the pointer->index->pointer operations in most cases,
invoking callables directly from ApplyIf is safer, as the array is guaranteed to
be untouched at this time.
Also, being templates taking function objects, in most cases the compiler should
be able to inline and optimize the search and its callables' code.

This patch gives example uses in nsTArray::Contains, and in
FrameProperties::GetInternal, SetInternal.
And FrameProperties::Has now calls Contains, which is more efficient because
the former code would compute an index (or NoIndex), and then convert that index
to a bool; whereas the new code directly produces a bool from within the search
algorithm.

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

--HG--
extra : moz-landing-system : lando
2018-08-28 22:04:09 +00:00
Nika Layzell da14f0e1df Bug 1461450 - Part 1: Add move constructors and assignment operators to nsTArray, r=froydnj 2018-07-31 17:52:59 -04:00
Cosmin Sabou e748fd8968 Backed out 15 changesets (bug 1475409, bug 1461450, bug 1474369, bug 1471726) for causing rooting hazards and browser chrome failures. CLOSED TREE
Backed out changeset 7ce27aa3ce68 (bug 1474369)
Backed out changeset a8a4e2414daa (bug 1474369)
Backed out changeset 13c9626970e2 (bug 1474369)
Backed out changeset 9817819b7765 (bug 1475409)
Backed out changeset 39fcebfe6529 (bug 1475409)
Backed out changeset c19ca740d3d1 (bug 1475409)
Backed out changeset b26c90518fca (bug 1474369)
Backed out changeset cbdde0474521 (bug 1474369)
Backed out changeset ccea3049fe0f (bug 1474369)
Backed out changeset e9f6d2544a82 (bug 1474369)
Backed out changeset 99c4d07d4b88 (bug 1474369)
Backed out changeset c721ada8a6d6 (bug 1461450)
Backed out changeset 961379be0f5e (bug 1461450)
Backed out changeset cf2448b2635f (bug 1471726)
Backed out changeset 408961783c95 (bug 1471726)
2018-07-30 20:31:24 +03:00
Nika Layzell a3c819960c Bug 1461450 - Part 1: Add move constructors and assignment operators to nsTArray, r=froydnj 2018-07-30 11:27:55 -04:00
Nathan Froyd cd8b60fc05 Bug 1478337 - avoid useless work in nsTArray::RemoveElement; r=erahm
When removing an element that exists in the array, there's no need to
perform extra bounds checks for actually removing the element; the
presence of the element guarantees that we have a valid index and a
valid range to remove.  So split RemoveElementsAt into a safe interface
and an unsafe interface, and let RemoveElement call the latter as an
internal optimization.  The same logic applies to RemoveElementSorted.

We call RemoveElement depressingly often, so this is a nice little win.
2018-07-26 09:37:48 -04:00
Brindusan Cristian d7e724835f Backed out 15 changesets (bug 1475409, bug 1461450, bug 1474369, bug 1471726) for build bustages on xptcstubs_gcc_x86_unix.cpp:55:1. CLOSED TREE
Backed out changeset 79dbf5b9d8db (bug 1474369)
Backed out changeset 7e2e13953e19 (bug 1474369)
Backed out changeset 9d0b9a4c4651 (bug 1474369)
Backed out changeset 9f14f7b8bc3d (bug 1475409)
Backed out changeset bddd838d1910 (bug 1475409)
Backed out changeset 850f21ca1f45 (bug 1475409)
Backed out changeset 320802ab02e3 (bug 1474369)
Backed out changeset db67bf0e7f91 (bug 1474369)
Backed out changeset f355d9be9912 (bug 1474369)
Backed out changeset e1b6a5f74642 (bug 1474369)
Backed out changeset 459635cdfc08 (bug 1474369)
Backed out changeset 44414b1cd32e (bug 1461450)
Backed out changeset a5d04cf5d67f (bug 1461450)
Backed out changeset 40885fbf99c6 (bug 1471726)
Backed out changeset da79e75b9cb3 (bug 1471726)
2018-07-25 22:57:09 +03:00
Nika Layzell 4658f7e519 Bug 1461450 - Part 1: Add move constructors and assignment operators to nsTArray, r=froydnj 2018-07-25 15:37:40 -04:00
Kris Maglione 94f26a6578 Bug 1457728: Support tri-state comparators in nsTArray. r=erahm
MozReview-Commit-ID: FC9GPsJJ03K

--HG--
extra : source : e2d3d7bb9d1f7150ec3be7f8507977f7378ec541
extra : amend_source : 23fe2a504342c2b548e1f01fc80b662ee16443dd
2018-04-28 15:15:04 -07:00
Andreea Pavel be1d77cb98 Backed out changeset e2d3d7bb9d1f (bug 1457728) for build bustages at build\build\src\xpcom\ds\nsTArray.h(807) on a CLOSED TREE 2018-07-07 22:55:25 +03:00
Kris Maglione cd92626ded Bug 1457728: Support tri-state comparators in nsTArray. r=erahm
MozReview-Commit-ID: FC9GPsJJ03K

--HG--
extra : rebase_source : e2384e8f98b76a55aece2358528e9d9cf0272e80
extra : histedit_source : 6d0d89de11127fafd62dda2b860a50ccbbfb583d
2018-04-28 15:15:04 -07:00
Ciure Andrei f61df5dc45 Backed out 4 changesets (bug 1461450, bug 1471726) for linting failure xpidl.py CLOSED TREE
Backed out changeset 6e8148c1ca7f (bug 1461450)
Backed out changeset 2a02d86bc113 (bug 1461450)
Backed out changeset 1907567a85c5 (bug 1471726)
Backed out changeset c4df8eab6d1c (bug 1471726)
2018-07-07 03:12:10 +03:00
Nika Layzell aa3038043c Bug 1461450 - Part 1: Add move constructors and assignment operators to nsTArray, r=froydnj 2018-07-06 19:53:06 -04:00
Andi-Bogdan Postelnicu 78304aaf0d Bug 1453795 - XPCOM - Initialize member fields in classes/ structures. r=froydnj
--HG--
extra : rebase_source : c9d9e80b83ad52d8ac9203f491f1c9469a7e9b0c
extra : amend_source : ca502ae98ff21a2e3d1ab2d389310f3a5aded5ed
2018-06-15 14:41:20 +03:00
Emilio Cobos Álvarez 1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Markus Stange 3c2f4b195e Bug 1460733 - Rename nsTArrayHeader::sEmptyHdr to extern "C" { sEmptyTArrayHeader } so that thin-vec can link with it. r=froydnj
MozReview-Commit-ID: CjaE7udG9m2

--HG--
extra : rebase_source : 83f36ecf7fe96c6207575ce222a807a629866168
2018-05-10 16:37:27 -04:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Bas Schouten 0d91fc49fd Bug 1444200: Explicitly call the parent class default constructor from AutoTArray's copy constructor. r=froydnj
MozReview-Commit-ID: 5alSZfYJxmV
2018-03-09 05:27:14 +01:00
Andrew McCreight e1a6f8c267 Bug 1442295 - Add two missing includes in XPCOM. r=erahm
nsTArray.h needs mozalloc.h for moz_xmalloc

nsTStringRepr.h needs fallible.h for fallible

MozReview-Commit-ID: 9jz2pGPXMHk
2018-03-01 11:03:00 +02:00
Miko Mynttinen 7ca020bee6 Bug 1441779 - Part 2: Add nsTArray::RemoveLastElement() and nsTArray::PopLastElement() r=froydnj
MozReview-Commit-ID: ENgK1CTS6Fq

--HG--
extra : rebase_source : 3468ba67dd8b45119f37a8c96cc34964f9155a40
2018-02-28 10:32:10 +01:00
Daniel Holbert 1e76715d6d Bug 1433584: Fix misleading nsTArray::SetCapacity documentation to avoid implying that its arg is a delta. r=froydnj
DONTBUILD because comment-only

MozReview-Commit-ID: 8cr092aAJSm

--HG--
extra : rebase_source : 730be11254e22a81cca78911813444b366e16eaa
2018-01-26 14:24:48 -08:00
Nika Layzell 0c171ce388 Bug 1431122 - Part 1: Add UnorderedRemoveElement[s]At to nsTArray, r=froydnj
MozReview-Commit-ID: H0oqG7H7299
2018-01-23 17:27:35 -05:00
Adrian Wielgosik 1e20a980f6 Bug 1361815 - Do less work in nsTArray's Clear() and destructor. r=froydnj
MozReview-Commit-ID: DnkE7LFxkF3
2018-01-12 11:26:55 +01:00
Mike Hommey a1947c3098 Bug 1423119 - Remove the sole use of MOZALLOC_HAVE_XMALLOC. r=erahm
When this was added, the xpcom glue was still a thing, and there was a
distinction between things that would build with mozalloc available and
others. There is no such distinction anymore. Anything that has access
to xpcom has access to infallible allocator functions.

--HG--
extra : rebase_source : 04bce114e940c53709275d0354ea7240df4a051e
2017-12-05 17:45:20 +09:00
Boris Zbarsky fb684cc726 Bug 1409152. Add an nsTArray::ContainsSorted method. r=froydnj 2017-10-17 15:39:59 -04:00
Eric Rahm 79b2a97ced Bug 1373371 - Properly convert index in RemoveElementsAt. r=froydnj
MozReview-Commit-ID: 2CRrUmOxA9B

--HG--
extra : rebase_source : 6071d63fa45d391b6c0fc8ce6a89bb7d0ef8eb11
2017-06-19 17:09:54 -07:00
Jon Coppeard b6270c9da7 Bug 1400003 - Mark Heap<T> and barrier classes as MOZ_NON_MEMMOVABLE r=sfink r=froydnj 2017-10-09 10:03:20 +01:00
Nathan Froyd 84951ded23 Bug 1386476 - avoid unnecessary checks in nsTArray::AppendElement; r=erahm
nsTArray::AppendElement{,s} uses an IncrementLength method to adjust the
length of the array after appending elements.  There are checks in
IncrementLength to ensure that we're not incrementing the length stored
in the static empty header object; these checks are necessary in cases
such as appending a zero-length array to another zero-length array.

But we do not need this check when we're calling AppendElement: we know
the header is obviously not the empty header, because we increased the
length of the array by one for the newly appended element.  Incrementing
the length can therefore be inlined, saving ~90K of codesize on x86-64
Linux.
2017-08-02 19:21:23 -04:00
Daniel Holbert 4564af3454 Bug 1368326: Don't bother calling Clear() in destructor for empty nsTArrays. r=froydnj
MozReview-Commit-ID: 7mi2Os52JfJ

--HG--
extra : rebase_source : 4c7296fd84509f71b680a55f513574285e754481
2017-06-01 14:38:13 -07:00
Henri Sivonen c514501f1a Bug 1295611 - Add mozilla::Span. r=froydnj,gerv.
MozReview-Commit-ID: HGNDClVctbE
2017-03-31 13:32:18 +03:00
Eric Rahm b8b8dd4a0c Bug 1348123 - Add release bounds checking when inserting and replacing. r=froydnj
This adds release bounds checking to ReplaceElementsAt, InsertElementAt, and
InsertElementsAt to make sure the insertion point is within the current array
bounds.

MozReview-Commit-ID: 1pFr8LuOROI
2017-03-17 16:40:53 -07:00