gecko-dev/js/public
Julian Seward 6dbd528357 Bug 1820120 - Manage Wasm{Array,Struct}Object OOL-storage-blocks using a thread-private cache. r=jonco,rhunt.
Wasm{Array,Struct}Objects may be freely nursery-allocated, hence enjoying the
benefits of generational GC.  However, those with out-of-line storage in the
C++ heap (called "trailer blocks" in the patch) have those blocks managed by
js_malloc/js_free.  This is expensive, and especially for objects which don't
get tenured, undercuts the benefit gained from generational GC.

This patch adds to js::Nursery, two new mechanisms:

* a cache of blocks, js::gc::MallocedBlockCache, which are suitable for use as
  trailers.  Allocation and freeing of trailers is done mostly from this
  cache.  A supporting type, js::PointerAndUint7, has also been added, as
  extra data (a freelist ID) is needed when returning blocks to the cache.

* a more limited version of the existing Nursery::mallocedBuffers mechanism.
  The goal is the same -- to enumerate the subtraction of sets of allocated vs
  tenured trailer blocks, at the end of minor GC.  The new version differs in
  that (1) it tracks PointerAndUint7, not void*s, (2) block resizing is not
  supported, and (3) the difference is computed via vector comparison rather
  than a hash set, for performance reasons.

