parse memory instructions

This commit is contained in:
Ilya Rezvov
2023-08-21 21:11:39 -06:00
parent 2d4ad42549
commit 46f95dd11d
7 changed files with 73 additions and 30 deletions
+2 -2
View File
@@ -643,10 +643,10 @@ store32 addr val offset align = do
appendExpr [I64Store32 $ MemArg (fromIntegral offset) (fromIntegral align)]
memorySize :: GenFun (Proxy I32)
memorySize = appendExpr [CurrentMemory] >> return Proxy
memorySize = appendExpr [MemorySize] >> return Proxy
growMemory :: (Producer size, OutType size ~ Proxy I32) => size -> GenFun ()
growMemory size = produce size >> appendExpr [GrowMemory]
growMemory size = produce size >> appendExpr [MemoryGrow]
call :: (Returnable res) => Fn res -> [GenFun a] -> GenFun res
call (Fn idx) args = sequence_ args >> appendExpr [Call idx] >> return returnableValue