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

1408 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 5c86c09175 Bug 1682556 - Increase vm_copy() threshold. r=glandium
The current implementation is a regression on microbenchmarks that
reallocate allocations that go over gPageSize * 32 compared to memcpy().

Differential Revision: https://phabricator.services.mozilla.com/D100217
2020-12-23 01:35:22 +00:00
Paul Bone 788a04db2c Bug 1682204 - Clear arena_t::mId in the constructor r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D99638
2020-12-17 23:24:53 +00:00
Cristina Coroiu 8994f0036c Backed out changeset f12f5989419a (bug 1670885) for causing frequent failures for bug 1682467 on a CLOSED TREE 2020-12-16 15:49:51 +02:00
Gabriele Svelto ff41ce10e1 Bug 1670885 - Replace deprecated NSSpinLocks with os_unfair_locks in the memory allocator r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D99280
2020-12-14 15:53:41 +00:00
Emilio Cobos Álvarez 71926eea81 Bug 1681003 - When realloc() grows an allocation, allow switching out of public arenas if plain malloc() would've done that. r=glandium
Otherwise we may grow thread-local arenas a lot.

Differential Revision: https://phabricator.services.mozilla.com/D98924
2020-12-10 10:59:09 +00:00
David Major 785368780a Bug 1681243 - Use noexcept on arena_t's fallible allocator, even on Windows r=glandium
In clang-cl builds, thanks to clang-cl's defining of `_MSC_VER`, this function was not marked `noexcept`. This led clang to believe that it could call `arena_t`'s constructor without checking for null.

I suppose we could scope the condition down to real MSVC, but since we don't support that anymore, we can just stop checking.

Differential Revision: https://phabricator.services.mozilla.com/D99137
2020-12-09 14:10:26 +00:00
Emilio Cobos Álvarez 22f8edff88 Bug 1681075 - Manually inline arena_salloc. r=glandium
It's small and only has one caller.

Differential Revision: https://phabricator.services.mozilla.com/D98923
2020-12-09 08:19:49 +00:00
Emilio Cobos Álvarez 2a038173c3 Bug 1681075 - Deduplicate some common code in Ralloc. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D98922
2020-12-08 11:24:10 +00:00
Mike Hommey 14c1084f72 Bug 1679938 - Don't recurse the build into mfbt for projects that don't need it. r=firefox-build-system-reviewers,mhentges
While all toolkit and js-based projects make use of mfbt, some others,
like tools/crashreporter and tools/update-packaging, don't.

So instead of including mfbt from the top-level directory, include it
from the relevant project top-level mozbuilds.

This allows to remove the dependency on mfbt files in the hash for the
minidump-stackwalk and mar-tools toolchains.

Differential Revision: https://phabricator.services.mozilla.com/D98378
2020-12-01 23:52:03 +00:00
Paul Bone 96d3e53990 Bug 1670188 - pt 2. Add a tool that prints the run lengths for size classes r=glandium
This new program prints the jemalloc configuration, it is only built for
--enable-project=memory

Differential Revision: https://phabricator.services.mozilla.com/D93184
2020-11-20 03:33:57 +00:00
Paul Bone 790088fdb7 Bug 1670188 - pt 1. Update run size table on arena_bin_t:Init r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D93183
2020-11-11 05:21:25 +00:00
David Major dc2575e011 Bug 1677726 - Disable LTO for SmokeDMD.cpp r=andi
Sheriff note: We should keep this regardless of whether bug 1675600 sticks.

The comment above SmokeDMD's `RunTests()` says "This test relies on the compiler not doing various optimizations ... So we compile it with -O0 (or equivalent)".

That suggests that LTO should also be disallowed.

Differential Revision: https://phabricator.services.mozilla.com/D97336
2020-11-18 16:08:31 +00:00
David Major 6e260b8d5a Bug 1677893 - CONFIG["CXX_TYPE"] is not a thing r=firefox-build-system-reviewers,andi,mhentges
Due to lack of `CXX_TYPE`, clang-cl builds were accidentally taking the `else` branch where the `-O0` was ignored/unrecognized. This went unnoticed for a long time until it busted the landing of bug 1677726.

While here, fix the intent of SmokeDMD: `-Og-` is a silent no-op in clang-cl, so it's not actually disabling anything.

Differential Revision: https://phabricator.services.mozilla.com/D97387
2020-11-18 16:01:23 +00:00
Bogdan Tara 5a09a3c8ce Backed out changeset 1305b74f1c0b (bug 1677726) for SmokeDMD.obj related bustage CLOSED TREE
DONTBUILD
2020-11-18 02:49:01 +02:00
David Major e631afd3ae Bug 1677726 - Disable LTO for SmokeDMD.cpp r=andi
Sheriff note: We should keep this regardless of whether bug 1675600 sticks.

