Commit Graph

204 Commits

Author SHA1 Message Date
Philip Chimento
dda8b08621 Bug 1590907 - Stop configure macros from masking function prototypes in public JS headers. r=jwalden,sfink
We should have the same public API available whenever possible, and make
it a no-op or make it throw immediately if JS was built without support
for it, instead of showing or hiding the API in header files using
configure macros. Otherwise embedders can easily get mismatches between
a library with functionality and header files without it, or vice versa.

There was no good reason why JS_GetErrorType() was nightly-only API, so
this also enables it unconditionally.

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

--HG--
extra : moz-landing-system : lando
2019-11-26 10:27:27 +00:00
Brindusan Cristian
3e0cb96b6e Backed out 7 changesets (bug 1590907) for build bustages at jsfriendapi.cpp. CLOSED TREE
Backed out changeset d6ac9325cb2c (bug 1590907)
Backed out changeset fc85ee5e144c (bug 1590907)
Backed out changeset 1b5b40dcaac4 (bug 1590907)
Backed out changeset 1b2d91f00be2 (bug 1590907)
Backed out changeset 67f939760329 (bug 1590907)
Backed out changeset 4d5818a72b46 (bug 1590907)
Backed out changeset 308b42f3a99c (bug 1590907)

--HG--
extra : rebase_source : 47578231d4749f023c3d206c479ee532dbf6fc6c
extra : histedit_source : 9e7427349342272e7fbe02fee29cb87cda45f75d
2019-11-26 05:23:11 +02:00
Philip Chimento
1ccf7df721 Bug 1590907 - Stop configure macros from masking function prototypes in public JS headers. r=jwalden,sfink
We should have the same public API available whenever possible, and make
it a no-op or make it throw immediately if JS was built without support
for it, instead of showing or hiding the API in header files using
configure macros. Otherwise embedders can easily get mismatches between
a library with functionality and header files without it, or vice versa.

There was no good reason why JS_GetErrorType() was nightly-only API, so
this also enables it unconditionally.

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

--HG--
extra : moz-landing-system : lando
2019-11-26 02:00:58 +00:00
Philip Chimento
b90e70a466 Bug 1590907 - Remove obsolete macro JS_OOM_DO_BACKTRACES. r=sfink
This macro isn't defined anywhere and doesn't seem to do anything. It
affects the oom-backtraces property of the build configuration object in
the testing functions, but since the macro is never defined, it seems to
be always set to false anyway, so just hardcode it.

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

--HG--
extra : moz-landing-system : lando
2019-11-12 22:01:06 +00:00
André Bargull
a1298a12f9 Bug 1592992 - Part 19: Move jsutil.cpp to util/Utility.cpp. r=jonco
This file provides the implementation of js/Utility.h, so it should be renamed
to match the header name.

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

--HG--
rename : js/src/jsutil.cpp => js/src/util/Utility.cpp
extra : moz-landing-system : lando
2019-11-08 13:24:15 +00:00
Jon Coppeard
d21beb7f9e Bug 1572782 - Remove unused js::FreeOp alias and remaining references r=tcampbell?
Differential Revision: https://phabricator.services.mozilla.com/D41413

--HG--
extra : moz-landing-system : lando
2019-08-12 12:35:11 +00:00
Jon Coppeard
6c416aec4d Bug 1572782 - Replace internal use of js::FreeOp with JSFreeOp r=tcampbell?
Sorry for the huge patch.  This is pretty much a search and replace of all uses of js::FreeOp.

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

--HG--
extra : moz-landing-system : lando
2019-08-12 10:43:51 +00:00
Oana Pop Rus
44aafcc0d0 Backed out 4 changesets (bug 1572782) for build bustages at build/src/obj-firefox/dist/include/nsIXPCScriptable.h on a CLOSED TREE
Backed out changeset ec9d15c69bc8 (bug 1572782)
Backed out changeset 8239e4baa0f4 (bug 1572782)
Backed out changeset 9fd7bea2b512 (bug 1572782)
Backed out changeset 11d750555fe1 (bug 1572782)
2019-08-12 13:37:03 +03:00
Jon Coppeard
fa84e34044 Bug 1572782 - Remove unused js::FreeOp alias r=tcampbell?
Differential Revision: https://phabricator.services.mozilla.com/D41413

