gecko-dev/js/public
Julian Seward 2c3173600a Bug 1797933, part 2 - initial implementation of struct.{new,set,get} and ref.cast for Ion. r=rhunt.
This patch implements struct.{new,set,get} and ref.cast for Ion.  The
implementation is in principle straightforward and is derived from the
baseline equivalents.  There are however many pieces that need to be
coordinated.  Changes:

* Compiler gating logic -- enable Ion for wasm GC extensions.

* Pertaining to the above, extend the guard conditions in many of the wasm/gc
  test cases so as to limit them to baseline only, for now, so that we don't
  get failures as a result of gc insns that are currently unimplemented in
  Ion.  This will need to be incrementally undone as more gc insns get
  implemented in Ion.

* Pertaining to testing (lib/wasm-binary.js), remove wasm gc opcodes from the
  lists of opcodes that we check are unimplemented.

* New test file wasm/gc/structs2.js, that tests 8- and 16-bit field accesses,
  since the existing structs.js file doesn't.

* Add support to MIR and LIR to handle 8- and 16-bit memory accesses.  One
  possibility would have been to add MIRType::Int16 and MIRType::Int8, but I
  didn't want to destabilise the existing, probably carefully-balanced MIR
  optimisation machinery for JS.  So I chose to add auxiliary descriptors just
  for the 4 relevant MIR/LIR nodes instead:

  - New enums MNarrowingOp and MWideningOp, to describe how to narrow to /
    widen from Int32.

  - Renamed wasm::FieldExtension to wasm::FieldWideningOp for consistency with
    the above.  Note MWideningOp and wasm::FieldWideningOp both need to exist;
    neither can exactly do the job of the other.

  - LIRGenerator::visitWasmLoadObjectField/LoadObjectFieldWithKA
    /StoreObjectFieldWithKA: handle 8- and 16-bit accesses.
    WasmStoreObjectRefFieldWithKA is unaffected since a ref can't be 8- or
    16-bits long.

  - CodeGenerator::visitWasm{Store,Load}Slot: handle 8- and 16-bit accesses.

* The actual implementations of struct.{new,set,get} and ref.cast, which are
  pretty straightforward.  They use the following new helper functions inside
  class FunctionCompiler:

  - FunctionCompiler::loadGcCanon, same function as the baseline version

  - FunctionCompiler::writeValueToStructField, used for both struct.new
    and struct.set.

  - FunctionCompiler::readValueFromStructField, used for struct.get.

  - FunctionCompiler::trapIfZero, used for ref.cast.

  - FunctionCompiler::refCast, used for ref.cast.

  - FunctionCompiler::field{Load,Store}InfoToMIR, used to create the right MIR
    descriptions for 8- and 16-bit transactions.

  It is envisaged that these helpers will be further refined in subsequent
  patches to support accesses for the array instructions.

* Ridealong fix: FunctionCompiler::loadExceptionValues: add missing OOM check
  for `auto* data = ..`.

