Codebase Browser
chromium
;; expected = ";; This is a polyglot C++/WAT file.\n;; Comment lines are ignored and not expected in the disassembler output.\n(module\n ;; Empty recgroups are useless but supported.\n (rec)\n (rec)\n ;; Structs.\n (type $type0 (struct))\n (type $type1 (struct (field $field0 i32)))\n (type $type2 (struct (field $field0 (mut i32)) (field $field1 (mut i64))))\n (type $type3 (struct (field $field0 i8) (field $field1 (mut i16))))\n ;; Arrays.\n (type $type4 (array (field i64)))\n (type $type5 (array (field (mut i64))))\n (type $type6 (array (field i8)))\n ;; References to other types, mutual recursion.\n (type $type7 (struct (field $field0 (ref $type0))))\n (rec\n (type $type8 (struct (field $field0 (ref $type9))))\n (type $type9 (struct (field $field0 (ref $type8))))\n )\n ;; Subtyping constraints.\n (type $type10 (sub $type0 (struct (field $field0 i32))))\n (type $type12 (sub final $type0 (struct (field $field0 (mut i32)))))\n ;; Empty recgroups are useless but supported.\n (rec)\n (rec)\n ;; Globals using reference types.\n (global $env.imported_global (;0;) (import \"env\" \"imported_global\") (ref $type7))\n (global $env.another_global (;1;) (import \"env\" \"another_global\") (ref $type8))\n (global $global2 anyref (ref.null none))\n (global $global3 (mut eqref) (ref.null none))\n ;; Function with GC instructions and taking GC types as parameters.\n (func $func0 (param $var0 (ref $type1)) (param $var1 eqref)\n ;; Structs.\n struct.new_default $type1\n struct.get $type1 $field0\n drop\n struct.new_default $type2\n i32.const 0\n struct.set $type2 $field0\n struct.new_default $type3\n struct.get_s $type3 $field0\n drop\n struct.new_default $type3\n struct.get_u $type3 $field1\n drop\n ;; Arrays.\n array.new_fixed $type4 0\n drop\n i32.const 0\n array.new_default $type4\n array.len\n drop\n i64.const 0\n i32.const 0\n array.new $type4\n i32.const 0\n array.get $type4\n drop\n i32.const 0\n array.new_default $type5\n i32.const 0\n i64.const 0\n array.set $type5\n i32.const 0\n array.new_default $type6\n i32.const 0\n array.get_s $type6\n drop\n i32.const 0\n array.new_default $type6\n i32.const 0\n array.get_u $type6\n drop\n ;; References.\n local.get $var1\n local.get $var1\n ref.eq\n drop\n local.get $var1\n ref.test $type0\n drop\n local.get $var0\n ref.cast $type0\n drop\n local.get $var0\n ref.test null $type0\n drop\n local.get $var0\n ref.cast null $type0\n drop\n ;; Branches.\n block $label0 (result (ref $type1))\n local.get $var0\n br_on_non_null $label0\n local.get $var0\n br_on_cast $label0 (ref null $type0) (ref $type1)\n drop\n local.get $var0\n br_on_cast_fail $label0 (ref $type0) (ref null $type1)\n drop\n local.get $var0\n end $label0\n drop\n )\n)\n;;";