Commit Graph
77 Commits
Author SHA1 Message Date
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Jan de Mooij f58a166eb8 Bug 1490632 - Always use braces for if/for/while statements in js/ipc. r=evilpie
Differential Revision: https://phabricator.services.mozilla.com/D5661
2018-09-12 20:04:14 +00:00
Nicholas Nethercote 439d31614d 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
Jan de Mooij 9d3bc542f6 Bug 1479363 part 10 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in other directories. r=mrbkap 2018-08-02 19:30:17 +02:00
Jan de Mooij fddc23c346 Bug 1478955 part 1 - Rename JSAutoRealm to JSAutoRealmAllowCCW. r=luke 2018-07-28 12:12:26 +02:00
Tom Schuster f5de305bda Bug 1465911 - Disable CPOWs outside of test mode. r=mrbkap 2018-06-08 00:00:54 +02:00
Jan de Mooij e5f8a28c84 Bug 1461292 part 1 - Rename JSAutoCompartment to JSAutoRealm. r=bz,luke 2018-05-16 10:53:16 +02:00
Kris Maglione 2f66e87f0b Bug 1445551: Part 3 - Remove AllowCPOWsInAddon machinery. r=mccr8
This is all dead code now that the add-on manager support for shimmed add-ons
has been removed.

MozReview-Commit-ID: J6aRQDqEahs
2018-03-13 19:20:17 -07:00
Andrea Marchesini cdb15164d7 Bug 1443079 - nsScriptError.isFromPrivateWindow must match the correct value also in e10s mode, r=smaug 2018-03-13 06:40:38 +01:00
Jason Orendorff d640df5146 Bug 1439063 - Part 1: Move several public headers from js/src to js/public. r=jandem.
js/src/jsalloc.h -> js/public/AllocPolicy.h
jsalloc.cpp -> js/src/util/AllocPolicy.cpp
jsbytecode.h -> merge into js/public/TypeDecls.h
jsprf.h -> js/public/Printf.h
jsprf.cpp -> js/src/util/Printf.cpp
jsprototypes.h -> public/ProtoKey.h
jswrapper.h -> js/Wrapper.h
2018-02-21 10:30:19 -06:00
Steve Fink cb2dda1273 Bug 1406570 - Rooting improvements, r=jonco,bz 2017-10-09 10:59:02 -07:00
Nicholas Nethercote 09493fcbcf Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj. 2017-07-31 14:28:48 +10:00
Tooru Fujisawa 4b595b32f4 Bug 1332245 - Move nsScriptError from js/xpconnect to dom/bindings. r=bz 2017-01-28 00:42:47 +09:00
Andrew McCreight 4f6b7d8ac4 Bug 1331115 - Fix two typos in CPOW code. r=billm
MozReview-Commit-ID: FAh7O1U9hGP
2017-01-13 09:49:17 -08:00
Bill McCloskey 1deceb4b29 Bug 1311212 - Add dead CPOW debugging facility (r=mrbkap) 2016-10-19 16:26:23 -07:00
Tooru Fujisawa a5294e0308 Bug 1289050 - Part 1: Use ASCII variant of JS_ReportError in simple case. r=jwalden 2016-08-14 20:39:28 +09:00
Jan de Mooij 519f0d4bf1 Bug 1292892 part 7 - Remove unnecessary JSContext arguments from IPC classes. r=bz 2016-08-11 14:39:23 +02:00
Jan de Mooij bd0f1c9018 Bug 1292892 part 1 - Stop using JSRuntime outside SpiderMonkey. r=bz,terrence,fitzgen,kanru 2016-08-11 14:39:22 +02:00
Bill McCloskey 30522c51bd Bug 1214824 - Forbid CPOW usage if add-on declares it is multiprocessCompatible (r=mrbkap) 2016-07-05 13:59:36 -07:00
Jan de Mooij 24d5a9da4c Bug 1283855 part 11 - Make some GC callback APIs take JSContext instead of JSRuntime. r=terrence,mccr8 2016-07-05 14:35:19 +02:00
Phil Ringnalda 7612068980 Back out 14928a6b38f3 (bug 1214824) for leaking an nsStringBuffer in debug e10s devtools 2016-06-30 21:12:11 -07:00
Bill McCloskey d030f958ce Bug 1214824 - Forbid CPOW usage if add-on declares it is multiprocessCompatible (r=mrbkap) 2016-06-30 17:38:54 -07:00
Jonathan Watt 9c5b8de022 Bug 1279451 - Remove a lot of unnecessary includes of nsAutoPtr.h. rs=sparky 2016-06-07 21:10:18 +01:00
Benjamin Smedberg 6953cf7efe Bug 1245901 - Measure counts of browser CPOW usage which is now rejected, r=billm
MozReview-Commit-ID: GwLq9EoDEuR
2016-02-16 11:21:11 -05:00
Bill McCloskey 0fbb50f168 Bug 1233497 - Fix infrastructure for disallowing unsafe CPOWs in browser code. r=mrbkap 2016-01-05 19:28:27 -05:00
Bill McCloskey 7953e46b07 Bug 1215167 - Forbid unsafe browser CPOWs (disabled by default for now) (r=mrbkap) 2015-11-05 13:17:04 -08:00
Wes Kocher dd9e3ef892 Backed out changeset 89446bf8d6b8 (bug 1215167) for introducing a hazard 2015-11-04 16:16:59 -08:00
Bill McCloskey f333296703 Bug 1215167 - Forbid unsafe browser CPOWs (disabled by default for now) (r=mrbkap) 2015-11-04 13:40:15 -08:00
Makoto Kato 736b38b2b9 Bug 1187773 - Don't include heapapi.h from js/public. r=jorendorff 2015-08-06 15:34:08 +09:00
Makoto Kato 04317dce18 Backed out changeset a3243d1ec51f due to invalid bug number 2015-08-06 15:32:14 +09:00
Makoto Kato ce96b6427b Bug 187773 - Don't include heapapi.h from js/public. r=jorendorff 2015-08-06 11:48:46 +09:00
Jan de Mooij c6596c5fa8 Bug 1144366 - Switch SpiderMonkey and XPConnect style from |T *t| to |T* t|. r=jorendorff 2015-03-28 23:22:11 +01:00
Phil Ringnalda 1a1c158706 Backed out changeset 0c030f97a04f (bug 1144366) for being on top of patches being backed out
CLOSED TREE
2015-03-28 10:39:56 -07:00
Jan de Mooij 369ef1b850 Bug 1144366 - Switch SpiderMonkey and XPConnect style from |T *t| to |T* t|. r=jorendorff 2015-03-28 12:08:37 +01:00
Tom Schuster 34ccb29137 Bug 1131003 - Move jsproxy.h to js/Proxy.h. r=efaust 2015-02-10 19:58:18 +01:00
Bill McCloskey 3fdc0539fb Bug 1123461 - Make a real interface for js/ipc (r=dvander) 2015-01-26 13:32:18 -08:00
Bill McCloskey 15acb49389 Bug 1119753 - Fix CPOW GC crash (r=jonco) 2015-01-16 09:56:30 -08:00
Bobby Holley f2b9845ecb Bug 1065811 - Track Xray waivers with CPOWs. r=billm 2014-09-25 13:13:29 +02:00
Jon Coppeard 35fa24ed09 Bug 650161 - Unify the finalization and moving GC callbacks into a weak pointer update callback r=terrence r=bholley 2014-09-24 12:54:11 +01:00
Bobby Holley 0432f88162 Bug 1052096 - Move CPOW targets into the privileged/unprivileged junk scope of the child/parent. r=billm 2014-09-12 17:41:18 -07:00
Jon Coppeard bc23226f38 Bug 650161 - Add moving GC callback and use it to fix up ipc CPOW tables r=terrence 2014-09-02 11:07:22 +02:00
Bill McCloskey 219eb6cb82 Bug 1052093 - Child->parent CPOWs should go through COWs in the parent for security (r=bholley) 2014-08-20 12:49:10 -07:00
Bill McCloskey 6582876747 Bug 996785 - Bidirectional CPOWs (r=mrbkap) 2014-05-16 16:40:37 -07:00
Bill McCloskey 648513711d Bug 996785 - Distinguish local and remote CPOW objects in IPDL (r=mrbkap) 2014-05-16 16:40:36 -07:00
Bill McCloskey a6ad990683 Bug 996785 - Move CPOW wrapper owner code (r=mrbkap) 2014-05-16 16:40:36 -07:00
Bill McCloskey 9af6eef5a8 Bug 996785 - Use separate maps for local and remote CPOW objects (r=mrbkap) 2014-05-16 16:40:36 -07:00
Bill McCloskey b07848079e Bug 996785 - Rename CPOW makeId/unwrap (r=mrbkap) 2014-05-16 16:40:35 -07:00
Bill McCloskey 50900210f8 Bug 996785 - Rename CPOW toValue (r=mrbkap) 2014-05-16 16:40:35 -07:00
Bill McCloskey cbd9358768 Bug 996785 - Rename CPOW findObject (r=mrbkap) 2014-05-16 16:40:35 -07:00
Bill McCloskey 0f7f7b7bb9 Bug 996785 - Move global CPOW functions to top level (r=mrbkap) 2014-05-16 16:40:35 -07:00