An SMDOC explaining the mechanisms in detail has been added to WasmGcObject.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D171551
2023-03-07 22:05:59 +00:00
..
experimental Backed out 16 changesets (bug 1773319) for causing hazard bustages in TestingFunctions.cpp CLOSED TREE 2023-02-22 12:10:18 -05:00
friend Bug 1817965 - Add telemetry to monitor how quickly GC tasks run after being queued r=jandem 2023-03-06 15:41:40 +00:00
shadow Bug 1804253 part 4 - Optimize checks for native objects and proxies. r=jonco 2022-12-13 10:58:30 +00:00
AllocationLogging.h
AllocationRecording.h
AllocPolicy.h Bug 1787528 - Part 4: Use fc as FrontendContext variable name. r=bthrall 2022-12-14 07:31:10 +00:00
Array.h
ArrayBuffer.h Bug 1703508 part 1 - Remove pref for large ArrayBuffers. r=rhunt 2022-12-21 09:25:23 +00:00
ArrayBufferMaybeShared.h Bug 1703508 part 1 - Remove pref for large ArrayBuffers. r=rhunt 2022-12-21 09:25:23 +00:00
BigInt.h
BuildId.h
CallAndConstruct.h
CallArgs.h
CallNonGenericMethod.h
CharacterEncoding.h Bug 1791357 - Part 2: Use char32_t instead of uint32_t for code points. r=arai 2022-09-20 05:46:03 +00:00
Class.h
ComparisonOperators.h
CompilationAndEvaluation.h Bug 1788977 - Remove JS::CompileAndStartIncrementalEncoding. r=arai 2022-09-06 12:01:37 +00:00
CompileOptions.h Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium 2023-02-13 15:02:07 +00:00
Context.h Bug 1726039 - Disallow setting private fields on MaybeCrossOrigin objects (HostEnsureCanPrivateElementAdd) r=peterv,jandem 2022-10-26 21:53:36 +00:00
ContextOptions.h Bug 1783703 - Part 2: Change-Array-By-Copy flag should be a RealmCreationOptions. r=mgaudet 2022-08-09 09:50:29 +00:00
Conversions.h
Date.h Bug 1778510: Add a ShouldResistFingerprinting flag to JS RealmOptions r=jandem 2022-11-29 13:34:13 +00:00
Debug.h Bug 1780857 - Change if to ifdef for DEBUG. (r=jimb) DONTBUILD 2022-07-25 09:35:43 +00:00
Equality.h
ErrorInterceptor.h
ErrorReport.h Bug 1787528 - Part 4: Use fc as FrontendContext variable name. r=bthrall 2022-12-14 07:31:10 +00:00
Exception.h
ForOfIterator.h
GCAnnotations.h
GCAPI.h Bug 1820120 - Manage Wasm{Array,Struct}Object OOL-storage-blocks using a thread-private cache. r=jonco,rhunt. 2023-03-07 22:05:59 +00:00
GCHashTable.h
GCPolicyAPI.h Bug 1785287 - Stop IsInsideNursery from accepting null argument r=sfink 2022-08-18 20:14:55 +00:00
GCTypeMacros.h
GCVariant.h
GCVector.h Bug 1808927 - Use a single vector for module export entries r=arai 2023-01-10 09:44:07 +00:00
GlobalObject.h
HashTable.h
HeapAPI.h Bug 1802897 - Part 5: Add methods to update the mark bitmap atomically r=sfink 2022-12-07 12:58:51 +00:00
HelperThreadAPI.h Bug 1769451 - Part 1: Fix missing include in js/public. r=sfink 2022-06-10 19:19:51 +00:00
Id.h Bug 1812540 - Part 1: Add JS::ToGetterId and JS::ToSetterId. r=sfink 2023-02-07 07:36:17 +00:00
Initialization.h
Interrupt.h
JitCodeAPI.h Bug 1814105: part 1 - Record offsets directly instead of through a Label, and add string support for recording instructions r=iain 2023-02-16 14:07:55 +00:00
JSON.h Bug 1814478 - Add JSON parsing to JS Validator r=farre,smaug,tcampbell 2023-03-02 17:55:31 +00:00
LocaleSensitive.h
MapAndSet.h
MemoryCallbacks.h
MemoryFunctions.h
MemoryMetrics.h Bug 1820120 - Manage Wasm{Array,Struct}Object OOL-storage-blocks using a thread-private cache. r=jonco,rhunt. 2023-03-07 22:05:59 +00:00
Modules.h Bug 1806725 - Avoid gray unmarking when unlinking module records r=mccr8,sfink 2023-01-04 09:40:05 +00:00
Object.h
OffThreadScriptCompilation.h
Principals.h Bug 1740263 - Block WASM code generation by CSP. r=lth,jandem 2022-05-19 14:13:49 +00:00
Printf.h
ProfilingCategory.h
ProfilingFrameIterator.h Bug 1801875 part 3 - Tidy up entry data structures. r=jonco 2022-11-23 15:41:04 +00:00
ProfilingStack.h
Promise.h
PropertyAndElement.h Bug 1786471 - Part 1: Remove unnecessary includes in js/src/vm. r=jonco 2022-08-23 13:48:30 +00:00
PropertyDescriptor.h Bug 1786471 - Part 1: Remove unnecessary includes in js/src/vm. r=jonco 2022-08-23 13:48:30 +00:00
PropertySpec.h
ProtoKey.h Bug 1483869 part 4 - Make wrappers work correctly with bound functions. r=iain,peterv 2023-02-27 13:05:43 +00:00
Proxy.h Bug 1804253 part 4 - Optimize checks for native objects and proxies. r=jonco 2022-12-13 10:58:30 +00:00
Realm.h Bug 1577383 - Implement async iterable declaration in WebIDL. r=peterv 2022-07-29 14:06:31 +00:00
RealmIterators.h
RealmOptions.h Bug 1778510: Add a ShouldResistFingerprinting flag to JS RealmOptions r=jandem 2022-11-29 13:34:13 +00:00
RefCounted.h Bug 1774827 - wasm: Add RecGroup and implement canonicalization of all types. r=yury 2022-11-04 13:26:40 +00:00
RegExp.h
RegExpFlags.h
Result.h
RootingAPI.h Bug 1803438 - Bump wasiRecursionDepthLimit to 350. r=arai 2022-12-09 15:05:51 +00:00
SavedFrameAPI.h
ScalarType.h Bug 1763606 - Part 1: Replace TypedArray QuickSort JS-function with C++. r=tcampbell 2022-06-08 14:40:52 +00:00
ScriptPrivate.h
ShadowRealmCallbacks.h Bug 1767525 - Implement (under a flag) ShadowRealm constructor and evaluate function. r=jandem 2022-06-28 22:04:16 +00:00
SharedArrayBuffer.h
SliceBudget.h Bug 1776931 - Refactor GC slice telemetry. r=jonco 2022-07-21 17:51:35 +00:00
SourceText.h Bug 1803495 - Support initializing SourceText from AutoStableStringChars. r=arai 2022-12-07 21:52:37 +00:00
StableStringChars.h Bug 1767525 - Implement (under a flag) ShadowRealm constructor and evaluate function. r=jandem 2022-06-28 22:04:16 +00:00
Stack.h Bug 1781255 - Part 2: Add {ParseTask,DelazifyTask}::stackLimit and directly pass it to compilation. r=bthrall 2022-08-04 05:11:17 +00:00
StreamConsumer.h
String.h
StructuredClone.h Bug 1807169 - Properly hand over ownership of the transferables in a JSStructuredCloneData r=iain 2023-01-10 22:23:44 +00:00
SweepingAPI.h
Symbol.h
TelemetryTimers.h
TraceKind.h
TracingAPI.h Bug 1785804 - Part 5: Merge GenericTracer into JSTracer r=sfink 2022-09-07 09:49:59 +00:00
Transcoding.h Bug 1802525 - Do not perform serialization in GiveUpBytecodeEncoding. r=nbp 2022-12-01 09:28:47 +00:00
TypeDecls.h Bug 1795914 - Remove JS Streams implementation r=jandem 2022-10-24 16:05:58 +00:00
UbiNode.h Bug 1786471 - Part 1: Remove unnecessary includes in js/src/vm. r=jonco 2022-08-23 13:48:30 +00:00
UbiNodeBreadthFirst.h
UbiNodeCensus.h Bug 1786471 - Part 1: Remove unnecessary includes in js/src/vm. r=jonco 2022-08-23 13:48:30 +00:00
UbiNodeDominatorTree.h
UbiNodePostOrder.h
UbiNodeShortestPaths.h Bug 1786471 - Part 1: Remove unnecessary includes in js/src/vm. r=jonco 2022-08-23 13:48:30 +00:00
UbiNodeUtils.h
UniquePtr.h
Utility.h Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium 2023-02-13 15:02:07 +00:00
Value.h Bug 1808744 part 1 - Combine Value unboxing mask with ChunkMask for Value barriers in JIT code. r=jonco 2023-01-06 12:29:51 +00:00
ValueArray.h
Vector.h
WaitCallbacks.h
Warnings.h
WasmFeatures.h Bug 1814421: Prepare wasm extended-const for ship. r=rhunt 2023-03-07 20:18:45 +00:00
WasmModule.h
WeakMap.h
WeakMapPtr.h Bug 1786471 - Part 2: Remove unnecessary includes from js/src/gc. r=jonco 2022-08-23 13:48:31 +00:00
Wrapper.h
WrapperCallbacks.h
Zone.h Bug 1769451 - Part 1: Fix missing include in js/public. r=sfink 2022-06-10 19:19:51 +00:00