A lightweight WebAssembly runtime that is fast, secure, and standards-compliant
;;! target = "x86_64"
;;! flags = "-W function-references,gc -C collector=null"
;;! test = "optimize"
(module
(type $ty (struct (field (mut f32))
(field (mut i8))
(field (mut anyref))))
(func (param (ref null $ty)) (result f32)
(struct.get $ty 0 (local.get 0))
)
(func (param (ref null $ty)) (result i32)
(struct.get_s $ty 1 (local.get 0))
)
(func (param (ref null $ty)) (result i32)
(struct.get_u $ty 1 (local.get 0))
)
(func (param (ref null $ty)) (result anyref)
(struct.get $ty 2 (local.get 0))
)
)
;; function u0:0(i64 vmctx, i64, i32) -> f32 tail {
;; region0 = 123 ""
;; region1 = 160 ""
;; region2 = 196 ""
;; region3 = 206 ""
;; region4 = 147 ""
;; gv0 = vmctx
;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8
;; gv2 = load.i64 notrap aligned region1 gv1+24
;; stack_limit = gv2
;;
;; block0(v0: i64, v1: i64, v2: i32):
;; @0033 trapz v2, user16
;; @0033 v4 = load.i64 notrap aligned readonly can_move region0 v0+8
;; @0033 v5 = load.i64 notrap aligned readonly can_move region2 v4+32
;; @0033 v3 = uextend.i64 v2
;; @0033 v6 = iadd v5, v3
;; @0033 v7 = iconst.i64 8
;; @0033 v8 = iadd v6, v7 ; v7 = 8
;; @0033 v9 = load.f32 user2 little region4 v8
;; @0037 jump block1
;;
;; block1:
;; @0037 return v9
;; }
;;
;; function u0:1(i64 vmctx, i64, i32) -> i32 tail {
;; region0 = 123 ""
;; region1 = 160 ""
;; region2 = 196 ""
;; region3 = 206 ""
;; region4 = 225 ""
;; gv0 = vmctx
;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8
;; gv2 = load.i64 notrap aligned region1 gv1+24
;; stack_limit = gv2
;;
;; block0(v0: i64, v1: i64, v2: i32):
;; @003c trapz v2, user16
;; @003c v4 = load.i64 notrap aligned readonly can_move region0 v0+8
;; @003c v5 = load.i64 notrap aligned readonly can_move region2 v4+32
;; @003c v3 = uextend.i64 v2
;; @003c v6 = iadd v5, v3
;; @003c v7 = iconst.i64 12
;; @003c v8 = iadd v6, v7 ; v7 = 12
;; @003c v9 = load.i8 user2 little region4 v8
;; @0040 jump block1
;;
;; block1:
;; @003c v10 = sextend.i32 v9
;; @0040 return v10
;; }
;;
;; function u0:2(i64 vmctx, i64, i32) -> i32 tail {
;; region0 = 123 ""
;; region1 = 160 ""
;; region2 = 196 ""
;; region3 = 206 ""
;; region4 = 225 ""
;; gv0 = vmctx
;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8
;; gv2 = load.i64 notrap aligned region1 gv1+24
;; stack_limit = gv2
;;
;; block0(v0: i64, v1: i64, v2: i32):
;; @0045 trapz v2, user16
;; @0045 v4 = load.i64 notrap aligned readonly can_move region0 v0+8
;; @0045 v5 = load.i64 notrap aligned readonly can_move region2 v4+32
;; @0045 v3 = uextend.i64 v2
;; @0045 v6 = iadd v5, v3
;; @0045 v7 = iconst.i64 12
;; @0045 v8 = iadd v6, v7 ; v7 = 12
;; @0045 v9 = load.i8 user2 little region4 v8
;; @0049 jump block1
;;
;; block1:
;; @0045 v10 = uextend.i32 v9
;; @0049 return v10
;; }
;;
;; function u0:3(i64 vmctx, i64, i32) -> i32 tail {
;; region0 = 123 ""
;; region1 = 160 ""
;; region2 = 196 ""
;; region3 = 206 ""
;; region4 = 152 ""
;; gv0 = vmctx
;; gv1 = load.i64 notrap aligned readonly can_move region0 gv0+8
;; gv2 = load.i64 notrap aligned region1 gv1+24
;; stack_limit = gv2
;;
;; block0(v0: i64, v1: i64, v2: i32):
;; @004e trapz v2, user16
;; @004e v4 = load.i64 notrap aligned readonly can_move region0 v0+8
;; @004e v5 = load.i64 notrap aligned readonly can_move region2 v4+32
;; @004e v3 = uextend.i64 v2
;; @004e v6 = iadd v5, v3
;; @004e v7 = iconst.i64 16
;; @004e v8 = iadd v6, v7 ; v7 = 16
;; @004e v9 = load.i32 user2 little region4 v8
;; @0052 jump block1
;;
;; block1:
;; @0052 return v9
;; }