Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

2.2 KB
Raw Blame
;;! target = "x86_64"

(module
    (func $small1 (param i32) (result i32)
        (i32.add (local.get 0) (i32.const 1))
    )

    (func $small2 (param i32) (result i32)
        (return (i32.add (local.get 0) (i32.const 1)))
    )

    (func $infloop (result i32)
        (local i32)
        (loop (result i32)
            (i32.add (local.get 0) (i32.const 1))
            (local.set 0)
            (br 0)
        )
    )
)
;; function u0:0(i64 vmctx, i64, i32) -> i32 tail {
;;     region0 = 123 ""
;;     region1 = 160 ""
;;     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):
;; @0021                               v3 = iconst.i32 1
;; @0023                               v4 = iadd v2, v3  ; v3 = 1
;; @0024                               jump block1
;;
;;                                 block1:
;; @0024                               return v4
;; }
;;
;; function u0:1(i64 vmctx, i64, i32) -> i32 tail {
;;     region0 = 123 ""
;;     region1 = 160 ""
;;     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):
;; @0029                               v3 = iconst.i32 1
;; @002b                               v4 = iadd v2, v3  ; v3 = 1
;; @002c                               return v4
;; }
;;
;; function u0:2(i64 vmctx, i64) -> i32 tail {
;;     region0 = 123 ""
;;     region1 = 160 ""
;;     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):
;; @0030                               v2 = iconst.i32 0
;; @0032                               jump block2(v2)  ; v2 = 0
;;
;;                                 block2(v3: i32):
;; @0036                               v4 = iconst.i32 1
;; @0038                               v5 = iadd v3, v4  ; v4 = 1
;; @003b                               jump block2(v5)
;; }