Commit Graph

189 Commits

Author SHA1 Message Date
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
Jon Coppeard
45f03229f6 Bug 1410132 - Use a separate jemalloc arena for all SpiderMonkey malloc allocations r=njn r=nbp 2017-11-02 14:51:27 +00:00
Jon Coppeard
0f32c9b07b Bug 1411302 - Don't try and OOM test worker threads r=jandem 2017-10-27 15:52:43 +01:00
Jon Coppeard
74f1c6ece5 Bug 1406455 - Disallow OOM simulation on worker threads r=jandem 2017-10-10 12:07:08 +01:00
Christian Holler
59f6711346 Bug 1402815 - Add interruptTest function to JS engine. r=jandem
MozReview-Commit-ID: El24BdESnM2

--HG--
extra : rebase_source : e0dc21d42f19ba3e036746f7f60f4527e314b1a5
2017-09-22 18:28:47 +02:00
Christian Holler
5c886f1afd Bug 1395240 - Implement stackTest function for JS stack OOM testing. r=jandem
MozReview-Commit-ID: LRFb0adTFR8

--HG--
extra : rebase_source : f36fff24683195d4239b4ae29f3e0f0d8a0535c7
2017-09-20 14:19:21 +02:00
Lars T Hansen
691c2c0203 Bug 1277562 - Part 9: Add Wasm Tier 2 compilation tasks. r=luke
--HG--
extra : rebase_source : 2b95eddcf25d17445b1a377bd3017538b663179c
extra : source : da9e75d2e82c3e3564bb3e37230d384bcf7ffacf
2017-02-09 15:15:17 +01:00
Lars T Hansen
b0a78cb977 Bug 1388756 - Move helper thread types out of the OOM namespace. r=jonco
--HG--
extra : rebase_source : 2ec28160c41db48b2fa043f3d36e75d32832b26f
extra : histedit_source : d93bebede5edd065bb0cbcdebc509bbe3ab26d1c
2017-08-11 10:11:35 +02:00
Philip Chimento
3faca05ad5 Bug 1379538 - Unresolved symbols when linking program to standalone SpiderMonkey. r=fitzgen
Some symbols that need to be public are not marked as such.
2017-07-11 10:59:00 -04:00
Jan de Mooij
dc45e8e90e Bug 1377238 - Free finished IonBuilders off-thread. r=jonco 2017-06-29 14:43:55 -07: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
Brian Hackett
539e47cd96 Bug 1337117 - Remove references to main thread in the JS engine, r=jandem.
--HG--
extra : rebase_source : 466336ed48fb8636d1ef428195408411ed81473d
2017-02-11 05:27:32 -07:00
Benjamin Bouvier
02cd2cddce Bug 1320374: Rename THREAD_TYPE_ASMJS into THREAD_TYPE_WASM; r=luke
--HG--
extra : rebase_source : 38d4f0b6b73d86fb65a1ad2ba20a839cc3034ed1
2016-11-25 11:50:12 +01: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