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

497 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote 953ed1dcc1 Bug 1499907 - Add a `jsonEscape` argument to `fixSymbols`. r=erahm
So that dmd.py isn't broken by function names that, after stack fixing, contain
escape-worthy chars such as " and /.

--HG--
extra : rebase_source : 625cef56e4599bbb810273ef04af2b971e777b58
2018-11-21 10:28:00 +11:00
Chris Martin adde9e8556 Bug 1402282 - Change jemalloc to use secure random private arena ids r=glandium
Previously the id for a new arena was just a counter that increased by one
every time. For hardening purposes, we want to make private arenas use a secure
random ID, so an attacker will have a more difficult time finding the memory
they are looking for.

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

--HG--
extra : moz-landing-system : lando
2018-11-21 01:52:26 +00:00
Mark Banner 50fbf54ef3 Bug 1506559 - Enable ESLint for memory/replace/dmd/test/. r=njn
Differential Revision: https://phabricator.services.mozilla.com/D11619

--HG--
extra : moz-landing-system : lando
2018-11-13 09:07:38 +00:00
arthur.iakab 27754a7d12 Backed out 2 changesets (bug 1402282) for turning multiple browser chrome bugs into permafail
Backed out changeset db7059b57f92 (bug 1402282)
Backed out changeset cea1d44ac776 (bug 1402282)
2018-11-05 17:56:37 +02:00
Chris Martin 3824b0d43e Bug 1402282 - Change jemalloc to use secure random arena ids r=glandium
Previously the id for a new arena was just a counter that increased by one
every time. For hardening purposes, we want to make the new counter a secure
random ID, so an attacker will have a more difficult time finding the memory
they are looking for.

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

--HG--
extra : moz-landing-system : lando
2018-11-05 00:27:31 +00:00
Noemi Erli 06a8cd8e3c Backed out changeset bee1c344cb47 (bug 1491909) for failures in browser/components/extensions/test/xpcshell/test_ext_geckoProfiler_control.js 2018-10-24 04:23:13 +03:00
Denis Palmeiro fc930ad16f Bug 1491909 - Add an AllocPolicy to mozilla::JSONWriter r=jwalden,mstange
JSONWriter currently calls new and delete indirectly through mozilla::MakeUnique to allocate a buffer.  Becuase of this, the methods of this class cannot be invoked within Spidermonkey due to https://searchfox.org/mozilla-central/source/config/check_vanilla_allocations.py#6-14.  Therefore, JSONWriter needs an AllocPolicy template parameter so that the allocation and deallocation routines can be changed to match the JS AllocPolicy when invoked within SpiderMonkey.

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

--HG--
extra : moz-landing-system : lando
2018-10-23 20:46:31 +00:00
Randell Jesup 0f390bf1a5 Bug 1480430: Modify jemalloc to allow dynamic replacement r=glandium 2018-10-09 22:28:37 -04:00
Eric Rahm c5bb74ff5d Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.

--HG--
extra : rebase_source : 475166fa6d1f241bf4d67cbdda1aab73000a5c3a
extra : intermediate-source : fcdc1d5eaf1a932992287074d0c91504dd7180d8
extra : source : 1192c15fc9347ccd6169dcb5bea81d7f2399e3fd
2018-10-01 16:38:17 -07:00
Cosmin Sabou 5a8eb92385 Backed out 3 changesets (bug 1409739) for causing Linux x64 ccov & fuzzing bustages. a=backout
Backed out changeset 387f946c7c48 (bug 1409739)
Backed out changeset 617288a6b2d9 (bug 1409739)
Backed out changeset fcdc1d5eaf1a (bug 1409739)
2018-10-03 20:29:42 +03:00
Eric Rahm 703da53d94 Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.

--HG--
extra : source : 1192c15fc9347ccd6169dcb5bea81d7f2399e3fd
extra : intermediate-source : d39c2dfcc7004a4736436c564de239ba68b20c03
extra : histedit_source : 5a75a20f5b88481c994597da81fdbc29186aba3d%2C3f60f2bfbe54ab3843d4b18d66296cd4aadf4a30
2018-10-01 16:38:17 -07:00
Coroiu Cristina 7f6d72d2a2 Backed out 3 changesets (bug 1409739) for xpcshell failures at memory/replace/dmd/test/test_dmd.js
Backed out changeset dc3c5143ba4e (bug 1409739)
Backed out changeset e37ea5eb932a (bug 1409739)
Backed out changeset d39c2dfcc700 (bug 1409739)
2018-10-03 02:07:19 +03:00
Eric Rahm 6566498f9e Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.

--HG--
extra : rebase_source : 2b1d2dbf8a3a538533554c6697f0e9ee51ec1bed
extra : source : 1192c15fc9347ccd6169dcb5bea81d7f2399e3fd
2018-10-01 16:38:17 -07:00
Gurzau Raul 4f0690bc0d Backed out 3 changesets (bug 1409739) for failing at /dmd/test/test_dmd.js on a CLOSED TREE
Backed out changeset 39c8abcf9cb2 (bug 1409739)
Backed out changeset c0da83c08b62 (bug 1409739)
Backed out changeset 1192c15fc934 (bug 1409739)
2018-10-02 18:43:32 +03:00
Eric Rahm 0196b4c2ca Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.

--HG--
extra : rebase_source : 147e62e22248971980d95fe211c86116a98cbdf4
2018-10-01 16:38:17 -07:00
Tom Ritter 934ba40bb8 Bug 1480457-Correct typedef so it matches an earlier typedef r=aklotz
--HG--
extra : amend_source : c6796d3a8bb13939440b390ac9af11054b46dd15
2018-08-30 23:05:59 +03:00
Nicholas Nethercote b9e071e2e8 Bug 1481998 - Make mozilla::Hash{Map,Set}'s entry storage allocation lazy. r=luke,sfink
Entry storage allocation now occurs on the first lookupForAdd()/put()/putNew().
This removes the need for init() and initialized(), and matches how
PLDHashTable/nsTHashtable work. It also removes the need for init() functions
in a lot of types that are built on top of mozilla::Hash{Map,Set}.

Pros:

- No need for init() calls and subsequent checks.

- No memory allocated for empty tables, which are not that uncommon.

Cons:

- An extra branch in lookup() and lookupForAdd(), but not in put()/putNew(),
  because the existing checkOverloaded() can handle it.

Specifics:

- Construction now can take a length parameter.

- init() is removed. Explicit length-setting, when necessary, now occurs in the
  constructors.

- initialized() is removed.

- capacity() now returns zero when the entry storage is absent.

- lookupForAdd() is no longer `const`, because it can instantiate the storage,
  which requires modifications.

- lookupForAdd() can now return an invalid AddPtr in two cases:

  - old: hashing failure (due to OOM in the hasher)

  - new: OOM while instantiating entry storage

  The existing failure handling paths for the old case work for the new case.

- clear(), finish(), and clearAndShrink() are replaced by clear(), compact(),
  and reserve(). The old compactIfUnderloaded() is also removed.

- Capacity computation code is now in its own functions, bestCapacity() and
  hashShift(). setTableSizeLog2() is removed.

- uint32_t is used throughout for capacities, instead of size_t, for
  consistency with other similar values.

- changeTableSize() now takes a capacity instead of a deltaLog2, and it can now
  handle !mTable.

Measurements:

- Total source code size is reduced by over 900 lines. Also, lots of existing
  lines got shorter (i.e. two checks were reduced to one).

- Executable size barely changed, down by 2 KiB on Linux64. The extra branches
  are compensated for by the lack of init() calls.

- Speed changed negligibly. The instruction count for Bench_Cpp_MozHash
  increased from 2.84 billion to 2.89 billion but any execution time change was
  well below noise.
2018-08-10 18:00:29 +10:00
Masatoshi Kimura 3b21b7868b Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj
--HG--
extra : rebase_source : c09366fb93e5b0f72abe1e99d3094e3d96a934fb
extra : intermediate-source : 5950c9d63c3b4fd63a25464a7b50944aaec7079f
extra : source : ca1b9a2bcc4381795f556fea2fb59066567c30f3
2018-07-31 22:10:07 +09:00
Cosmin Sabou de8c2bd891 Backed out changeset 5950c9d63c3b (bug 1090497) for build bustages on several files. CLOSED TREE 2018-08-02 19:59:53 +03:00
Masatoshi Kimura feea19030c Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj
--HG--
extra : rebase_source : a62521fdc66def4e4d5d7bf52e68365a786b5c55
extra : source : ca1b9a2bcc4381795f556fea2fb59066567c30f3
2018-07-31 22:10:07 +09:00
Nicholas Nethercote a4cfd53308 Bug 1478879 - Remove Range/Enum use in DMD. r=mccr8
--HG--
extra : rebase_source : 19428e3d0d1b8676fe55be729b0e75d787086b6c
2018-07-27 12:21:01 +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
Nicholas Nethercote 6998f465ed Bug 1477626 - Use mozilla::HashTable instead of JS::HashTable in DMD. r=erahm
Also use mozilla::HashNumber where appropriate.