--HG--
extra : moz-landing-system : lando
2019-08-12 10:16:04 +00:00
Jon Coppeard
8186c345e2 Bug 1572782 - Replace internal use of js::FreeOp with JSFreeOp r=tcampbell?
Sorry for the huge patch.  This is pretty much a search and replace of all uses of js::FreeOp.

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

--HG--
extra : moz-landing-system : lando
2019-08-12 10:16:02 +00:00
Karan Sapolia
638fd4ee57 Bug 1557112 - Remove THREAD_TYPE_GCHELPER from the js::ThreadType enum. r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D34975

--HG--
extra : moz-landing-system : lando
2019-06-14 20:42:12 +00:00
Christian Holler
fa2fa5573f Bug 1435532 - Prevent/crash on large allocations in fuzzing JS shell. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D28973

--HG--
extra : moz-landing-system : lando
2019-06-28 18:59:55 +00:00
Kristen Wright
cae8e5b60b Bug 1556861 - Adding ThreadType to js::RunnableTask r=jonco
Added thread type as ThreadType enum. Default is ThreadType::THREAD_TYPE_NONE. RunnableTasks must specify their own thread type.

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

--HG--
extra : moz-landing-system : lando
2019-06-07 21:09:05 +00:00
Chris Martin
73fef3e094 Bug 1052579 - Change all found JSString allocation sites to new arena r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D25710

--HG--
extra : moz-landing-system : lando
2019-04-24 13:57:07 +00:00
Kristen Wright
e663ae74b9 Bug 1532803 - Common interface for JSThreadPool tasks r=jonco
Added 'RunnableTask' struct to Utility.h to unify HelperThread task types in a way that can be exposed to XPCOM thread pools. Re-implemented tasks within native HelperThreads using their runnableTask method.

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

--HG--
extra : moz-landing-system : lando
2019-04-16 16:43:43 +00:00
Chris Martin
d87dc0790f Bug 1527767 - Make all JS allocator functions accept an arena as an argument r=sfink
Currently, some of the JS allocators accept an 'arena' argument, but some
don't. This change makes it so they all do. This is nice for consistency, but
it also feeds into Bug 1052579, which will need to use arenas for JSString
backing buffers.

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

--HG--
extra : moz-landing-system : lando
2019-02-22 18:12:05 +00:00
Ehsan Akhgari
e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Matthew Gaudet
a2c6c03a73 Bug 1511168: Mark low-level memory management comment with SMDOC r=tcampbell DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D13733

--HG--
extra : moz-landing-system : lando
2018-12-04 18:19:51 +00:00
Tooru Fujisawa
7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Benjamin Bouvier
a7f1d173a0 Bug 1511383: Update vim modelines after clang-format; r=sylvestre
- modify line wrap up to 80 chars; (tw=80)
- modify size of tab to 2 chars everywhere; (sts=2, sw=2)

--HG--
extra : rebase_source : 7eedce0311b340c9a5a1265dc42d3121cc0f32a0
extra : amend_source : 9cb4ffdd5005f5c4c14172390dd00b04b2066cd7
2018-11-30 16:39:55 +01:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Jan de Mooij
bccfe7c569 Bug 1508065 - Change JS_PUBLIC_{API,DATA} and JS_FRIEND_{API,DATA} to be more like similar macros to avoid confusing clang-format. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D12256

--HG--
extra : moz-landing-system : lando
2018-11-19 17:02:47 +00:00
Jan de Mooij
efb754cb0c Bug 1507721 - Simplify AutoEnterOOMUnsafeRegion by adding an explicit inUnsafeRegion_ flag to the OOM simulator. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D12103

--HG--
extra : amend_source : cd42864f6a7053f2b599d6e17e5ba799beed7d90
2018-11-16 11:23:11 +01:00
Cosmin Sabou
2ea797e651 Backed out changeset 1d50d21da50d (bug 1507721) for spidermonkey bustages on dynamic-import-oom.js. 2018-11-16 22:53:36 +02:00
Jan de Mooij
7efc1db5ba Bug 1507721 - Simplify AutoEnterOOMUnsafeRegion by adding an explicit inUnsafeRegion_ flag to the OOM simulator. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D12103