The comment above SmokeDMD's `RunTests()` says "This test relies on the compiler not doing various optimizations ... So we compile it with -O0 (or equivalent)".

That suggests that LTO should also be disallowed.

Differential Revision: https://phabricator.services.mozilla.com/D97336
2020-11-17 16:56:18 +00:00
Sylvestre Ledru 9bfd4073b2 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D95434
2020-11-04 18:46:00 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Mike Hommey 6d9ed07aa6 Bug 1672867 - Silence warning about aligned_alloc only being available on macOS 10.15 or newer. r=firefox-build-system-reviewers,mhentges
This warning turns into an error on automation, and is only due to the
fact that newer SDKs have a declaration for it with a version guard, but
we're actually using our own definition of the function, so whether it's
available in older versions of macOS is irrelevant.

Differential Revision: https://phabricator.services.mozilla.com/D94512
2020-10-22 23:16:23 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Petr Sumbera fd342d7126 Bug 1671623 - don't overloaded log10 r=pbone
Differential Revision: https://phabricator.services.mozilla.com/D93762
2020-10-19 06:42:45 +00:00
Paul Bone e09c34ec99 Bug 1656155 - pt 7. Add slop histograms r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D88705
2020-10-08 22:35:59 +00:00
Paul Bone de7f32735e Bug 1656155 - pt 6. Add slop information to Replay.cpp r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D88403
2020-10-08 22:44:38 +00:00
Paul Bone 6655819c99 Bug 1656155 - pt 5. Add bin-stats to the memory replay tool r=glandium
Add more format specifiers to FdPrintf: %, s and add width and precision
specifiers.

Differential Revision: https://phabricator.services.mozilla.com/D87829
2020-10-08 22:44:00 +00:00
Paul Bone 8e48a8d8f3 Bug 1656155 - pt 4. Update size class fields in jemalloc_stats_t r=glandium
Previously there was one field here named small_max, and it wasn't obvious
from the name alone whether this meant the end of the
quantum-spaced sizes or the subpage sizes.  Instead place both these fields
into the structure with clearer names.  Besides, a later page will need
subpage_max.

Differential Revision: https://phabricator.services.mozilla.com/D88402
2020-10-08 22:43:35 +00:00
Paul Bone 46597c49d2 Bug 1656155 - pt 2. Provide bin usage stats in jemalloc_stats r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D85726
2020-10-08 22:42:45 +00:00
Paul Bone b325fd9328 Bug 1656155 - pt 1. Reuse a computation in jemalloc r=glandium
Add a new variable and use it instead of a longer expression in several
places.

Differential Revision: https://phabricator.services.mozilla.com/D85724
2020-10-08 22:42:27 +00:00
Paul Bone 9177c6da0b Bug 1668421 - Improve a use of fallible in jemalloc r=glandium
Depends on D92017

Differential Revision: https://phabricator.services.mozilla.com/D92018
2020-10-05 00:49:22 +00:00
Gerald Squelart 782cf5d3ad Bug 1657033 - Use Span<const char> in JSONWriter - r=froydnj
In most situations, JSONWriter users already know string lengths (either directly, or through `nsCString` and friends), so we should keep this information through JSONWriter and not recompute it again.
This also allows using JSONWriter with sub-strings (e.g., from a bigger buffer), without having to create null-terminated strings.

Public JSONWriter functions have overloads that accept literal strings.

Differential Revision: https://phabricator.services.mozilla.com/D86192
2020-09-14 02:33:20 +00:00
Chris Peterson 3e124aaca9 Bug 1663237 - Replace MOZ_MUST_USE with [[nodiscard]] in mozjemalloc. r=glandium
The MOZ_MUST_USE macro is defined as clang's and gcc's nonstandard __attribute__((warn_unused_result)). Now that we compile as C++17 by default (bug 1560664), we can replace MOZ_MUST_USE with C++17's standard [[nodiscard]] attribute.

We can also stop #including mozilla/Attributes.h because it was only needed for its MOZ_MUST_USE declaration.