MozReview-Commit-ID: BTq0XDS5UfQ

--HG--
extra : rebase_source : 28f45a9b27e831e99620a2b575f373003f1301f2
2018-07-26 20:15:58 +10:00
Brian Hackett f6b8e6f81c Bug 1309552 - Specify buffer size when freeing data in AllocPolicy, r=waldo.
--HG--
extra : rebase_source : f4e2d9f8831cf41c19d592ce252e87161f32250b
2018-07-20 23:58:34 +00:00
Eric Rahm ca834a09a7 Bug 1470268 - Add allocation filter to dmd.py. r=njn
This adds an '--allocation-filter' param that can be used to limit output to
only allocations that include the filter in their stack. For example:
  dmd.py --allocation-filter fontconfig dmd.json.gz
limits its output to just allocations that have an instance of 'fontconfig' in
in one of their stack frames.

--HG--
extra : rebase_source : 9ed34d5c7a6a2b76e96455e66b2e8196686ade16
2018-06-20 13:11:50 -07:00
Sylvestre Ledru 3e84d308c3 Bug 1464869 - Fix flake8/pep8 issue by hand in memory/ r=njn
MozReview-Commit-ID: 8bkhAB4g6rv

--HG--
extra : rebase_source : 623f4ed95d601b47878c910859f3b91e87897011
2018-05-25 23:27:02 -07:00
Sylvestre Ledru 21f28e8329 Bug 1464869 - Run autopep8 on memory/ r=njn
MozReview-Commit-ID: GzFGXZ8WLX5

--HG--
extra : rebase_source : 15b2f8fefaa4ee32a4f655086194202d9e82efb6
2018-05-25 23:16:07 -07: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
Andreea Pavel 8469234a9f Bug 1461964 - removed mac 10.6 reference r=njn 2018-05-20 23:08:00 +03:00
David Major fa8d998487 Bug 1447795: Add even more UseItOrLoseIt to SmokeDMD.cpp 2018-04-01 09:37:42 -04:00
David Major 0fab6b57fc Bug 1447795 - Add some more UseItOrLoseIt to SmokeDMD.cpp. r=njn 2018-03-21 13:52:00 +02:00
Mike Hommey 61d75ea276 Bug 1442468 - Remove workaround for http://code.google.com/p/android/issues/detail?id=23203. r=froydnj
That NDK bug has been fixed since r8c, and we now require something more
recent than that. This effectively reverts the changes from bug 720621
and bug 734832.

--HG--
extra : rebase_source : 9ff76a790ec4135dc0172cfd0f11fc1ecef7df64
2018-03-01 15:15:02 +09:00
Florian Quèze c714053d73 Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Kris Maglione 918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Cosmin Sabou 9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione 6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Marco Castelluccio 871dbb2b23 Bug 1403005 - Don't run memory/replace/logalloc/replay in coverage builds. r=glandium
--HG--
extra : rebase_source : b2f451d764f8efb92082d8b987e74744091bfe4c
2018-01-16 15:45:40 +01:00
Chris Peterson 37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Sylvestre Ledru 9bfe27d903 Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 7duJk2gSd4m

--HG--
extra : rebase_source : 7312fe276e561e8c034a5f6749774ae812727f9c
2017-12-07 22:09:15 +01:00
Mike Hommey c6b6415a7b Bug 1423512 - Remove unnecessary XPCOM_GLUE define in DMD. r=njn
This was added in bug 1122337 back when the stackwalker was still
in XPCOM, which it isn't anymore, so XPCOM_GLUE is not necessary
anymore.

--HG--
extra : rebase_source : e550671c26e250843d34cb2b83497c861225883f
2017-12-06 09:52:55 +09:00
David Major ad7ff3a791 Bug 1423287 - Simplify NtCurrentTeb() handling. r=njn 2017-12-06 09:36:00 -05:00
Mike Hommey 3f1f5c9fc2 Bug 1423114 - Remove moz_xposix_memalign and moz_xvalloc. r=njn
They are both infallible wrappers of posix_memalign and valloc.
There is also moz_xmemalign, which wraps memalign, which is mostly
always available as of bug 1402647.

None of them are actually used, but it's still desirable to at least
have one infallible variant, so keep moz_xmemalign and remove the other
two.

While here, we actually make both memalign and moz_xmemalign always
available.

--HG--
extra : rebase_source : 1c3ca4b3e3310543145f3181dfa4e764be1d6ff8
2017-12-05 17:34:19 +09:00
Narcis Beleuzu dfd58840d1 Backed out changeset 8a4050c7e0fd (bug 1423114) for bustages on memory/mozalloc/mozalloc.cpp r=backout on a CLOSED TREE 2017-12-06 00:27:11 +02:00
Mike Hommey 5f1f0bbdc4 Bug 1423114 - Remove moz_xposix_memalign and moz_xvalloc. r=njn
They are both infallible wrappers of posix_memalign and valloc.
There is also moz_xmemalign, which wraps memalign, which is always
available as of bug 1402647.

None of them are actually used, but it's still desirable to at least
have one infallible variant, so keep moz_xmemalign and remove the other
two.

While here, we actually make moz_xmemalign always available, since
memalign is always available.

--HG--
extra : rebase_source : 17300bc03a715e5d36b4b687f22050622c1c70c8
2017-12-05 17:34:19 +09:00
Mike Hommey b796bc0e6d Bug 1423000 - Run clang-format in memory/replace/logalloc. r=njn
--HG--
extra : rebase_source : 6372d6eb88bad9da824e6a2a99380554e1ae04f5
2017-12-05 08:28:32 +09:00
Mike Hommey 55b2629bb8 Bug 1423000 - Always log allocator function calls. r=njn
So far, logalloc has avoided logging calls that e.g. return null
pointers, but both to make the code more generic and to enable logging
of error conditions, we now log every call.

--HG--
extra : rebase_source : 5e41914552f44e330f8f9c12b34fd6d30fdf30a7
2017-11-30 07:55:12 +09:00
Mike Hommey c617c4a119 Bug 1423000 - Don't use a separate replace-malloc library for the minimal-logalloc test. r=njn
Instead, only register a minimal set of functions when an environment
variable is set.

--HG--
extra : rebase_source : 94f2403ed9afe2acab1f56714d60fb32401076dc
2017-12-03 13:59:16 +09:00
Mike Hommey 2ff212b9f9 Bug 1423000 - Use mozjemalloc mutexes in logalloc. r=njn
Instead of the chromium one, which required some tricks.

--HG--
extra : rebase_source : f2918c33ff5263f50b81ac4606aa0ab3059cdc36
2017-12-03 14:23:23 +09:00
Mike Hommey 938618a5e1 Bug 1423000 - Reject some more invalid logalloc replay logs. r=njn
For functions with no result, such as free, it's invalid for some string
to appear after the closing parenthesis.

--HG--
extra : rebase_source : d7a72c064c408ba9c4a8722ebbaafb878633e857
2017-11-30 10:33:18 +09:00
Mike Hommey c142d8c12f Bug 1423000 - Move MemSlot lookup for replay results into the Replay methods. r=njn
This allows all methods to have the same signature.

--HG--
extra : rebase_source : 6c6e952d00ba5f92c2cf368fa871e8979f640780
2017-11-30 10:31:25 +09:00
Mike Hommey 94fe24fd79 Bug 1423000 - Count jemalloc_stats as an operation. r=njn
While jemalloc_stats is not actively doing anything, it can be
cumbersome to not have it count as an operation, because the operation
count shown on jemalloc_stats doesn't match the line number in the input
replay log, and the offset grows as the number of jemalloc_stats
operations grows.

While here, also update a comment about the replay log format.

--HG--
extra : rebase_source : da0ad9a990487ebdfadae7f8fcfad85e82b482fc
2017-11-30 10:18:39 +09:00
Mike Hommey ddec58883e Bug 1423000 - Remove Replay::Commit. r=njn
It adds an uncompressible and noticeable time overhead to replaying
logs, even when one is not interested in measuring RSS. This has caused
me to clear the method body on multiple occasions.

If necessary, it is possible to enable zero or junk at the allocator
level for the same effect.

--HG--
extra : rebase_source : a4c44e97986668e712b500266d7fffe985e85881
2017-11-30 10:48:41 +09:00
Mike Hommey 2b2a874b47 Bug 1420355 - Statically link DMD. r=njn
--HG--
extra : rebase_source : 8e7cf975d096116b666532f3fe8aa5a7f61b5725
2017-11-28 08:10:48 +09:00
Mike Hommey 50d09b60b0 Bug 1420355 - Allow to statically link replace-malloc libraries. r=njn
And statically link logalloc.

