From eda6530a187add28f06d9ab84d78b21b5001a6df Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 12 Jul 2024 16:48:06 -0400 Subject: [threads] ref.i31_shared (#6735) Implement `ref.i31_shared` the new instruction for creating references to shared i31s. Implement binary and text parsing and emitting as well as interpretation. Copy the upstream spec test for i31 and modify it so that all the heap types are shared. Comment out some parts that we do not yet support. --- src/parser/contexts.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/parser/contexts.h') diff --git a/src/parser/contexts.h b/src/parser/contexts.h index f58275d71..96a70663d 100644 --- a/src/parser/contexts.h +++ b/src/parser/contexts.h @@ -695,7 +695,10 @@ struct NullInstrParserCtx { Result<> makeCallRef(Index, const std::vector&, HeapTypeT, bool) { return Ok{}; } - Result<> makeRefI31(Index, const std::vector&) { return Ok{}; } + Result<> + makeRefI31(Index, const std::vector&, Shareability share) { + return Ok{}; + } Result<> makeI31Get(Index, const std::vector&, bool) { return Ok{}; } @@ -2363,8 +2366,10 @@ struct ParseDefsCtx : TypeParserCtx { return withLoc(pos, irBuilder.makeCallRef(type, isReturn)); } - Result<> makeRefI31(Index pos, const std::vector& annotations) { - return withLoc(pos, irBuilder.makeRefI31()); + Result<> makeRefI31(Index pos, + const std::vector& annotations, + Shareability share) { + return withLoc(pos, irBuilder.makeRefI31(share)); } Result<> makeI31Get(Index pos, -- cgit v1.2.3