Differential Revision: https://phabricator.services.mozilla.com/D89310
2020-09-08 07:20:19 +00:00
Sylvestre Ledru 9c192aa9ca Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 09:23:02 +00:00
Mihai Alexandru Michis 261d01524b Backed out changeset d0f173a90792 (bug 1519636) for causing bustages.
CLOSED TREE
2020-08-31 10:14:58 +03:00
Sylvestre Ledru 939dd426e6 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 06:51:21 +00:00
Paul Bone d4a42076ec Bug 1661884 - Update link to DMD docs r=njn
Differential Revision: https://phabricator.services.mozilla.com/D88706
2020-08-31 01:23:59 +00:00
Haik Aftandilian cc6114c1cc Bug 1660045 - Patch 1 - Use the runtime pagesize for Mac Intel builds r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D87013
2020-08-27 07:04:01 +00:00
Nathan Froyd 92a3a92555 Bug 1658424 - add support for grabbing fp on arm64 macOS in DMD; r=mccr8
This code just cribs from the profiler's code and has not been tested.

Differential Revision: https://phabricator.services.mozilla.com/D86647
2020-08-11 14:09:28 +00:00
Mike Hommey 748bff0a39 Bug 1658434 - Replace replace_malloc.mk with a mozbuild file. r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D86639
2020-08-11 00:05:38 +00:00
Christian Holler d157c468a9 Bug 1657857 - Call native abort in UBSan builds. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D86334
2020-08-07 18:22:03 +00:00
Nathan Froyd e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mike Hommey 69fef46cab Bug 1651079 - Add necessary LOCAL_INCLUDES for StackWalk.cpp in memory/replace/logalloc/replay. r=rstewart
This requires a workaround for the use of __wrap_dladdr, which can't be
used in logalloc-replay. The workaround involves making __wrap_dladdr
expand to dladdr, but that makes the definition ElfLinker.h conflict
with the one in the Android system headers, so we change it to match,
and adjust ElfLinker.cpp accordingly.

And while here, fix the condition in mozglue/misc to match the condition
around including Linker.h in StackWalk.cpp itself.

Differential Revision: https://phabricator.services.mozilla.com/D82648
2020-07-08 21:37:24 +00:00
Sylvestre Ledru caf785c695 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D82178
2020-07-04 09:38:43 +00:00
Nathan Froyd 1f77873a31 Bug 1649259 - include Attributes.h in memory/'s Mutex.h; r=glandium
We need this for `MOZ_RAII`.

Differential Revision: https://phabricator.services.mozilla.com/D81599
2020-07-01 13:39:34 +00:00
Mike Hommey eb6d411650 Bug 1200075 - Do not avoid sqlite3 using _msize. r=froydnj
It was setup this way in bug 719579 for legitimate reasons (because
_msize would end up using the system symbol, which would crash trying to
get the size information from jemalloc allocations), but these reasons
don't apply anymore: back then the linking situation was different, and
nowadays, mozglue.dll exports its own _msize which plugs into
mozjemalloc, and sqlite is folded into nss3.dll, which links against
mozglue.dll, such that using _msize on mozjemalloc allocations works.

For some reason, while _msize (and other similar functions) are exported
from mozglue.dll without an explicit instruction to do so on clang-cl
builds, that's not the case for mingw builds (presumably related to the
definition of these functions in system headers, or lack thereof). So
we also add MOZ_EXPORT for them.

Differential Revision: https://phabricator.services.mozilla.com/D81286
2020-06-29 16:22:50 +00:00
Sylvestre Ledru 68e6f06c65 Bug 1649071 - Replace the DISALLOW_COPY_AND_ASSIGN & DISALLOW_EVIL_CONSTRUCTORS macros with = delete; r=froydnj
Generated with:
./mach static-analysis check --checks="-*, modernize-replace-disallow-copy-and-assign-macro" --fix -j 10 <file>
and
./mach clang-format -p <file>
(as clang-apply-replacement doesn't reformat the change)

(with ~/.mozbuild/clang-tools/clang-tidy/bin/clang-tidy pointing to clang-tidy 11)

Differential Revision: https://phabricator.services.mozilla.com/D81489
2020-06-29 14:37:56 +00:00
Mike Hommey 79bfecf6b3 Bug 1648340 - Include cstdlib/stdlib.h first in mozalloc.h. r=froydnj
I don't know why this isn't a problem currently, but it becomes one with
the #include orders in some of the source files in mozglue/linker, where
the compiler complains about the allocator functions being defined
differently wrt exceptions if they are defined via malloc_decls before
cstdlib/stdlib.h is included.

Differential Revision: https://phabricator.services.mozilla.com/D81022
2020-06-25 11:01:04 +00:00
Gian-Carlo Pascutto ecee111c1f Bug 1553717 - Use Randomization on all arenas in non-Content Processes. r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D70240
2020-05-13 08:31:04 +00:00