Statically linking is the default, except when building with
--enable-project=memory, allowing to use the generated libraries from
such builds with Firefox.

--HG--
extra : rebase_source : efe9edce8db6a6264703e0105c2192edc5ca8415
2017-11-23 17:24:19 +09:00
Mike Hommey 1e631092c5 Bug 1420355 - Don't initialize DMD if the DMD environment variable is not given. r=njn
This makes things slightly more inconvenient (having to set two
environment variables instead of one for the simplest case) until a few
patches down the line, when DMD is statically linked, at which point it
will get down to one environment variable every time.

--HG--
extra : rebase_source : 08dc3c05318b572ae1026227d0369fa8bf21b20f
2017-11-28 08:10:07 +09:00
Mike Hommey 7c59f18de8 Bug 1420355 - Don't initialize logalloc if MALLOC_LOG is not given. r=njn
Now that replace_init can opt-out of registering the replace-malloc
functions, don't do so when MALLOC_LOG was not set in the environment.

While one would normally set MALLOC_LOG alongside one of the environment
variable necessary to load the replace-malloc library, we're also going,
in a subsequent change, to allow statically linking replace-malloc
libraries, taking full advantage of this change.

--HG--
extra : rebase_source : 944a9d7af33f88f793ee0104bd5e58ec508e4f58
2017-11-23 13:54:16 +09:00
Mike Hommey 8b50bbe85b Bug 1420355 - Remove fallbacks when DMD is initializing. r=njn
As of bug 1420353, DMD's replace_* functions can't be called before
replace_init places them in the malloc function table, which only
happens after DMD::Init has run, meaning DMD is always initialized
by the time any of its replace_* function can be called.

--HG--
extra : rebase_source : 96bf4d01b6fac5cbb4712f56c572791cc4972f77
2017-11-28 08:05:58 +09:00
Mike Hommey 449973411b Bug 1420355 - Don't declare replace_* functions in replace_malloc.h. r=njn
The original purpose of those declarations was to avoid the function
definitions being wrong, as well as forcing them being exported
properly (as extern "C", as weak symbols when necessary, etc.), but:

- The implementations being C++, function overloads simply allowed
  functions with the same name to have a different signature.

- As of bug 1420353, the functions don't need to be exported anymore,
  nor do we care whether their symbols are mangled. Furthermore, they're
  now being assigned to function table fields, meaning there is type
  checking in place, now.

So all in all, these declarations can be removed.

Also, as further down the line we're going to statically link the
replace-malloc libraries, avoid symbol conflicts by making those
functions static.