--HG--
extra : moz-landing-system : lando
2018-11-16 17:12:44 +00:00
Steve Fink
b5b78d5525 Bug 1321014 - Respect MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS for the purpose of identifying GC types and pointers, r=jonco
--HG--
extra : topic : hazard
extra : rebase_source : bdaf0ae60a6b45c9d44294aa9c2bc31a8811bdbd
extra : source : c7b32ffa822e353b5479b6224194e3cdfd135e65
2018-07-20 18:36:20 -07:00
Jan de Mooij
2420688486 Bug 1501229 - Disallow {oom,stack,interrupt}Test functions on shell worker threads. r=jonco,nbp
Differential Revision: https://phabricator.services.mozilla.com/D9524

--HG--
extra : moz-landing-system : lando
2018-10-23 15:37:43 +00:00
Jan de Mooij
1dbada33f5 Bug 1493627 part 2 - Unify OOM testing state variables for different kinds to make AutoEnterOOMUnsafeRegion work for stack checks. r=jonco
Depends on D9253

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

--HG--
extra : moz-landing-system : lando
2018-10-23 01:18:22 +00:00
Steve Fink
2fbae0eae1 Backed out changeset c7b32ffa822e (bug 1321014) on a CLOSED TREE
--HG--
extra : amend_source : 1a8f1a344d56d70673ec9977c62847ebb147f4ca
2018-10-16 14:35:48 -07:00
Steve Fink
0db11faae6 Bug 1321014 - Respect MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS for the purpose of identifying GC types and pointers, r=jonco
--HG--
extra : rebase_source : 91efd92b5febca961c2edaeb12ef37770936ee79
2018-07-20 18:36:20 -07:00
Nicolas B. Pierron
bf1398f7d2 Bug 1497906 - Add THREAD_TYPE_CURRENT to simulate errors on a single worker thread. r=jonco 2018-10-16 16:40:46 +02:00
Jan de Mooij
ab644b087f Bug 1488698 - Always use braces for if/for/while statements in js/public. r=jandem
--HG--
extra : rebase_source : 075f0747c9256fee67925853b501b7a3549cebba
2018-09-06 12:11:07 +02:00
Jan de Mooij
15b08e299e Bug 1486444 - Remove bogus/over-allocating no-arg versions of js_pod_malloc/js_pod_calloc. r=tcampbell
These functions incorrectly passed sizeof(T) instead of 1, so we would allocate sizeof(T) * sizeof(T) bytes instead of sizeof(T) bytes. This was used for PcScriptCache where we would allocate a few extra megabytes due to this bug. The patch changes PcScriptCache to use UniquePtr + MakeUnique.

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

--HG--
extra : amend_source : e9e3e906ac649a4b05d91c10e60bc10bc858fb98
2018-08-27 17:28:16 +02:00
Nicholas Nethercote
0f205a7ce0 Bug 1477626 - Move ScrambleHashCode() from js/src/Utility.h to mfbt/HashFunctions.h. r=Waldo
And use it in PLDHashTable.cpp.

MozReview-Commit-ID: BqwEkE0p5AG

--HG--
extra : rebase_source : bd9118e24b82add6ad1fdcb067a5f25b25e90201
2018-07-26 18:52:47 +10:00
Nicholas Nethercote
25a1140207 Bug 1477626 - Introduce mozilla::HashNumber and use it in various places. r=Waldo
Currently we have three ways of representing hash values.

- uint32_t: used in HashFunctions.h.

- PLDHashNumber: defined in PLDHashTable.{h,cpp}.

- js::HashNumber: defined in js/public/Utility.h.

Functions that create hash values with functions from HashFunctions.h use a mix
of these three types. It's a bit of a mess.

This patch introduces mozilla::HashNumber, and redefines PLDHashNumber and
js::HashNumber as synonyms. It also changes HashFunctions.h to use
mozilla::HashNumber throughout instead of uint32_t.

This leaves plenty of places that still use uint32_t that should use
mozilla::HashNumber or one of its synonyms, but I didn't want to tackle that
now.

The patch also:

- Does similar things for the constants defining the number of bits in each
  hash number type.

- Moves js::HashNumber from Utility.h to HashTable.h, which is a better spot
  for it. (This required changing the signature of ScrambleHashCode(); that's
  ok, it'll get moved by the next patch anyway.)

MozReview-Commit-ID: EdoWlCm7OUC

--HG--
extra : rebase_source : 5b92c0c3560eb56850cd8832f8ee514d25e3c16f
2018-07-26 18:52:46 +10:00
Matt Howell
638dfe2577 Bug 1052582 Part 2 - Create and use a separate malloc arena for ArrayBuffer contents. r=sfink
MozReview-Commit-ID: 7IlFvr3hoA8

--HG--
extra : rebase_source : 862a259389e7085f4b5c6cb2b27d3f72627e36b3
2018-05-23 14:57:42 -07:00
Matt Howell
76ff0a0612 Bug 1052582 Part 1 - Support an arena parameter for js_pod_malloc and friends. r=sfink
This patch adds new functions taking the arena parameter rather than overloading
existing functions, because there are already overloads of calloc that take
two size_t parameters (which arena_id_t is an alias for), so it couldn't have
been done that way, and malloc and realloc needed to be consistent with calloc.

MozReview-Commit-ID: 1MUXoCUgJWO

--HG--
extra : rebase_source : 16261ba4e802efa0bc65878d490ae9b62aa35797
2018-06-29 13:06:14 -07:00
André Bargull
1eba073f7e Bug 1467438 - Part 4: Remove ScopedJSFreePtr, ScopedJSDeletePtr, and ScopedReleasePtr. r=sfink 2018-06-07 12:33:40 -07:00
Jon Coppeard
4d20a29316 Bug 1466792 - Update out-of-date memory allocation comments r=sfink 2018-06-06 10:54:59 +01:00
André Bargull
272b9eeecd Bug 1464845 - Remove js_strdup and JS_strdup. r=Waldo 2018-06-04 13:34:06 -07:00
Dorel Luca
8a5e435163 Backed out changeset 2426ac9d78fe (bug 1464845) for Merge conflicts with bug 1465060 2018-06-04 21:10:36 +03:00
André Bargull
350c65991b Bug 1464845 - Remove js_strdup and JS_strdup. r=Waldo 2018-06-04 01:30:51 -07:00
Emilio Cobos Álvarez
1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

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

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

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02:00
Jeff Walden
7e7300c162 Bug 1461556 - Call memset on a void*, not a T*, in js_delete_poison to avoid memset-on-nontrivial warnings with gcc that don't matter for an object whose lifetime is about to end. r=jandem 2018-05-16 10:44:54 -07:00
Jan de Mooij
441f19d63f Bug 1458567 part 1 - Don't invoke interrupt callback and Debugger onStep hook for internal JS engine interrupts. r=luke 2018-05-03 16:01:01 +02:00
Jan de Mooij
4f87b13b19 Bug 1452982 part 15 - Rename some constants. r=jonco 2018-04-19 13:06:12 +02:00
Jeff Walden
25a7df6306 Bug 1441657 - Implement mozilla::WrappingMultiply. r=froydnj
--HG--
extra : rebase_source : 57d1796976a25597ee4dda90561d40debc6a9fc9
2018-02-15 17:36:55 -08:00
Ted Campbell
78a8f17527 Bug 1418842 - Support JS_OOM_BREAKPOINT on MSVC. r=sfink
MozReview-Commit-ID: CHLvYjKkP7n
2017-11-19 14:35:00 +02:00
Jon Coppeard
a6e864d2ce Bug 1410132 - Use a separate jemalloc arena for all SpiderMonkey malloc allocations r=njn r=nbp 2017-11-02 14:51:27 +00:00
Sebastian Hengst
a5d99d720e Backed out 2 changesets (bug 1410132) for bustage, e.g. in spidermonkey non-unified at js/src/threading/Mutex.cpp:47: 'JS_IsInitialized' was not declared in this scope. r=backout on a CLOSED TREE
Backed out changeset 28c901411c1e (bug 1410132)
Backed out changeset 003ff6a2a254 (bug 1410132)
2017-11-07 20:04:43 +02:00