mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
2c3173600a
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 |
||
---|---|---|
.. | ||
experimental | ||
friend | ||
shadow | ||
AllocationLogging.h | ||
AllocationRecording.h | ||
AllocPolicy.h | ||
Array.h | ||
ArrayBuffer.h | ||
ArrayBufferMaybeShared.h | ||
BigInt.h | ||
BuildId.h | ||
CallAndConstruct.h | ||
CallArgs.h | ||
CallNonGenericMethod.h | ||
CharacterEncoding.h | ||
Class.h | ||
ComparisonOperators.h | ||
CompilationAndEvaluation.h | ||
CompileOptions.h | ||
Context.h | ||
ContextOptions.h | ||
Conversions.h | ||
Date.h | ||
Debug.h | ||
Equality.h | ||
ErrorInterceptor.h | ||
ErrorReport.h | ||
Exception.h | ||
ForOfIterator.h | ||
GCAnnotations.h | ||
GCAPI.h | ||
GCHashTable.h | ||
GCPolicyAPI.h | ||
GCTypeMacros.h | ||
GCVariant.h | ||
GCVector.h | ||
GlobalObject.h | ||
HashTable.h | ||
HeapAPI.h | ||
HelperThreadAPI.h | ||
Id.h | ||
Initialization.h | ||
Interrupt.h | ||
JitCodeAPI.h | ||
JSON.h | ||
LocaleSensitive.h | ||
MapAndSet.h | ||
MemoryCallbacks.h | ||
MemoryFunctions.h | ||
MemoryMetrics.h | ||
Modules.h | ||
Object.h | ||
OffThreadScriptCompilation.h | ||
Principals.h | ||
Printf.h | ||
ProfilingCategory.h | ||
ProfilingFrameIterator.h | ||
ProfilingStack.h | ||
Promise.h | ||
PropertyAndElement.h | ||
PropertyDescriptor.h | ||
PropertySpec.h | ||
ProtoKey.h | ||
Proxy.h | ||
Realm.h | ||
RealmIterators.h | ||
RealmOptions.h | ||
RefCounted.h | ||
RegExp.h | ||
RegExpFlags.h | ||
Result.h | ||
RootingAPI.h | ||
SavedFrameAPI.h | ||
ScalarType.h | ||
ScriptPrivate.h | ||
ShadowRealmCallbacks.h | ||
SharedArrayBuffer.h | ||
SliceBudget.h | ||
SourceText.h | ||
StableStringChars.h | ||
Stack.h | ||
StreamConsumer.h | ||
String.h | ||
StructuredClone.h | ||
SweepingAPI.h | ||
Symbol.h | ||
TelemetryTimers.h | ||
TraceKind.h | ||
TracingAPI.h | ||
Transcoding.h | ||
TypeDecls.h | ||
UbiNode.h | ||
UbiNodeBreadthFirst.h | ||
UbiNodeCensus.h | ||
UbiNodeDominatorTree.h | ||
UbiNodePostOrder.h | ||
UbiNodeShortestPaths.h | ||
UbiNodeUtils.h | ||
UniquePtr.h | ||
Utility.h | ||
Value.h | ||
ValueArray.h | ||
Vector.h | ||
WaitCallbacks.h | ||
Warnings.h | ||
WasmFeatures.h | ||
WasmModule.h | ||
WeakMap.h | ||
WeakMapPtr.h | ||
Wrapper.h | ||
WrapperCallbacks.h | ||
Zone.h |