Differential Revision: https://phabricator.services.mozilla.com/D161253
2022-11-22 13:42:14 +00:00
..
experimental Bug 1788977 - Remove JS::CompileAndStartIncrementalEncoding. r=arai 2022-09-06 12:01:37 +00:00
friend Bug 1774837 - wasm: Add anyref. r=jseward 2022-11-14 17:09:10 +00:00
shadow Bug 1785772 - Part 4: Give pre-barrier verification its own Zone GC state to simply marking check r=sfink 2022-08-24 09:52:45 +00:00
AllocationLogging.h
AllocationRecording.h
AllocPolicy.h Bug 1782569 - Add JS::ReportOutOfMemory(ErrorContext*) r=nbp 2022-08-19 14:59:18 +00:00
Array.h
ArrayBuffer.h Bug 1741941 - Add JSAPI helper to verify transfer safety r=sfink 2022-01-04 22:33:20 +00:00
ArrayBufferMaybeShared.h
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 Bug 1270746 part 5 - Remove hasInstance class hook. r=iain 2022-03-20 11:28:04 +00:00
ComparisonOperators.h
CompilationAndEvaluation.h Bug 1788977 - Remove JS::CompileAndStartIncrementalEncoding. r=arai 2022-09-06 12:01:37 +00:00
CompileOptions.h Bug 1774796 - Add largest-first delazification strategy. r=arai 2022-06-20 13:33:49 +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 Bug 1730843 - Part 8 - Add support for spread in records r=jandem 2021-12-20 15:17:20 +00:00
Date.h
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 1782569 - Use ErrorContext instead of JSContext for off-thread ReportOutOfMemory() r=nbp 2022-08-19 14:59:19 +00:00
Exception.h Bug 1735200 - Add JSAPI for getting Error.cause. r=jandem 2022-01-17 15:23:40 +00:00
ForOfIterator.h
GCAnnotations.h
GCAPI.h Bug 1797755 - Part 4: Remove option to set maximum mark stack capacity in release builds r=sfink 2022-10-28 15:17:43 +00:00
GCHashTable.h Bug 1736604 - Part 3: Rename MapSweepPolicy to MapEntryGCPolicy r=sfink 2021-11-09 09:17:35 +00:00
GCPolicyAPI.h Bug 1785287 - Stop IsInsideNursery from accepting null argument r=sfink 2022-08-18 20:14:55 +00:00
GCTypeMacros.h Bug 1754405 part 11 - Make PropertyKey bits field private. r=evilpie 2022-02-13 12:01:48 +00:00
GCVariant.h
GCVector.h Bug 1749298 - Part 3: Only trace finalization records if the registry's global is alive r=sfink 2022-02-11 11:28:29 +00:00
GlobalObject.h
HashTable.h
HeapAPI.h Bug 1760920 - pt 9. Don't count shared memory more than once r=jonco 2022-11-07 22:36:38 +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 1754405 part 14 - Rename PropertyKey::fromNonIntAtom to PropertyKey::NonIntAtom. r=evilpie 2022-02-13 12:01:49 +00:00
Initialization.h Bug 1759909 - Enable AVX support for Wasm SIMD by default in Nightly. r=lth 2022-03-18 15:07:31 +00:00
Interrupt.h
JitCodeAPI.h Bug 1788779: Add API for the Gecko Profiler to access JitCode address ranges and debug info r=iain 2022-09-23 15:18:57 +00:00
JSON.h
LocaleSensitive.h
MapAndSet.h
MemoryCallbacks.h
MemoryFunctions.h Bug 1757956 - Part 1: Removed unused JS_freeop API r=jandem 2022-03-10 08:40:03 +00:00
MemoryMetrics.h Bug 1777529 - Remove Tracelogger from Memory Stats r=jandem 2022-07-13 15:26:51 +00:00
Modules.h Bug 1782686 - Document arguments to embedding module hooks r=arai 2022-08-02 15:32:36 +00:00
Object.h
OffThreadScriptCompilation.h Bug 1734098 - Part 15: Use consistent name for decode multi stencils API. r=tcampbell 2021-12-10 04:28:31 +00:00
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 1782188 - Use more reliable endStackAddress when profiling JIT/Wasm frames. r=iain 2022-08-01 11:10:52 +00:00
ProfilingStack.h
Promise.h Bug 1734243 - Part 1: Add JS::SetAnyPromiseIsHandled r=arai 2022-02-25 02:32:04 +00:00
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 1795914 - Remove JS Streams implementation r=jandem 2022-10-24 16:05:58 +00:00
Proxy.h Bug 1726039 - Disallow setting private fields on MaybeCrossOrigin objects (HostEnsureCanPrivateElementAdd) r=peterv,jandem 2022-10-26 21:53:36 +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 1799619 - Disable array grouping by default on nightly; r=mgaudet 2022-11-09 09:24:14 +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 1781641 - Add JS::NativeStackBase, JS::NativeStackSize, and JS::NativeStackLimit. r=bthrall 2022-07-30 04:45:22 +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
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 Bug 1545131 - compress wasm alt data entries (r=jandem) 2021-10-21 22:08:14 +00:00
String.h Bug 1758088 part 3 - Add and use js::AtomizeWithoutActiveZone. r=arai 2022-03-04 13:19:32 +00:00
StructuredClone.h Bug 1786471 - Part 1: Remove unnecessary includes in js/src/vm. r=jonco 2022-08-23 13:48:30 +00:00
SweepingAPI.h Bug 1736397 - Part 6: Use tracing for the incremental read barrier on WeakCached maps and sets r=sfink 2021-10-19 14:43:32 +00:00
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 1788977 - Remove JS::CompileAndStartIncrementalEncoding. r=arai 2022-09-06 12:01:37 +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 1784164 - update comment on current state r=jonco 2022-08-11 16:21:06 +00:00
Value.h Bug 1798723 - Document punboxing and nunboxing r=nbp DONTBUILD 2022-11-09 20:49:41 +00:00
ValueArray.h
Vector.h
WaitCallbacks.h
Warnings.h
WasmFeatures.h Bug 1797933, part 2 - initial implementation of struct.{new,set,get} and ref.cast for Ion. r=rhunt. 2022-11-22 13:42:14 +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 Bug 1760844 part 1 - Remove hasInstance proxy trap. r=iain,peterv,robwu 2022-04-04 15:09:29 +00:00
WrapperCallbacks.h
Zone.h Bug 1769451 - Part 1: Fix missing include in js/public. r=sfink 2022-06-10 19:19:51 +00:00