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

16 Коммитов

Автор SHA1 Сообщение Дата
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
Kristen Wright 927abec5f2 Bug 1476141 - JS::ubi::Nodes represent DOM structure in more detail r=KrisWright
Added a new CoarseType that refers to DOM nodes. Updated the trees to represent the CoarseType. Created a new type of count in the heap snapshot that sorts the data by a more descriptive type name. Created the descriptive in JS::ubi::Base.

--HG--
extra : histedit_source : be24efa4d2ccb85e82046d7cf7d2c3a1e13b1fd7
2018-07-16 14:42: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
Jon Coppeard 02d634159d Bug 1463723 - Remove ubi::Census' pointer to the atoms zone r=fitzgen 2018-05-24 09:40:46 +01:00
Boris Zbarsky 746467862d Bug 1346389. Make --enable-shared-js link again, at least for an opt mac build with intl api disabled. r=sfink, a=waldo on the gcc-specific bits. 2017-03-10 23:52:55 -05:00
Boris Zbarsky d6b2fc9b4d Backed out changeset c1978f7d49c4 for build failures.
MozReview-Commit-ID: FOwcGtykkXR
2017-03-11 00:10:36 -05:00
Boris Zbarsky 160b2e80e9 Bug 1346389. Make --enable-shared-js link again, at least for an opt mac build with intl api disabled. r=sfink
MozReview-Commit-ID: 264vsCvhh9Z
2017-03-10 23:52:55 -05:00
Nick Fitzgerald 8d76510cde Bug 1267551 - Use MOZ_MUST_USE in js/public/UbiNodeCensus.h; r=jimb 2016-06-17 13:52:43 +01:00
Nick Fitzgerald 03303bde0d Bug 1263270 - Sort census reports by smallest node ID counted, rather than number of nodes counted. r=jimb 2016-04-08 16:21:00 -04:00
Luke Wagner 6ebd19920f Bug 1239601 - improve the UniquePtr situation (r=jorendorff)
--HG--
extra : commitid : FwqWNSZ3SKY
extra : rebase_source : 75ed67bfadcbdaeb5bf89a57ad6ca9ef75b7f1f0
2016-01-15 18:26:06 -06:00
Nick Fitzgerald ffd963dd3f Bug 1231763 - Extract breakdown parsing from JS::ubi::Census. r=jimb 2015-12-16 09:19:00 +01:00
Nick Fitzgerald 896a2e9849 Bug 1206290 - Part 0: Move js/UbiNodeTraverse.h to js/UbiNodeBreadthFirst.h; r=sfink
--HG--
rename : js/public/UbiNodeTraverse.h => js/public/UbiNodeBreadthFirst.h
2015-09-24 14:01:22 -07:00
Jakob Olesen e9ff98b451 Bug 1204102 - Add missing includes and namespaces to UbiNodeCensus files. r=sfink
--HG--
extra : rebase_source : 3a6d3748a0d49c4070cf5b0d7b44df8ce5d748ac
2015-09-14 13:59:00 +02:00
Nick Fitzgerald edb9a948ac Bug 1194422 - Expose census traversals to SpiderMonkey embedders; r=sfink
This moves census types and functions to js/public/UbiNodeCensus.h and
js/src/vm/UbiNodeCensus.cpp. This is required so that embedders can do census
traversals on offline heap snapshots.
2015-08-19 13:21:08 -07:00
Nathan Froyd ced2e48608 Backout f786a3ae0410 (bug 1194422) and 9f979aa382a9 (bug 1194418) for SM ARM build bustage 2015-08-19 20:18:42 -04:00
Nick Fitzgerald 0ba4ba4f55 Bug 1194422 - Expose census traversals to SpiderMonkey embedders. r=sfink
This moves census types and functions to js/public/UbiNodeCensus.h and
js/src/vm/UbiNodeCensus.cpp. This is required so that embedders can do census
traversals on offline heap snapshots.
2015-08-17 15:54:00 -04:00