--HG--
extra : rebase_source : 0dbb15f2c85bc873e7eb662b8d757f99b0732270
2017-11-28 07:18:15 +09:00
Mike Hommey 2b959b7c6e Bug 1420355 - Don't link logalloc against the static runtime on Windows. r=njn
This was never strictly required (for instance, DMD doesn't do that),
and would make things harder with the subsequent changes.

--HG--
extra : rebase_source : 29ea08d41f54da7f99120f9fe9af4017f61d8a4b
2017-11-28 17:11:40 +09:00
Csoregi Natalia 4ce8d0124c Backed out 7 changesets (bug 1420355) for mass failures on OS X and Android. r=backout on a CLOSED TREE
Backed out changeset a7ed89e13a4c (bug 1420355)
Backed out changeset fd6702e6e0a0 (bug 1420355)
Backed out changeset 0479dda078a2 (bug 1420355)
Backed out changeset e69357ccca9e (bug 1420355)
Backed out changeset 3742a4b69ba2 (bug 1420355)
Backed out changeset 451cd087922f (bug 1420355)
Backed out changeset d80b5c4e1dd0 (bug 1420355)
2017-11-29 03:08:46 +02:00
Mike Hommey 7c62087a43 Bug 1420355 - Statically link DMD. r=njn
--HG--
extra : rebase_source : 46800c9c0c5006a5a32f11abc209da27e65ae0f5
2017-11-28 08:10:48 +09:00
Mike Hommey d60e80991e Bug 1420355 - Allow to statically link replace-malloc libraries. r=njn
And statically link logalloc.

Statically linking is the default, except when building with
--enable-project=memory, allowing to use the generated libraries from
such builds with Firefox.

--HG--
extra : rebase_source : efe9edce8db6a6264703e0105c2192edc5ca8415
2017-11-23 17:24:19 +09:00
Mike Hommey 0a3b6c9813 Bug 1420355 - Don't initialize DMD if the DMD environment variable is not given. r=njn
This makes things slightly more inconvenient (having to set two
environment variables instead of one for the simplest case) until a few
patches down the line, when DMD is statically linked, at which point it
will get down to one environment variable every time.

--HG--
extra : rebase_source : 08dc3c05318b572ae1026227d0369fa8bf21b20f
2017-11-28 08:10:07 +09:00
Mike Hommey e38859b199 Bug 1420355 - Don't initialize logalloc if MALLOC_LOG is not given. r=njn
Now that replace_init can opt-out of registering the replace-malloc
functions, don't do so when MALLOC_LOG was not set in the environment.

While one would normally set MALLOC_LOG alongside one of the environment
variable necessary to load the replace-malloc library, we're also going,
in a subsequent change, to allow statically linking replace-malloc
libraries, taking full advantage of this change.

--HG--
extra : rebase_source : 944a9d7af33f88f793ee0104bd5e58ec508e4f58
2017-11-23 13:54:16 +09:00
Mike Hommey 3e3dbe9627 Bug 1420355 - Remove fallbacks when DMD is initializing. r=njn
As of bug 1420353, DMD's replace_* functions can't be called before
replace_init places them in the malloc function table, which only
happens after DMD::Init has run, meaning DMD is always initialized
by the time any of its replace_* function can be called.

--HG--
extra : rebase_source : 96bf4d01b6fac5cbb4712f56c572791cc4972f77
2017-11-28 08:05:58 +09:00
Mike Hommey ef6af827be Bug 1420355 - Don't declare replace_* functions in replace_malloc.h. r=njn
The original purpose of those declarations was to avoid the function
definitions being wrong, as well as forcing them being exported
properly (as extern "C", as weak symbols when necessary, etc.), but:

- The implementations being C++, function overloads simply allowed
  functions with the same name to have a different signature.

- As of bug 1420353, the functions don't need to be exported anymore,
  nor do we care whether their symbols are mangled. Furthermore, they're
  now being assigned to function table fields, meaning there is type
  checking in place, now.

So all in all, these declarations can be removed.

Also, as further down the line we're going to statically link the
replace-malloc libraries, avoid symbol conflicts by making those
functions static.

--HG--
extra : rebase_source : 0dbb15f2c85bc873e7eb662b8d757f99b0732270
2017-11-28 07:18:15 +09:00
Mike Hommey 8771ae803b Bug 1420355 - Don't link logalloc against the static runtime on Windows. r=njn
This was never strictly required (for instance, DMD doesn't do that),
and would make things harder with the subsequent changes.

--HG--
extra : rebase_source : 29ea08d41f54da7f99120f9fe9af4017f61d8a4b
2017-11-28 17:11:40 +09:00
Mike Hommey 32ecc64ada Bug 1420353 - Change how replace-malloc initializes, part 2. r=njn
Because one entry point is simpler than two, we make replace_init fulfil
both the roles of replace_init and replace_get_bridge.

Note this should be binary compatible with older replace-malloc
libraries, albeit not detecting their bridge (and with the
previous change, they do not register anyways). So loading older
replace-malloc libraries should do nothing, but not crash in awful ways.

--HG--
extra : rebase_source : aaf83e706ee34f45cfa75551a2f0998e5c5b8726
2017-11-24 16:02:05 +09:00
Mike Hommey 845f9c5d82 Bug 1420353 - Change how replace-malloc initializes, part 1. r=njn
The allocator API is a moving target, and every time we change it, the
surface for replace-malloc libraries grows. This causes some build
system problems, because of the tricks in replace_malloc.mk, which
require the full list of symbols.

Considering the above and the goal of moving some of the replace-malloc
libraries into mozglue, it becomes simpler to reduce the replace-malloc
exposure to the initialization functions.

So instead of the allocator poking into replace-malloc libraries for all
the functions, we expect their replace_init function to alter the table
of allocator functions it's passed to register its own functions.

This means replace-malloc implementations now need to copy the original
table, which is not a bad thing, as it allows function calls with one
level of indirection less. It also replace_init functions to not
actually register the replace-malloc functions in some cases, which will
be useful when linking some replace-malloc libraries into mozglue.

Note this is binary compatible with previously built replace-malloc
libraries, but because those libraries wouldn't update the function
table, they would stay disabled.

--HG--
extra : rebase_source : 2518f6ebe76b4c82359e98369de6a5a8c3ca9967
2017-11-22 17:24:29 +09:00
Mike Hommey 1f75d81c1c Bug 1417234 - Use SRWLock as Mutex for mozjemalloc on Windows. r=njn
SRWLock is more lightweight than CriticalSection, but is only available
on Windows Vista and more. So until we actually dropped support Windows
XP, we had to use CriticalSection.

Now that all supported Windows versions do have SRWLock, this is a
switch we can make, and not only because SRWLock is more lightweight,
but because it can be statically initialized like on other platforms,
allowing to use the same initialization code as on other platforms,
and removing the requirement for a DllMain, which in turn can allow
to statically link mozjemalloc in some cases, instead of requiring a
shared library (DllMain only works on shared libraries), or manually
call the initialization function soon enough.

There is a downside, though: SRWLock, as opposed to CriticalSection, is
not fair, meaning it can have thread scheduling implications, and can
theoretically increase latency on some threads. However, it is the
default used by Rust Mutex, meaning it's at least good enough there.
Let's see how things go with this.

--HG--
extra : rebase_source : 337dc4e245e461fd0ea23a2b6b53981346a545c6
2017-11-14 12:58:33 +09:00
Mike Hommey 5bf6af5d52 Bug 1229384 - Make pages_commit fallible. r=njn
This will make allocation operations return nullptr in the face of OOM,
allowing callers to either handle the allocation error or for the normal
OOM machinery, which also records the requested size, to kick in.

--HG--
extra : rebase_source : 723048645cb3f0db269c91f9d023bb06825a817b
2017-10-27 10:31:50 +09:00
Nicholas Nethercote a6fede36c2 Bug 1384814 - Remove critical address machinery from Mac implementation of MozStackWalk(). r=glandium.
It seemingly hasn't been needed since Mac OS 10.7. A diagnostic assertion that
has been in place for a while hasn't caught any uses of it.

--HG--
extra : rebase_source : 9834849eec9174267c7df8de7fd22840ffa36d8f
2017-10-03 13:53:14 +11:00
Mike Hommey d4a847cce0 Bug 1401101 - Remove the generic replace-malloc library. r=njn
It is one of the moving parts when adding new memory allocation APIs.

It was added in bug 1168719 and the only thing that actually used it
was the sampling-based memory profiler, which was removed in bug
1385953. We however keep the replace-malloc bridge entry point so that
something else, in the future, may still provide the feature.

--HG--
extra : rebase_source : dd4a226171429e2a4ab5666b0873e7b945f161e6
2017-09-19 15:58:33 +09:00
Mike Hommey 05e3823899 Bug 1399350 - Remove jemalloc_*_impl macros. r=njn
Those macros are one more thing that needs to be added when the
mozjemalloc API surface is increased, but after bug 1399350, nothing
actually needs them, so remove them.

--HG--
extra : rebase_source : 2bf62cc6c179540482722a72b0d0c134d2ac2a19
2017-09-13 14:25:21 +09:00
Sebastian Hengst 6af41593df merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-09-12 11:37:58 +02:00
Mike Hommey 6981b76dbc No bug - Remove the TODO item that was implemented in bug 1300948. r=me 2017-09-12 16:34:43 +09:00
Chris Manchester c0a229d4c3 Bug 1386876 - Replace all uses of DISABLE_STL_WRAPPING with a template, remove DISABLE_STL_WRAPPING. r=glandium
MozReview-Commit-ID: FMEtb5PY7iP

--HG--
extra : rebase_source : 3cdee7528846462c758e623d6bcd2e6e17dbabff
2017-09-11 11:33:26 -07:00
Nicholas Nethercote c419d5fa48 Bug 1389305 (attempt 2) - Add jemalloc_ptr_info() and moz_malloc_enclosing_size_of(). r=glandium.
--HG--
extra : rebase_source : 93a6cfcc916fb239581c2892f24b24c6fc65ac71
2017-09-01 11:52:23 +10:00
Sebastian Hengst 4310ea4600 Backed out changeset f232b5b1a0c7 (bug 1389305) for frequently failing GTest Jemalloc.PtrInfo on Linux opt. r=backout 2017-08-31 13:52:48 +02:00
Nicholas Nethercote 365285b831 Bug 1389305 - Add jemalloc_ptr_info() and moz_malloc_enclosing_size_of(). r=glandium.
jemalloc_ptr_info() gives info about any pointer, such as whether it's within a
live or free allocation, and if so, info about that allocation. It's useful for
debugging.

moz_malloc_enclosing_size_of() uses jemalloc_ptr_info() to measure the size of
an allocation from an interior pointer. It's useful for memory reporting,
especially for Rust code.

--HG--
extra : rebase_source : caa19cccf8c2d1f79cf004fe6a408775de5a7b22
2017-08-24 19:37:27 +10:00
Mike Hommey 57c65279a0 Bug 1395088 - Remove the jemalloc_bool type. r=njn
Back when it was added (for Windows CE, in bug 488608), mozjemalloc was
C and all the supported compilers didn't support C99 bools. Now
mozjemalloc is C++, and all the supported compilers support C99 bools
for the cases where the type is used from C.

--HG--
extra : rebase_source : b9c710a0c48dc36cb473af59e3119131d13523ce
2017-08-30 18:04:47 +09:00
David Major 406287685a Bug 1391420: Set NO_PGO on a bunch of binaries that we don't ship. r=ted 2017-08-23 15:05:40 -04: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
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
Nicholas Nethercote 710682624c Bug 1387940 - Make --max-frames=8 the default for dmd.py. r=mccr8.
The current default is 24, which is equal to the maximum number of stack frames
that DMD will record. And that's a terrible value because it splits up too many
related stack traces into separate records. There is no single best value, but
8 is a much better default.

--HG--
extra : rebase_source : c423fc4fe0e490ff6d58fa8f7116bc01c86a366e
2017-08-07 14:56:15 +10:00
Nicholas Nethercote 406a9ed175 Bug 1384819 (part 3) - Remove the return value from the stack walker functions. r=glandium.
Just one caller (in DMD) actually looks at it, and that's in an unimportant way
-- if the return value was false, mLength would be zero anyway.

--HG--
extra : rebase_source : 0463ab3765744742a9e854964342d631095fa55f
2017-07-27 16:46:55 +10:00
Nicholas Nethercote 8a20eb82d2 Bug 1384819 (part 2) - Tweak FramePointerStackWalk() arguments. r=glandium.
This patch does he following.

- Avoids some unnecessary casting.

- Renames the |bp| parameter as |aBp|.

- Makes the no-op FramePointerStackWalk() signature match the real one.
  (Clearly it's dead code in all built configurations!)

--HG--
extra : rebase_source : 3fe606d1ff9b063294f4028ff884c20661ed9e0a
2017-07-27 16:46:33 +10:00
Nicholas Nethercote 08e54b7c13 Bug 1384819 (part 1) - Split MozStackWalk(). r=glandium.
MozStackWalk() is different on Windows to the other platforms. It has two extra
arguments, which can be used to walk the stack of a different thread.

This patch makes those differences clearer. Instead of having a single function
and forbidding those two arguments on non-Windows, it removes those arguments
from MozStackWalk, and splits off MozStackWalkThread() which retains them. This
also allows those arguments to have more appropriate types (HANDLE instead of
uintptr_t; CONTEXT* instead of than void*) and names (aContext instead of
aPlatformData).

The patch also removes unnecessary reinterpret_casts for the aClosure argument
at a couple of MozStackWalk() callsites.

--HG--
extra : rebase_source : 111ab7d6426d7be921facc2264f6db86c501d127
2017-07-27 12:46:47 +10:00
Nicholas Nethercote f7a538edd4 Bug 1382076 - Use FramePointerStackWalk() in DMD on Win32. r=erahm.
The patch also uses a better value for skipFrames on Win64.

--HG--
extra : rebase_source : ef3d6d68fbea45e7fd571db2ba78904d97f5e21e
2017-07-20 11:33:31 +10:00
Nicholas Nethercote 4325ae218a Bug 1371397 - Use FramePointerStackWalk() in DMD on Mac. r=erahm.
This avoids MozStackWalk(), which has become unusably slow on Mac due to
changes in libunwind, and gets us back to decent speed.

The code for getting the frame pointer and stack end was copied from the Gecko
Profiler, which also uses FramePointerStackWalk() on Mac.

--HG--
extra : rebase_source : 58c32c2df8716c7c8123a4a8fb692182d066caca
2017-07-07 07:08:08 +10:00
Mike Hommey ed863255b4 Bug 1378592 - Remove MOZ_REPLACE_MALLOC_LINKAGE. r=froydnj
MOZ_REPLACE_MALLOC_LINKAGE was added back when there were problems with
getting weak references working properly for replace-malloc.

Versions of OSX < 10.6 needed flat namespace, but aren't supported
anymore.

Versions of Xcode < 4.5 required flat namespace + a dummy library in
order to produce proper weak references. There is virtually nobody still
building with such an ancient toolchain.

Keeping those around doesn't /really/ hurt, except recent versions of
Xcode don't expose dyldinfo in /usr/bin, used for the configure test.
Consequently, MOZ_REPLACE_MALLOC_LINKAGE ended up being set to use the
dummy library setup, which, by using flat namespace, now causes harm in
bug 1356701, causing bug 1378332.

--HG--
extra : rebase_source : e3edc1f2cf905943c33fafeb631f2f88fc87167e
2017-07-06 10:26:04 +09:00
Mike Hommey 1b12c351f2 Bug 1368932 - Add a testcase for a replace-malloc library that doesn't implement all functions. r=njn
--HG--
rename : memory/replace/logalloc/moz.build => memory/replace/logalloc/logalloc.mozbuild
rename : memory/replace/logalloc/replay/replay.log => memory/replace/logalloc/replay/expected_output_minimal.log
extra : rebase_source : 94f8fb4444e2e0ecda61e5ffd283ab560d1e9dfe
2017-05-31 15:04:32 +09:00
Mike Hommey 4ae1509807 Bug 1368932 - Handle missing replace_posix_memalign at the replace-malloc level. r=njn
Replace-malloc libraries, such as DMD, don't really need to care about
the details of implementing all the variants of aligned memory
allocation functions. Currently, by defining MOZ_REPLACE_ONLY_MEMALIGN
before including replace_malloc.h, they get predefined functions.

Instead of making that an opt-in at build time, we make the
replace-malloc initialization just fill the replace-malloc
malloc_table_t with implementations that rely on the replace_memalign
the library provides.

--HG--
extra : rebase_source : 0842a67d9bc27a9a86c33d14d98b9c25f39982fb
2017-05-31 13:47:17 +09:00
Mike Hommey 782725e19a Bug 1363992 - Remove jemalloc 4. r=njn
--HG--
extra : rebase_source : 9794320e96279cbb8b7b66db6720c959eaa6a95b
2017-05-11 13:23:07 +09:00
Mike Hommey 02a06f7958 Bug 1363992 - Remove support for making jemalloc4 the default. r=njn
--HG--
extra : rebase_source : 77e1c13aa329637d0ec875439d572ee06e6919fa
2017-05-11 13:16:00 +09:00
Julian Seward 83969e88eb Bug 1361258 - Add a jemalloc_thread_local_arena API with a binding for rust. r=glandium
The intent of the API is to allow threads to opt-in to use a separate
mozjemalloc arena.

This indroduces a dummy shell with no actual implementation.
2017-05-12 18:08:08 +09:00
Tom Tromey b4f2234e87 Bug 1334286 - use MOZ_FORMAT_PRINTF in DMD; r=njn
Add MOZ_FORMAT_PRINTF to the appropriate spots in DMD and fix up the
one (trivial) error that this pointed out.

MozReview-Commit-ID: LS0UWV5YRoM

--HG--
extra : rebase_source : eb09be39df61a51acd46ed72a1461c495727af79
2017-04-21 15:54:05 -06:00
Eric Rahm 3d78211d31 Bug 1349002 - Build DMD with unified sources. r=njn
DMD can be built with unified sources, additionally it doesn't need NSPR's
strcpy to build properly.

MozReview-Commit-ID: 9hZFlpWdt7
2017-03-21 12:24:43 -07:00
Wes Kocher 9b58353afe Backed out changeset 2f6d3cbedd12 (bug 1349002) for build bustage a=backout
MozReview-Commit-ID: DY4OupKVBlS
2017-03-20 18:08:43 -07:00
Eric Rahm 5b55122df3 Bug 1349002 - Build DMD with unified sources. r=njn
DMD can be built with unified sources, additionally it doesn't need NSPR's
strcpy to build properly.

MozReview-Commit-ID: 9hZFlpWdt7
2017-03-20 17:24:34 -07:00
Eric Rahm 6bb5fd3d99 Bug 1341621 - Avoid deadlocks in DMD when forking. r=njn
In order to avoid the possibility of a deadlock if the DMD state lock is
currently acquired when forking a |pthread_atfork| hook is added to wait for
and acquire the lock prior to forking, then release it after forking.
2017-02-23 17:47:02 -08:00
Emanuel Hoogeveen 9c7c14c872 Bug 1338574 - Part 1: Add MOZ_CRASH_UNSAFE_OOL and MOZ_CRASH_UNSAFE_PRINTF to crash with a runtime generated explanation string. r=froydnj
--HG--
extra : rebase_source : 3ba633aa77ab96f763ea03a8308c539c9c2aeda0
2017-02-21 18:01:41 +01:00
Sylvestre Ledru 6fd3084f65 Bug 1338086 - Remove useless else blocks in order to reduce complexity in memory/ r=njn
MozReview-Commit-ID: G7jBKlDHshQ

--HG--
extra : rebase_source : 4317651e0cc87b0be1230b19ceb844cfcb4842bc
2017-02-09 11:24:39 +01:00
Mike Hommey d1c271f02d Bug 1321093 - Avoid logalloc-replay make check failure when libstdc++ allocates memory in some static initializer. r=njn
--HG--
extra : rebase_source : 83ef3414b74a5164b8535bdf266075d1076e0437
2016-11-30 07:22:20 +09:00
Emanuel Hoogeveen b324d2ba21 Bug 1315939 - Use FINAL_LIBRARY = 'memory' in jemalloc and mozjemalloc. r=glandium
--HG--
extra : rebase_source : 94d19e08090839537ca5174baa8b37993d108acc
2016-11-10 06:57:00 -05:00
Emanuel Hoogeveen e0a81d7503 Bug 1309573 - Part 2: Define MOZ_HAS_MOZGLUE in various places so that the crash reason gets used. r=glandium
--HG--
extra : rebase_source : d55e8dd75469759f333366bdf9662178ff0a2474
2016-11-08 03:53:00 -05:00
Mike Hommey 97f635df6b Bug 1303232 - Use per-process reduced thread-ids when munging logalloc logs. r=njn
Bug 1300948 added thread-ids to logalloc logs, and logalloc_munge.py was
munging them all as if they were all under the same namespace. But when
filtering munged logs to only contain logs from a given process,
thread-ids then don't necessarily start from 1, which would be the
desired outcome.

So use a different pool of thread-ids for each process.
2016-09-20 13:44:27 +09:00
Mike Hommey 7e7b4f9fe6 Bug 1300974 - Work around race condition leading to deadlock on fork when enabling LogAlloc. r=njn 2016-09-08 07:56:02 +09:00
Mike Hommey 39fe86c4ed Bug 1300948 - Add thread identifier to LogAlloc output. r=njn 2016-09-08 07:55:03 +09:00
Emanuel Hoogeveen 8210833803 Bug 1294732 - Back out all of bug 1271165 as it has served its purpose. r=glandium 2016-08-23 08:45:00 -04:00
Kan-Ru Chen b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
Emanuel Hoogeveen 57b1d1e8f2 Bug 1271165 - Part 2: Hook the new functions up and provide dummy implementations where needed. r=ehoogeveen 2016-08-12 07:37:00 -04:00
Alexandre Lissy 0af5b943b6 Bug 1284674 - Remove NUWA r=cyu
MozReview-Commit-ID: GyMRNzOBKw6

--HG--
extra : rebase_source : 293af1cd55f2035ce6a99f4ebf144059c32a2b8f
2016-08-02 14:54:00 +02:00
Chris Peterson 6229606616 Bug 1290645 - Remove VS2013 workarounds in memory/. r=glandium 2016-07-28 11:46:30 -07:00
Tom Tromey 5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Nicholas Nethercote 6f4e7b36f5 Bug 1282185 (part 2) - Fix an assertion failure in DMD. r=erahm.
--HG--
extra : rebase_source : cb2ae2a5a6fdc84bbcaba64759b0dbce1e161249
2016-07-13 19:32:27 +10:00
Nicholas Nethercote dcf407f2a8 Bug 1282185 (part 1) - Remove a bogus assertion in DMD. r=erahm.
Since bug 1253512 landed, it's possible for DeadBlocks to lack an allocation
stack.

--HG--
extra : rebase_source : 0efc60192ed0992d2f68838d95586cd888765586
2016-07-13 18:10:56 +10:00
Chris Peterson 8a9e2d2bd4 Bug 1272513 - Part 2: Remove redundant -Wshadow CXXFLAGS from moz.build files. r=glandium 2016-05-14 00:54:55 -07:00
Chris Peterson 353ee65255 Bug 1272513 - Part 1: Suppress -Wshadow warnings-as-errors in some directories. r=glandium 2016-05-11 00:00:01 -07:00
Nicholas Nethercote b1378bc5e8 Bug 1260329 - Properly escape the frameTable when running |dmd.py --clamp-contents|. r=mccr8.
--HG--
extra : rebase_source : 7a55328abb0a79cfa6de21734ee3d440b7625f79
2016-03-29 13:34:57 +11:00
Nicholas Nethercote 43969ea737 Bug 1181142 - Part 0: Update DMD tests to handle a minimum alloc size of 16 on Win64. r=erahm. 2016-03-29 16:31:21 +11:00
Nicholas Nethercote eb9d46b90f Bug 1253512 (part 2) - Aggregate live blocks. r=erahm.
Due to the change in part 1, DMD now prints an entry for every live block,
which increases the output file size significantly in the default case. However,
a lot of those entries are identical and so can be aggregated via the existing
"num" property.

This patch does that, reducing output size by more than half.

--HG--
extra : rebase_source : 6a3709d068f2fb9bbfe3344d7406f05af896380b
2016-03-29 10:41:06 +11:00
Nicholas Nethercote 0f418f3874 Bug 1253512 (part 1) - Overhaul DMD's "sampling". r=erahm.
DMD currently uses a very hacky form of "sampling" by default to avoid
recording stack traces for all blocks. This makes DMD run faster than when it
records all stack traces.

This patch changes the sampling method used; in fact, it avoids "sampling" at
all. The existence of all heap blocks is now recorded exactly, but by default
we only record an allocation stack for each heap block if a Bernoulli trial
succeeds. This choice works well because getting the stack trace is ~100x
slower than recording the block's existence.

Overall, this approach is simpler and it also gives better output -- the choice
of which blocks to record allocation stacks for is mathematically sound, no
stack trace gets blamed for allocations it didn't do, and block counts and
sizes are now always exact.

Other specific things changed.

- All notion of sampling is removed from the various data structures.

- The --sample-below option is removed in favour of --stacks={partial,full}.

- The format of the JSON output file has changed.

- The names of various test files have changed to reflect concept changes.

--HG--
rename : memory/replace/dmd/test/full-empty-cumulative-expected.txt => memory/replace/dmd/test/complete-empty-cumulative-expected.txt
rename : memory/replace/dmd/test/full-empty-dark-matter-expected.txt => memory/replace/dmd/test/complete-empty-dark-matter-expected.txt
rename : memory/replace/dmd/test/full-empty-live-expected.txt => memory/replace/dmd/test/complete-empty-live-expected.txt
rename : memory/replace/dmd/test/full-unsampled1-dark-matter-expected.txt => memory/replace/dmd/test/complete-full1-dark-matter-expected.txt
rename : memory/replace/dmd/test/full-unsampled1-live-expected.txt => memory/replace/dmd/test/complete-full1-live-expected.txt
rename : memory/replace/dmd/test/full-unsampled2-cumulative-expected.txt => memory/replace/dmd/test/complete-full2-cumulative-expected.txt
rename : memory/replace/dmd/test/full-unsampled2-dark-matter-expected.txt => memory/replace/dmd/test/complete-full2-dark-matter-expected.txt
rename : memory/replace/dmd/test/full-sampled-live-expected.txt => memory/replace/dmd/test/complete-partial-live-expected.txt
extra : rebase_source : 47d287405dc5e9075f08addaba49e879c2c6e23f
2016-02-24 14:42:22 +11:00
Ms2ger d1f112a81b Bug 1254948 - Remove makefiles used to transition from jemalloc_config.c to jemalloc_config.cpp; r=glandium 2016-03-10 15:53:58 +01:00
Jonathan Watt a9c7d25928 Bug 1253094, part 10 - Stop using DebugOnly for class/struct members in memory/. r=njn
MozReview-Commit-ID: LLSCgDES38Q
2016-02-26 15:52:08 +00:00
Nicholas Nethercote 460cabb8f7 Bug 1253526 (part 2) - Gut DMD's usage message. r=erahm
It's rare anyone would see it, and it just duplicates the info present in |mach
run|.

--HG--
extra : rebase_source : fbb1716616ca1ff007af4202757586627c8612b4
2016-03-04 17:12:37 +11:00
Nicholas Nethercote ebc23cf4dc Bug 1253526 (part 1) - Remove DMD's --max-frames option. r=erahm.
Nobody uses it.

--HG--
extra : rebase_source : 6fe2af5f2b7ec19fad8f8cd49871a63599d7ebba
2016-03-04 17:02:20 +11:00
Nicholas Nethercote 160743c7c2 Bug 1144842 (part 2) - Make --enable-dmd imply --enable-profiling. r=glandium.
This requires moving the --enable-dmd code earlier, before MOZ_PROFILING starts
being used.

--HG--
extra : rebase_source : acfdc6c4c82436c0a1834e11ddc567e37318da60
2016-01-21 16:58:50 -08:00
Mike Hommey e0c501a1c1 Bug 1235738 - Move MOZ_DEBUG_DEFINES to build frontend. r=gps
MOZ_DEBUG_DEFINES are essentially defines used everywhere. So treat them as
feeding the initial value for DEFINES in each moz.build sandbox. This allows
the kind overrides that was done in the past by resetting MOZ_DEBUG_DEFINES
in Makefiles.
2015-12-31 07:27:23 +09:00
Jon Coppeard 498b421261 Bug 1232672 - Use MOZ_WARN_UNUSED_RESULT to make hash table clients check for failure r=luke r=billm r=njn 2015-12-22 13:29:43 +00:00
Eric Rahm ce27e9a516 Bug 1160272 - DMD build should include |mfbt/Poison.cpp|. r=glandium
--HG--
extra : rebase_source : 01dbcc2f41aa8325a9e0859e7848ce673457d4a7
2015-04-30 15:13:05 -07:00
Mike Hommey 762aba02cd Bug 1221453 - Use ObjDirPaths for GENERATED_INCLUDES and merge with LOCAL_INCLUDES. r=gps 2015-11-06 09:59:21 +09:00
Carsten "Tomcat" Book 08997000eb Backed out 2 changesets (bug 1202902) to recking bug 1202902 to be able to reopen inbound on a CLOSED TREE
Backed out changeset 647025383676 (bug 1202902)
Backed out changeset d70c7fe532c6 (bug 1202902)
2015-10-07 14:03:21 +02:00
Carsten "Tomcat" Book e7ef778c9d Backed out 1 changesets (bug 1202902) for causing merge conflicts to mozilla-central
Backed out changeset cfc1820361f5 (bug 1202902)

--HG--
extra : rebase_source : 5d3db72337754bc7ab0ed0c30b2896100411ff92
2015-10-07 12:13:45 +02:00
Shu-yu Guo d06b6030f6 Bug 1202902 - Scripted fix the world. 2015-10-06 14:00:31 -07:00
Mike Hommey 9f2c4e94ba Bug 1209875 - Get rid of XULPPFLAGS. r=gps
The flags added in toolkit/locales/Makefile.in turn out not to be actually
used, so just remove that.

The remaining uses of XULPPFLAGS are to set debug flags depending on whether
MOZ_DEBUG is set or not. Just set a dedicated variable with the right value
from configure.
2015-10-01 07:30:48 +09:00
Jon Coppeard 204777d13d Bug 1207519 - Prevent HashTable shrink from ignoring allocation failures that may have been reported r=Waldo 2015-09-30 11:34:49 +01:00
Jon Coppeard 0b41e069f3 Bug 1200642 - Add checkSimulatedOOM() to AllocPolicy r=Waldo 2015-09-30 11:34:44 +01:00
Chris Peterson 71920a9550 Bug 1207030 - Enable -Wshadow flag in more directories that have no -Wshadow warnings. r=glandium 2015-09-22 21:39:03 -07:00
Shu-yu Guo 64db2267cf Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
Nicholas Nethercote 26157f37df Bug 1202965 (part 2) - Use MOZ_UNUSED in FdPrintf.c. r=glandium. 2015-09-09 17:01:32 -07:00
Mike Hommey 0efccdc82c Bug 1201792 - s/MOZ_JEMALLOC3/MOZ_JEMALLOC4/. r=njn 2015-09-04 15:15:47 +09:00
Mike Hommey 4fb6c55f9d Bug 1141079 - Make jemalloc_config.c a C++ source file. r=ted
--HG--
rename : memory/build/jemalloc_config.c => memory/build/jemalloc_config.cpp
2015-09-04 14:35:54 +09:00
Nicholas Nethercote e5dc6b8368 Bug 1200623 - Fix FdPrintf.o link error in --disable-optimize builds. r=glandium.
--HG--
extra : rebase_source : 2225f8496f540a01a19477e6e5e77cbc56877dea
2015-09-01 17:52:56 -07:00
Nicholas Nethercote a6522f55a6 Bug 1200097 - Fix warnings in logalloc. r=glandium.
--HG--
extra : rebase_source : 5f49243f7b46b411ec845c3f747fdb14bc959b07
2015-08-31 16:53:13 -07:00
Nicholas Nethercote f44287005f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.

--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
2015-08-27 20:44:53 -07:00
Chris Peterson 1416e566de Bug 1198124 - Enable -Wshadow in directories that have no -Wshadow warnings. r=glandium 2015-08-25 09:14:38 -07:00
Andrew McCreight ae06b3dd9d Bug 1179042 - Add a script for analyzing memory blocks using a heap scan DMD log. r=njn DONTBUILD
Based on:
0a68e57a2c/dmd/block_analyzer.py
2015-08-17 16:48:10 -07:00
Makoto Kato ed0bf31fba Bug 830801 - Part 3. Remove NOMINMAX define from cpp source. r=mshal 2015-08-03 10:07:20 +09:00
Ehsan Akhgari 85cda505f8 Bug 1188209 - Fix more constructors in memory; r=njn 2015-07-28 08:53:29 -04:00
Birunthan Mohanathas a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Andrew McCreight 6e608d39d9 Bug 1058178, part 2 - Implement address clamping analysis for DMD scan logs. r=njn
This adds a new option --clamp-contents to dmd.py. This replaces every value
contained in the memory contents in the log with a pointer to the start of a live
block, if the value is a pointer into the middle of that block. All other values
are replaced with 0. This conservative analysis makes it easier to determine
which blocks point to other blocks.
2015-06-30 11:54:15 -07:00
Andrew McCreight 1f8cde6f73 Bug 1058178, part 1 - Implement DMD heap scanning mode. r=njn
This implements a new "scan" mode for DMD that records the address
and contents of every live unsampled block in the DMD log. This
enables the low-level analysis of references from one block to
another, which can help leak investigations.
2015-06-30 11:54:15 -07:00
Benoit Girard 8d6a67f6d3 Bug 1172216 - Move nsStackwalk to mozglue. r=glandium
--HG--
rename : xpcom/base/nsStackWalk.cpp => mozglue/misc/StackWalk.cpp
rename : xpcom/base/nsStackWalk.h => mozglue/misc/StackWalk.h
extra : commitid : EMbWGfjKvdq
extra : rebase_source : b7308eb569cc1a019d3b7a92aaff0de7a49b5682
2015-06-10 16:32:45 -04:00
Andrew McCreight e1908881c5 Bug 1172568 - Run test_dmd.js on OS X. r=njn 2015-06-10 07:24:00 -04:00
Mike Hommey 68221d7d35 Bug 1172668 - Unbreak DMD on OS X after bug 1168719. r=gps
Bug 1168719 added a generic replace malloc library which name happened to be
the same as the existing dummy library used to link replace malloc on OSX.
Change the name of that dummy library.
2015-06-10 10:49:22 +09:00
Andrew McCreight 2a29c1b921 Bug 1171647, part 2 - Remove redundant assertion for dark matter mode. r=njn 2015-06-06 14:44:19 -07:00
Andrew McCreight 7cb7fe1ebd Bug 1171647, part 1 - Define a new function to convert the mode to a string. r=njn 2015-06-06 14:44:19 -07:00
Mike Hommey 985ca5fd67 Bug 1168719 - Generic replace-malloc library. r=njn 2015-06-05 10:40:58 +09:00
Mike Hommey fe90037862 Bug 1043692 - Add a DIST_INSTALL variable to moz.build, and replace NO_DIST_INSTALL with it. r=gps 2015-05-12 07:55:21 +09:00
Mike Hommey 924c9eb636 Bug 1134923 - Remove NS_Alloc/NS_Realloc/NS_Free. r=nfroyd
They are kept around for the sake of the standalone glue, which is used
for e.g. webapprt, which doesn't have direct access to jemalloc, and thus
still needs a wrapper to go through the xpcom function list and get to
jemalloc from there.
2015-05-01 09:40:30 +09:00
ziyunfei e1db0f779e Bug 1102219 - Part 4: Replace `String.prototype.contains` with `String.prototype.includes` in chrome code. r=till 2015-04-30 00:32:05 +09:00
Jed Davis 5841b01411 Bug 1102388 - Fix DMD static constructor ordering dependency. r=mccr8
Sometimes, at least on Linux, DMDFuncs::sSingleton's static initializer
(in libxul) was being called before sDMDBridge's (in libdmd).
Thus sDMDBridge wasn't constructed yet in the path where its
address is taken, passed down through {replace_,}get_bridge to
ReplaceMallocBridge::Get, and its mVersion field is read.

This patch uses dynamic allocation, following what's done for other
globals in the same situation in this file.

Also, naming convention fix: leading "s" is for C++ class statics;
C-style static globals should be "g".

--HG--
extra : rebase_source : 4a6447760555aa11109749c612094ba1694b41f6
2015-04-20 23:05:00 +02:00
Ehsan Akhgari 399276d5fc Bug 1153348 - Add an analysis to prohibit operator bools which aren't marked as either explicit or MOZ_IMPLICIT; r=jrmuizel
This is the counterpart to the existing analysis to catch
constructors which aren't marked as either explicit or
MOZ_IMPLICIT.
2015-04-21 21:40:49 -04:00
Wes Kocher 638b28b8e0 Backed out changeset 02e6a50741a9 (bug 1153348) to hopefully fix the static bustage CLOSED TREE 2015-04-21 15:47:40 -07:00
Ehsan Akhgari 3d21a05904 Bug 1153348 - Add an analysis to prohibit operator bools which aren't marked as either explicit or MOZ_IMPLICIT; r=jrmuizel
This is the counterpart to the existing analysis to catch
constructors which aren't marked as either explicit or
MOZ_IMPLICIT.
2015-04-21 16:31:58 -04:00
Jed Davis 83dc2d2c83 Bug 1128705 - Don't redefine PAGE_SIZE in DMD if it's already defined. r=erahm
--HG--
extra : rebase_source : 978b2d5440e448dec97affa98c8f5c712fcbb051
2015-04-20 14:15:00 +02:00
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Anish 4063a569ed Bug 958147 - Choose one of run-if or skip-if and get rid of the other.r=jmaher, mwargers 2015-03-03 08:46:37 -05:00
Chris Peterson a7dcfcca64 Bug 1129326 - Remove nonstandard let blocks from memory/replace/dmd/test/test_dmd.js. r=njn 2015-01-24 23:37:31 -08:00
Nicholas Nethercote a479e9ccad Bug 1121830 - DMD: add "num" property to blocks in the output. r=mccr8.
The new "num" property lets identical blocks be aggregated in the output. This
patch only uses the "num" property for dead blocks, because that's where the
greatest potential benefit lies, but it could be used for live blocks as well.

On one test case (a complex PDF file) running with --mode=cumulative
--sample-below=1 this patch had the following effects.

- Change in running speed was negligible.

- Compressed output file size dropped from 8.8 to 5.0 MB.

- Compressed output file size dropped from 297 to 50 MB.

- dmd.py runtime (without stack fixing) dropped from 30 to 8 seconds.

--HG--
extra : rebase_source : 46a32058cd5c31cd823fe3f1accb5e68bcd320f3
2015-01-15 20:38:38 -08:00
Nicholas Nethercote 059cf96c41 Bug 1122337 - Mark DMD directories as FAIL_ON_WARNINGS. r=glandium.
The DEFINES and XPCOM_API changes are needed to get rid of "inconsistent dll
linkage" warnings on Windows builds.

--HG--
extra : rebase_source : 00756f51ebee85c70f65d51dbac17b4835262697
2015-01-15 21:17:18 -08:00
Mike Hommey 2e083509f2 Bug 1120798 - Use a larger realloc in one of the DMD tests so that it passes for mozjemalloc as well as jemalloc3. r=njn 2015-01-14 15:18:49 +09:00
Masatoshi Kimura bf312ad056 Bug 1120062 - Part 1: Remove most Nullptr.h includes. r=waldo 2015-01-11 11:34:52 +09:00
Nicholas Nethercote cdd9ba9d57 Bug 1088343 (part 2) - Enable test_dmd on Win64. r=glandium.
--HG--
extra : rebase_source : b85a5e35c71f44d7f615bc67863711a4876e9da4
2015-01-08 16:04:43 -08:00
Vladimir Vukicevic a910628209 Bug 1112566 - Use jemalloc C99 msvc compat headers when building mozjemalloc compat glue and jemalloc3 replace-malloc library. r=glandium 2014-12-23 15:27:18 +09:00
Nicholas Nethercote 53da6fb716 Bug 1112968 - dmd.py: Tweak the --alloc-fns list for better effect on Windows. r=mccr8.
--HG--
extra : rebase_source : 3dc8a09f9a22bf234406c0ff89d7b4050c7908e7
2014-12-18 18:59:53 -08:00
Nicholas Nethercote 8030658f62 Bug 1112968 - dmd.py: Tweak the --alloc-fns list for better effect on Mac. r=mccr8.
--HG--
extra : rebase_source : 03dbab1eeb4e3f99672a174277ba634a39a98292
2014-12-17 19:10:59 -08:00
Nicholas Nethercote 658df429fc Bug 1110455 - Add --sort-by=num-blocks option to dmd.py. r=mccr8.
--HG--
extra : rebase_source : 6d6aa87f102ee069f4f5052607463380c656f80d
2014-12-15 15:04:39 -08:00
Nicholas Nethercote e358318e29 Bug 1111419 - dmd.py: add a cache for recordKeyParts. r=mccr8.
This reduces the runtime on my Linux machine for one large DMD output file from
235 seconds to 105 seconds.

--HG--
extra : rebase_source : bd567319c1207a09fa47b94571066109de1cc9e7
2014-12-15 15:04:34 -08:00
Ehsan Akhgari ebdf8e7c36 Bug 1109746 - Fix more bad implicit constructors in some random code across the tree
--HG--
extra : amend_source : 48ca151cb1ca2193404c65831556051c02093914
2014-12-13 14:17:04 -05:00
Ryan VanderMeulen 9a56a97e41 Backed out changesets 34a66a625618, 32db3daa20fe, and ac15ba8568c5 (bug 1102219) for Gaia unit test failures.
--HG--
extra : rebase_source : 0266cc0b2a6568ca653885745f381df8d6d167ec
2014-12-11 11:28:30 -05:00
ziyunfei 5f470bd4a1 Bug 1102219 - Part 3: Replace String.prototype.contains with String.prototype.includes in chrome code. r=till 2014-12-10 20:50:00 -05:00
Nicholas Nethercote ee6de8d6c9 Bug 1100851 - Print the mode in dmd.py's output. r=mccr8.
--HG--
extra : rebase_source : ae0f985ba8a74dfec8a36ff1a380279ed18b675b
2014-12-10 13:33:50 -08:00
Nicholas Nethercote 98688c1a41 Bug 1100851 - Tweak DMD to account for the fact that $DMD can now be undefined. r=glandium.
Now that defining $DMD is no longer necessary to run DMD, this patch does the
following.
- Removes all the places where we set DMD=1 (test harnesses, etc.)
- Still handles DMD=1, for backwards compatibility.
- Prints "$DMD is undefined" at DMD start-up if appropriate.
- Writes a |null| value for |dmdEnvVar| in the JSON if $DMD is undefined. Bumps
  the DMD output version number accordingly.
- Changes a bunch of the test files accordingly, including changing the mode of
  script-ignore-alloc-fns.json in order to test a case where $DMD is undefined.

--HG--
extra : rebase_source : eb1ef5722410734ce6d7658465ff6f442ee4ed49
2014-11-27 21:04:46 -08:00
Nicholas Nethercote 5e166635cb Bug 1094552 (part 6) - DMD: add support for cumulative heap profiling. r=mccr8.
By adding a new "cumulative" mode.

--HG--
extra : rebase_source : 5c851b7c594a134fae48393ff0becfd057715041
2014-10-30 20:22:47 -07:00
Nicholas Nethercote c3648686f0 Bug 1094552 (part 5) - DMD: choose the profiling mode at start-up. r=mccr8.
This patch moves profiling mode selection from post-processing (in dmd.py) to
DMD start-up. This will make it easier to add new kinds of profiling, such as
cumulative heap profiling.

Specifically:

- There's a new --mode option. |LiveWithReports| is the default, as it is
  currently.

- dmd.py's --ignore-reports option is gone.

- There's a new |mode| field in the JSON output.

- Reports-related operations are now no-ops if DMD isn't in LiveWithReports
  mode.

- Diffs are only allowed for output files that have the same mode.

- A new function ResetEverything() replaces the SetSampleBelowSize() and
  ClearBlocks(), which were used by the test to change DMD options.

- The tests in SmokeDMD.cpp are split up so they can be run multiple times, in
  different modes. The exact combinations of tests and modes has been changed a
  bit.

--HG--
rename : memory/replace/dmd/test/full-reports-empty-expected.txt => memory/replace/dmd/test/full-empty-dark-matter-expected.txt
rename : memory/replace/dmd/test/full-heap-empty-expected.txt => memory/replace/dmd/test/full-empty-live-expected.txt
rename : memory/replace/dmd/test/full-heap-sampled-expected.txt => memory/replace/dmd/test/full-sampled-live-expected.txt
rename : memory/replace/dmd/test/full-reports-unsampled1-expected.txt => memory/replace/dmd/test/full-unsampled1-dark-matter-expected.txt
rename : memory/replace/dmd/test/full-heap-unsampled1-expected.txt => memory/replace/dmd/test/full-unsampled1-live-expected.txt
rename : memory/replace/dmd/test/full-reports-unsampled2-expected.txt => memory/replace/dmd/test/full-unsampled2-dark-matter-expected.txt
rename : memory/replace/dmd/test/script-diff-basic-expected.txt => memory/replace/dmd/test/script-diff-live-expected.txt
rename : memory/replace/dmd/test/script-diff1.json => memory/replace/dmd/test/script-diff-live1.json
rename : memory/replace/dmd/test/script-diff2.json => memory/replace/dmd/test/script-diff-live2.json
extra : rebase_source : bf32cc4e0d82aa1a20ceb55e8ea259850b49cc06
2014-12-08 14:45:14 -08:00
Nicholas Nethercote 7a1087c6c6 Bug 1094552 (part 4) - Rename AnalyzeReports() as Analyze(). r=mccr8.
Because DMD is no longer just about measuring memory reports coverage, but is
also used for more general heap profiling.

--HG--
extra : rebase_source : 82b4579de240037f96cf6618b15870925adc431b
2014-12-08 14:45:13 -08:00
Nicholas Nethercote e4c12e978c Bug 1102525 (part 1) - Add InfallibleAllocPolicy to mozalloc. r=glandium.
--HG--
extra : rebase_source : a79162fb7f73e52c5c8df29c8229efc64c3451e5
2014-12-08 14:45:10 -08:00
Nicholas Nethercote 5fad01bb19 Bug 1094552 (part 3) - DMD: rename |Block| as |LiveBlock|. r=mccr8.
This is to give better contrast with |DeadBlock|, which will be added in the
next patch.

--HG--
extra : rebase_source : cbc767fcc5667cfed108ca7c4ebf1d7e82aa185e
2014-11-18 18:57:20 -08:00
Nicholas Nethercote 29bf26b228 Bug 1094552 (part 2) - DMD: tweak Range and Enum use. r=mccr8.
This patch:

- Uses |auto| in Range loops, so more of them fit on a single line.

- Converts one use of HashSet::Enum (which is only needed if you're modifying
  the HashSet as you iterate) to HashSet::Range.

--HG--
extra : rebase_source : 09b011cd69218c06984f06420d375839cd4e9214
2014-11-23 17:39:17 -08:00
Nicholas Nethercote f38abd1199 Bug 1094552 (part 1) - DMD: rename mSampled field. r=mccr8.
The getter is called IsSampled(), so the field should match that.

--HG--
extra : rebase_source : 074c748eff909faee51bc03888b0c7f328bff82e
2014-11-18 19:11:36 -08:00
Mike Hommey e68882a91d Bug 1098967 - Use native Win32 APIs to append to the LogAlloc output. r=nfroyd
Because it turns out that the POSIX API the CRT exposes doesn't do O_APPEND
in a sane manner.
2014-11-19 09:46:49 +09:00
Mike Hommey 558fe59234 Bug 1087245 part 2 - Register the MALLOC_LOG file handle from LogAlloc to poison IO interposer. r=nfroyd 2014-11-18 19:21:06 +09:00
Mike Hommey 7def0f9cd3 Bug 1097507 - Make libxul independent of libdmd when DMD is enabled. r=njn
This also effectively changes how DMD is enabled from requiring both
replace-malloc initialization and the DMD environment variable to
requiring only the former. The DMD environment variable can still be
used to specify options, but not to disable entirely.

This however doesn't touch all the parts that do enable DMD by setting
the DMD environment variable to 1, so the code to handle this value
is kept.
2014-11-18 19:21:06 +09:00
Mike Hommey 6d15698158 Bug 818922 - Add bidirectional method calls with replace-malloc library. r=njn 2014-11-18 19:21:06 +09:00
Mike Hommey 486629b635 Bug 1097506 - Pass a JSONWriteFunc to dmd::AnalyzeReports instead of a JSONWriter. r=njn
The interesting feature JSONWriteFunc has, contrary to JSONWriter, is that it
only has virtual methods, which makes it a better candidate to be passed
around between libraries not linked against each other.

This will allow to make dmd and libxul independent from each other.
2014-11-13 09:24:28 +09:00