typenative 0.6.2 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1131) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +18 -8
  3. package/bin/go/overrides.js +21 -1
  4. package/bin/index.js +48 -25
  5. package/bin/main.js +2 -1
  6. package/bin/node/assert.js +56 -17
  7. package/bin/node/async_hooks.js +69 -10
  8. package/bin/node/buffer.js +321 -7
  9. package/bin/node/child_process.js +220 -16
  10. package/bin/node/cluster.js +436 -32
  11. package/bin/node/crypto.js +814 -5
  12. package/bin/node/crypto_curves.js +142 -0
  13. package/bin/node/crypto_keys.js +1147 -48
  14. package/bin/node/crypto_pem.js +313 -0
  15. package/bin/node/crypto_pkcs12.js +17 -0
  16. package/bin/node/dgram.js +161 -10
  17. package/bin/node/diagnostics_channel.js +5 -1
  18. package/bin/node/events.js +358 -8
  19. package/bin/node/ffi.js +933 -0
  20. package/bin/node/fs.js +1346 -10
  21. package/bin/node/histogram.js +1991 -0
  22. package/bin/node/http.js +630 -55
  23. package/bin/node/http2.js +1141 -88
  24. package/bin/node/intl.js +4576 -0
  25. package/bin/node/intl_data.js +65412 -0
  26. package/bin/node/module_v8.js +155 -16
  27. package/bin/node/net.js +59 -10
  28. package/bin/node/path.js +5 -1
  29. package/bin/node/process.js +355 -4
  30. package/bin/node/readline.js +558 -8
  31. package/bin/node/registry.js +2 -0
  32. package/bin/node/sqlite.js +1539 -7
  33. package/bin/node/stream.js +371 -32
  34. package/bin/node/stream_web.js +422 -15
  35. package/bin/node/system_extra.js +40 -154
  36. package/bin/node/temporal.js +96 -0
  37. package/bin/node/temporal_runtime.js +5075 -0
  38. package/bin/node/temporal_zones.js +460 -0
  39. package/bin/node/test.js +191 -8
  40. package/bin/node/test_coverage.js +58 -0
  41. package/bin/node/test_report.js +50 -4
  42. package/bin/node/test_run.js +64 -3
  43. package/bin/node/timers.js +123 -0
  44. package/bin/node/tls.js +346 -12
  45. package/bin/node/tls_roots.js +122 -0
  46. package/bin/node/typed_arrays.js +867 -93
  47. package/bin/node/url.js +657 -0
  48. package/bin/node/util.js +449 -7
  49. package/bin/node/util_extra.js +6 -0
  50. package/bin/node/wasi.js +214 -0
  51. package/bin/node/webassembly.js +1137 -0
  52. package/bin/node/websocket.js +763 -0
  53. package/bin/node/webview.js +3257 -244
  54. package/bin/node/worker_threads.js +434 -52
  55. package/bin/node/zlib.js +455 -22
  56. package/bin/node/zlib_iter.js +585 -0
  57. package/bin/node/zlib_zip.js +2392 -0
  58. package/bin/transpiler.js +3417 -501
  59. package/bin/typecheck-node.js +49 -17
  60. package/bin/version.js +1 -1
  61. package/govendor/github.com/cloudflare/circl/.golangci.yaml +64 -0
  62. package/govendor/github.com/cloudflare/circl/.semgrepignore +1 -0
  63. package/govendor/github.com/cloudflare/circl/AGENTS.md +91 -0
  64. package/govendor/github.com/cloudflare/circl/CITATION.cff +30 -0
  65. package/govendor/github.com/cloudflare/circl/LICENSE +57 -0
  66. package/govendor/github.com/cloudflare/circl/Makefile +70 -0
  67. package/govendor/github.com/cloudflare/circl/README.md +206 -0
  68. package/govendor/github.com/cloudflare/circl/REVIEW.md +83 -0
  69. package/govendor/github.com/cloudflare/circl/codecov.yml +21 -0
  70. package/govendor/github.com/cloudflare/circl/dh/x448/curve.go +104 -0
  71. package/govendor/github.com/cloudflare/circl/dh/x448/curve_amd64.go +30 -0
  72. package/govendor/github.com/cloudflare/circl/dh/x448/curve_amd64.h +111 -0
  73. package/govendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s +194 -0
  74. package/govendor/github.com/cloudflare/circl/dh/x448/curve_generic.go +100 -0
  75. package/govendor/github.com/cloudflare/circl/dh/x448/curve_noasm.go +11 -0
  76. package/govendor/github.com/cloudflare/circl/dh/x448/doc.go +19 -0
  77. package/govendor/github.com/cloudflare/circl/dh/x448/key.go +46 -0
  78. package/govendor/github.com/cloudflare/circl/dh/x448/table.go +460 -0
  79. package/govendor/github.com/cloudflare/circl/doc.go +8 -0
  80. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/constants.go +71 -0
  81. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go +90 -0
  82. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/isogeny.go +52 -0
  83. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/point.go +181 -0
  84. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/scalar.go +203 -0
  85. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twist.go +138 -0
  86. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twistPoint.go +135 -0
  87. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twistTables.go +216 -0
  88. package/govendor/github.com/cloudflare/circl/ecc/goldilocks/twist_basemult.go +62 -0
  89. package/govendor/github.com/cloudflare/circl/go.mod +3 -0
  90. package/govendor/github.com/cloudflare/circl/internal/conv/conv.go +173 -0
  91. package/govendor/github.com/cloudflare/circl/internal/sha3/doc.go +62 -0
  92. package/govendor/github.com/cloudflare/circl/internal/sha3/hashes.go +69 -0
  93. package/govendor/github.com/cloudflare/circl/internal/sha3/keccakf.go +391 -0
  94. package/govendor/github.com/cloudflare/circl/internal/sha3/rc.go +29 -0
  95. package/govendor/github.com/cloudflare/circl/internal/sha3/sha3.go +200 -0
  96. package/govendor/github.com/cloudflare/circl/internal/sha3/sha3_s390x.s +33 -0
  97. package/govendor/github.com/cloudflare/circl/internal/sha3/shake.go +119 -0
  98. package/govendor/github.com/cloudflare/circl/internal/sha3/xor.go +15 -0
  99. package/govendor/github.com/cloudflare/circl/internal/sha3/xor_generic.go +33 -0
  100. package/govendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go +61 -0
  101. package/govendor/github.com/cloudflare/circl/math/fp448/fp.go +164 -0
  102. package/govendor/github.com/cloudflare/circl/math/fp448/fp_amd64.go +43 -0
  103. package/govendor/github.com/cloudflare/circl/math/fp448/fp_amd64.h +591 -0
  104. package/govendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s +75 -0
  105. package/govendor/github.com/cloudflare/circl/math/fp448/fp_generic.go +339 -0
  106. package/govendor/github.com/cloudflare/circl/math/fp448/fp_noasm.go +12 -0
  107. package/govendor/github.com/cloudflare/circl/math/fp448/fuzzer.go +75 -0
  108. package/govendor/github.com/cloudflare/circl/math/integer.go +16 -0
  109. package/govendor/github.com/cloudflare/circl/math/mlsbset/mlsbset.go +145 -0
  110. package/govendor/github.com/cloudflare/circl/math/mlsbset/power.go +64 -0
  111. package/govendor/github.com/cloudflare/circl/math/primes.go +34 -0
  112. package/govendor/github.com/cloudflare/circl/math/wnaf.go +84 -0
  113. package/govendor/github.com/cloudflare/circl/sign/ed448/ed448.go +417 -0
  114. package/govendor/github.com/cloudflare/circl/sign/ed448/signapi.go +89 -0
  115. package/govendor/github.com/cloudflare/circl/sign/sign.go +119 -0
  116. package/{examples/react-compiler/vendor/picocolors → govendor/github.com/decred/dcrd/dcrec/secp256k1/v4}/LICENSE +4 -2
  117. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/README.md +72 -0
  118. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/compressedbytepoints.go +18 -0
  119. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/curve.go +1310 -0
  120. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/curve_embedded.go +14 -0
  121. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/curve_precompute.go +14 -0
  122. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/doc.go +59 -0
  123. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdh.go +21 -0
  124. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/README.md +52 -0
  125. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/doc.go +42 -0
  126. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/error.go +134 -0
  127. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa/signature.go +1001 -0
  128. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/ellipticadaptor.go +296 -0
  129. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/error.go +67 -0
  130. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/field.go +1696 -0
  131. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/go.mod +3 -0
  132. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/loadprecomputed.go +91 -0
  133. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/modnscalar.go +1105 -0
  134. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/nonce.go +263 -0
  135. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/privkey.go +111 -0
  136. package/govendor/github.com/decred/dcrd/dcrec/secp256k1/v4/pubkey.go +236 -0
  137. package/govendor/github.com/ebitengine/purego/LICENSE +201 -0
  138. package/govendor/github.com/ebitengine/purego/README.md +124 -0
  139. package/govendor/github.com/ebitengine/purego/abi_amd64.h +99 -0
  140. package/govendor/github.com/ebitengine/purego/abi_arm64.h +39 -0
  141. package/govendor/github.com/ebitengine/purego/abi_loong64.h +60 -0
  142. package/govendor/github.com/ebitengine/purego/cdecl.go +11 -0
  143. package/govendor/github.com/ebitengine/purego/cgo.go +19 -0
  144. package/govendor/github.com/ebitengine/purego/dlerror.go +17 -0
  145. package/govendor/github.com/ebitengine/purego/dlfcn.go +99 -0
  146. package/govendor/github.com/ebitengine/purego/dlfcn_android.go +34 -0
  147. package/govendor/github.com/ebitengine/purego/dlfcn_darwin.go +20 -0
  148. package/govendor/github.com/ebitengine/purego/dlfcn_freebsd.go +14 -0
  149. package/govendor/github.com/ebitengine/purego/dlfcn_linux.go +16 -0
  150. package/govendor/github.com/ebitengine/purego/dlfcn_netbsd.go +15 -0
  151. package/govendor/github.com/ebitengine/purego/dlfcn_nocgo_freebsd.go +11 -0
  152. package/govendor/github.com/ebitengine/purego/dlfcn_nocgo_linux.go +19 -0
  153. package/govendor/github.com/ebitengine/purego/dlfcn_nocgo_netbsd.go +11 -0
  154. package/govendor/github.com/ebitengine/purego/dlfcn_playground.go +24 -0
  155. package/govendor/github.com/ebitengine/purego/dlfcn_stubs.s +22 -0
  156. package/govendor/github.com/ebitengine/purego/func.go +780 -0
  157. package/govendor/github.com/ebitengine/purego/gen.go +6 -0
  158. package/govendor/github.com/ebitengine/purego/go.mod +3 -0
  159. package/govendor/github.com/ebitengine/purego/go_runtime.go +19 -0
  160. package/govendor/github.com/ebitengine/purego/internal/cgo/dlfcn_cgo_unix.go +56 -0
  161. package/govendor/github.com/ebitengine/purego/internal/cgo/empty.go +6 -0
  162. package/govendor/github.com/ebitengine/purego/internal/cgo/syscall_cgo_unix.go +49 -0
  163. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_amd64.h +99 -0
  164. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_arm64.h +39 -0
  165. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_loong64.h +60 -0
  166. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_ppc64x.h +195 -0
  167. package/govendor/github.com/ebitengine/purego/internal/fakecgo/abi_riscv64.h +72 -0
  168. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_386.s +29 -0
  169. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_amd64.s +39 -0
  170. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_arm.s +58 -0
  171. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_arm64.s +35 -0
  172. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_loong64.s +38 -0
  173. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_ppc64le.s +79 -0
  174. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_riscv64.s +36 -0
  175. package/govendor/github.com/ebitengine/purego/internal/fakecgo/asm_s390x.s +52 -0
  176. package/govendor/github.com/ebitengine/purego/internal/fakecgo/callbacks.go +93 -0
  177. package/govendor/github.com/ebitengine/purego/internal/fakecgo/doc.go +32 -0
  178. package/govendor/github.com/ebitengine/purego/internal/fakecgo/fakecgo.go +14 -0
  179. package/govendor/github.com/ebitengine/purego/internal/fakecgo/freebsd.go +27 -0
  180. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_darwin.go +86 -0
  181. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_freebsd.go +77 -0
  182. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_libinit.go +72 -0
  183. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_linux.go +77 -0
  184. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_netbsd.go +83 -0
  185. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_setenv.go +18 -0
  186. package/govendor/github.com/ebitengine/purego/internal/fakecgo/go_util.go +38 -0
  187. package/govendor/github.com/ebitengine/purego/internal/fakecgo/iscgo.go +19 -0
  188. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo.go +37 -0
  189. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_darwin.go +37 -0
  190. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_freebsd.go +27 -0
  191. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_linux.go +27 -0
  192. package/govendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_netbsd.go +36 -0
  193. package/govendor/github.com/ebitengine/purego/internal/fakecgo/linux.go +189 -0
  194. package/govendor/github.com/ebitengine/purego/internal/fakecgo/netbsd.go +23 -0
  195. package/govendor/github.com/ebitengine/purego/internal/fakecgo/setenv.go +19 -0
  196. package/govendor/github.com/ebitengine/purego/internal/fakecgo/threadentry_amd64.go +15 -0
  197. package/govendor/github.com/ebitengine/purego/internal/fakecgo/threadentry_noasm.go +24 -0
  198. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_386.s +130 -0
  199. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_amd64.s +124 -0
  200. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_arm.s +131 -0
  201. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_arm64.s +81 -0
  202. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_386.s +78 -0
  203. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_amd64.s +69 -0
  204. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_arm.s +69 -0
  205. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_arm64.s +60 -0
  206. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_loong64.s +60 -0
  207. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_ppc64le.s +69 -0
  208. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_riscv64.s +60 -0
  209. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_linux_s390x.s +51 -0
  210. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_loong64.s +78 -0
  211. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_ppc64le.s +132 -0
  212. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_riscv64.s +76 -0
  213. package/govendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_s390x.s +158 -0
  214. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols.go +165 -0
  215. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_darwin.go +59 -0
  216. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_freebsd.go +48 -0
  217. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_linux.go +158 -0
  218. package/govendor/github.com/ebitengine/purego/internal/fakecgo/zsymbols_netbsd.go +59 -0
  219. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_darwin.s +19 -0
  220. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_freebsd.s +16 -0
  221. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_linux.s +46 -0
  222. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_netbsd.s +19 -0
  223. package/govendor/github.com/ebitengine/purego/internal/fakecgo/ztrampolines_stubs.s +55 -0
  224. package/govendor/github.com/ebitengine/purego/internal/strings/strings.go +40 -0
  225. package/govendor/github.com/ebitengine/purego/is_ios.go +13 -0
  226. package/govendor/github.com/ebitengine/purego/nocgo.go +25 -0
  227. package/govendor/github.com/ebitengine/purego/struct_amd64.go +518 -0
  228. package/govendor/github.com/ebitengine/purego/struct_arm.go +100 -0
  229. package/govendor/github.com/ebitengine/purego/struct_arm64.go +757 -0
  230. package/govendor/github.com/ebitengine/purego/struct_loong64.go +244 -0
  231. package/govendor/github.com/ebitengine/purego/struct_other.go +54 -0
  232. package/govendor/github.com/ebitengine/purego/struct_ppc64le.go +180 -0
  233. package/govendor/github.com/ebitengine/purego/struct_riscv64.go +158 -0
  234. package/govendor/github.com/ebitengine/purego/struct_s390x.go +158 -0
  235. package/govendor/github.com/ebitengine/purego/sys_386.s +153 -0
  236. package/govendor/github.com/ebitengine/purego/sys_amd64.s +206 -0
  237. package/govendor/github.com/ebitengine/purego/sys_arm.s +153 -0
  238. package/govendor/github.com/ebitengine/purego/sys_arm64.s +133 -0
  239. package/govendor/github.com/ebitengine/purego/sys_loong64.s +131 -0
  240. package/govendor/github.com/ebitengine/purego/sys_ppc64le.s +126 -0
  241. package/govendor/github.com/ebitengine/purego/sys_riscv64.s +135 -0
  242. package/govendor/github.com/ebitengine/purego/sys_s390x.s +148 -0
  243. package/govendor/github.com/ebitengine/purego/sys_unix_386.s +234 -0
  244. package/govendor/github.com/ebitengine/purego/sys_unix_arm.s +99 -0
  245. package/govendor/github.com/ebitengine/purego/sys_unix_arm64.s +75 -0
  246. package/govendor/github.com/ebitengine/purego/sys_unix_loong64.s +79 -0
  247. package/govendor/github.com/ebitengine/purego/sys_unix_ppc64le.s +114 -0
  248. package/govendor/github.com/ebitengine/purego/sys_unix_riscv64.s +79 -0
  249. package/govendor/github.com/ebitengine/purego/sys_unix_s390x.s +111 -0
  250. package/govendor/github.com/ebitengine/purego/syscall.go +95 -0
  251. package/govendor/github.com/ebitengine/purego/syscall_32bit.go +97 -0
  252. package/govendor/github.com/ebitengine/purego/syscall_cgo_linux.go +20 -0
  253. package/govendor/github.com/ebitengine/purego/syscall_notstackargs.go +55 -0
  254. package/govendor/github.com/ebitengine/purego/syscall_ppc64le.go +73 -0
  255. package/govendor/github.com/ebitengine/purego/syscall_stackargs_ppc64le.go +38 -0
  256. package/govendor/github.com/ebitengine/purego/syscall_stackargs_s390x.go +38 -0
  257. package/govendor/github.com/ebitengine/purego/syscall_unix.go +392 -0
  258. package/govendor/github.com/ebitengine/purego/syscall_windows.go +54 -0
  259. package/govendor/github.com/ebitengine/purego/zcallback_386.s +4014 -0
  260. package/govendor/github.com/ebitengine/purego/zcallback_amd64.s +2014 -0
  261. package/govendor/github.com/ebitengine/purego/zcallback_arm.s +4014 -0
  262. package/govendor/github.com/ebitengine/purego/zcallback_arm64.s +4014 -0
  263. package/govendor/github.com/ebitengine/purego/zcallback_loong64.s +4014 -0
  264. package/govendor/github.com/ebitengine/purego/zcallback_ppc64le.s +4014 -0
  265. package/govendor/github.com/ebitengine/purego/zcallback_riscv64.s +4051 -0
  266. package/govendor/github.com/ebitengine/purego/zcallback_s390x.s +4015 -0
  267. package/govendor/github.com/klauspost/compress/.gitattributes +3 -0
  268. package/govendor/github.com/klauspost/compress/.goreleaser.yml +132 -0
  269. package/govendor/github.com/klauspost/compress/AGENTS.md +106 -0
  270. package/govendor/github.com/klauspost/compress/LICENSE +304 -0
  271. package/govendor/github.com/klauspost/compress/README.md +766 -0
  272. package/govendor/github.com/klauspost/compress/SECURITY.md +25 -0
  273. package/govendor/github.com/klauspost/compress/compressible.go +85 -0
  274. package/govendor/github.com/klauspost/compress/fse/README.md +79 -0
  275. package/govendor/github.com/klauspost/compress/fse/bitreader.go +122 -0
  276. package/govendor/github.com/klauspost/compress/fse/bitwriter.go +167 -0
  277. package/govendor/github.com/klauspost/compress/fse/bytereader.go +47 -0
  278. package/govendor/github.com/klauspost/compress/fse/compress.go +685 -0
  279. package/govendor/github.com/klauspost/compress/fse/decompress.go +383 -0
  280. package/govendor/github.com/klauspost/compress/fse/fse.go +150 -0
  281. package/govendor/github.com/klauspost/compress/gen.sh +4 -0
  282. package/govendor/github.com/klauspost/compress/go.mod +3 -0
  283. package/govendor/github.com/klauspost/compress/huff0/README.md +89 -0
  284. package/govendor/github.com/klauspost/compress/huff0/bitreader.go +323 -0
  285. package/govendor/github.com/klauspost/compress/huff0/bitwriter.go +97 -0
  286. package/govendor/github.com/klauspost/compress/huff0/build_table.go +168 -0
  287. package/govendor/github.com/klauspost/compress/huff0/compress.go +747 -0
  288. package/govendor/github.com/klauspost/compress/huff0/decompress.go +1188 -0
  289. package/govendor/github.com/klauspost/compress/huff0/decompress_amd64.go +128 -0
  290. package/govendor/github.com/klauspost/compress/huff0/decompress_amd64.s +3476 -0
  291. package/govendor/github.com/klauspost/compress/huff0/decompress_arm64.go +72 -0
  292. package/govendor/github.com/klauspost/compress/huff0/decompress_arm64.s +1648 -0
  293. package/govendor/github.com/klauspost/compress/huff0/decompress_asm.go +252 -0
  294. package/govendor/github.com/klauspost/compress/huff0/decompress_generic.go +278 -0
  295. package/govendor/github.com/klauspost/compress/huff0/huff0.go +337 -0
  296. package/govendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go +34 -0
  297. package/govendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go +10 -0
  298. package/govendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s +34 -0
  299. package/govendor/github.com/klauspost/compress/internal/le/le.go +5 -0
  300. package/govendor/github.com/klauspost/compress/internal/le/unsafe_disabled.go +42 -0
  301. package/govendor/github.com/klauspost/compress/internal/le/unsafe_enabled.go +52 -0
  302. package/govendor/github.com/klauspost/compress/internal/regmask/regmask.go +50 -0
  303. package/govendor/github.com/klauspost/compress/internal/regmask/regmask_386.go +39 -0
  304. package/govendor/github.com/klauspost/compress/internal/snapref/LICENSE +27 -0
  305. package/govendor/github.com/klauspost/compress/internal/snapref/decode.go +264 -0
  306. package/govendor/github.com/klauspost/compress/internal/snapref/decode_other.go +113 -0
  307. package/govendor/github.com/klauspost/compress/internal/snapref/encode.go +291 -0
  308. package/govendor/github.com/klauspost/compress/internal/snapref/encode_other.go +250 -0
  309. package/govendor/github.com/klauspost/compress/internal/snapref/snappy.go +98 -0
  310. package/govendor/github.com/klauspost/compress/s2sx.mod +3 -0
  311. package/govendor/github.com/klauspost/compress/s2sx.sum +0 -0
  312. package/govendor/github.com/klauspost/compress/zstd/README.md +487 -0
  313. package/govendor/github.com/klauspost/compress/zstd/bitreader.go +176 -0
  314. package/govendor/github.com/klauspost/compress/zstd/bitwriter.go +151 -0
  315. package/govendor/github.com/klauspost/compress/zstd/blockdec.go +728 -0
  316. package/govendor/github.com/klauspost/compress/zstd/blockenc.go +923 -0
  317. package/govendor/github.com/klauspost/compress/zstd/blocktype_string.go +85 -0
  318. package/govendor/github.com/klauspost/compress/zstd/bytebuf.go +131 -0
  319. package/govendor/github.com/klauspost/compress/zstd/bytereader.go +82 -0
  320. package/govendor/github.com/klauspost/compress/zstd/decodeheader.go +261 -0
  321. package/govendor/github.com/klauspost/compress/zstd/decoder.go +995 -0
  322. package/govendor/github.com/klauspost/compress/zstd/decoder_options.go +213 -0
  323. package/govendor/github.com/klauspost/compress/zstd/dict.go +605 -0
  324. package/govendor/github.com/klauspost/compress/zstd/enc_base.go +200 -0
  325. package/govendor/github.com/klauspost/compress/zstd/enc_best.go +572 -0
  326. package/govendor/github.com/klauspost/compress/zstd/enc_better.go +1262 -0
  327. package/govendor/github.com/klauspost/compress/zstd/enc_dfast.go +1136 -0
  328. package/govendor/github.com/klauspost/compress/zstd/enc_fast.go +892 -0
  329. package/govendor/github.com/klauspost/compress/zstd/enc_jobs.go +352 -0
  330. package/govendor/github.com/klauspost/compress/zstd/encoder.go +881 -0
  331. package/govendor/github.com/klauspost/compress/zstd/encoder_options.go +422 -0
  332. package/govendor/github.com/klauspost/compress/zstd/framedec.go +404 -0
  333. package/govendor/github.com/klauspost/compress/zstd/frameenc.go +137 -0
  334. package/govendor/github.com/klauspost/compress/zstd/fse_decoder.go +333 -0
  335. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s +132 -0
  336. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_arm64.s +148 -0
  337. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_asm.go +70 -0
  338. package/govendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go +71 -0
  339. package/govendor/github.com/klauspost/compress/zstd/fse_encoder.go +701 -0
  340. package/govendor/github.com/klauspost/compress/zstd/fse_predefined.go +168 -0
  341. package/govendor/github.com/klauspost/compress/zstd/hash.go +57 -0
  342. package/govendor/github.com/klauspost/compress/zstd/history.go +119 -0
  343. package/{examples/react-compiler/vendor/jsesc/LICENSE-MIT.txt → govendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt} +3 -1
  344. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md +71 -0
  345. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go +242 -0
  346. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s +210 -0
  347. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s +184 -0
  348. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go +11 -0
  349. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go +75 -0
  350. package/govendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go +11 -0
  351. package/govendor/github.com/klauspost/compress/zstd/matchlen_amd64.go +15 -0
  352. package/govendor/github.com/klauspost/compress/zstd/matchlen_amd64.s +66 -0
  353. package/govendor/github.com/klauspost/compress/zstd/matchlen_generic.go +37 -0
  354. package/govendor/github.com/klauspost/compress/zstd/seqdec.go +620 -0
  355. package/govendor/github.com/klauspost/compress/zstd/seqdec_amd64.go +115 -0
  356. package/govendor/github.com/klauspost/compress/zstd/seqdec_amd64.s +4762 -0
  357. package/govendor/github.com/klauspost/compress/zstd/seqdec_arm64.go +81 -0
  358. package/govendor/github.com/klauspost/compress/zstd/seqdec_arm64.s +2919 -0
  359. package/govendor/github.com/klauspost/compress/zstd/seqdec_asm.go +327 -0
  360. package/govendor/github.com/klauspost/compress/zstd/seqdec_generic.go +258 -0
  361. package/govendor/github.com/klauspost/compress/zstd/seqenc.go +159 -0
  362. package/govendor/github.com/klauspost/compress/zstd/simple.go +54 -0
  363. package/govendor/github.com/klauspost/compress/zstd/snappy.go +447 -0
  364. package/govendor/github.com/klauspost/compress/zstd/zip.go +141 -0
  365. package/govendor/github.com/klauspost/compress/zstd/zstd.go +126 -0
  366. package/govendor/github.com/tetratelabs/wazero/.editorconfig +7 -0
  367. package/govendor/github.com/tetratelabs/wazero/.gitattributes +2 -0
  368. package/govendor/github.com/tetratelabs/wazero/.gitmodules +3 -0
  369. package/govendor/github.com/tetratelabs/wazero/CONTRIBUTING.md +75 -0
  370. package/govendor/github.com/tetratelabs/wazero/LICENSE +201 -0
  371. package/govendor/github.com/tetratelabs/wazero/Makefile +385 -0
  372. package/govendor/github.com/tetratelabs/wazero/NOTICE +2 -0
  373. package/govendor/github.com/tetratelabs/wazero/RATIONALE.md +1577 -0
  374. package/govendor/github.com/tetratelabs/wazero/README.md +135 -0
  375. package/govendor/github.com/tetratelabs/wazero/api/features.go +228 -0
  376. package/govendor/github.com/tetratelabs/wazero/api/wasm.go +766 -0
  377. package/govendor/github.com/tetratelabs/wazero/builder.go +367 -0
  378. package/govendor/github.com/tetratelabs/wazero/cache.go +123 -0
  379. package/govendor/github.com/tetratelabs/wazero/codecov.yml +9 -0
  380. package/govendor/github.com/tetratelabs/wazero/config.go +899 -0
  381. package/govendor/github.com/tetratelabs/wazero/experimental/checkpoint.go +35 -0
  382. package/govendor/github.com/tetratelabs/wazero/experimental/close.go +63 -0
  383. package/govendor/github.com/tetratelabs/wazero/experimental/compilationworkers.go +19 -0
  384. package/govendor/github.com/tetratelabs/wazero/experimental/experimental.go +41 -0
  385. package/govendor/github.com/tetratelabs/wazero/experimental/features.go +39 -0
  386. package/govendor/github.com/tetratelabs/wazero/experimental/importresolver.go +19 -0
  387. package/govendor/github.com/tetratelabs/wazero/experimental/listener.go +324 -0
  388. package/govendor/github.com/tetratelabs/wazero/experimental/memory.go +52 -0
  389. package/govendor/github.com/tetratelabs/wazero/experimental/sys/dir.go +92 -0
  390. package/govendor/github.com/tetratelabs/wazero/experimental/sys/errno.go +98 -0
  391. package/govendor/github.com/tetratelabs/wazero/experimental/sys/error.go +45 -0
  392. package/govendor/github.com/tetratelabs/wazero/experimental/sys/file.go +356 -0
  393. package/govendor/github.com/tetratelabs/wazero/experimental/sys/fs.go +292 -0
  394. package/govendor/github.com/tetratelabs/wazero/experimental/sys/oflag.go +70 -0
  395. package/govendor/github.com/tetratelabs/wazero/experimental/sys/poll.go +48 -0
  396. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno.go +106 -0
  397. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_notwindows.go +13 -0
  398. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_unsupported.go +7 -0
  399. package/govendor/github.com/tetratelabs/wazero/experimental/sys/syscall_errno_windows.go +37 -0
  400. package/govendor/github.com/tetratelabs/wazero/experimental/sys/time.go +10 -0
  401. package/govendor/github.com/tetratelabs/wazero/experimental/sys/unimplemented.go +160 -0
  402. package/govendor/github.com/tetratelabs/wazero/fsconfig.go +213 -0
  403. package/govendor/github.com/tetratelabs/wazero/go.mod +3 -0
  404. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/args.go +97 -0
  405. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/clock.go +116 -0
  406. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/environ.go +100 -0
  407. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/fs.go +2015 -0
  408. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/poll.go +247 -0
  409. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/proc.go +44 -0
  410. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/random.go +55 -0
  411. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sched.go +22 -0
  412. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sock.go +188 -0
  413. package/govendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/wasi.go +314 -0
  414. package/govendor/github.com/tetratelabs/wazero/internal/descriptor/table.go +149 -0
  415. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/compiler.go +3884 -0
  416. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/format.go +22 -0
  417. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/interpreter.go +4963 -0
  418. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/operations.go +2978 -0
  419. package/govendor/github.com/tetratelabs/wazero/internal/engine/interpreter/signature.go +825 -0
  420. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/abi.go +170 -0
  421. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/backend.go +3 -0
  422. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/compiler.go +402 -0
  423. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/compiler_lower.go +226 -0
  424. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/go_call.go +33 -0
  425. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi.go +186 -0
  426. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_amd64.go +9 -0
  427. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_amd64.s +29 -0
  428. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_entry_preamble.go +248 -0
  429. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/abi_go_call.go +440 -0
  430. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/cond.go +168 -0
  431. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/ext.go +35 -0
  432. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/instr.go +2495 -0
  433. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/instr_encoding.go +1714 -0
  434. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/lower_constant.go +71 -0
  435. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/lower_mem.go +187 -0
  436. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine.go +3782 -0
  437. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_pro_epi_logue.go +334 -0
  438. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_regalloc.go +352 -0
  439. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/machine_vec.go +992 -0
  440. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/operands.go +336 -0
  441. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/reg.go +181 -0
  442. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/amd64/stack.go +130 -0
  443. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi.go +376 -0
  444. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_arm64.go +9 -0
  445. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_arm64.s +29 -0
  446. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_entry_preamble.go +233 -0
  447. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/abi_go_call.go +430 -0
  448. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/cond.go +215 -0
  449. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/instr.go +2562 -0
  450. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/instr_encoding.go +2357 -0
  451. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_constant.go +301 -0
  452. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_instr.go +2227 -0
  453. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_instr_operands.go +340 -0
  454. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/lower_mem.go +451 -0
  455. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine.go +631 -0
  456. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_pro_epi_logue.go +486 -0
  457. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_regalloc.go +351 -0
  458. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/machine_relocation.go +128 -0
  459. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/reg.go +397 -0
  460. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/isa/arm64/unwind_stack.go +84 -0
  461. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/machine.go +119 -0
  462. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/api.go +124 -0
  463. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/reg.go +123 -0
  464. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/regalloc.go +1189 -0
  465. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc/regset.go +96 -0
  466. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/backend/vdef.go +19 -0
  467. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/call_engine.go +884 -0
  468. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/engine.go +1008 -0
  469. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/engine_cache.go +347 -0
  470. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_amd64.go +13 -0
  471. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_arm64.go +13 -0
  472. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/entrypoint_other.go +15 -0
  473. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/frontend.go +663 -0
  474. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/lower.go +5045 -0
  475. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/misc.go +10 -0
  476. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/frontend/sort_id.go +13 -0
  477. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/hostmodule.go +88 -0
  478. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_amd64.go +30 -0
  479. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_arm64.go +32 -0
  480. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/isa_other.go +29 -0
  481. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/memmove.go +11 -0
  482. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/module_engine.go +403 -0
  483. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/basic_block.go +381 -0
  484. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/basic_block_sort.go +32 -0
  485. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/builder.go +790 -0
  486. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/cmp.go +107 -0
  487. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/funcref.go +12 -0
  488. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/instructions.go +3024 -0
  489. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass.go +393 -0
  490. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass_blk_layouts.go +334 -0
  491. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/pass_cfg.go +313 -0
  492. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/signature.go +49 -0
  493. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/ssa.go +14 -0
  494. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/type.go +115 -0
  495. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/ssa/vs.go +114 -0
  496. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/debug_options.go +189 -0
  497. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/exitcode.go +150 -0
  498. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/offsetdata.go +248 -0
  499. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap.go +96 -0
  500. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap_disabled.go +5 -0
  501. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/perfmap_enabled.go +5 -0
  502. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/pool.go +215 -0
  503. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/ptr.go +15 -0
  504. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/queue.go +26 -0
  505. package/govendor/github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi/resetmap.go +11 -0
  506. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/checkpoint.go +10 -0
  507. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/close.go +5 -0
  508. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/compilationworkers.go +6 -0
  509. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/expctxkeys.go +2 -0
  510. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/importresolver.go +6 -0
  511. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/listener.go +7 -0
  512. package/govendor/github.com/tetratelabs/wazero/internal/expctxkeys/memory.go +4 -0
  513. package/govendor/github.com/tetratelabs/wazero/internal/filecache/compilationcache.go +42 -0
  514. package/govendor/github.com/tetratelabs/wazero/internal/filecache/file_cache.go +76 -0
  515. package/govendor/github.com/tetratelabs/wazero/internal/ieee754/ieee754.go +29 -0
  516. package/govendor/github.com/tetratelabs/wazero/internal/internalapi/internal.go +9 -0
  517. package/govendor/github.com/tetratelabs/wazero/internal/leb128/leb128.go +285 -0
  518. package/govendor/github.com/tetratelabs/wazero/internal/moremath/moremath.go +271 -0
  519. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid.go +26 -0
  520. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.go +22 -0
  521. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid_arm64.go +13 -0
  522. package/govendor/github.com/tetratelabs/wazero/internal/platform/cpuid_unsupported.go +5 -0
  523. package/govendor/github.com/tetratelabs/wazero/internal/platform/crypto.go +17 -0
  524. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_linux.go +72 -0
  525. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_other.go +19 -0
  526. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_unix.go +14 -0
  527. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_unsupported.go +22 -0
  528. package/govendor/github.com/tetratelabs/wazero/internal/platform/mmap_windows.go +31 -0
  529. package/govendor/github.com/tetratelabs/wazero/internal/platform/path.go +6 -0
  530. package/govendor/github.com/tetratelabs/wazero/internal/platform/path_windows.go +17 -0
  531. package/govendor/github.com/tetratelabs/wazero/internal/platform/platform.go +71 -0
  532. package/govendor/github.com/tetratelabs/wazero/internal/platform/time.go +76 -0
  533. package/govendor/github.com/tetratelabs/wazero/internal/platform/time_notwindows.go +11 -0
  534. package/govendor/github.com/tetratelabs/wazero/internal/platform/time_windows.go +40 -0
  535. package/govendor/github.com/tetratelabs/wazero/internal/sock/sock.go +89 -0
  536. package/govendor/github.com/tetratelabs/wazero/internal/sock/sock_supported.go +11 -0
  537. package/govendor/github.com/tetratelabs/wazero/internal/sock/sock_unsupported.go +10 -0
  538. package/govendor/github.com/tetratelabs/wazero/internal/sys/fs.go +458 -0
  539. package/govendor/github.com/tetratelabs/wazero/internal/sys/lazy.go +135 -0
  540. package/govendor/github.com/tetratelabs/wazero/internal/sys/stdio.go +125 -0
  541. package/govendor/github.com/tetratelabs/wazero/internal/sys/sys.go +228 -0
  542. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/adapter.go +105 -0
  543. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_linux.go +12 -0
  544. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_unsupported.go +14 -0
  545. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/dir.go +24 -0
  546. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/dirfs.go +137 -0
  547. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file.go +576 -0
  548. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file_unix.go +39 -0
  549. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file_unsupported.go +28 -0
  550. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/file_windows.go +133 -0
  551. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens.go +29 -0
  552. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.go +42 -0
  553. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.s +8 -0
  554. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_linux.go +38 -0
  555. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_unsupported.go +18 -0
  556. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_windows.go +42 -0
  557. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/ino_unix.go +22 -0
  558. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/ino_unsupported.go +17 -0
  559. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/ino_windows.go +28 -0
  560. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unix.go +17 -0
  561. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unsupported.go +13 -0
  562. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_windows.go +23 -0
  563. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/oflag.go +38 -0
  564. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_bsd.go +26 -0
  565. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_darwin.go +26 -0
  566. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_supported.go +30 -0
  567. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_unix.go +20 -0
  568. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_unsupported.go +16 -0
  569. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_windows.go +163 -0
  570. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/osfile.go +318 -0
  571. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll.go +17 -0
  572. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_darwin.go +55 -0
  573. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_darwin.s +8 -0
  574. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_linux.go +57 -0
  575. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_unsupported.go +12 -0
  576. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/poll_windows.go +224 -0
  577. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/readfs.go +117 -0
  578. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/rename_unix.go +16 -0
  579. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/rename_unsupported.go +16 -0
  580. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/rename_windows.go +55 -0
  581. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock.go +186 -0
  582. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_supported.go +76 -0
  583. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unix.go +48 -0
  584. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unsupported.go +79 -0
  585. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sock_windows.go +80 -0
  586. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat.go +16 -0
  587. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat_supported.go +40 -0
  588. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat_unsupported.go +40 -0
  589. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/stat_windows.go +118 -0
  590. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sync.go +13 -0
  591. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sync_windows.go +20 -0
  592. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/syscall6_darwin.go +13 -0
  593. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/sysfs.go +6 -0
  594. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_unix.go +17 -0
  595. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_unsupported.go +14 -0
  596. package/govendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_windows.go +25 -0
  597. package/govendor/github.com/tetratelabs/wazero/internal/u32/u32.go +11 -0
  598. package/govendor/github.com/tetratelabs/wazero/internal/u64/u64.go +15 -0
  599. package/govendor/github.com/tetratelabs/wazero/internal/version/version.go +52 -0
  600. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/args.go +6 -0
  601. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/clock.go +16 -0
  602. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/environ.go +6 -0
  603. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/errno.go +314 -0
  604. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/fs.go +164 -0
  605. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/poll.go +15 -0
  606. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/proc.go +6 -0
  607. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/random.go +3 -0
  608. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/rights.go +148 -0
  609. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/sched.go +3 -0
  610. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/sock.go +71 -0
  611. package/govendor/github.com/tetratelabs/wazero/internal/wasip1/wasi.go +26 -0
  612. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/code.go +124 -0
  613. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/const_expr.go +116 -0
  614. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/custom.go +22 -0
  615. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/data.go +79 -0
  616. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/decoder.go +235 -0
  617. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/element.go +250 -0
  618. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/errors.go +11 -0
  619. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/export.go +32 -0
  620. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/function.go +56 -0
  621. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/global.go +50 -0
  622. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/header.go +9 -0
  623. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/import.go +68 -0
  624. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/limits.go +47 -0
  625. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/memory.go +42 -0
  626. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/names.go +151 -0
  627. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/section.go +309 -0
  628. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/table.go +79 -0
  629. package/govendor/github.com/tetratelabs/wazero/internal/wasm/binary/value.go +97 -0
  630. package/govendor/github.com/tetratelabs/wazero/internal/wasm/const_expr.go +259 -0
  631. package/govendor/github.com/tetratelabs/wazero/internal/wasm/counts.go +53 -0
  632. package/govendor/github.com/tetratelabs/wazero/internal/wasm/engine.go +76 -0
  633. package/govendor/github.com/tetratelabs/wazero/internal/wasm/exception.go +9 -0
  634. package/govendor/github.com/tetratelabs/wazero/internal/wasm/func_validation.go +2804 -0
  635. package/govendor/github.com/tetratelabs/wazero/internal/wasm/function_definition.go +210 -0
  636. package/govendor/github.com/tetratelabs/wazero/internal/wasm/global.go +55 -0
  637. package/govendor/github.com/tetratelabs/wazero/internal/wasm/gofunc.go +279 -0
  638. package/govendor/github.com/tetratelabs/wazero/internal/wasm/host.go +179 -0
  639. package/govendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go +1962 -0
  640. package/govendor/github.com/tetratelabs/wazero/internal/wasm/memory.go +475 -0
  641. package/govendor/github.com/tetratelabs/wazero/internal/wasm/memory_definition.go +128 -0
  642. package/govendor/github.com/tetratelabs/wazero/internal/wasm/module.go +1359 -0
  643. package/govendor/github.com/tetratelabs/wazero/internal/wasm/module_instance.go +251 -0
  644. package/govendor/github.com/tetratelabs/wazero/internal/wasm/module_instance_lookup.go +73 -0
  645. package/govendor/github.com/tetratelabs/wazero/internal/wasm/store.go +726 -0
  646. package/govendor/github.com/tetratelabs/wazero/internal/wasm/store_module_list.go +95 -0
  647. package/govendor/github.com/tetratelabs/wazero/internal/wasm/table.go +321 -0
  648. package/govendor/github.com/tetratelabs/wazero/internal/wasmdebug/debug.go +170 -0
  649. package/govendor/github.com/tetratelabs/wazero/internal/wasmdebug/dwarf.go +225 -0
  650. package/govendor/github.com/tetratelabs/wazero/internal/wasmruntime/errors.go +54 -0
  651. package/govendor/github.com/tetratelabs/wazero/netlify.toml +15 -0
  652. package/govendor/github.com/tetratelabs/wazero/runtime.go +399 -0
  653. package/govendor/github.com/tetratelabs/wazero/sys/clock.go +26 -0
  654. package/govendor/github.com/tetratelabs/wazero/sys/error.go +83 -0
  655. package/govendor/github.com/tetratelabs/wazero/sys/stat.go +105 -0
  656. package/govendor/github.com/tetratelabs/wazero/sys/stat_bsd.go +29 -0
  657. package/govendor/github.com/tetratelabs/wazero/sys/stat_posix.go +29 -0
  658. package/govendor/github.com/tetratelabs/wazero/sys/stat_unsupported.go +14 -0
  659. package/govendor/github.com/tetratelabs/wazero/sys/stat_windows.go +24 -0
  660. package/govendor/golang.org/x/crypto/LICENSE +27 -0
  661. package/govendor/golang.org/x/crypto/PATENTS +22 -0
  662. package/govendor/golang.org/x/crypto/cryptobyte/asn1/asn1.go +46 -0
  663. package/govendor/golang.org/x/crypto/cryptobyte/asn1.go +825 -0
  664. package/govendor/golang.org/x/crypto/cryptobyte/builder.go +350 -0
  665. package/govendor/golang.org/x/crypto/cryptobyte/string.go +183 -0
  666. package/govendor/golang.org/x/crypto/go.mod +3 -0
  667. package/govendor/golang.org/x/crypto/pbkdf2/pbkdf2.go +30 -0
  668. package/govendor/golang.org/x/net/LICENSE +27 -0
  669. package/govendor/golang.org/x/net/PATENTS +22 -0
  670. package/govendor/golang.org/x/net/dns/dnsmessage/message.go +2733 -0
  671. package/govendor/golang.org/x/net/dns/dnsmessage/svcb.go +333 -0
  672. package/govendor/golang.org/x/net/go.mod +3 -0
  673. package/govendor/golang.org/x/net/http/httpguts/guts.go +50 -0
  674. package/govendor/golang.org/x/net/http/httpguts/httplex.go +347 -0
  675. package/govendor/golang.org/x/net/http2/README.md +19 -0
  676. package/govendor/golang.org/x/net/http2/ascii.go +65 -0
  677. package/govendor/golang.org/x/net/http2/ciphers.go +641 -0
  678. package/govendor/golang.org/x/net/http2/client_conn_pool.go +301 -0
  679. package/govendor/golang.org/x/net/http2/client_priority_go126.go +20 -0
  680. package/govendor/golang.org/x/net/http2/client_priority_go127.go +13 -0
  681. package/govendor/golang.org/x/net/http2/clientconn.go +57 -0
  682. package/govendor/golang.org/x/net/http2/config.go +171 -0
  683. package/govendor/golang.org/x/net/http2/config_go125.go +15 -0
  684. package/govendor/golang.org/x/net/http2/config_go126.go +15 -0
  685. package/govendor/golang.org/x/net/http2/databuffer.go +146 -0
  686. package/govendor/golang.org/x/net/http2/errors.go +145 -0
  687. package/govendor/golang.org/x/net/http2/flow.go +175 -0
  688. package/govendor/golang.org/x/net/http2/frame.go +1887 -0
  689. package/govendor/golang.org/x/net/http2/gotrack.go +181 -0
  690. package/govendor/golang.org/x/net/http2/hpack/encode.go +244 -0
  691. package/govendor/golang.org/x/net/http2/hpack/hpack.go +522 -0
  692. package/govendor/golang.org/x/net/http2/hpack/huffman.go +226 -0
  693. package/govendor/golang.org/x/net/http2/hpack/static_table.go +188 -0
  694. package/govendor/golang.org/x/net/http2/hpack/tables.go +426 -0
  695. package/govendor/golang.org/x/net/http2/http2.go +415 -0
  696. package/govendor/golang.org/x/net/http2/pipe.go +184 -0
  697. package/govendor/golang.org/x/net/http2/server.go +3239 -0
  698. package/govendor/golang.org/x/net/http2/server_common.go +268 -0
  699. package/govendor/golang.org/x/net/http2/server_wrap.go +217 -0
  700. package/govendor/golang.org/x/net/http2/transport.go +3084 -0
  701. package/govendor/golang.org/x/net/http2/transport_common.go +516 -0
  702. package/govendor/golang.org/x/net/http2/transport_wrap.go +583 -0
  703. package/govendor/golang.org/x/net/http2/unencrypted.go +32 -0
  704. package/govendor/golang.org/x/net/http2/write.go +381 -0
  705. package/govendor/golang.org/x/net/http2/writesched.go +253 -0
  706. package/govendor/golang.org/x/net/http2/writesched_common.go +90 -0
  707. package/govendor/golang.org/x/net/http2/writesched_priority_rfc7540.go +420 -0
  708. package/govendor/golang.org/x/net/http2/writesched_priority_rfc9218.go +226 -0
  709. package/govendor/golang.org/x/net/http2/writesched_random.go +81 -0
  710. package/govendor/golang.org/x/net/http2/writesched_roundrobin.go +121 -0
  711. package/govendor/golang.org/x/net/idna/idna.go +884 -0
  712. package/govendor/golang.org/x/net/idna/punycode.go +220 -0
  713. package/govendor/golang.org/x/net/idna/tables15.0.0.go +5144 -0
  714. package/govendor/golang.org/x/net/idna/tables17.0.0.go +5302 -0
  715. package/govendor/golang.org/x/net/idna/trie.go +51 -0
  716. package/govendor/golang.org/x/net/idna/trieval.go +119 -0
  717. package/govendor/golang.org/x/net/internal/httpcommon/README.md +7 -0
  718. package/govendor/golang.org/x/net/internal/httpcommon/ascii.go +53 -0
  719. package/govendor/golang.org/x/net/internal/httpcommon/gzip.go +132 -0
  720. package/govendor/golang.org/x/net/internal/httpcommon/headermap.go +115 -0
  721. package/govendor/golang.org/x/net/internal/httpcommon/request.go +503 -0
  722. package/govendor/golang.org/x/net/internal/httpsfv/httpsfv.go +665 -0
  723. package/govendor/golang.org/x/sys/cpu/asm_aix_ppc64.s +17 -0
  724. package/govendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.s +12 -0
  725. package/govendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s +17 -0
  726. package/govendor/golang.org/x/sys/cpu/byteorder.go +66 -0
  727. package/govendor/golang.org/x/sys/cpu/cpu.go +357 -0
  728. package/govendor/golang.org/x/sys/cpu/cpu_aix.go +33 -0
  729. package/govendor/golang.org/x/sys/cpu/cpu_arm.go +73 -0
  730. package/govendor/golang.org/x/sys/cpu/cpu_arm64.go +191 -0
  731. package/govendor/golang.org/x/sys/cpu/cpu_arm64.s +35 -0
  732. package/govendor/golang.org/x/sys/cpu/cpu_darwin_arm64.go +67 -0
  733. package/govendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go +31 -0
  734. package/govendor/golang.org/x/sys/cpu/cpu_darwin_x86.go +61 -0
  735. package/govendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +12 -0
  736. package/govendor/golang.org/x/sys/cpu/cpu_gc_riscv64.go +11 -0
  737. package/govendor/golang.org/x/sys/cpu/cpu_gc_s390x.go +21 -0
  738. package/govendor/golang.org/x/sys/cpu/cpu_gc_x86.go +15 -0
  739. package/govendor/golang.org/x/sys/cpu/cpu_gc_x86.s +26 -0
  740. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go +12 -0
  741. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go +22 -0
  742. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c +37 -0
  743. package/govendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go +25 -0
  744. package/govendor/golang.org/x/sys/cpu/cpu_linux.go +15 -0
  745. package/govendor/golang.org/x/sys/cpu/cpu_linux_arm.go +39 -0
  746. package/govendor/golang.org/x/sys/cpu/cpu_linux_arm64.go +120 -0
  747. package/govendor/golang.org/x/sys/cpu/cpu_linux_loong64.go +22 -0
  748. package/govendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go +22 -0
  749. package/govendor/golang.org/x/sys/cpu/cpu_linux_noinit.go +9 -0
  750. package/govendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go +34 -0
  751. package/govendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go +173 -0
  752. package/govendor/golang.org/x/sys/cpu/cpu_linux_s390x.go +40 -0
  753. package/govendor/golang.org/x/sys/cpu/cpu_loong64.go +62 -0
  754. package/govendor/golang.org/x/sys/cpu/cpu_loong64.s +13 -0
  755. package/govendor/golang.org/x/sys/cpu/cpu_mips64x.go +15 -0
  756. package/govendor/golang.org/x/sys/cpu/cpu_mipsx.go +11 -0
  757. package/govendor/golang.org/x/sys/cpu/cpu_netbsd_amd64.go +47 -0
  758. package/govendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go +173 -0
  759. package/govendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go +65 -0
  760. package/govendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s +11 -0
  761. package/govendor/golang.org/x/sys/cpu/cpu_other_arm.go +9 -0
  762. package/govendor/golang.org/x/sys/cpu/cpu_other_arm64.go +11 -0
  763. package/govendor/golang.org/x/sys/cpu/cpu_other_mips64x.go +11 -0
  764. package/govendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go +12 -0
  765. package/govendor/golang.org/x/sys/cpu/cpu_other_riscv64.go +11 -0
  766. package/govendor/golang.org/x/sys/cpu/cpu_other_x86.go +11 -0
  767. package/govendor/golang.org/x/sys/cpu/cpu_ppc64x.go +16 -0
  768. package/govendor/golang.org/x/sys/cpu/cpu_riscv64.go +33 -0
  769. package/govendor/golang.org/x/sys/cpu/cpu_riscv64.s +17 -0
  770. package/govendor/golang.org/x/sys/cpu/cpu_s390x.go +172 -0
  771. package/govendor/golang.org/x/sys/cpu/cpu_s390x.s +57 -0
  772. package/govendor/golang.org/x/sys/cpu/cpu_sparc64.go +12 -0
  773. package/govendor/golang.org/x/sys/cpu/cpu_wasm.go +17 -0
  774. package/govendor/golang.org/x/sys/cpu/cpu_windows.go +26 -0
  775. package/govendor/golang.org/x/sys/cpu/cpu_windows_arm64.go +38 -0
  776. package/govendor/golang.org/x/sys/cpu/cpu_x86.go +259 -0
  777. package/govendor/golang.org/x/sys/cpu/cpu_zos.go +10 -0
  778. package/govendor/golang.org/x/sys/cpu/cpu_zos_s390x.go +25 -0
  779. package/govendor/golang.org/x/sys/cpu/endian_big.go +10 -0
  780. package/govendor/golang.org/x/sys/cpu/endian_little.go +10 -0
  781. package/govendor/golang.org/x/sys/cpu/hwcap_linux.go +71 -0
  782. package/govendor/golang.org/x/sys/cpu/parse.go +55 -0
  783. package/govendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go +53 -0
  784. package/govendor/golang.org/x/sys/cpu/runtime_auxv.go +16 -0
  785. package/govendor/golang.org/x/sys/cpu/runtime_auxv_go121.go +18 -0
  786. package/govendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go +26 -0
  787. package/govendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go +35 -0
  788. package/govendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.go +54 -0
  789. package/govendor/golang.org/x/sys/cpu/syscall_darwin_x86_gc.go +98 -0
  790. package/govendor/golang.org/x/sys/cpu/zcpu_windows.go +48 -0
  791. package/govendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +20 -0
  792. package/govendor/golang.org/x/sys/unix/asm_linux_sparc64.s +48 -0
  793. package/govendor/golang.org/x/sys/unix/asm_zos_s390x.s +4 -186
  794. package/govendor/golang.org/x/sys/unix/bpxsvc_zos.s +9 -9
  795. package/govendor/golang.org/x/sys/unix/fcntl_darwin.go +2 -2
  796. package/govendor/golang.org/x/sys/unix/mkerrors.sh +1 -1
  797. package/govendor/golang.org/x/sys/unix/ptrace_zos.go +537 -0
  798. package/govendor/golang.org/x/sys/unix/ptrace_zos_singlestep.go +425 -0
  799. package/govendor/golang.org/x/sys/unix/syscall_darwin.go +1 -0
  800. package/govendor/golang.org/x/sys/unix/syscall_freebsd.go +9 -0
  801. package/govendor/golang.org/x/sys/unix/syscall_linux.go +20 -1
  802. package/govendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +3 -3
  803. package/govendor/golang.org/x/sys/unix/syscall_netbsd.go +9 -0
  804. package/govendor/golang.org/x/sys/unix/syscall_unix_gc.go +1 -1
  805. package/govendor/golang.org/x/sys/unix/syscall_zos_s390x.go +0 -4
  806. package/govendor/golang.org/x/sys/unix/xattr_bsd.go +12 -12
  807. package/govendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +6 -0
  808. package/govendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +6 -0
  809. package/govendor/golang.org/x/sys/unix/zerrors_linux.go +32 -0
  810. package/govendor/golang.org/x/sys/unix/zerrors_linux_386.go +2 -0
  811. package/govendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +2 -0
  812. package/govendor/golang.org/x/sys/unix/zerrors_linux_arm.go +2 -0
  813. package/govendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +2 -0
  814. package/govendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +2 -0
  815. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips.go +2 -0
  816. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +2 -0
  817. package/govendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +2 -0
  818. package/govendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +2 -0
  819. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +2 -0
  820. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +2 -0
  821. package/govendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +2 -0
  822. package/govendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +2 -0
  823. package/govendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +2 -0
  824. package/govendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +2 -0
  825. package/govendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +11 -0
  826. package/govendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +11 -0
  827. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +159 -0
  828. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +159 -0
  829. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +159 -0
  830. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +159 -0
  831. package/govendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go +159 -0
  832. package/govendor/golang.org/x/sys/unix/zsyscall_linux.go +28 -1
  833. package/govendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +3 -3
  834. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +159 -0
  835. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +159 -0
  836. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +159 -0
  837. package/govendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +159 -0
  838. package/govendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +13 -0
  839. package/govendor/golang.org/x/sys/unix/ztypes_linux.go +65 -36
  840. package/govendor/golang.org/x/sys/unix/ztypes_linux_386.go +6 -0
  841. package/govendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +7 -0
  842. package/govendor/golang.org/x/sys/unix/ztypes_linux_arm.go +6 -0
  843. package/govendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +7 -0
  844. package/govendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +7 -0
  845. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips.go +6 -0
  846. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +7 -0
  847. package/govendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +7 -0
  848. package/govendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +6 -0
  849. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +6 -0
  850. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +7 -0
  851. package/govendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +7 -0
  852. package/govendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +7 -0
  853. package/govendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +7 -0
  854. package/govendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +10 -5
  855. package/govendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +78 -0
  856. package/govendor/golang.org/x/text/.gitattributes +10 -0
  857. package/govendor/golang.org/x/text/CONTRIBUTING.md +26 -0
  858. package/govendor/golang.org/x/text/LICENSE +27 -0
  859. package/govendor/golang.org/x/text/PATENTS +22 -0
  860. package/govendor/golang.org/x/text/README.md +81 -0
  861. package/govendor/golang.org/x/text/cases/cases.go +162 -0
  862. package/govendor/golang.org/x/text/cases/context.go +376 -0
  863. package/govendor/golang.org/x/text/cases/fold.go +34 -0
  864. package/govendor/golang.org/x/text/cases/icu.go +61 -0
  865. package/govendor/golang.org/x/text/cases/info.go +82 -0
  866. package/govendor/golang.org/x/text/cases/map.go +816 -0
  867. package/govendor/golang.org/x/text/cases/tables15.0.0.go +2527 -0
  868. package/govendor/golang.org/x/text/cases/tables17.0.0.go +2642 -0
  869. package/govendor/golang.org/x/text/cases/trieval.go +217 -0
  870. package/govendor/golang.org/x/text/codereview.cfg +1 -0
  871. package/govendor/golang.org/x/text/collate/collate.go +402 -0
  872. package/govendor/golang.org/x/text/collate/index.go +32 -0
  873. package/govendor/golang.org/x/text/collate/option.go +239 -0
  874. package/govendor/golang.org/x/text/collate/sort.go +81 -0
  875. package/govendor/golang.org/x/text/collate/tables.go +73789 -0
  876. package/govendor/golang.org/x/text/currency/common.go +67 -0
  877. package/govendor/golang.org/x/text/currency/currency.go +185 -0
  878. package/govendor/golang.org/x/text/currency/format.go +220 -0
  879. package/govendor/golang.org/x/text/currency/query.go +152 -0
  880. package/govendor/golang.org/x/text/currency/tables.go +2629 -0
  881. package/govendor/golang.org/x/text/doc.go +16 -0
  882. package/govendor/golang.org/x/text/feature/plural/common.go +70 -0
  883. package/govendor/golang.org/x/text/feature/plural/message.go +244 -0
  884. package/govendor/golang.org/x/text/feature/plural/plural.go +262 -0
  885. package/govendor/golang.org/x/text/feature/plural/tables.go +552 -0
  886. package/govendor/golang.org/x/text/go.mod +3 -0
  887. package/govendor/golang.org/x/text/internal/catmsg/catmsg.go +417 -0
  888. package/govendor/golang.org/x/text/internal/catmsg/codec.go +407 -0
  889. package/govendor/golang.org/x/text/internal/catmsg/varint.go +62 -0
  890. package/govendor/golang.org/x/text/internal/colltab/collelem.go +374 -0
  891. package/govendor/golang.org/x/text/internal/colltab/colltab.go +105 -0
  892. package/govendor/golang.org/x/text/internal/colltab/contract.go +145 -0
  893. package/govendor/golang.org/x/text/internal/colltab/iter.go +178 -0
  894. package/govendor/golang.org/x/text/internal/colltab/numeric.go +236 -0
  895. package/govendor/golang.org/x/text/internal/colltab/table.go +275 -0
  896. package/govendor/golang.org/x/text/internal/colltab/trie.go +159 -0
  897. package/govendor/golang.org/x/text/internal/colltab/weighter.go +31 -0
  898. package/govendor/golang.org/x/text/internal/format/format.go +41 -0
  899. package/govendor/golang.org/x/text/internal/format/parser.go +358 -0
  900. package/govendor/golang.org/x/text/internal/internal.go +49 -0
  901. package/govendor/golang.org/x/text/internal/language/common.go +16 -0
  902. package/govendor/golang.org/x/text/internal/language/compact/compact.go +61 -0
  903. package/govendor/golang.org/x/text/internal/language/compact/language.go +260 -0
  904. package/govendor/golang.org/x/text/internal/language/compact/parents.go +120 -0
  905. package/govendor/golang.org/x/text/internal/language/compact/tables.go +1015 -0
  906. package/govendor/golang.org/x/text/internal/language/compact/tags.go +91 -0
  907. package/govendor/golang.org/x/text/internal/language/compact.go +29 -0
  908. package/govendor/golang.org/x/text/internal/language/compose.go +167 -0
  909. package/govendor/golang.org/x/text/internal/language/coverage.go +28 -0
  910. package/govendor/golang.org/x/text/internal/language/language.go +627 -0
  911. package/govendor/golang.org/x/text/internal/language/lookup.go +412 -0
  912. package/govendor/golang.org/x/text/internal/language/match.go +226 -0
  913. package/govendor/golang.org/x/text/internal/language/parse.go +608 -0
  914. package/govendor/golang.org/x/text/internal/language/tables.go +3494 -0
  915. package/govendor/golang.org/x/text/internal/language/tags.go +48 -0
  916. package/govendor/golang.org/x/text/internal/match.go +67 -0
  917. package/govendor/golang.org/x/text/internal/number/common.go +55 -0
  918. package/govendor/golang.org/x/text/internal/number/decimal.go +500 -0
  919. package/govendor/golang.org/x/text/internal/number/format.go +533 -0
  920. package/govendor/golang.org/x/text/internal/number/number.go +152 -0
  921. package/govendor/golang.org/x/text/internal/number/pattern.go +485 -0
  922. package/govendor/golang.org/x/text/internal/number/roundingmode_string.go +30 -0
  923. package/govendor/golang.org/x/text/internal/number/tables.go +1219 -0
  924. package/govendor/golang.org/x/text/internal/stringset/set.go +86 -0
  925. package/govendor/golang.org/x/text/internal/tag/tag.go +100 -0
  926. package/govendor/golang.org/x/text/language/coverage.go +187 -0
  927. package/govendor/golang.org/x/text/language/display/dict.go +92 -0
  928. package/govendor/golang.org/x/text/language/display/display.go +420 -0
  929. package/govendor/golang.org/x/text/language/display/lookup.go +253 -0
  930. package/govendor/golang.org/x/text/language/display/tables.go +53114 -0
  931. package/govendor/golang.org/x/text/language/doc.go +98 -0
  932. package/govendor/golang.org/x/text/language/language.go +605 -0
  933. package/govendor/golang.org/x/text/language/match.go +735 -0
  934. package/govendor/golang.org/x/text/language/parse.go +258 -0
  935. package/govendor/golang.org/x/text/language/tables.go +298 -0
  936. package/govendor/golang.org/x/text/language/tags.go +145 -0
  937. package/govendor/golang.org/x/text/message/catalog/catalog.go +365 -0
  938. package/govendor/golang.org/x/text/message/catalog/dict.go +133 -0
  939. package/govendor/golang.org/x/text/secure/bidirule/bidirule.go +346 -0
  940. package/govendor/golang.org/x/text/transform/transform.go +709 -0
  941. package/govendor/golang.org/x/text/unicode/bidi/bidi.go +359 -0
  942. package/govendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
  943. package/govendor/golang.org/x/text/unicode/bidi/core.go +1050 -0
  944. package/govendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
  945. package/govendor/golang.org/x/text/unicode/bidi/tables15.0.0.go +2042 -0
  946. package/govendor/golang.org/x/text/unicode/bidi/tables17.0.0.go +2135 -0
  947. package/govendor/golang.org/x/text/unicode/bidi/trieval.go +48 -0
  948. package/govendor/golang.org/x/text/unicode/norm/composition.go +524 -0
  949. package/govendor/golang.org/x/text/unicode/norm/forminfo.go +296 -0
  950. package/govendor/golang.org/x/text/unicode/norm/input.go +109 -0
  951. package/govendor/golang.org/x/text/unicode/norm/iter.go +454 -0
  952. package/govendor/golang.org/x/text/unicode/norm/normalize.go +613 -0
  953. package/govendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
  954. package/govendor/golang.org/x/text/unicode/norm/tables15.0.0.go +7907 -0
  955. package/govendor/golang.org/x/text/unicode/norm/tables17.0.0.go +8104 -0
  956. package/govendor/golang.org/x/text/unicode/norm/transform.go +89 -0
  957. package/govendor/golang.org/x/text/unicode/norm/trie.go +54 -0
  958. package/govendor/manifest.txt +11 -2
  959. package/govendor/software.sslmate.com/src/go-pkcs12/.gitattributes +10 -0
  960. package/govendor/software.sslmate.com/src/go-pkcs12/LICENSE +28 -0
  961. package/govendor/software.sslmate.com/src/go-pkcs12/README.md +31 -0
  962. package/govendor/software.sslmate.com/src/go-pkcs12/bmp-string.go +63 -0
  963. package/govendor/software.sslmate.com/src/go-pkcs12/crypto.go +331 -0
  964. package/govendor/software.sslmate.com/src/go-pkcs12/errors.go +23 -0
  965. package/govendor/software.sslmate.com/src/go-pkcs12/go.mod +3 -0
  966. package/govendor/software.sslmate.com/src/go-pkcs12/internal/rc2/rc2.go +271 -0
  967. package/govendor/software.sslmate.com/src/go-pkcs12/mac.go +202 -0
  968. package/govendor/software.sslmate.com/src/go-pkcs12/pbkdf.go +184 -0
  969. package/govendor/software.sslmate.com/src/go-pkcs12/pkcs12.go +1000 -0
  970. package/govendor/software.sslmate.com/src/go-pkcs12/safebags.go +107 -0
  971. package/package.json +11 -1
  972. package/types/tsconfig.json +17 -0
  973. package/types/typenative-npm.d.ts +1327 -80
  974. package/types/typenative.d.ts +1312 -25
  975. package/.gitattributes +0 -1
  976. package/.github/workflows/ci.yml +0 -68
  977. package/.github/workflows/npm-publish-github-packages.yml +0 -88
  978. package/CHANGELOG.md +0 -1358
  979. package/CONTRIBUTION.md +0 -133
  980. package/conformance.md +0 -1450
  981. package/examples/README.md +0 -113
  982. package/examples/angular-templates/README.md +0 -141
  983. package/examples/angular-templates/bench.mjs +0 -173
  984. package/examples/angular-templates/dom-type-globals.d.ts +0 -21
  985. package/examples/angular-templates/dom-type-stubs.ts +0 -21
  986. package/examples/angular-templates/main.ts +0 -135
  987. package/examples/angular-templates/parity.mjs +0 -157
  988. package/examples/angular-templates/run-node.mjs +0 -69
  989. package/examples/angular-templates/vendor/angular/compiler/LICENSE +0 -21
  990. package/examples/desktop-notes/README.md +0 -106
  991. package/examples/desktop-notes/bench.mjs +0 -125
  992. package/examples/desktop-notes/main.ts +0 -131
  993. package/examples/desktop-notes/package-lock.json +0 -726
  994. package/examples/desktop-notes/package.json +0 -9
  995. package/examples/desktop-notes/ui.ts +0 -176
  996. package/examples/dupe-finder/README.md +0 -78
  997. package/examples/dupe-finder/bench.mjs +0 -120
  998. package/examples/dupe-finder/main.ts +0 -87
  999. package/examples/fibonacci/README.md +0 -89
  1000. package/examples/fibonacci/bench.mjs +0 -87
  1001. package/examples/fibonacci/main.ts +0 -21
  1002. package/examples/hello-world/README.md +0 -62
  1003. package/examples/hello-world/bench.mjs +0 -66
  1004. package/examples/hello-world/main.ts +0 -7
  1005. package/examples/json-server/README.md +0 -131
  1006. package/examples/json-server/bench.mjs +0 -263
  1007. package/examples/json-server/main.ts +0 -67
  1008. package/examples/mandelbrot-png/README.md +0 -63
  1009. package/examples/mandelbrot-png/bench.mjs +0 -95
  1010. package/examples/mandelbrot-png/main.ts +0 -98
  1011. package/examples/mandelbrot-png/preview.png +0 -0
  1012. package/examples/marked-cli/README.md +0 -175
  1013. package/examples/marked-cli/bench.mjs +0 -178
  1014. package/examples/marked-cli/main.ts +0 -410
  1015. package/examples/marked-cli/parity.mjs +0 -185
  1016. package/examples/marked-cli/vendor/marked/LICENSE +0 -44
  1017. package/examples/marked-cli/vendor/marked/VENDOR.md +0 -26
  1018. package/examples/openai-chat/README.md +0 -148
  1019. package/examples/openai-chat/bench.mjs +0 -175
  1020. package/examples/openai-chat/main.ts +0 -488
  1021. package/examples/react-compiler/README.md +0 -185
  1022. package/examples/react-compiler/bench.mjs +0 -181
  1023. package/examples/react-compiler/main.ts +0 -324
  1024. package/examples/react-compiler/parity.mjs +0 -362
  1025. package/examples/react-compiler/run-node.mjs +0 -90
  1026. package/examples/react-compiler/vendor/babel/LICENSE +0 -22
  1027. package/examples/react-compiler/vendor/babel/helper-globals/data/builtin-lower.json +0 -15
  1028. package/examples/react-compiler/vendor/babel/helper-globals/data/builtin-upper.json +0 -51
  1029. package/examples/react-compiler/vendor/charcodes/package.json +0 -25
  1030. package/examples/react-compiler/vendor/invariant/LICENSE +0 -21
  1031. package/examples/react-compiler/vendor/invariant/invariant.cjs +0 -51
  1032. package/examples/react-compiler/vendor/invariant/invariant.d.cts +0 -11
  1033. package/examples/react-compiler/vendor/invariant/types/LICENSE +0 -21
  1034. package/examples/react-compiler/vendor/jridgewell/gen-mapping/LICENSE +0 -19
  1035. package/examples/react-compiler/vendor/jridgewell/resolve-uri/LICENSE +0 -19
  1036. package/examples/react-compiler/vendor/jridgewell/sourcemap-codec/LICENSE +0 -19
  1037. package/examples/react-compiler/vendor/jridgewell/trace-mapping/LICENSE +0 -19
  1038. package/examples/react-compiler/vendor/js-tokens/LICENSE +0 -21
  1039. package/examples/react-compiler/vendor/js-tokens/index.cjs +0 -23
  1040. package/examples/react-compiler/vendor/js-tokens/index.d.cts +0 -13
  1041. package/examples/react-compiler/vendor/jsesc/jsesc.cjs +0 -337
  1042. package/examples/react-compiler/vendor/jsesc/jsesc.d.cts +0 -384
  1043. package/examples/react-compiler/vendor/jsesc/types/LICENSE +0 -21
  1044. package/examples/react-compiler/vendor/picocolors/picocolors.cjs +0 -75
  1045. package/examples/react-compiler/vendor/picocolors/picocolors.d.cts +0 -5
  1046. package/examples/react-compiler/vendor/picocolors/types.d.ts +0 -51
  1047. package/examples/react-compiler/vendor/react-compiler/LICENSE +0 -21
  1048. package/examples/react-compiler/vendor/stubs/babel-core.ts +0 -31
  1049. package/examples/react-compiler/vendor/stubs/debug.ts +0 -18
  1050. package/examples/react-compiler/vendor/stubs/js-tokens.d.ts +0 -13
  1051. package/examples/react-compiler/vendor/stubs/pretty-format.ts +0 -18
  1052. package/examples/react-compiler/vendor/zod/LICENSE +0 -21
  1053. package/examples/react-compiler/vendor/zod-validation-error/LICENSE +0 -9
  1054. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/NonEmptyArray.ts +0 -5
  1055. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/joinPath.ts +0 -49
  1056. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/joinValues.ts +0 -48
  1057. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/stringify.ts +0 -50
  1058. package/examples/react-compiler/vendor/zod-validation-error/lib/utils/titleCase.ts +0 -6
  1059. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/MessageBuilder.ts +0 -126
  1060. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/ValidationError.ts +0 -39
  1061. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/custom.ts +0 -12
  1062. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/errorMap.ts +0 -78
  1063. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/index.ts +0 -2
  1064. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidElement.ts +0 -12
  1065. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidKey.ts +0 -12
  1066. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidStringFormat.ts +0 -131
  1067. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidType.ts +0 -54
  1068. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidUnion.ts +0 -12
  1069. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/invalidValue.ts +0 -40
  1070. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/notMultipleOf.ts +0 -12
  1071. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/tooBig.ts +0 -76
  1072. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/tooSmall.ts +0 -76
  1073. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/types.ts +0 -27
  1074. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/errorMap/unrecognizedKeys.ts +0 -27
  1075. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromError.ts +0 -13
  1076. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromZodError.ts +0 -61
  1077. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/fromZodIssue.ts +0 -38
  1078. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/index.ts +0 -20
  1079. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isValidationError.ts +0 -5
  1080. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isValidationErrorLike.ts +0 -8
  1081. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/isZodErrorLike.ts +0 -11
  1082. package/examples/react-compiler/vendor/zod-validation-error/lib/v4/toValidationError.ts +0 -20
  1083. package/examples/react-compiler/vendor.mjs +0 -688
  1084. package/examples/todo-cli/README.md +0 -69
  1085. package/examples/todo-cli/bench.mjs +0 -89
  1086. package/examples/todo-cli/main.ts +0 -92
  1087. package/examples/yaml-cli/README.md +0 -152
  1088. package/examples/yaml-cli/bench.mjs +0 -265
  1089. package/examples/yaml-cli/main.ts +0 -251
  1090. package/examples/yaml-cli/parity.mjs +0 -156
  1091. package/examples/yaml-cli/vendor/yaml/LICENSE +0 -13
  1092. package/examples/yaml-cli/vendor/yaml/VENDOR.md +0 -25
  1093. package/govendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +0 -22
  1094. package/govendor/golang.org/x/sys/windows/types_windows_arm.go +0 -35
  1095. package/performance/README.md +0 -196
  1096. package/performance/any-dynamic.ts +0 -21
  1097. package/performance/any-record-view.ts +0 -20
  1098. package/performance/arr-hof.ts +0 -21
  1099. package/performance/arr-push-index.ts +0 -15
  1100. package/performance/arr-sort.ts +0 -21
  1101. package/performance/async-await.ts +0 -24
  1102. package/performance/class-dispatch.ts +0 -52
  1103. package/performance/events-emit.ts +0 -27
  1104. package/performance/exc-throw-rare.ts +0 -25
  1105. package/performance/exc-try-catch.ts +0 -26
  1106. package/performance/fn-closures.ts +0 -29
  1107. package/performance/fn-recursion-tree.ts +0 -31
  1108. package/performance/gen-for-of.ts +0 -46
  1109. package/performance/json-roundtrip.ts +0 -27
  1110. package/performance/map-delete.ts +0 -24
  1111. package/performance/map-string-keys.ts +0 -22
  1112. package/performance/num-arith-loop.ts +0 -14
  1113. package/performance/num-bitwise.ts +0 -21
  1114. package/performance/num-mod-int.ts +0 -16
  1115. package/performance/num-to-string.ts +0 -16
  1116. package/performance/obj-alloc.ts +0 -32
  1117. package/performance/regex-exec.ts +0 -29
  1118. package/performance/regex-site.ts +0 -28
  1119. package/performance/set-ops.ts +0 -20
  1120. package/performance/str-char-scan.ts +0 -35
  1121. package/performance/str-concat-plus.ts +0 -18
  1122. package/performance/str-concat.ts +0 -24
  1123. package/performance/str-short-scan.ts +0 -26
  1124. package/performance/str-split-join.ts +0 -23
  1125. package/performance/str-template.ts +0 -16
  1126. package/performance/union-switch.ts +0 -57
  1127. package/tsparser/check.go +0 -158
  1128. package/tsparser/go.mod +0 -14
  1129. package/tsparser/go.sum +0 -22
  1130. package/tsparser/main.go +0 -363
  1131. package/tsparser/tsparser.exe +0 -4
@@ -0,0 +1,2978 @@
1
+ package interpreter
2
+
3
+ import (
4
+ "fmt"
5
+ "math"
6
+ "strings"
7
+ )
8
+
9
+ // unsignedInt represents unsigned 32-bit or 64-bit integers.
10
+ type unsignedInt byte
11
+
12
+ const (
13
+ unsignedInt32 unsignedInt = iota
14
+ unsignedInt64
15
+ )
16
+
17
+ // String implements fmt.Stringer.
18
+ func (s unsignedInt) String() (ret string) {
19
+ switch s {
20
+ case unsignedInt32:
21
+ ret = "i32"
22
+ case unsignedInt64:
23
+ ret = "i64"
24
+ }
25
+ return
26
+ }
27
+
28
+ // signedInt represents signed or unsigned integers.
29
+ type signedInt byte
30
+
31
+ const (
32
+ signedInt32 signedInt = iota
33
+ signedInt64
34
+ signedUint32
35
+ signedUint64
36
+ )
37
+
38
+ // String implements fmt.Stringer.
39
+ func (s signedInt) String() (ret string) {
40
+ switch s {
41
+ case signedUint32:
42
+ ret = "u32"
43
+ case signedUint64:
44
+ ret = "u64"
45
+ case signedInt32:
46
+ ret = "s32"
47
+ case signedInt64:
48
+ ret = "s64"
49
+ }
50
+ return
51
+ }
52
+
53
+ // float represents the scalar double or single precision floating points.
54
+ type float byte
55
+
56
+ const (
57
+ f32 float = iota
58
+ f64
59
+ )
60
+
61
+ // String implements fmt.Stringer.
62
+ func (s float) String() (ret string) {
63
+ switch s {
64
+ case f32:
65
+ ret = "f32"
66
+ case f64:
67
+ ret = "f64"
68
+ }
69
+ return
70
+ }
71
+
72
+ // unsignedType is the union of unsignedInt, float and V128 vector type.
73
+ type unsignedType byte
74
+
75
+ const (
76
+ unsignedTypeI32 unsignedType = iota
77
+ unsignedTypeI64
78
+ unsignedTypeF32
79
+ unsignedTypeF64
80
+ unsignedTypeV128
81
+ unsignedTypeUnknown
82
+ )
83
+
84
+ // String implements fmt.Stringer.
85
+ func (s unsignedType) String() (ret string) {
86
+ switch s {
87
+ case unsignedTypeI32:
88
+ ret = "i32"
89
+ case unsignedTypeI64:
90
+ ret = "i64"
91
+ case unsignedTypeF32:
92
+ ret = "f32"
93
+ case unsignedTypeF64:
94
+ ret = "f64"
95
+ case unsignedTypeV128:
96
+ ret = "v128"
97
+ case unsignedTypeUnknown:
98
+ ret = "unknown"
99
+ }
100
+ return
101
+ }
102
+
103
+ // signedType is the union of signedInt and float types.
104
+ type signedType byte
105
+
106
+ const (
107
+ signedTypeInt32 signedType = iota
108
+ signedTypeUint32
109
+ signedTypeInt64
110
+ signedTypeUint64
111
+ signedTypeFloat32
112
+ signedTypeFloat64
113
+ )
114
+
115
+ // String implements fmt.Stringer.
116
+ func (s signedType) String() (ret string) {
117
+ switch s {
118
+ case signedTypeInt32:
119
+ ret = "s32"
120
+ case signedTypeUint32:
121
+ ret = "u32"
122
+ case signedTypeInt64:
123
+ ret = "s64"
124
+ case signedTypeUint64:
125
+ ret = "u64"
126
+ case signedTypeFloat32:
127
+ ret = "f32"
128
+ case signedTypeFloat64:
129
+ ret = "f64"
130
+ }
131
+ return
132
+ }
133
+
134
+ // operationKind is the Kind of each implementation of Operation interface.
135
+ type operationKind uint16
136
+
137
+ // String implements fmt.Stringer.
138
+ func (o operationKind) String() (ret string) {
139
+ switch o {
140
+ case operationKindUnreachable:
141
+ ret = "Unreachable"
142
+ case operationKindLabel:
143
+ ret = "label"
144
+ case operationKindBr:
145
+ ret = "Br"
146
+ case operationKindBrIf:
147
+ ret = "BrIf"
148
+ case operationKindBrTable:
149
+ ret = "BrTable"
150
+ case operationKindCall:
151
+ ret = "Call"
152
+ case operationKindCallIndirect:
153
+ ret = "CallIndirect"
154
+ case operationKindDrop:
155
+ ret = "Drop"
156
+ case operationKindSelect:
157
+ ret = "Select"
158
+ case operationKindPick:
159
+ ret = "Pick"
160
+ case operationKindSet:
161
+ ret = "Swap"
162
+ case operationKindGlobalGet:
163
+ ret = "GlobalGet"
164
+ case operationKindGlobalSet:
165
+ ret = "GlobalSet"
166
+ case operationKindLoad:
167
+ ret = "Load"
168
+ case operationKindLoad8:
169
+ ret = "Load8"
170
+ case operationKindLoad16:
171
+ ret = "Load16"
172
+ case operationKindLoad32:
173
+ ret = "Load32"
174
+ case operationKindStore:
175
+ ret = "Store"
176
+ case operationKindStore8:
177
+ ret = "Store8"
178
+ case operationKindStore16:
179
+ ret = "Store16"
180
+ case operationKindStore32:
181
+ ret = "Store32"
182
+ case operationKindMemorySize:
183
+ ret = "MemorySize"
184
+ case operationKindMemoryGrow:
185
+ ret = "MemoryGrow"
186
+ case operationKindConstI32:
187
+ ret = "ConstI32"
188
+ case operationKindConstI64:
189
+ ret = "ConstI64"
190
+ case operationKindConstF32:
191
+ ret = "ConstF32"
192
+ case operationKindConstF64:
193
+ ret = "ConstF64"
194
+ case operationKindEq:
195
+ ret = "Eq"
196
+ case operationKindNe:
197
+ ret = "Ne"
198
+ case operationKindEqz:
199
+ ret = "Eqz"
200
+ case operationKindLt:
201
+ ret = "Lt"
202
+ case operationKindGt:
203
+ ret = "Gt"
204
+ case operationKindLe:
205
+ ret = "Le"
206
+ case operationKindGe:
207
+ ret = "Ge"
208
+ case operationKindAdd:
209
+ ret = "Add"
210
+ case operationKindSub:
211
+ ret = "Sub"
212
+ case operationKindMul:
213
+ ret = "Mul"
214
+ case operationKindClz:
215
+ ret = "Clz"
216
+ case operationKindCtz:
217
+ ret = "Ctz"
218
+ case operationKindPopcnt:
219
+ ret = "Popcnt"
220
+ case operationKindDiv:
221
+ ret = "Div"
222
+ case operationKindRem:
223
+ ret = "Rem"
224
+ case operationKindAnd:
225
+ ret = "And"
226
+ case operationKindOr:
227
+ ret = "Or"
228
+ case operationKindXor:
229
+ ret = "Xor"
230
+ case operationKindShl:
231
+ ret = "Shl"
232
+ case operationKindShr:
233
+ ret = "Shr"
234
+ case operationKindRotl:
235
+ ret = "Rotl"
236
+ case operationKindRotr:
237
+ ret = "Rotr"
238
+ case operationKindAbs:
239
+ ret = "Abs"
240
+ case operationKindNeg:
241
+ ret = "Neg"
242
+ case operationKindCeil:
243
+ ret = "Ceil"
244
+ case operationKindFloor:
245
+ ret = "Floor"
246
+ case operationKindTrunc:
247
+ ret = "Trunc"
248
+ case operationKindNearest:
249
+ ret = "Nearest"
250
+ case operationKindSqrt:
251
+ ret = "Sqrt"
252
+ case operationKindMin:
253
+ ret = "Min"
254
+ case operationKindMax:
255
+ ret = "Max"
256
+ case operationKindCopysign:
257
+ ret = "Copysign"
258
+ case operationKindI32WrapFromI64:
259
+ ret = "I32WrapFromI64"
260
+ case operationKindITruncFromF:
261
+ ret = "ITruncFromF"
262
+ case operationKindFConvertFromI:
263
+ ret = "FConvertFromI"
264
+ case operationKindF32DemoteFromF64:
265
+ ret = "F32DemoteFromF64"
266
+ case operationKindF64PromoteFromF32:
267
+ ret = "F64PromoteFromF32"
268
+ case operationKindI32ReinterpretFromF32:
269
+ ret = "I32ReinterpretFromF32"
270
+ case operationKindI64ReinterpretFromF64:
271
+ ret = "I64ReinterpretFromF64"
272
+ case operationKindF32ReinterpretFromI32:
273
+ ret = "F32ReinterpretFromI32"
274
+ case operationKindF64ReinterpretFromI64:
275
+ ret = "F64ReinterpretFromI64"
276
+ case operationKindExtend:
277
+ ret = "Extend"
278
+ case operationKindMemoryInit:
279
+ ret = "MemoryInit"
280
+ case operationKindDataDrop:
281
+ ret = "DataDrop"
282
+ case operationKindMemoryCopy:
283
+ ret = "MemoryCopy"
284
+ case operationKindMemoryFill:
285
+ ret = "MemoryFill"
286
+ case operationKindTableInit:
287
+ ret = "TableInit"
288
+ case operationKindElemDrop:
289
+ ret = "ElemDrop"
290
+ case operationKindTableCopy:
291
+ ret = "TableCopy"
292
+ case operationKindRefFunc:
293
+ ret = "RefFunc"
294
+ case operationKindTableGet:
295
+ ret = "TableGet"
296
+ case operationKindTableSet:
297
+ ret = "TableSet"
298
+ case operationKindTableSize:
299
+ ret = "TableSize"
300
+ case operationKindTableGrow:
301
+ ret = "TableGrow"
302
+ case operationKindTableFill:
303
+ ret = "TableFill"
304
+ case operationKindV128Const:
305
+ ret = "ConstV128"
306
+ case operationKindV128Add:
307
+ ret = "V128Add"
308
+ case operationKindV128Sub:
309
+ ret = "V128Sub"
310
+ case operationKindV128Load:
311
+ ret = "V128Load"
312
+ case operationKindV128LoadLane:
313
+ ret = "V128LoadLane"
314
+ case operationKindV128Store:
315
+ ret = "V128Store"
316
+ case operationKindV128StoreLane:
317
+ ret = "V128StoreLane"
318
+ case operationKindV128ExtractLane:
319
+ ret = "V128ExtractLane"
320
+ case operationKindV128ReplaceLane:
321
+ ret = "V128ReplaceLane"
322
+ case operationKindV128Splat:
323
+ ret = "V128Splat"
324
+ case operationKindV128Shuffle:
325
+ ret = "V128Shuffle"
326
+ case operationKindV128Swizzle:
327
+ ret = "V128Swizzle"
328
+ case operationKindV128AnyTrue:
329
+ ret = "V128AnyTrue"
330
+ case operationKindV128AllTrue:
331
+ ret = "V128AllTrue"
332
+ case operationKindV128And:
333
+ ret = "V128And"
334
+ case operationKindV128Not:
335
+ ret = "V128Not"
336
+ case operationKindV128Or:
337
+ ret = "V128Or"
338
+ case operationKindV128Xor:
339
+ ret = "V128Xor"
340
+ case operationKindV128Bitselect:
341
+ ret = "V128Bitselect"
342
+ case operationKindV128AndNot:
343
+ ret = "V128AndNot"
344
+ case operationKindV128BitMask:
345
+ ret = "V128BitMask"
346
+ case operationKindV128Shl:
347
+ ret = "V128Shl"
348
+ case operationKindV128Shr:
349
+ ret = "V128Shr"
350
+ case operationKindV128Cmp:
351
+ ret = "V128Cmp"
352
+ case operationKindSignExtend32From8:
353
+ ret = "SignExtend32From8"
354
+ case operationKindSignExtend32From16:
355
+ ret = "SignExtend32From16"
356
+ case operationKindSignExtend64From8:
357
+ ret = "SignExtend64From8"
358
+ case operationKindSignExtend64From16:
359
+ ret = "SignExtend64From16"
360
+ case operationKindSignExtend64From32:
361
+ ret = "SignExtend64From32"
362
+ case operationKindV128AddSat:
363
+ ret = "V128AddSat"
364
+ case operationKindV128SubSat:
365
+ ret = "V128SubSat"
366
+ case operationKindV128Mul:
367
+ ret = "V128Mul"
368
+ case operationKindV128Div:
369
+ ret = "V128Div"
370
+ case operationKindV128Neg:
371
+ ret = "V128Neg"
372
+ case operationKindV128Sqrt:
373
+ ret = "V128Sqrt"
374
+ case operationKindV128Abs:
375
+ ret = "V128Abs"
376
+ case operationKindV128Popcnt:
377
+ ret = "V128Popcnt"
378
+ case operationKindV128Min:
379
+ ret = "V128Min"
380
+ case operationKindV128Max:
381
+ ret = "V128Max"
382
+ case operationKindV128AvgrU:
383
+ ret = "V128AvgrU"
384
+ case operationKindV128Ceil:
385
+ ret = "V128Ceil"
386
+ case operationKindV128Floor:
387
+ ret = "V128Floor"
388
+ case operationKindV128Trunc:
389
+ ret = "V128Trunc"
390
+ case operationKindV128Nearest:
391
+ ret = "V128Nearest"
392
+ case operationKindV128Pmin:
393
+ ret = "V128Pmin"
394
+ case operationKindV128Pmax:
395
+ ret = "V128Pmax"
396
+ case operationKindV128Extend:
397
+ ret = "V128Extend"
398
+ case operationKindV128ExtMul:
399
+ ret = "V128ExtMul"
400
+ case operationKindV128Q15mulrSatS:
401
+ ret = "V128Q15mulrSatS"
402
+ case operationKindV128ExtAddPairwise:
403
+ ret = "V128ExtAddPairwise"
404
+ case operationKindV128FloatPromote:
405
+ ret = "V128FloatPromote"
406
+ case operationKindV128FloatDemote:
407
+ ret = "V128FloatDemote"
408
+ case operationKindV128FConvertFromI:
409
+ ret = "V128FConvertFromI"
410
+ case operationKindV128Dot:
411
+ ret = "V128Dot"
412
+ case operationKindV128Narrow:
413
+ ret = "V128Narrow"
414
+ case operationKindV128ITruncSatFromF:
415
+ ret = "V128ITruncSatFromF"
416
+ case operationKindBuiltinFunctionCheckExitCode:
417
+ ret = "BuiltinFunctionCheckExitCode"
418
+ case operationKindAtomicMemoryWait:
419
+ ret = "operationKindAtomicMemoryWait"
420
+ case operationKindAtomicMemoryNotify:
421
+ ret = "operationKindAtomicMemoryNotify"
422
+ case operationKindAtomicFence:
423
+ ret = "operationKindAtomicFence"
424
+ case operationKindAtomicLoad:
425
+ ret = "operationKindAtomicLoad"
426
+ case operationKindAtomicLoad8:
427
+ ret = "operationKindAtomicLoad8"
428
+ case operationKindAtomicLoad16:
429
+ ret = "operationKindAtomicLoad16"
430
+ case operationKindAtomicStore:
431
+ ret = "operationKindAtomicStore"
432
+ case operationKindAtomicStore8:
433
+ ret = "operationKindAtomicStore8"
434
+ case operationKindAtomicStore16:
435
+ ret = "operationKindAtomicStore16"
436
+ case operationKindAtomicRMW:
437
+ ret = "operationKindAtomicRMW"
438
+ case operationKindAtomicRMW8:
439
+ ret = "operationKindAtomicRMW8"
440
+ case operationKindAtomicRMW16:
441
+ ret = "operationKindAtomicRMW16"
442
+ case operationKindAtomicRMWCmpxchg:
443
+ ret = "operationKindAtomicRMWCmpxchg"
444
+ case operationKindAtomicRMW8Cmpxchg:
445
+ ret = "operationKindAtomicRMW8Cmpxchg"
446
+ case operationKindAtomicRMW16Cmpxchg:
447
+ ret = "operationKindAtomicRMW16Cmpxchg"
448
+ case operationKindTailCallReturnCall:
449
+ ret = "operationKindTailCallReturnCall"
450
+ case operationKindTailCallReturnCallIndirect:
451
+ ret = "operationKindTailCallReturnCallIndirect"
452
+ case operationKindThrow:
453
+ ret = "operationKindThrow"
454
+ case operationKindThrowRef:
455
+ ret = "operationKindThrowRef"
456
+ case operationKindCallRef:
457
+ ret = "operationKindCallRef"
458
+ case operationKindReturnCallRef:
459
+ ret = "operationKindReturnCallRef"
460
+ case operationKindRefAsNonNull:
461
+ ret = "operationKindRefAsNonNull"
462
+ case operationKindBrOnNull:
463
+ ret = "operationKindBrOnNull"
464
+ case operationKindBrOnNonNull:
465
+ ret = "operationKindBrOnNonNull"
466
+ default:
467
+ panic(fmt.Errorf("unknown operation %d", o))
468
+ }
469
+ return
470
+ }
471
+
472
+ const (
473
+ // operationKindUnreachable is the Kind for NewOperationUnreachable.
474
+ operationKindUnreachable operationKind = iota
475
+ // operationKindLabel is the Kind for NewOperationLabel.
476
+ operationKindLabel
477
+ // operationKindBr is the Kind for NewOperationBr.
478
+ operationKindBr
479
+ // operationKindBrIf is the Kind for NewOperationBrIf.
480
+ operationKindBrIf
481
+ // operationKindBrTable is the Kind for NewOperationBrTable.
482
+ operationKindBrTable
483
+ // operationKindCall is the Kind for NewOperationCall.
484
+ operationKindCall
485
+ // operationKindCallIndirect is the Kind for NewOperationCallIndirect.
486
+ operationKindCallIndirect
487
+ // operationKindDrop is the Kind for NewOperationDrop.
488
+ operationKindDrop
489
+ // operationKindSelect is the Kind for NewOperationSelect.
490
+ operationKindSelect
491
+ // operationKindPick is the Kind for NewOperationPick.
492
+ operationKindPick
493
+ // operationKindSet is the Kind for NewOperationSet.
494
+ operationKindSet
495
+ // operationKindGlobalGet is the Kind for NewOperationGlobalGet.
496
+ operationKindGlobalGet
497
+ // operationKindGlobalSet is the Kind for NewOperationGlobalSet.
498
+ operationKindGlobalSet
499
+ // operationKindLoad is the Kind for NewOperationLoad.
500
+ operationKindLoad
501
+ // operationKindLoad8 is the Kind for NewOperationLoad8.
502
+ operationKindLoad8
503
+ // operationKindLoad16 is the Kind for NewOperationLoad16.
504
+ operationKindLoad16
505
+ // operationKindLoad32 is the Kind for NewOperationLoad32.
506
+ operationKindLoad32
507
+ // operationKindStore is the Kind for NewOperationStore.
508
+ operationKindStore
509
+ // operationKindStore8 is the Kind for NewOperationStore8.
510
+ operationKindStore8
511
+ // operationKindStore16 is the Kind for NewOperationStore16.
512
+ operationKindStore16
513
+ // operationKindStore32 is the Kind for NewOperationStore32.
514
+ operationKindStore32
515
+ // operationKindMemorySize is the Kind for NewOperationMemorySize.
516
+ operationKindMemorySize
517
+ // operationKindMemoryGrow is the Kind for NewOperationMemoryGrow.
518
+ operationKindMemoryGrow
519
+ // operationKindConstI32 is the Kind for NewOperationConstI32.
520
+ operationKindConstI32
521
+ // operationKindConstI64 is the Kind for NewOperationConstI64.
522
+ operationKindConstI64
523
+ // operationKindConstF32 is the Kind for NewOperationConstF32.
524
+ operationKindConstF32
525
+ // operationKindConstF64 is the Kind for NewOperationConstF64.
526
+ operationKindConstF64
527
+ // operationKindEq is the Kind for NewOperationEq.
528
+ operationKindEq
529
+ // operationKindNe is the Kind for NewOperationNe.
530
+ operationKindNe
531
+ // operationKindEqz is the Kind for NewOperationEqz.
532
+ operationKindEqz
533
+ // operationKindLt is the Kind for NewOperationLt.
534
+ operationKindLt
535
+ // operationKindGt is the Kind for NewOperationGt.
536
+ operationKindGt
537
+ // operationKindLe is the Kind for NewOperationLe.
538
+ operationKindLe
539
+ // operationKindGe is the Kind for NewOperationGe.
540
+ operationKindGe
541
+ // operationKindAdd is the Kind for NewOperationAdd.
542
+ operationKindAdd
543
+ // operationKindSub is the Kind for NewOperationSub.
544
+ operationKindSub
545
+ // operationKindMul is the Kind for NewOperationMul.
546
+ operationKindMul
547
+ // operationKindClz is the Kind for NewOperationClz.
548
+ operationKindClz
549
+ // operationKindCtz is the Kind for NewOperationCtz.
550
+ operationKindCtz
551
+ // operationKindPopcnt is the Kind for NewOperationPopcnt.
552
+ operationKindPopcnt
553
+ // operationKindDiv is the Kind for NewOperationDiv.
554
+ operationKindDiv
555
+ // operationKindRem is the Kind for NewOperationRem.
556
+ operationKindRem
557
+ // operationKindAnd is the Kind for NewOperationAnd.
558
+ operationKindAnd
559
+ // operationKindOr is the Kind for NewOperationOr.
560
+ operationKindOr
561
+ // operationKindXor is the Kind for NewOperationXor.
562
+ operationKindXor
563
+ // operationKindShl is the Kind for NewOperationShl.
564
+ operationKindShl
565
+ // operationKindShr is the Kind for NewOperationShr.
566
+ operationKindShr
567
+ // operationKindRotl is the Kind for NewOperationRotl.
568
+ operationKindRotl
569
+ // operationKindRotr is the Kind for NewOperationRotr.
570
+ operationKindRotr
571
+ // operationKindAbs is the Kind for NewOperationAbs.
572
+ operationKindAbs
573
+ // operationKindNeg is the Kind for NewOperationNeg.
574
+ operationKindNeg
575
+ // operationKindCeil is the Kind for NewOperationCeil.
576
+ operationKindCeil
577
+ // operationKindFloor is the Kind for NewOperationFloor.
578
+ operationKindFloor
579
+ // operationKindTrunc is the Kind for NewOperationTrunc.
580
+ operationKindTrunc
581
+ // operationKindNearest is the Kind for NewOperationNearest.
582
+ operationKindNearest
583
+ // operationKindSqrt is the Kind for NewOperationSqrt.
584
+ operationKindSqrt
585
+ // operationKindMin is the Kind for NewOperationMin.
586
+ operationKindMin
587
+ // operationKindMax is the Kind for NewOperationMax.
588
+ operationKindMax
589
+ // operationKindCopysign is the Kind for NewOperationCopysign.
590
+ operationKindCopysign
591
+ // operationKindI32WrapFromI64 is the Kind for NewOperationI32WrapFromI64.
592
+ operationKindI32WrapFromI64
593
+ // operationKindITruncFromF is the Kind for NewOperationITruncFromF.
594
+ operationKindITruncFromF
595
+ // operationKindFConvertFromI is the Kind for NewOperationFConvertFromI.
596
+ operationKindFConvertFromI
597
+ // operationKindF32DemoteFromF64 is the Kind for NewOperationF32DemoteFromF64.
598
+ operationKindF32DemoteFromF64
599
+ // operationKindF64PromoteFromF32 is the Kind for NewOperationF64PromoteFromF32.
600
+ operationKindF64PromoteFromF32
601
+ // operationKindI32ReinterpretFromF32 is the Kind for NewOperationI32ReinterpretFromF32.
602
+ operationKindI32ReinterpretFromF32
603
+ // operationKindI64ReinterpretFromF64 is the Kind for NewOperationI64ReinterpretFromF64.
604
+ operationKindI64ReinterpretFromF64
605
+ // operationKindF32ReinterpretFromI32 is the Kind for NewOperationF32ReinterpretFromI32.
606
+ operationKindF32ReinterpretFromI32
607
+ // operationKindF64ReinterpretFromI64 is the Kind for NewOperationF64ReinterpretFromI64.
608
+ operationKindF64ReinterpretFromI64
609
+ // operationKindExtend is the Kind for NewOperationExtend.
610
+ operationKindExtend
611
+ // operationKindSignExtend32From8 is the Kind for NewOperationSignExtend32From8.
612
+ operationKindSignExtend32From8
613
+ // operationKindSignExtend32From16 is the Kind for NewOperationSignExtend32From16.
614
+ operationKindSignExtend32From16
615
+ // operationKindSignExtend64From8 is the Kind for NewOperationSignExtend64From8.
616
+ operationKindSignExtend64From8
617
+ // operationKindSignExtend64From16 is the Kind for NewOperationSignExtend64From16.
618
+ operationKindSignExtend64From16
619
+ // operationKindSignExtend64From32 is the Kind for NewOperationSignExtend64From32.
620
+ operationKindSignExtend64From32
621
+ // operationKindMemoryInit is the Kind for NewOperationMemoryInit.
622
+ operationKindMemoryInit
623
+ // operationKindDataDrop is the Kind for NewOperationDataDrop.
624
+ operationKindDataDrop
625
+ // operationKindMemoryCopy is the Kind for NewOperationMemoryCopy.
626
+ operationKindMemoryCopy
627
+ // operationKindMemoryFill is the Kind for NewOperationMemoryFill.
628
+ operationKindMemoryFill
629
+ // operationKindTableInit is the Kind for NewOperationTableInit.
630
+ operationKindTableInit
631
+ // operationKindElemDrop is the Kind for NewOperationElemDrop.
632
+ operationKindElemDrop
633
+ // operationKindTableCopy is the Kind for NewOperationTableCopy.
634
+ operationKindTableCopy
635
+ // operationKindRefFunc is the Kind for NewOperationRefFunc.
636
+ operationKindRefFunc
637
+ // operationKindTableGet is the Kind for NewOperationTableGet.
638
+ operationKindTableGet
639
+ // operationKindTableSet is the Kind for NewOperationTableSet.
640
+ operationKindTableSet
641
+ // operationKindTableSize is the Kind for NewOperationTableSize.
642
+ operationKindTableSize
643
+ // operationKindTableGrow is the Kind for NewOperationTableGrow.
644
+ operationKindTableGrow
645
+ // operationKindTableFill is the Kind for NewOperationTableFill.
646
+ operationKindTableFill
647
+
648
+ // Vector value related instructions are prefixed by V128.
649
+
650
+ // operationKindV128Const is the Kind for NewOperationV128Const.
651
+ operationKindV128Const
652
+ // operationKindV128Add is the Kind for NewOperationV128Add.
653
+ operationKindV128Add
654
+ // operationKindV128Sub is the Kind for NewOperationV128Sub.
655
+ operationKindV128Sub
656
+ // operationKindV128Load is the Kind for NewOperationV128Load.
657
+ operationKindV128Load
658
+ // operationKindV128LoadLane is the Kind for NewOperationV128LoadLane.
659
+ operationKindV128LoadLane
660
+ // operationKindV128Store is the Kind for NewOperationV128Store.
661
+ operationKindV128Store
662
+ // operationKindV128StoreLane is the Kind for NewOperationV128StoreLane.
663
+ operationKindV128StoreLane
664
+ // operationKindV128ExtractLane is the Kind for NewOperationV128ExtractLane.
665
+ operationKindV128ExtractLane
666
+ // operationKindV128ReplaceLane is the Kind for NewOperationV128ReplaceLane.
667
+ operationKindV128ReplaceLane
668
+ // operationKindV128Splat is the Kind for NewOperationV128Splat.
669
+ operationKindV128Splat
670
+ // operationKindV128Shuffle is the Kind for NewOperationV128Shuffle.
671
+ operationKindV128Shuffle
672
+ // operationKindV128Swizzle is the Kind for NewOperationV128Swizzle.
673
+ operationKindV128Swizzle
674
+ // operationKindV128AnyTrue is the Kind for NewOperationV128AnyTrue.
675
+ operationKindV128AnyTrue
676
+ // operationKindV128AllTrue is the Kind for NewOperationV128AllTrue.
677
+ operationKindV128AllTrue
678
+ // operationKindV128BitMask is the Kind for NewOperationV128BitMask.
679
+ operationKindV128BitMask
680
+ // operationKindV128And is the Kind for NewOperationV128And.
681
+ operationKindV128And
682
+ // operationKindV128Not is the Kind for NewOperationV128Not.
683
+ operationKindV128Not
684
+ // operationKindV128Or is the Kind for NewOperationV128Or.
685
+ operationKindV128Or
686
+ // operationKindV128Xor is the Kind for NewOperationV128Xor.
687
+ operationKindV128Xor
688
+ // operationKindV128Bitselect is the Kind for NewOperationV128Bitselect.
689
+ operationKindV128Bitselect
690
+ // operationKindV128AndNot is the Kind for NewOperationV128AndNot.
691
+ operationKindV128AndNot
692
+ // operationKindV128Shl is the Kind for NewOperationV128Shl.
693
+ operationKindV128Shl
694
+ // operationKindV128Shr is the Kind for NewOperationV128Shr.
695
+ operationKindV128Shr
696
+ // operationKindV128Cmp is the Kind for NewOperationV128Cmp.
697
+ operationKindV128Cmp
698
+ // operationKindV128AddSat is the Kind for NewOperationV128AddSat.
699
+ operationKindV128AddSat
700
+ // operationKindV128SubSat is the Kind for NewOperationV128SubSat.
701
+ operationKindV128SubSat
702
+ // operationKindV128Mul is the Kind for NewOperationV128Mul.
703
+ operationKindV128Mul
704
+ // operationKindV128Div is the Kind for NewOperationV128Div.
705
+ operationKindV128Div
706
+ // operationKindV128Neg is the Kind for NewOperationV128Neg.
707
+ operationKindV128Neg
708
+ // operationKindV128Sqrt is the Kind for NewOperationV128Sqrt.
709
+ operationKindV128Sqrt
710
+ // operationKindV128Abs is the Kind for NewOperationV128Abs.
711
+ operationKindV128Abs
712
+ // operationKindV128Popcnt is the Kind for NewOperationV128Popcnt.
713
+ operationKindV128Popcnt
714
+ // operationKindV128Min is the Kind for NewOperationV128Min.
715
+ operationKindV128Min
716
+ // operationKindV128Max is the Kind for NewOperationV128Max.
717
+ operationKindV128Max
718
+ // operationKindV128AvgrU is the Kind for NewOperationV128AvgrU.
719
+ operationKindV128AvgrU
720
+ // operationKindV128Pmin is the Kind for NewOperationV128Pmin.
721
+ operationKindV128Pmin
722
+ // operationKindV128Pmax is the Kind for NewOperationV128Pmax.
723
+ operationKindV128Pmax
724
+ // operationKindV128Ceil is the Kind for NewOperationV128Ceil.
725
+ operationKindV128Ceil
726
+ // operationKindV128Floor is the Kind for NewOperationV128Floor.
727
+ operationKindV128Floor
728
+ // operationKindV128Trunc is the Kind for NewOperationV128Trunc.
729
+ operationKindV128Trunc
730
+ // operationKindV128Nearest is the Kind for NewOperationV128Nearest.
731
+ operationKindV128Nearest
732
+ // operationKindV128Extend is the Kind for NewOperationV128Extend.
733
+ operationKindV128Extend
734
+ // operationKindV128ExtMul is the Kind for NewOperationV128ExtMul.
735
+ operationKindV128ExtMul
736
+ // operationKindV128Q15mulrSatS is the Kind for NewOperationV128Q15mulrSatS.
737
+ operationKindV128Q15mulrSatS
738
+ // operationKindV128ExtAddPairwise is the Kind for NewOperationV128ExtAddPairwise.
739
+ operationKindV128ExtAddPairwise
740
+ // operationKindV128FloatPromote is the Kind for NewOperationV128FloatPromote.
741
+ operationKindV128FloatPromote
742
+ // operationKindV128FloatDemote is the Kind for NewOperationV128FloatDemote.
743
+ operationKindV128FloatDemote
744
+ // operationKindV128FConvertFromI is the Kind for NewOperationV128FConvertFromI.
745
+ operationKindV128FConvertFromI
746
+ // operationKindV128Dot is the Kind for NewOperationV128Dot.
747
+ operationKindV128Dot
748
+ // operationKindV128Narrow is the Kind for NewOperationV128Narrow.
749
+ operationKindV128Narrow
750
+ // operationKindV128ITruncSatFromF is the Kind for NewOperationV128ITruncSatFromF.
751
+ operationKindV128ITruncSatFromF
752
+
753
+ // operationKindBuiltinFunctionCheckExitCode is the Kind for NewOperationBuiltinFunctionCheckExitCode.
754
+ operationKindBuiltinFunctionCheckExitCode
755
+
756
+ // operationKindAtomicMemoryWait is the kind for NewOperationAtomicMemoryWait.
757
+ operationKindAtomicMemoryWait
758
+ // operationKindAtomicMemoryNotify is the kind for NewOperationAtomicMemoryNotify.
759
+ operationKindAtomicMemoryNotify
760
+ // operationKindAtomicFence is the kind for NewOperationAtomicFence.
761
+ operationKindAtomicFence
762
+ // operationKindAtomicLoad is the kind for NewOperationAtomicLoad.
763
+ operationKindAtomicLoad
764
+ // operationKindAtomicLoad8 is the kind for NewOperationAtomicLoad8.
765
+ operationKindAtomicLoad8
766
+ // operationKindAtomicLoad16 is the kind for NewOperationAtomicLoad16.
767
+ operationKindAtomicLoad16
768
+ // operationKindAtomicStore is the kind for NewOperationAtomicStore.
769
+ operationKindAtomicStore
770
+ // operationKindAtomicStore8 is the kind for NewOperationAtomicStore8.
771
+ operationKindAtomicStore8
772
+ // operationKindAtomicStore16 is the kind for NewOperationAtomicStore16.
773
+ operationKindAtomicStore16
774
+
775
+ // operationKindAtomicRMW is the kind for NewOperationAtomicRMW.
776
+ operationKindAtomicRMW
777
+ // operationKindAtomicRMW8 is the kind for NewOperationAtomicRMW8.
778
+ operationKindAtomicRMW8
779
+ // operationKindAtomicRMW16 is the kind for NewOperationAtomicRMW16.
780
+ operationKindAtomicRMW16
781
+
782
+ // operationKindAtomicRMWCmpxchg is the kind for NewOperationAtomicRMWCmpxchg.
783
+ operationKindAtomicRMWCmpxchg
784
+ // operationKindAtomicRMW8Cmpxchg is the kind for NewOperationAtomicRMW8Cmpxchg.
785
+ operationKindAtomicRMW8Cmpxchg
786
+ // operationKindAtomicRMW16Cmpxchg is the kind for NewOperationAtomicRMW16Cmpxchg.
787
+ operationKindAtomicRMW16Cmpxchg
788
+
789
+ // operationKindTailCallReturnCall is the Kind for newOperationTailCallReturnCall.
790
+ operationKindTailCallReturnCall
791
+ // operationKindTailCallReturnCallIndirect is the Kind for newOperationKindTailCallReturnCallIndirect.
792
+ operationKindTailCallReturnCallIndirect
793
+
794
+ // operationKindThrow is the Kind for throw instruction.
795
+ operationKindThrow
796
+ // operationKindThrowRef is the Kind for throw_ref instruction.
797
+ operationKindThrowRef
798
+
799
+ // operationKindCallRef is the Kind for call_ref instruction.
800
+ operationKindCallRef
801
+ // operationKindReturnCallRef is the Kind for return_call_ref instruction.
802
+ operationKindReturnCallRef
803
+ // operationKindRefAsNonNull is the Kind for ref.as_non_null instruction.
804
+ operationKindRefAsNonNull
805
+ // operationKindBrOnNull is the Kind for br_on_null instruction.
806
+ operationKindBrOnNull
807
+ // operationKindBrOnNonNull is the Kind for br_on_non_null instruction.
808
+ operationKindBrOnNonNull
809
+
810
+ // operationKindEnd is always placed at the bottom of this iota definition to be used in the test.
811
+ operationKindEnd
812
+ )
813
+
814
+ // NewOperationBuiltinFunctionCheckExitCode is a constructor for unionOperation with Kind operationKindBuiltinFunctionCheckExitCode.
815
+ //
816
+ // OperationBuiltinFunctionCheckExitCode corresponds to the instruction to check the api.Module is already closed due to
817
+ // context.DeadlineExceeded, context.Canceled, or the explicit call of CloseWithExitCode on api.Module.
818
+ func newOperationBuiltinFunctionCheckExitCode() unionOperation {
819
+ return unionOperation{Kind: operationKindBuiltinFunctionCheckExitCode}
820
+ }
821
+
822
+ // label is the unique identifier for each block in a single function in interpreterir
823
+ // where "block" consists of multiple operations, and must End with branching operations
824
+ // (e.g. operationKindBr or operationKindBrIf).
825
+ type label uint64
826
+
827
+ // Kind returns the labelKind encoded in this label.
828
+ func (l label) Kind() labelKind {
829
+ return labelKind(uint32(l))
830
+ }
831
+
832
+ // FrameID returns the frame id encoded in this label.
833
+ func (l label) FrameID() int {
834
+ return int(uint32(l >> 32))
835
+ }
836
+
837
+ // NewLabel is a constructor for a label.
838
+ func newLabel(kind labelKind, frameID uint32) label {
839
+ return label(kind) | label(frameID)<<32
840
+ }
841
+
842
+ // String implements fmt.Stringer.
843
+ func (l label) String() (ret string) {
844
+ frameID := l.FrameID()
845
+ switch l.Kind() {
846
+ case labelKindHeader:
847
+ ret = fmt.Sprintf(".L%d", frameID)
848
+ case labelKindElse:
849
+ ret = fmt.Sprintf(".L%d_else", frameID)
850
+ case labelKindContinuation:
851
+ ret = fmt.Sprintf(".L%d_cont", frameID)
852
+ case labelKindReturn:
853
+ return ".return"
854
+ }
855
+ return
856
+ }
857
+
858
+ func (l label) IsReturnTarget() bool {
859
+ return l.Kind() == labelKindReturn
860
+ }
861
+
862
+ // labelKind is the Kind of the label.
863
+ type labelKind = byte
864
+
865
+ const (
866
+ // labelKindHeader is the header for various blocks. For example, the "then" block of
867
+ // wasm.OpcodeIfName in Wasm has the label of this Kind.
868
+ labelKindHeader labelKind = iota
869
+ // labelKindElse is the Kind of label for "else" block of wasm.OpcodeIfName in Wasm.
870
+ labelKindElse
871
+ // labelKindContinuation is the Kind of label which is the continuation of blocks.
872
+ // For example, for wasm text like
873
+ // (func
874
+ // ....
875
+ // (if (local.get 0) (then (nop)) (else (nop)))
876
+ // return
877
+ // )
878
+ // we have the continuation block (of if-block) corresponding to "return" opcode.
879
+ labelKindContinuation
880
+ labelKindReturn
881
+ labelKindNum
882
+ )
883
+
884
+ // unionOperation implements Operation and is the compilation (engine.lowerIR) result of a interpreterir.Operation.
885
+ //
886
+ // Not all operations result in a unionOperation, e.g. interpreterir.OperationI32ReinterpretFromF32, and some operations are
887
+ // more complex than others, e.g. interpreterir.NewOperationBrTable.
888
+ //
889
+ // Note: This is a form of union type as it can store fields needed for any operation. Hence, most fields are opaque and
890
+ // only relevant when in context of its kind.
891
+ type unionOperation struct {
892
+ // Kind determines how to interpret the other fields in this struct.
893
+ Kind operationKind
894
+ B1, B2 byte
895
+ B3 bool
896
+ U1, U2 uint64
897
+ U3 uint64
898
+ Us []uint64
899
+ }
900
+
901
+ // String implements fmt.Stringer.
902
+ func (o unionOperation) String() string {
903
+ switch o.Kind {
904
+ case operationKindUnreachable,
905
+ operationKindSelect,
906
+ operationKindMemorySize,
907
+ operationKindMemoryGrow,
908
+ operationKindI32WrapFromI64,
909
+ operationKindF32DemoteFromF64,
910
+ operationKindF64PromoteFromF32,
911
+ operationKindI32ReinterpretFromF32,
912
+ operationKindI64ReinterpretFromF64,
913
+ operationKindF32ReinterpretFromI32,
914
+ operationKindF64ReinterpretFromI64,
915
+ operationKindSignExtend32From8,
916
+ operationKindSignExtend32From16,
917
+ operationKindSignExtend64From8,
918
+ operationKindSignExtend64From16,
919
+ operationKindSignExtend64From32,
920
+ operationKindMemoryInit,
921
+ operationKindDataDrop,
922
+ operationKindMemoryCopy,
923
+ operationKindMemoryFill,
924
+ operationKindTableInit,
925
+ operationKindElemDrop,
926
+ operationKindTableCopy,
927
+ operationKindRefFunc,
928
+ operationKindTableGet,
929
+ operationKindTableSet,
930
+ operationKindTableSize,
931
+ operationKindTableGrow,
932
+ operationKindTableFill,
933
+ operationKindBuiltinFunctionCheckExitCode:
934
+ return o.Kind.String()
935
+
936
+ case operationKindCall,
937
+ operationKindGlobalGet,
938
+ operationKindGlobalSet:
939
+ return fmt.Sprintf("%s %d", o.Kind, o.B1)
940
+
941
+ case operationKindLabel:
942
+ return label(o.U1).String()
943
+
944
+ case operationKindBr:
945
+ return fmt.Sprintf("%s %s", o.Kind, label(o.U1).String())
946
+
947
+ case operationKindBrIf:
948
+ thenTarget := label(o.U1)
949
+ elseTarget := label(o.U2)
950
+ return fmt.Sprintf("%s %s, %s", o.Kind, thenTarget, elseTarget)
951
+
952
+ case operationKindBrTable:
953
+ var targets []string
954
+ var defaultLabel label
955
+ if len(o.Us) > 0 {
956
+ targets = make([]string, len(o.Us)-1)
957
+ for i, t := range o.Us[1:] {
958
+ targets[i] = label(t).String()
959
+ }
960
+ defaultLabel = label(o.Us[0])
961
+ }
962
+ return fmt.Sprintf("%s [%s] %s", o.Kind, strings.Join(targets, ","), defaultLabel)
963
+
964
+ case operationKindCallIndirect:
965
+ return fmt.Sprintf("%s: type=%d, table=%d", o.Kind, o.U1, o.U2)
966
+
967
+ case operationKindDrop:
968
+ start := int64(o.U1)
969
+ end := int64(o.U2)
970
+ return fmt.Sprintf("%s %d..%d", o.Kind, start, end)
971
+
972
+ case operationKindPick, operationKindSet:
973
+ return fmt.Sprintf("%s %d (is_vector=%v)", o.Kind, o.U1, o.B3)
974
+
975
+ case operationKindLoad, operationKindStore:
976
+ return fmt.Sprintf("%s.%s (align=%d, offset=%d)", unsignedType(o.B1), o.Kind, o.U1, o.U2)
977
+
978
+ case operationKindLoad8,
979
+ operationKindLoad16:
980
+ return fmt.Sprintf("%s.%s (align=%d, offset=%d)", signedType(o.B1), o.Kind, o.U1, o.U2)
981
+
982
+ case operationKindStore8,
983
+ operationKindStore16,
984
+ operationKindStore32:
985
+ return fmt.Sprintf("%s (align=%d, offset=%d)", o.Kind, o.U1, o.U2)
986
+
987
+ case operationKindLoad32:
988
+ var t string
989
+ if o.B1 == 1 {
990
+ t = "i64"
991
+ } else {
992
+ t = "u64"
993
+ }
994
+ return fmt.Sprintf("%s.%s (align=%d, offset=%d)", t, o.Kind, o.U1, o.U2)
995
+
996
+ case operationKindEq,
997
+ operationKindNe,
998
+ operationKindAdd,
999
+ operationKindSub,
1000
+ operationKindMul:
1001
+ return fmt.Sprintf("%s.%s", unsignedType(o.B1), o.Kind)
1002
+
1003
+ case operationKindEqz,
1004
+ operationKindClz,
1005
+ operationKindCtz,
1006
+ operationKindPopcnt,
1007
+ operationKindAnd,
1008
+ operationKindOr,
1009
+ operationKindXor,
1010
+ operationKindShl,
1011
+ operationKindRotl,
1012
+ operationKindRotr:
1013
+ return fmt.Sprintf("%s.%s", unsignedInt(o.B1), o.Kind)
1014
+
1015
+ case operationKindRem, operationKindShr:
1016
+ return fmt.Sprintf("%s.%s", signedInt(o.B1), o.Kind)
1017
+
1018
+ case operationKindLt,
1019
+ operationKindGt,
1020
+ operationKindLe,
1021
+ operationKindGe,
1022
+ operationKindDiv:
1023
+ return fmt.Sprintf("%s.%s", signedType(o.B1), o.Kind)
1024
+
1025
+ case operationKindAbs,
1026
+ operationKindNeg,
1027
+ operationKindCeil,
1028
+ operationKindFloor,
1029
+ operationKindTrunc,
1030
+ operationKindNearest,
1031
+ operationKindSqrt,
1032
+ operationKindMin,
1033
+ operationKindMax,
1034
+ operationKindCopysign:
1035
+ return fmt.Sprintf("%s.%s", float(o.B1), o.Kind)
1036
+
1037
+ case operationKindConstI32,
1038
+ operationKindConstI64:
1039
+ return fmt.Sprintf("%s %#x", o.Kind, o.U1)
1040
+
1041
+ case operationKindConstF32:
1042
+ return fmt.Sprintf("%s %f", o.Kind, math.Float32frombits(uint32(o.U1)))
1043
+ case operationKindConstF64:
1044
+ return fmt.Sprintf("%s %f", o.Kind, math.Float64frombits(o.U1))
1045
+
1046
+ case operationKindITruncFromF:
1047
+ return fmt.Sprintf("%s.%s.%s (non_trapping=%v)", signedInt(o.B2), o.Kind, float(o.B1), o.B3)
1048
+ case operationKindFConvertFromI:
1049
+ return fmt.Sprintf("%s.%s.%s", float(o.B2), o.Kind, signedInt(o.B1))
1050
+ case operationKindExtend:
1051
+ var in, out string
1052
+ if o.B3 {
1053
+ in = "i32"
1054
+ out = "i64"
1055
+ } else {
1056
+ in = "u32"
1057
+ out = "u64"
1058
+ }
1059
+ return fmt.Sprintf("%s.%s.%s", out, o.Kind, in)
1060
+
1061
+ case operationKindV128Const:
1062
+ return fmt.Sprintf("%s [%#x, %#x]", o.Kind, o.U1, o.U2)
1063
+ case operationKindV128Add,
1064
+ operationKindV128Sub:
1065
+ return fmt.Sprintf("%s (shape=%s)", o.Kind, shapeName(o.B1))
1066
+ case operationKindV128Load,
1067
+ operationKindV128LoadLane,
1068
+ operationKindV128Store,
1069
+ operationKindV128StoreLane,
1070
+ operationKindV128ExtractLane,
1071
+ operationKindV128ReplaceLane,
1072
+ operationKindV128Splat,
1073
+ operationKindV128Shuffle,
1074
+ operationKindV128Swizzle,
1075
+ operationKindV128AnyTrue,
1076
+ operationKindV128AllTrue,
1077
+ operationKindV128BitMask,
1078
+ operationKindV128And,
1079
+ operationKindV128Not,
1080
+ operationKindV128Or,
1081
+ operationKindV128Xor,
1082
+ operationKindV128Bitselect,
1083
+ operationKindV128AndNot,
1084
+ operationKindV128Shl,
1085
+ operationKindV128Shr,
1086
+ operationKindV128Cmp,
1087
+ operationKindV128AddSat,
1088
+ operationKindV128SubSat,
1089
+ operationKindV128Mul,
1090
+ operationKindV128Div,
1091
+ operationKindV128Neg,
1092
+ operationKindV128Sqrt,
1093
+ operationKindV128Abs,
1094
+ operationKindV128Popcnt,
1095
+ operationKindV128Min,
1096
+ operationKindV128Max,
1097
+ operationKindV128AvgrU,
1098
+ operationKindV128Pmin,
1099
+ operationKindV128Pmax,
1100
+ operationKindV128Ceil,
1101
+ operationKindV128Floor,
1102
+ operationKindV128Trunc,
1103
+ operationKindV128Nearest,
1104
+ operationKindV128Extend,
1105
+ operationKindV128ExtMul,
1106
+ operationKindV128Q15mulrSatS,
1107
+ operationKindV128ExtAddPairwise,
1108
+ operationKindV128FloatPromote,
1109
+ operationKindV128FloatDemote,
1110
+ operationKindV128FConvertFromI,
1111
+ operationKindV128Dot,
1112
+ operationKindV128Narrow:
1113
+ return o.Kind.String()
1114
+
1115
+ case operationKindV128ITruncSatFromF:
1116
+ if o.B3 {
1117
+ return fmt.Sprintf("%s.%sS", o.Kind, shapeName(o.B1))
1118
+ } else {
1119
+ return fmt.Sprintf("%s.%sU", o.Kind, shapeName(o.B1))
1120
+ }
1121
+
1122
+ case operationKindAtomicMemoryWait,
1123
+ operationKindAtomicMemoryNotify,
1124
+ operationKindAtomicFence,
1125
+ operationKindAtomicLoad,
1126
+ operationKindAtomicLoad8,
1127
+ operationKindAtomicLoad16,
1128
+ operationKindAtomicStore,
1129
+ operationKindAtomicStore8,
1130
+ operationKindAtomicStore16,
1131
+ operationKindAtomicRMW,
1132
+ operationKindAtomicRMW8,
1133
+ operationKindAtomicRMW16,
1134
+ operationKindAtomicRMWCmpxchg,
1135
+ operationKindAtomicRMW8Cmpxchg,
1136
+ operationKindAtomicRMW16Cmpxchg:
1137
+ return o.Kind.String()
1138
+
1139
+ case operationKindTailCallReturnCall:
1140
+ return fmt.Sprintf("%s %d %s", o.Kind, o.U1, label(o.U2).String())
1141
+
1142
+ case operationKindTailCallReturnCallIndirect:
1143
+ return fmt.Sprintf("%s %d %d", o.Kind, o.U1, o.U2)
1144
+
1145
+ case operationKindThrow:
1146
+ return fmt.Sprintf("%s %d", o.Kind, o.U1)
1147
+
1148
+ case operationKindThrowRef:
1149
+ return o.Kind.String()
1150
+
1151
+ case operationKindCallRef:
1152
+ return fmt.Sprintf("%s %d", o.Kind, o.U1)
1153
+
1154
+ case operationKindReturnCallRef:
1155
+ return fmt.Sprintf("%s %d", o.Kind, o.U1)
1156
+
1157
+ case operationKindRefAsNonNull:
1158
+ return o.Kind.String()
1159
+
1160
+ case operationKindBrOnNull:
1161
+ return fmt.Sprintf("%s %s %s", o.Kind, label(o.U1).String(), label(o.U2).String())
1162
+
1163
+ case operationKindBrOnNonNull:
1164
+ return fmt.Sprintf("%s %s %s", o.Kind, label(o.U1).String(), label(o.U2).String())
1165
+
1166
+ default:
1167
+ panic(fmt.Sprintf("TODO: %v", o.Kind))
1168
+ }
1169
+ }
1170
+
1171
+ // NewOperationUnreachable is a constructor for unionOperation with operationKindUnreachable
1172
+ //
1173
+ // This corresponds to wasm.OpcodeUnreachable.
1174
+ //
1175
+ // The engines are expected to exit the execution with wasmruntime.ErrRuntimeUnreachable error.
1176
+ func newOperationUnreachable() unionOperation {
1177
+ return unionOperation{Kind: operationKindUnreachable}
1178
+ }
1179
+
1180
+ // NewOperationLabel is a constructor for unionOperation with operationKindLabel.
1181
+ //
1182
+ // This is used to inform the engines of the beginning of a label.
1183
+ func newOperationLabel(label label) unionOperation {
1184
+ return unionOperation{Kind: operationKindLabel, U1: uint64(label)}
1185
+ }
1186
+
1187
+ // NewOperationBr is a constructor for unionOperation with operationKindBr.
1188
+ //
1189
+ // The engines are expected to branch into U1 label.
1190
+ func newOperationBr(target label) unionOperation {
1191
+ return unionOperation{Kind: operationKindBr, U1: uint64(target)}
1192
+ }
1193
+
1194
+ // NewOperationBrIf is a constructor for unionOperation with operationKindBrIf.
1195
+ //
1196
+ // The engines are expected to pop a value and branch into U1 label if the value equals 1.
1197
+ // Otherwise, the code branches into U2 label.
1198
+ func newOperationBrIf(thenTarget, elseTarget label, thenDrop inclusiveRange) unionOperation {
1199
+ return unionOperation{
1200
+ Kind: operationKindBrIf,
1201
+ U1: uint64(thenTarget),
1202
+ U2: uint64(elseTarget),
1203
+ U3: thenDrop.AsU64(),
1204
+ }
1205
+ }
1206
+
1207
+ // NewOperationBrTable is a constructor for unionOperation with operationKindBrTable.
1208
+ //
1209
+ // This corresponds to wasm.OpcodeBrTableName except that the label
1210
+ // here means the interpreterir level, not the ones of Wasm.
1211
+ //
1212
+ // The engines are expected to do the br_table operation based on the default (Us[len(Us)-1], Us[len(Us)-2]) and
1213
+ // targets (Us[:len(Us)-1], Rs[:len(Us)-1]). More precisely, this pops a value from the stack (called "index")
1214
+ // and decides which branch we go into next based on the value.
1215
+ //
1216
+ // For example, assume we have operations like {default: L_DEFAULT, targets: [L0, L1, L2]}.
1217
+ // If "index" >= len(defaults), then branch into the L_DEFAULT label.
1218
+ // Otherwise, we enter label of targets[index].
1219
+ func newOperationBrTable(targetLabelsAndRanges []uint64) unionOperation {
1220
+ return unionOperation{
1221
+ Kind: operationKindBrTable,
1222
+ Us: targetLabelsAndRanges,
1223
+ }
1224
+ }
1225
+
1226
+ // NewOperationCall is a constructor for unionOperation with operationKindCall.
1227
+ //
1228
+ // This corresponds to wasm.OpcodeCallName, and engines are expected to
1229
+ // enter into a function whose index equals OperationCall.FunctionIndex.
1230
+ func newOperationCall(functionIndex uint32) unionOperation {
1231
+ return unionOperation{Kind: operationKindCall, U1: uint64(functionIndex)}
1232
+ }
1233
+
1234
+ // NewOperationCallIndirect implements Operation.
1235
+ //
1236
+ // This corresponds to wasm.OpcodeCallIndirectName, and engines are expected to
1237
+ // consume the one value from the top of stack (called "offset"),
1238
+ // and make a function call against the function whose function address equals
1239
+ // Tables[OperationCallIndirect.TableIndex][offset].
1240
+ //
1241
+ // Note: This is called indirect function call in the sense that the target function is indirectly
1242
+ // determined by the current state (top value) of the stack.
1243
+ // Therefore, two checks are performed at runtime before entering the target function:
1244
+ // 1) whether "offset" exceeds the length of table Tables[OperationCallIndirect.TableIndex].
1245
+ // 2) whether the type of the function table[offset] matches the function type specified by OperationCallIndirect.TypeIndex.
1246
+ func newOperationCallIndirect(typeIndex, tableIndex uint32) unionOperation {
1247
+ return unionOperation{Kind: operationKindCallIndirect, U1: uint64(typeIndex), U2: uint64(tableIndex)}
1248
+ }
1249
+
1250
+ // inclusiveRange is the range which spans across the value stack starting from the top to the bottom, and
1251
+ // both boundary are included in the range.
1252
+ type inclusiveRange struct {
1253
+ Start, End int32
1254
+ }
1255
+
1256
+ // AsU64 is be used to convert inclusiveRange to uint64 so that it can be stored in unionOperation.
1257
+ func (i inclusiveRange) AsU64() uint64 {
1258
+ return uint64(uint32(i.Start))<<32 | uint64(uint32(i.End))
1259
+ }
1260
+
1261
+ // inclusiveRangeFromU64 retrieves inclusiveRange from the given uint64 which is stored in unionOperation.
1262
+ func inclusiveRangeFromU64(v uint64) inclusiveRange {
1263
+ return inclusiveRange{
1264
+ Start: int32(uint32(v >> 32)),
1265
+ End: int32(uint32(v)),
1266
+ }
1267
+ }
1268
+
1269
+ // nopinclusiveRange is inclusiveRange which corresponds to no-operation.
1270
+ var nopinclusiveRange = inclusiveRange{Start: -1, End: -1}
1271
+
1272
+ // NewOperationDrop is a constructor for unionOperation with operationKindDrop.
1273
+ //
1274
+ // The engines are expected to discard the values selected by NewOperationDrop.Depth which
1275
+ // starts from the top of the stack to the bottom.
1276
+ //
1277
+ // depth spans across the uint64 value stack at runtime to be dropped by this operation.
1278
+ func newOperationDrop(depth inclusiveRange) unionOperation {
1279
+ return unionOperation{Kind: operationKindDrop, U1: depth.AsU64()}
1280
+ }
1281
+
1282
+ // NewOperationSelect is a constructor for unionOperation with operationKindSelect.
1283
+ //
1284
+ // This corresponds to wasm.OpcodeSelect.
1285
+ //
1286
+ // The engines are expected to pop three values, say [..., x2, x1, c], then if the value "c" equals zero,
1287
+ // "x1" is pushed back onto the stack and, otherwise "x2" is pushed back.
1288
+ //
1289
+ // isTargetVector true if the selection target value's type is wasm.ValueTypeV128.
1290
+ func newOperationSelect(isTargetVector bool) unionOperation {
1291
+ return unionOperation{Kind: operationKindSelect, B3: isTargetVector}
1292
+ }
1293
+
1294
+ // NewOperationPick is a constructor for unionOperation with operationKindPick.
1295
+ //
1296
+ // The engines are expected to copy a value pointed by depth, and push the
1297
+ // copied value onto the top of the stack.
1298
+ //
1299
+ // depth is the location of the pick target in the uint64 value stack at runtime.
1300
+ // If isTargetVector=true, this points to the location of the lower 64-bits of the vector.
1301
+ func newOperationPick(depth int, isTargetVector bool) unionOperation {
1302
+ return unionOperation{Kind: operationKindPick, U1: uint64(depth), B3: isTargetVector}
1303
+ }
1304
+
1305
+ // NewOperationSet is a constructor for unionOperation with operationKindSet.
1306
+ //
1307
+ // The engines are expected to set the top value of the stack to the location specified by
1308
+ // depth.
1309
+ //
1310
+ // depth is the location of the set target in the uint64 value stack at runtime.
1311
+ // If isTargetVector=true, this points the location of the lower 64-bits of the vector.
1312
+ func newOperationSet(depth int, isTargetVector bool) unionOperation {
1313
+ return unionOperation{Kind: operationKindSet, U1: uint64(depth), B3: isTargetVector}
1314
+ }
1315
+
1316
+ // NewOperationGlobalGet is a constructor for unionOperation with operationKindGlobalGet.
1317
+ //
1318
+ // The engines are expected to read the global value specified by OperationGlobalGet.Index,
1319
+ // and push the copy of the value onto the stack.
1320
+ //
1321
+ // See wasm.OpcodeGlobalGet.
1322
+ func newOperationGlobalGet(index uint32) unionOperation {
1323
+ return unionOperation{Kind: operationKindGlobalGet, U1: uint64(index)}
1324
+ }
1325
+
1326
+ // NewOperationGlobalSet is a constructor for unionOperation with operationKindGlobalSet.
1327
+ //
1328
+ // The engines are expected to consume the value from the top of the stack,
1329
+ // and write the value into the global specified by OperationGlobalSet.Index.
1330
+ //
1331
+ // See wasm.OpcodeGlobalSet.
1332
+ func newOperationGlobalSet(index uint32) unionOperation {
1333
+ return unionOperation{Kind: operationKindGlobalSet, U1: uint64(index)}
1334
+ }
1335
+
1336
+ // memoryArg is the "memarg" to all memory instructions.
1337
+ //
1338
+ // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#memory-instructions%E2%91%A0
1339
+ type memoryArg struct {
1340
+ // Alignment the expected alignment (expressed as the exponent of a power of 2). Default to the natural alignment.
1341
+ //
1342
+ // "Natural alignment" is defined here as the smallest power of two that can hold the size of the value type. Ex
1343
+ // wasm.ValueTypeI64 is encoded in 8 little-endian bytes. 2^3 = 8, so the natural alignment is three.
1344
+ Alignment uint32
1345
+
1346
+ // Offset is the address offset added to the instruction's dynamic address operand, yielding a 33-bit effective
1347
+ // address that is the zero-based index at which the memory is accessed. Default to zero.
1348
+ Offset uint32
1349
+ }
1350
+
1351
+ // NewOperationLoad is a constructor for unionOperation with operationKindLoad.
1352
+ //
1353
+ // This corresponds to wasm.OpcodeI32LoadName wasm.OpcodeI64LoadName wasm.OpcodeF32LoadName and wasm.OpcodeF64LoadName.
1354
+ //
1355
+ // The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary,
1356
+ // otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction.
1357
+ func newOperationLoad(unsignedType unsignedType, arg memoryArg) unionOperation {
1358
+ return unionOperation{Kind: operationKindLoad, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
1359
+ }
1360
+
1361
+ // NewOperationLoad8 is a constructor for unionOperation with operationKindLoad8.
1362
+ //
1363
+ // This corresponds to wasm.OpcodeI32Load8SName wasm.OpcodeI32Load8UName wasm.OpcodeI64Load8SName wasm.OpcodeI64Load8UName.
1364
+ //
1365
+ // The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary,
1366
+ // otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction.
1367
+ func newOperationLoad8(signedInt signedInt, arg memoryArg) unionOperation {
1368
+ return unionOperation{Kind: operationKindLoad8, B1: byte(signedInt), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
1369
+ }
1370
+
1371
+ // NewOperationLoad16 is a constructor for unionOperation with operationKindLoad16.
1372
+ //
1373
+ // This corresponds to wasm.OpcodeI32Load16SName wasm.OpcodeI32Load16UName wasm.OpcodeI64Load16SName wasm.OpcodeI64Load16UName.
1374
+ //
1375
+ // The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary,
1376
+ // otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction.
1377
+ func newOperationLoad16(signedInt signedInt, arg memoryArg) unionOperation {
1378
+ return unionOperation{Kind: operationKindLoad16, B1: byte(signedInt), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
1379
+ }
1380
+
1381
+ // NewOperationLoad32 is a constructor for unionOperation with operationKindLoad32.
1382
+ //
1383
+ // This corresponds to wasm.OpcodeI64Load32SName wasm.OpcodeI64Load32UName.
1384
+ //
1385
+ // The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary,
1386
+ // otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction.
1387
+ func newOperationLoad32(signed bool, arg memoryArg) unionOperation {
1388
+ sigB := byte(0)
1389
+ if signed {
1390
+ sigB = 1
1391
+ }
1392
+ return unionOperation{Kind: operationKindLoad32, B1: sigB, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
1393
+ }
1394
+
1395
+ // NewOperationStore is a constructor for unionOperation with operationKindStore.
1396
+ //
1397
+ // # This corresponds to wasm.OpcodeI32StoreName wasm.OpcodeI64StoreName wasm.OpcodeF32StoreName wasm.OpcodeF64StoreName
1398
+ //
1399
+ // The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary,
1400
+ // otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction.
1401
+ func newOperationStore(unsignedType unsignedType, arg memoryArg) unionOperation {
1402
+ return unionOperation{Kind: operationKindStore, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
1403
+ }
1404
+
1405
+ // NewOperationStore8 is a constructor for unionOperation with operationKindStore8.
1406
+ //
1407
+ // # This corresponds to wasm.OpcodeI32Store8Name wasm.OpcodeI64Store8Name
1408
+ //
1409
+ // The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary,
1410
+ // otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction.
1411
+ func newOperationStore8(arg memoryArg) unionOperation {
1412
+ return unionOperation{Kind: operationKindStore8, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
1413
+ }
1414
+
1415
+ // NewOperationStore16 is a constructor for unionOperation with operationKindStore16.
1416
+ //
1417
+ // # This corresponds to wasm.OpcodeI32Store16Name wasm.OpcodeI64Store16Name
1418
+ //
1419
+ // The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary,
1420
+ // otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction.
1421
+ func newOperationStore16(arg memoryArg) unionOperation {
1422
+ return unionOperation{Kind: operationKindStore16, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
1423
+ }
1424
+
1425
+ // NewOperationStore32 is a constructor for unionOperation with operationKindStore32.
1426
+ //
1427
+ // # This corresponds to wasm.OpcodeI64Store32Name
1428
+ //
1429
+ // The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary,
1430
+ // otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction.
1431
+ func newOperationStore32(arg memoryArg) unionOperation {
1432
+ return unionOperation{Kind: operationKindStore32, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
1433
+ }
1434
+
1435
+ // NewOperationMemorySize is a constructor for unionOperation with operationKindMemorySize.
1436
+ //
1437
+ // This corresponds to wasm.OpcodeMemorySize.
1438
+ //
1439
+ // The engines are expected to push the current page size of the memory onto the stack.
1440
+ func newOperationMemorySize() unionOperation {
1441
+ return unionOperation{Kind: operationKindMemorySize}
1442
+ }
1443
+
1444
+ // NewOperationMemoryGrow is a constructor for unionOperation with operationKindMemoryGrow.
1445
+ //
1446
+ // This corresponds to wasm.OpcodeMemoryGrow.
1447
+ //
1448
+ // The engines are expected to pop one value from the top of the stack, then
1449
+ // execute wasm.MemoryInstance Grow with the value, and push the previous
1450
+ // page size of the memory onto the stack.
1451
+ func newOperationMemoryGrow() unionOperation {
1452
+ return unionOperation{Kind: operationKindMemoryGrow}
1453
+ }
1454
+
1455
+ // NewOperationConstI32 is a constructor for unionOperation with OperationConstI32.
1456
+ //
1457
+ // This corresponds to wasm.OpcodeI32Const.
1458
+ func newOperationConstI32(value uint32) unionOperation {
1459
+ return unionOperation{Kind: operationKindConstI32, U1: uint64(value)}
1460
+ }
1461
+
1462
+ // NewOperationConstI64 is a constructor for unionOperation with OperationConstI64.
1463
+ //
1464
+ // This corresponds to wasm.OpcodeI64Const.
1465
+ func newOperationConstI64(value uint64) unionOperation {
1466
+ return unionOperation{Kind: operationKindConstI64, U1: value}
1467
+ }
1468
+
1469
+ // NewOperationConstF32 is a constructor for unionOperation with OperationConstF32.
1470
+ //
1471
+ // This corresponds to wasm.OpcodeF32Const.
1472
+ func newOperationConstF32(value float32) unionOperation {
1473
+ return unionOperation{Kind: operationKindConstF32, U1: uint64(math.Float32bits(value))}
1474
+ }
1475
+
1476
+ // NewOperationConstF64 is a constructor for unionOperation with OperationConstF64.
1477
+ //
1478
+ // This corresponds to wasm.OpcodeF64Const.
1479
+ func newOperationConstF64(value float64) unionOperation {
1480
+ return unionOperation{Kind: operationKindConstF64, U1: math.Float64bits(value)}
1481
+ }
1482
+
1483
+ // NewOperationEq is a constructor for unionOperation with operationKindEq.
1484
+ //
1485
+ // This corresponds to wasm.OpcodeI32EqName wasm.OpcodeI64EqName wasm.OpcodeF32EqName wasm.OpcodeF64EqName
1486
+ func newOperationEq(b unsignedType) unionOperation {
1487
+ return unionOperation{Kind: operationKindEq, B1: byte(b)}
1488
+ }
1489
+
1490
+ // NewOperationNe is a constructor for unionOperation with operationKindNe.
1491
+ //
1492
+ // This corresponds to wasm.OpcodeI32NeName wasm.OpcodeI64NeName wasm.OpcodeF32NeName wasm.OpcodeF64NeName
1493
+ func newOperationNe(b unsignedType) unionOperation {
1494
+ return unionOperation{Kind: operationKindNe, B1: byte(b)}
1495
+ }
1496
+
1497
+ // NewOperationEqz is a constructor for unionOperation with operationKindEqz.
1498
+ //
1499
+ // This corresponds to wasm.OpcodeI32EqzName wasm.OpcodeI64EqzName
1500
+ func newOperationEqz(b unsignedInt) unionOperation {
1501
+ return unionOperation{Kind: operationKindEqz, B1: byte(b)}
1502
+ }
1503
+
1504
+ // NewOperationLt is a constructor for unionOperation with operationKindLt.
1505
+ //
1506
+ // This corresponds to wasm.OpcodeI32LtS wasm.OpcodeI32LtU wasm.OpcodeI64LtS wasm.OpcodeI64LtU wasm.OpcodeF32Lt wasm.OpcodeF64Lt
1507
+ func newOperationLt(b signedType) unionOperation {
1508
+ return unionOperation{Kind: operationKindLt, B1: byte(b)}
1509
+ }
1510
+
1511
+ // NewOperationGt is a constructor for unionOperation with operationKindGt.
1512
+ //
1513
+ // This corresponds to wasm.OpcodeI32GtS wasm.OpcodeI32GtU wasm.OpcodeI64GtS wasm.OpcodeI64GtU wasm.OpcodeF32Gt wasm.OpcodeF64Gt
1514
+ func newOperationGt(b signedType) unionOperation {
1515
+ return unionOperation{Kind: operationKindGt, B1: byte(b)}
1516
+ }
1517
+
1518
+ // NewOperationLe is a constructor for unionOperation with operationKindLe.
1519
+ //
1520
+ // This corresponds to wasm.OpcodeI32LeS wasm.OpcodeI32LeU wasm.OpcodeI64LeS wasm.OpcodeI64LeU wasm.OpcodeF32Le wasm.OpcodeF64Le
1521
+ func newOperationLe(b signedType) unionOperation {
1522
+ return unionOperation{Kind: operationKindLe, B1: byte(b)}
1523
+ }
1524
+
1525
+ // NewOperationGe is a constructor for unionOperation with operationKindGe.
1526
+ //
1527
+ // This corresponds to wasm.OpcodeI32GeS wasm.OpcodeI32GeU wasm.OpcodeI64GeS wasm.OpcodeI64GeU wasm.OpcodeF32Ge wasm.OpcodeF64Ge
1528
+ // NewOperationGe is the constructor for OperationGe
1529
+ func newOperationGe(b signedType) unionOperation {
1530
+ return unionOperation{Kind: operationKindGe, B1: byte(b)}
1531
+ }
1532
+
1533
+ // NewOperationAdd is a constructor for unionOperation with operationKindAdd.
1534
+ //
1535
+ // This corresponds to wasm.OpcodeI32AddName wasm.OpcodeI64AddName wasm.OpcodeF32AddName wasm.OpcodeF64AddName.
1536
+ func newOperationAdd(b unsignedType) unionOperation {
1537
+ return unionOperation{Kind: operationKindAdd, B1: byte(b)}
1538
+ }
1539
+
1540
+ // NewOperationSub is a constructor for unionOperation with operationKindSub.
1541
+ //
1542
+ // This corresponds to wasm.OpcodeI32SubName wasm.OpcodeI64SubName wasm.OpcodeF32SubName wasm.OpcodeF64SubName.
1543
+ func newOperationSub(b unsignedType) unionOperation {
1544
+ return unionOperation{Kind: operationKindSub, B1: byte(b)}
1545
+ }
1546
+
1547
+ // NewOperationMul is a constructor for unionOperation with wperationKindMul.
1548
+ //
1549
+ // This corresponds to wasm.OpcodeI32MulName wasm.OpcodeI64MulName wasm.OpcodeF32MulName wasm.OpcodeF64MulName.
1550
+ // NewOperationMul is the constructor for OperationMul
1551
+ func newOperationMul(b unsignedType) unionOperation {
1552
+ return unionOperation{Kind: operationKindMul, B1: byte(b)}
1553
+ }
1554
+
1555
+ // NewOperationClz is a constructor for unionOperation with operationKindClz.
1556
+ //
1557
+ // This corresponds to wasm.OpcodeI32ClzName wasm.OpcodeI64ClzName.
1558
+ //
1559
+ // The engines are expected to count up the leading zeros in the
1560
+ // current top of the stack, and push the count result.
1561
+ // For example, stack of [..., 0x00_ff_ff_ff] results in [..., 8].
1562
+ // See wasm.OpcodeI32Clz wasm.OpcodeI64Clz
1563
+ func newOperationClz(b unsignedInt) unionOperation {
1564
+ return unionOperation{Kind: operationKindClz, B1: byte(b)}
1565
+ }
1566
+
1567
+ // NewOperationCtz is a constructor for unionOperation with operationKindCtz.
1568
+ //
1569
+ // This corresponds to wasm.OpcodeI32CtzName wasm.OpcodeI64CtzName.
1570
+ //
1571
+ // The engines are expected to count up the trailing zeros in the
1572
+ // current top of the stack, and push the count result.
1573
+ // For example, stack of [..., 0xff_ff_ff_00] results in [..., 8].
1574
+ func newOperationCtz(b unsignedInt) unionOperation {
1575
+ return unionOperation{Kind: operationKindCtz, B1: byte(b)}
1576
+ }
1577
+
1578
+ // NewOperationPopcnt is a constructor for unionOperation with operationKindPopcnt.
1579
+ //
1580
+ // This corresponds to wasm.OpcodeI32PopcntName wasm.OpcodeI64PopcntName.
1581
+ //
1582
+ // The engines are expected to count up the number of set bits in the
1583
+ // current top of the stack, and push the count result.
1584
+ // For example, stack of [..., 0b00_00_00_11] results in [..., 2].
1585
+ func newOperationPopcnt(b unsignedInt) unionOperation {
1586
+ return unionOperation{Kind: operationKindPopcnt, B1: byte(b)}
1587
+ }
1588
+
1589
+ // NewOperationDiv is a constructor for unionOperation with operationKindDiv.
1590
+ //
1591
+ // This corresponds to wasm.OpcodeI32DivS wasm.OpcodeI32DivU wasm.OpcodeI64DivS
1592
+ //
1593
+ // wasm.OpcodeI64DivU wasm.OpcodeF32Div wasm.OpcodeF64Div.
1594
+ func newOperationDiv(b signedType) unionOperation {
1595
+ return unionOperation{Kind: operationKindDiv, B1: byte(b)}
1596
+ }
1597
+
1598
+ // NewOperationRem is a constructor for unionOperation with operationKindRem.
1599
+ //
1600
+ // This corresponds to wasm.OpcodeI32RemS wasm.OpcodeI32RemU wasm.OpcodeI64RemS wasm.OpcodeI64RemU.
1601
+ //
1602
+ // The engines are expected to perform division on the top
1603
+ // two values of integer type on the stack and puts the remainder of the result
1604
+ // onto the stack. For example, stack [..., 10, 3] results in [..., 1] where
1605
+ // the quotient is discarded.
1606
+ // NewOperationRem is the constructor for OperationRem
1607
+ func newOperationRem(b signedInt) unionOperation {
1608
+ return unionOperation{Kind: operationKindRem, B1: byte(b)}
1609
+ }
1610
+
1611
+ // NewOperationAnd is a constructor for unionOperation with operationKindAnd.
1612
+ //
1613
+ // # This corresponds to wasm.OpcodeI32AndName wasm.OpcodeI64AndName
1614
+ //
1615
+ // The engines are expected to perform "And" operation on
1616
+ // top two values on the stack, and pushes the result.
1617
+ func newOperationAnd(b unsignedInt) unionOperation {
1618
+ return unionOperation{Kind: operationKindAnd, B1: byte(b)}
1619
+ }
1620
+
1621
+ // NewOperationOr is a constructor for unionOperation with operationKindOr.
1622
+ //
1623
+ // # This corresponds to wasm.OpcodeI32OrName wasm.OpcodeI64OrName
1624
+ //
1625
+ // The engines are expected to perform "Or" operation on
1626
+ // top two values on the stack, and pushes the result.
1627
+ func newOperationOr(b unsignedInt) unionOperation {
1628
+ return unionOperation{Kind: operationKindOr, B1: byte(b)}
1629
+ }
1630
+
1631
+ // NewOperationXor is a constructor for unionOperation with operationKindXor.
1632
+ //
1633
+ // # This corresponds to wasm.OpcodeI32XorName wasm.OpcodeI64XorName
1634
+ //
1635
+ // The engines are expected to perform "Xor" operation on
1636
+ // top two values on the stack, and pushes the result.
1637
+ func newOperationXor(b unsignedInt) unionOperation {
1638
+ return unionOperation{Kind: operationKindXor, B1: byte(b)}
1639
+ }
1640
+
1641
+ // NewOperationShl is a constructor for unionOperation with operationKindShl.
1642
+ //
1643
+ // # This corresponds to wasm.OpcodeI32ShlName wasm.OpcodeI64ShlName
1644
+ //
1645
+ // The engines are expected to perform "Shl" operation on
1646
+ // top two values on the stack, and pushes the result.
1647
+ func newOperationShl(b unsignedInt) unionOperation {
1648
+ return unionOperation{Kind: operationKindShl, B1: byte(b)}
1649
+ }
1650
+
1651
+ // NewOperationShr is a constructor for unionOperation with operationKindShr.
1652
+ //
1653
+ // # This corresponds to wasm.OpcodeI32ShrSName wasm.OpcodeI32ShrUName wasm.OpcodeI64ShrSName wasm.OpcodeI64ShrUName
1654
+ //
1655
+ // If OperationShr.Type is signed integer, then, the engines are expected to perform arithmetic right shift on the two
1656
+ // top values on the stack, otherwise do the logical right shift.
1657
+ func newOperationShr(b signedInt) unionOperation {
1658
+ return unionOperation{Kind: operationKindShr, B1: byte(b)}
1659
+ }
1660
+
1661
+ // NewOperationRotl is a constructor for unionOperation with operationKindRotl.
1662
+ //
1663
+ // # This corresponds to wasm.OpcodeI32RotlName wasm.OpcodeI64RotlName
1664
+ //
1665
+ // The engines are expected to perform "Rotl" operation on
1666
+ // top two values on the stack, and pushes the result.
1667
+ func newOperationRotl(b unsignedInt) unionOperation {
1668
+ return unionOperation{Kind: operationKindRotl, B1: byte(b)}
1669
+ }
1670
+
1671
+ // NewOperationRotr is a constructor for unionOperation with operationKindRotr.
1672
+ //
1673
+ // # This corresponds to wasm.OpcodeI32RotrName wasm.OpcodeI64RotrName
1674
+ //
1675
+ // The engines are expected to perform "Rotr" operation on
1676
+ // top two values on the stack, and pushes the result.
1677
+ func newOperationRotr(b unsignedInt) unionOperation {
1678
+ return unionOperation{Kind: operationKindRotr, B1: byte(b)}
1679
+ }
1680
+
1681
+ // NewOperationAbs is a constructor for unionOperation with operationKindAbs.
1682
+ //
1683
+ // This corresponds to wasm.OpcodeF32Abs wasm.OpcodeF64Abs
1684
+ func newOperationAbs(b float) unionOperation {
1685
+ return unionOperation{Kind: operationKindAbs, B1: byte(b)}
1686
+ }
1687
+
1688
+ // NewOperationNeg is a constructor for unionOperation with operationKindNeg.
1689
+ //
1690
+ // This corresponds to wasm.OpcodeF32Neg wasm.OpcodeF64Neg
1691
+ func newOperationNeg(b float) unionOperation {
1692
+ return unionOperation{Kind: operationKindNeg, B1: byte(b)}
1693
+ }
1694
+
1695
+ // NewOperationCeil is a constructor for unionOperation with operationKindCeil.
1696
+ //
1697
+ // This corresponds to wasm.OpcodeF32CeilName wasm.OpcodeF64CeilName
1698
+ func newOperationCeil(b float) unionOperation {
1699
+ return unionOperation{Kind: operationKindCeil, B1: byte(b)}
1700
+ }
1701
+
1702
+ // NewOperationFloor is a constructor for unionOperation with operationKindFloor.
1703
+ //
1704
+ // This corresponds to wasm.OpcodeF32FloorName wasm.OpcodeF64FloorName
1705
+ func newOperationFloor(b float) unionOperation {
1706
+ return unionOperation{Kind: operationKindFloor, B1: byte(b)}
1707
+ }
1708
+
1709
+ // NewOperationTrunc is a constructor for unionOperation with operationKindTrunc.
1710
+ //
1711
+ // This corresponds to wasm.OpcodeF32TruncName wasm.OpcodeF64TruncName
1712
+ func newOperationTrunc(b float) unionOperation {
1713
+ return unionOperation{Kind: operationKindTrunc, B1: byte(b)}
1714
+ }
1715
+
1716
+ // NewOperationNearest is a constructor for unionOperation with operationKindNearest.
1717
+ //
1718
+ // # This corresponds to wasm.OpcodeF32NearestName wasm.OpcodeF64NearestName
1719
+ //
1720
+ // Note: this is *not* equivalent to math.Round and instead has the same
1721
+ // the semantics of LLVM's rint intrinsic. See https://llvm.org/docs/LangRef.html#llvm-rint-intrinsic.
1722
+ // For example, math.Round(-4.5) produces -5 while we want to produce -4.
1723
+ func newOperationNearest(b float) unionOperation {
1724
+ return unionOperation{Kind: operationKindNearest, B1: byte(b)}
1725
+ }
1726
+
1727
+ // NewOperationSqrt is a constructor for unionOperation with operationKindSqrt.
1728
+ //
1729
+ // This corresponds to wasm.OpcodeF32SqrtName wasm.OpcodeF64SqrtName
1730
+ func newOperationSqrt(b float) unionOperation {
1731
+ return unionOperation{Kind: operationKindSqrt, B1: byte(b)}
1732
+ }
1733
+
1734
+ // NewOperationMin is a constructor for unionOperation with operationKindMin.
1735
+ //
1736
+ // # This corresponds to wasm.OpcodeF32MinName wasm.OpcodeF64MinName
1737
+ //
1738
+ // The engines are expected to pop two values from the stack, and push back the maximum of
1739
+ // these two values onto the stack. For example, stack [..., 100.1, 1.9] results in [..., 1.9].
1740
+ //
1741
+ // Note: WebAssembly specifies that min/max must always return NaN if one of values is NaN,
1742
+ // which is a different behavior different from math.Min.
1743
+ func newOperationMin(b float) unionOperation {
1744
+ return unionOperation{Kind: operationKindMin, B1: byte(b)}
1745
+ }
1746
+
1747
+ // NewOperationMax is a constructor for unionOperation with operationKindMax.
1748
+ //
1749
+ // # This corresponds to wasm.OpcodeF32MaxName wasm.OpcodeF64MaxName
1750
+ //
1751
+ // The engines are expected to pop two values from the stack, and push back the maximum of
1752
+ // these two values onto the stack. For example, stack [..., 100.1, 1.9] results in [..., 100.1].
1753
+ //
1754
+ // Note: WebAssembly specifies that min/max must always return NaN if one of values is NaN,
1755
+ // which is a different behavior different from math.Max.
1756
+ func newOperationMax(b float) unionOperation {
1757
+ return unionOperation{Kind: operationKindMax, B1: byte(b)}
1758
+ }
1759
+
1760
+ // NewOperationCopysign is a constructor for unionOperation with operationKindCopysign.
1761
+ //
1762
+ // # This corresponds to wasm.OpcodeF32CopysignName wasm.OpcodeF64CopysignName
1763
+ //
1764
+ // The engines are expected to pop two float values from the stack, and copy the signbit of
1765
+ // the first-popped value to the last one.
1766
+ // For example, stack [..., 1.213, -5.0] results in [..., -1.213].
1767
+ func newOperationCopysign(b float) unionOperation {
1768
+ return unionOperation{Kind: operationKindCopysign, B1: byte(b)}
1769
+ }
1770
+
1771
+ // NewOperationI32WrapFromI64 is a constructor for unionOperation with operationKindI32WrapFromI64.
1772
+ //
1773
+ // This corresponds to wasm.OpcodeI32WrapI64 and equivalent to uint64(uint32(v)) in Go.
1774
+ //
1775
+ // The engines are expected to replace the 64-bit int on top of the stack
1776
+ // with the corresponding 32-bit integer.
1777
+ func newOperationI32WrapFromI64() unionOperation {
1778
+ return unionOperation{Kind: operationKindI32WrapFromI64}
1779
+ }
1780
+
1781
+ // NewOperationITruncFromF is a constructor for unionOperation with operationKindITruncFromF.
1782
+ //
1783
+ // This corresponds to
1784
+ //
1785
+ // wasm.OpcodeI32TruncF32SName wasm.OpcodeI32TruncF32UName wasm.OpcodeI32TruncF64SName
1786
+ // wasm.OpcodeI32TruncF64UName wasm.OpcodeI64TruncF32SName wasm.OpcodeI64TruncF32UName wasm.OpcodeI64TruncF64SName
1787
+ // wasm.OpcodeI64TruncF64UName. wasm.OpcodeI32TruncSatF32SName wasm.OpcodeI32TruncSatF32UName
1788
+ // wasm.OpcodeI32TruncSatF64SName wasm.OpcodeI32TruncSatF64UName wasm.OpcodeI64TruncSatF32SName
1789
+ // wasm.OpcodeI64TruncSatF32UName wasm.OpcodeI64TruncSatF64SName wasm.OpcodeI64TruncSatF64UName
1790
+ //
1791
+ // See [1] and [2] for when we encounter undefined behavior in the WebAssembly specification if NewOperationITruncFromF.NonTrapping == false.
1792
+ // To summarize, if the source float value is NaN or doesn't fit in the destination range of integers (incl. +=Inf),
1793
+ // then the runtime behavior is undefined. In wazero, the engines are expected to exit the execution in these undefined cases with
1794
+ // wasmruntime.ErrRuntimeInvalidConversionToInteger error.
1795
+ //
1796
+ // [1] https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#-hrefop-trunc-umathrmtruncmathsfu_m-n-z for unsigned integers.
1797
+ // [2] https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#-hrefop-trunc-smathrmtruncmathsfs_m-n-z for signed integers.
1798
+ //
1799
+ // nonTrapping true if this conversion is "nontrapping" in the sense of the
1800
+ // https://github.com/WebAssembly/spec/blob/ce4b6c4d47eb06098cc7ab2e81f24748da822f20/proposals/nontrapping-float-to-int-conversion/Overview.md
1801
+ func newOperationITruncFromF(inputType float, outputType signedInt, nonTrapping bool) unionOperation {
1802
+ return unionOperation{
1803
+ Kind: operationKindITruncFromF,
1804
+ B1: byte(inputType),
1805
+ B2: byte(outputType),
1806
+ B3: nonTrapping,
1807
+ }
1808
+ }
1809
+
1810
+ // NewOperationFConvertFromI is a constructor for unionOperation with operationKindFConvertFromI.
1811
+ //
1812
+ // This corresponds to
1813
+ //
1814
+ // wasm.OpcodeF32ConvertI32SName wasm.OpcodeF32ConvertI32UName wasm.OpcodeF32ConvertI64SName wasm.OpcodeF32ConvertI64UName
1815
+ // wasm.OpcodeF64ConvertI32SName wasm.OpcodeF64ConvertI32UName wasm.OpcodeF64ConvertI64SName wasm.OpcodeF64ConvertI64UName
1816
+ //
1817
+ // and equivalent to float32(uint32(x)), float32(int32(x)), etc in Go.
1818
+ func newOperationFConvertFromI(inputType signedInt, outputType float) unionOperation {
1819
+ return unionOperation{
1820
+ Kind: operationKindFConvertFromI,
1821
+ B1: byte(inputType),
1822
+ B2: byte(outputType),
1823
+ }
1824
+ }
1825
+
1826
+ // NewOperationF32DemoteFromF64 is a constructor for unionOperation with operationKindF32DemoteFromF64.
1827
+ //
1828
+ // This corresponds to wasm.OpcodeF32DemoteF64 and is equivalent float32(float64(v)).
1829
+ func newOperationF32DemoteFromF64() unionOperation {
1830
+ return unionOperation{Kind: operationKindF32DemoteFromF64}
1831
+ }
1832
+
1833
+ // NewOperationF64PromoteFromF32 is a constructor for unionOperation with operationKindF64PromoteFromF32.
1834
+ //
1835
+ // This corresponds to wasm.OpcodeF64PromoteF32 and is equivalent float64(float32(v)).
1836
+ func newOperationF64PromoteFromF32() unionOperation {
1837
+ return unionOperation{Kind: operationKindF64PromoteFromF32}
1838
+ }
1839
+
1840
+ // NewOperationI32ReinterpretFromF32 is a constructor for unionOperation with operationKindI32ReinterpretFromF32.
1841
+ //
1842
+ // This corresponds to wasm.OpcodeI32ReinterpretF32Name.
1843
+ func newOperationI32ReinterpretFromF32() unionOperation {
1844
+ return unionOperation{Kind: operationKindI32ReinterpretFromF32}
1845
+ }
1846
+
1847
+ // NewOperationI64ReinterpretFromF64 is a constructor for unionOperation with operationKindI64ReinterpretFromF64.
1848
+ //
1849
+ // This corresponds to wasm.OpcodeI64ReinterpretF64Name.
1850
+ func newOperationI64ReinterpretFromF64() unionOperation {
1851
+ return unionOperation{Kind: operationKindI64ReinterpretFromF64}
1852
+ }
1853
+
1854
+ // NewOperationF32ReinterpretFromI32 is a constructor for unionOperation with operationKindF32ReinterpretFromI32.
1855
+ //
1856
+ // This corresponds to wasm.OpcodeF32ReinterpretI32Name.
1857
+ func newOperationF32ReinterpretFromI32() unionOperation {
1858
+ return unionOperation{Kind: operationKindF32ReinterpretFromI32}
1859
+ }
1860
+
1861
+ // NewOperationF64ReinterpretFromI64 is a constructor for unionOperation with operationKindF64ReinterpretFromI64.
1862
+ //
1863
+ // This corresponds to wasm.OpcodeF64ReinterpretI64Name.
1864
+ func newOperationF64ReinterpretFromI64() unionOperation {
1865
+ return unionOperation{Kind: operationKindF64ReinterpretFromI64}
1866
+ }
1867
+
1868
+ // NewOperationExtend is a constructor for unionOperation with operationKindExtend.
1869
+ //
1870
+ // # This corresponds to wasm.OpcodeI64ExtendI32SName wasm.OpcodeI64ExtendI32UName
1871
+ //
1872
+ // The engines are expected to extend the 32-bit signed or unsigned int on top of the stack
1873
+ // as a 64-bit integer of corresponding signedness. For unsigned case, this is just reinterpreting the
1874
+ // underlying bit pattern as 64-bit integer. For signed case, this is sign-extension which preserves the
1875
+ // original integer's sign.
1876
+ func newOperationExtend(signed bool) unionOperation {
1877
+ op := unionOperation{Kind: operationKindExtend}
1878
+ if signed {
1879
+ op.B1 = 1
1880
+ }
1881
+ return op
1882
+ }
1883
+
1884
+ // NewOperationSignExtend32From8 is a constructor for unionOperation with operationKindSignExtend32From8.
1885
+ //
1886
+ // This corresponds to wasm.OpcodeI32Extend8SName.
1887
+ //
1888
+ // The engines are expected to sign-extend the first 8-bits of 32-bit in as signed 32-bit int.
1889
+ func newOperationSignExtend32From8() unionOperation {
1890
+ return unionOperation{Kind: operationKindSignExtend32From8}
1891
+ }
1892
+
1893
+ // NewOperationSignExtend32From16 is a constructor for unionOperation with operationKindSignExtend32From16.
1894
+ //
1895
+ // This corresponds to wasm.OpcodeI32Extend16SName.
1896
+ //
1897
+ // The engines are expected to sign-extend the first 16-bits of 32-bit in as signed 32-bit int.
1898
+ func newOperationSignExtend32From16() unionOperation {
1899
+ return unionOperation{Kind: operationKindSignExtend32From16}
1900
+ }
1901
+
1902
+ // NewOperationSignExtend64From8 is a constructor for unionOperation with operationKindSignExtend64From8.
1903
+ //
1904
+ // This corresponds to wasm.OpcodeI64Extend8SName.
1905
+ //
1906
+ // The engines are expected to sign-extend the first 8-bits of 64-bit in as signed 32-bit int.
1907
+ func newOperationSignExtend64From8() unionOperation {
1908
+ return unionOperation{Kind: operationKindSignExtend64From8}
1909
+ }
1910
+
1911
+ // NewOperationSignExtend64From16 is a constructor for unionOperation with operationKindSignExtend64From16.
1912
+ //
1913
+ // This corresponds to wasm.OpcodeI64Extend16SName.
1914
+ //
1915
+ // The engines are expected to sign-extend the first 16-bits of 64-bit in as signed 32-bit int.
1916
+ func newOperationSignExtend64From16() unionOperation {
1917
+ return unionOperation{Kind: operationKindSignExtend64From16}
1918
+ }
1919
+
1920
+ // NewOperationSignExtend64From32 is a constructor for unionOperation with operationKindSignExtend64From32.
1921
+ //
1922
+ // This corresponds to wasm.OpcodeI64Extend32SName.
1923
+ //
1924
+ // The engines are expected to sign-extend the first 32-bits of 64-bit in as signed 32-bit int.
1925
+ func newOperationSignExtend64From32() unionOperation {
1926
+ return unionOperation{Kind: operationKindSignExtend64From32}
1927
+ }
1928
+
1929
+ // NewOperationMemoryInit is a constructor for unionOperation with operationKindMemoryInit.
1930
+ //
1931
+ // This corresponds to wasm.OpcodeMemoryInitName.
1932
+ //
1933
+ // dataIndex is the index of the data instance in ModuleInstance.DataInstances
1934
+ // by which this operation instantiates a part of the memory.
1935
+ func newOperationMemoryInit(dataIndex uint32) unionOperation {
1936
+ return unionOperation{Kind: operationKindMemoryInit, U1: uint64(dataIndex)}
1937
+ }
1938
+
1939
+ // NewOperationDataDrop implements Operation.
1940
+ //
1941
+ // This corresponds to wasm.OpcodeDataDropName.
1942
+ //
1943
+ // dataIndex is the index of the data instance in ModuleInstance.DataInstances
1944
+ // which this operation drops.
1945
+ func newOperationDataDrop(dataIndex uint32) unionOperation {
1946
+ return unionOperation{Kind: operationKindDataDrop, U1: uint64(dataIndex)}
1947
+ }
1948
+
1949
+ // NewOperationMemoryCopy is a consuctor for unionOperation with operationKindMemoryCopy.
1950
+ //
1951
+ // This corresponds to wasm.OpcodeMemoryCopyName.
1952
+ func newOperationMemoryCopy() unionOperation {
1953
+ return unionOperation{Kind: operationKindMemoryCopy}
1954
+ }
1955
+
1956
+ // NewOperationMemoryFill is a consuctor for unionOperation with operationKindMemoryFill.
1957
+ func newOperationMemoryFill() unionOperation {
1958
+ return unionOperation{Kind: operationKindMemoryFill}
1959
+ }
1960
+
1961
+ // NewOperationTableInit is a constructor for unionOperation with operationKindTableInit.
1962
+ //
1963
+ // This corresponds to wasm.OpcodeTableInitName.
1964
+ //
1965
+ // elemIndex is the index of the element by which this operation initializes a part of the table.
1966
+ // tableIndex is the index of the table on which this operation initialize by the target element.
1967
+ func newOperationTableInit(elemIndex, tableIndex uint32) unionOperation {
1968
+ return unionOperation{Kind: operationKindTableInit, U1: uint64(elemIndex), U2: uint64(tableIndex)}
1969
+ }
1970
+
1971
+ // NewOperationElemDrop is a constructor for unionOperation with operationKindElemDrop.
1972
+ //
1973
+ // This corresponds to wasm.OpcodeElemDropName.
1974
+ //
1975
+ // elemIndex is the index of the element which this operation drops.
1976
+ func newOperationElemDrop(elemIndex uint32) unionOperation {
1977
+ return unionOperation{Kind: operationKindElemDrop, U1: uint64(elemIndex)}
1978
+ }
1979
+
1980
+ // NewOperationTableCopy implements Operation.
1981
+ //
1982
+ // This corresponds to wasm.OpcodeTableCopyName.
1983
+ func newOperationTableCopy(srcTableIndex, dstTableIndex uint32) unionOperation {
1984
+ return unionOperation{Kind: operationKindTableCopy, U1: uint64(srcTableIndex), U2: uint64(dstTableIndex)}
1985
+ }
1986
+
1987
+ // NewOperationRefFunc constructor for unionOperation with operationKindRefFunc.
1988
+ //
1989
+ // This corresponds to wasm.OpcodeRefFuncName, and engines are expected to
1990
+ // push the opaque pointer value of engine specific func for the given FunctionIndex.
1991
+ //
1992
+ // Note: in wazero, we express any reference types (funcref or externref) as opaque pointers which is uint64.
1993
+ // Therefore, the engine implementations emit instructions to push the address of *function onto the stack.
1994
+ func newOperationRefFunc(functionIndex uint32) unionOperation {
1995
+ return unionOperation{Kind: operationKindRefFunc, U1: uint64(functionIndex)}
1996
+ }
1997
+
1998
+ // NewOperationTableGet constructor for unionOperation with operationKindTableGet.
1999
+ //
2000
+ // This corresponds to wasm.OpcodeTableGetName.
2001
+ func newOperationTableGet(tableIndex uint32) unionOperation {
2002
+ return unionOperation{Kind: operationKindTableGet, U1: uint64(tableIndex)}
2003
+ }
2004
+
2005
+ // NewOperationTableSet constructor for unionOperation with operationKindTableSet.
2006
+ //
2007
+ // This corresponds to wasm.OpcodeTableSetName.
2008
+ func newOperationTableSet(tableIndex uint32) unionOperation {
2009
+ return unionOperation{Kind: operationKindTableSet, U1: uint64(tableIndex)}
2010
+ }
2011
+
2012
+ // NewOperationTableSize constructor for unionOperation with operationKindTableSize.
2013
+ //
2014
+ // This corresponds to wasm.OpcodeTableSizeName.
2015
+ func newOperationTableSize(tableIndex uint32) unionOperation {
2016
+ return unionOperation{Kind: operationKindTableSize, U1: uint64(tableIndex)}
2017
+ }
2018
+
2019
+ // NewOperationTableGrow constructor for unionOperation with operationKindTableGrow.
2020
+ //
2021
+ // This corresponds to wasm.OpcodeTableGrowName.
2022
+ func newOperationTableGrow(tableIndex uint32) unionOperation {
2023
+ return unionOperation{Kind: operationKindTableGrow, U1: uint64(tableIndex)}
2024
+ }
2025
+
2026
+ // NewOperationTableFill constructor for unionOperation with operationKindTableFill.
2027
+ //
2028
+ // This corresponds to wasm.OpcodeTableFillName.
2029
+ func newOperationTableFill(tableIndex uint32) unionOperation {
2030
+ return unionOperation{Kind: operationKindTableFill, U1: uint64(tableIndex)}
2031
+ }
2032
+
2033
+ // NewOperationV128Const constructor for unionOperation with operationKindV128Const
2034
+ func newOperationV128Const(lo, hi uint64) unionOperation {
2035
+ return unionOperation{Kind: operationKindV128Const, U1: lo, U2: hi}
2036
+ }
2037
+
2038
+ // shape corresponds to a shape of v128 values.
2039
+ // https://webassembly.github.io/spec/core/syntax/instructions.html#syntax-shape
2040
+ type shape = byte
2041
+
2042
+ const (
2043
+ shapeI8x16 shape = iota
2044
+ shapeI16x8
2045
+ shapeI32x4
2046
+ shapeI64x2
2047
+ shapeF32x4
2048
+ shapeF64x2
2049
+ )
2050
+
2051
+ func shapeName(s shape) (ret string) {
2052
+ switch s {
2053
+ case shapeI8x16:
2054
+ ret = "I8x16"
2055
+ case shapeI16x8:
2056
+ ret = "I16x8"
2057
+ case shapeI32x4:
2058
+ ret = "I32x4"
2059
+ case shapeI64x2:
2060
+ ret = "I64x2"
2061
+ case shapeF32x4:
2062
+ ret = "F32x4"
2063
+ case shapeF64x2:
2064
+ ret = "F64x2"
2065
+ }
2066
+ return
2067
+ }
2068
+
2069
+ // NewOperationV128Add constructor for unionOperation with operationKindV128Add.
2070
+ //
2071
+ // This corresponds to wasm.OpcodeVecI8x16AddName wasm.OpcodeVecI16x8AddName wasm.OpcodeVecI32x4AddName
2072
+ //
2073
+ // wasm.OpcodeVecI64x2AddName wasm.OpcodeVecF32x4AddName wasm.OpcodeVecF64x2AddName
2074
+ func newOperationV128Add(shape shape) unionOperation {
2075
+ return unionOperation{Kind: operationKindV128Add, B1: shape}
2076
+ }
2077
+
2078
+ // NewOperationV128Sub constructor for unionOperation with operationKindV128Sub.
2079
+ //
2080
+ // This corresponds to wasm.OpcodeVecI8x16SubName wasm.OpcodeVecI16x8SubName wasm.OpcodeVecI32x4SubName
2081
+ //
2082
+ // wasm.OpcodeVecI64x2SubName wasm.OpcodeVecF32x4SubName wasm.OpcodeVecF64x2SubName
2083
+ func newOperationV128Sub(shape shape) unionOperation {
2084
+ return unionOperation{Kind: operationKindV128Sub, B1: shape}
2085
+ }
2086
+
2087
+ // v128LoadType represents a type of wasm.OpcodeVecV128Load* instructions.
2088
+ type v128LoadType = byte
2089
+
2090
+ const (
2091
+ // v128LoadType128 corresponds to wasm.OpcodeVecV128LoadName.
2092
+ v128LoadType128 v128LoadType = iota
2093
+ // v128LoadType8x8s corresponds to wasm.OpcodeVecV128Load8x8SName.
2094
+ v128LoadType8x8s
2095
+ // v128LoadType8x8u corresponds to wasm.OpcodeVecV128Load8x8UName.
2096
+ v128LoadType8x8u
2097
+ // v128LoadType16x4s corresponds to wasm.OpcodeVecV128Load16x4SName
2098
+ v128LoadType16x4s
2099
+ // v128LoadType16x4u corresponds to wasm.OpcodeVecV128Load16x4UName
2100
+ v128LoadType16x4u
2101
+ // v128LoadType32x2s corresponds to wasm.OpcodeVecV128Load32x2SName
2102
+ v128LoadType32x2s
2103
+ // v128LoadType32x2u corresponds to wasm.OpcodeVecV128Load32x2UName
2104
+ v128LoadType32x2u
2105
+ // v128LoadType8Splat corresponds to wasm.OpcodeVecV128Load8SplatName
2106
+ v128LoadType8Splat
2107
+ // v128LoadType16Splat corresponds to wasm.OpcodeVecV128Load16SplatName
2108
+ v128LoadType16Splat
2109
+ // v128LoadType32Splat corresponds to wasm.OpcodeVecV128Load32SplatName
2110
+ v128LoadType32Splat
2111
+ // v128LoadType64Splat corresponds to wasm.OpcodeVecV128Load64SplatName
2112
+ v128LoadType64Splat
2113
+ // v128LoadType32zero corresponds to wasm.OpcodeVecV128Load32zeroName
2114
+ v128LoadType32zero
2115
+ // v128LoadType64zero corresponds to wasm.OpcodeVecV128Load64zeroName
2116
+ v128LoadType64zero
2117
+ )
2118
+
2119
+ // NewOperationV128Load is a constructor for unionOperation with operationKindV128Load.
2120
+ //
2121
+ // This corresponds to
2122
+ //
2123
+ // wasm.OpcodeVecV128LoadName wasm.OpcodeVecV128Load8x8SName wasm.OpcodeVecV128Load8x8UName
2124
+ // wasm.OpcodeVecV128Load16x4SName wasm.OpcodeVecV128Load16x4UName wasm.OpcodeVecV128Load32x2SName
2125
+ // wasm.OpcodeVecV128Load32x2UName wasm.OpcodeVecV128Load8SplatName wasm.OpcodeVecV128Load16SplatName
2126
+ // wasm.OpcodeVecV128Load32SplatName wasm.OpcodeVecV128Load64SplatName wasm.OpcodeVecV128Load32zeroName
2127
+ // wasm.OpcodeVecV128Load64zeroName
2128
+ func newOperationV128Load(loadType v128LoadType, arg memoryArg) unionOperation {
2129
+ return unionOperation{Kind: operationKindV128Load, B1: loadType, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2130
+ }
2131
+
2132
+ // NewOperationV128LoadLane is a constructor for unionOperation with operationKindV128LoadLane.
2133
+ //
2134
+ // This corresponds to wasm.OpcodeVecV128Load8LaneName wasm.OpcodeVecV128Load16LaneName
2135
+ //
2136
+ // wasm.OpcodeVecV128Load32LaneName wasm.OpcodeVecV128Load64LaneName.
2137
+ //
2138
+ // laneIndex is >=0 && <(128/LaneSize).
2139
+ // laneSize is either 8, 16, 32, or 64.
2140
+ func newOperationV128LoadLane(laneIndex, laneSize byte, arg memoryArg) unionOperation {
2141
+ return unionOperation{Kind: operationKindV128LoadLane, B1: laneSize, B2: laneIndex, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2142
+ }
2143
+
2144
+ // NewOperationV128Store is a constructor for unionOperation with operationKindV128Store.
2145
+ //
2146
+ // This corresponds to wasm.OpcodeVecV128Load8LaneName wasm.OpcodeVecV128Load16LaneName
2147
+ //
2148
+ // wasm.OpcodeVecV128Load32LaneName wasm.OpcodeVecV128Load64LaneName.
2149
+ func newOperationV128Store(arg memoryArg) unionOperation {
2150
+ return unionOperation{
2151
+ Kind: operationKindV128Store,
2152
+ U1: uint64(arg.Alignment),
2153
+ U2: uint64(arg.Offset),
2154
+ }
2155
+ }
2156
+
2157
+ // NewOperationV128StoreLane implements Operation.
2158
+ //
2159
+ // This corresponds to wasm.OpcodeVecV128Load8LaneName wasm.OpcodeVecV128Load16LaneName
2160
+ //
2161
+ // wasm.OpcodeVecV128Load32LaneName wasm.OpcodeVecV128Load64LaneName.
2162
+ //
2163
+ // laneIndex is >=0 && <(128/LaneSize).
2164
+ // laneSize is either 8, 16, 32, or 64.
2165
+ func newOperationV128StoreLane(laneIndex byte, laneSize byte, arg memoryArg) unionOperation {
2166
+ return unionOperation{
2167
+ Kind: operationKindV128StoreLane,
2168
+ B1: laneSize,
2169
+ B2: laneIndex,
2170
+ U1: uint64(arg.Alignment),
2171
+ U2: uint64(arg.Offset),
2172
+ }
2173
+ }
2174
+
2175
+ // NewOperationV128ExtractLane is a constructor for unionOperation with operationKindV128ExtractLane.
2176
+ //
2177
+ // This corresponds to
2178
+ //
2179
+ // wasm.OpcodeVecI8x16ExtractLaneSName wasm.OpcodeVecI8x16ExtractLaneUName
2180
+ // wasm.OpcodeVecI16x8ExtractLaneSName wasm.OpcodeVecI16x8ExtractLaneUName
2181
+ // wasm.OpcodeVecI32x4ExtractLaneName wasm.OpcodeVecI64x2ExtractLaneName
2182
+ // wasm.OpcodeVecF32x4ExtractLaneName wasm.OpcodeVecF64x2ExtractLaneName.
2183
+ //
2184
+ // laneIndex is >=0 && <M where shape = NxM.
2185
+ // signed is used when shape is either i8x16 or i16x2 to specify whether to sign-extend or not.
2186
+ func newOperationV128ExtractLane(laneIndex byte, signed bool, shape shape) unionOperation {
2187
+ return unionOperation{
2188
+ Kind: operationKindV128ExtractLane,
2189
+ B1: shape,
2190
+ B2: laneIndex,
2191
+ B3: signed,
2192
+ }
2193
+ }
2194
+
2195
+ // NewOperationV128ReplaceLane is a constructor for unionOperation with operationKindV128ReplaceLane.
2196
+ //
2197
+ // This corresponds to
2198
+ //
2199
+ // wasm.OpcodeVecI8x16ReplaceLaneName wasm.OpcodeVecI16x8ReplaceLaneName
2200
+ // wasm.OpcodeVecI32x4ReplaceLaneName wasm.OpcodeVecI64x2ReplaceLaneName
2201
+ // wasm.OpcodeVecF32x4ReplaceLaneName wasm.OpcodeVecF64x2ReplaceLaneName.
2202
+ //
2203
+ // laneIndex is >=0 && <M where shape = NxM.
2204
+ func newOperationV128ReplaceLane(laneIndex byte, shape shape) unionOperation {
2205
+ return unionOperation{Kind: operationKindV128ReplaceLane, B1: shape, B2: laneIndex}
2206
+ }
2207
+
2208
+ // NewOperationV128Splat is a constructor for unionOperation with operationKindV128Splat.
2209
+ //
2210
+ // This corresponds to
2211
+ //
2212
+ // wasm.OpcodeVecI8x16SplatName wasm.OpcodeVecI16x8SplatName
2213
+ // wasm.OpcodeVecI32x4SplatName wasm.OpcodeVecI64x2SplatName
2214
+ // wasm.OpcodeVecF32x4SplatName wasm.OpcodeVecF64x2SplatName.
2215
+ func newOperationV128Splat(shape shape) unionOperation {
2216
+ return unionOperation{Kind: operationKindV128Splat, B1: shape}
2217
+ }
2218
+
2219
+ // NewOperationV128Shuffle is a constructor for unionOperation with operationKindV128Shuffle.
2220
+ func newOperationV128Shuffle(lanes []uint64) unionOperation {
2221
+ return unionOperation{Kind: operationKindV128Shuffle, Us: lanes}
2222
+ }
2223
+
2224
+ // NewOperationV128Swizzle is a constructor for unionOperation with operationKindV128Swizzle.
2225
+ //
2226
+ // This corresponds to wasm.OpcodeVecI8x16SwizzleName.
2227
+ func newOperationV128Swizzle() unionOperation {
2228
+ return unionOperation{Kind: operationKindV128Swizzle}
2229
+ }
2230
+
2231
+ // NewOperationV128AnyTrue is a constructor for unionOperation with operationKindV128AnyTrue.
2232
+ //
2233
+ // This corresponds to wasm.OpcodeVecV128AnyTrueName.
2234
+ func newOperationV128AnyTrue() unionOperation {
2235
+ return unionOperation{Kind: operationKindV128AnyTrue}
2236
+ }
2237
+
2238
+ // NewOperationV128AllTrue is a constructor for unionOperation with operationKindV128AllTrue.
2239
+ //
2240
+ // This corresponds to
2241
+ //
2242
+ // wasm.OpcodeVecI8x16AllTrueName wasm.OpcodeVecI16x8AllTrueName
2243
+ // wasm.OpcodeVecI32x4AllTrueName wasm.OpcodeVecI64x2AllTrueName.
2244
+ func newOperationV128AllTrue(shape shape) unionOperation {
2245
+ return unionOperation{Kind: operationKindV128AllTrue, B1: shape}
2246
+ }
2247
+
2248
+ // NewOperationV128BitMask is a constructor for unionOperation with operationKindV128BitMask.
2249
+ //
2250
+ // This corresponds to
2251
+ //
2252
+ // wasm.OpcodeVecI8x16BitMaskName wasm.OpcodeVecI16x8BitMaskName
2253
+ // wasm.OpcodeVecI32x4BitMaskName wasm.OpcodeVecI64x2BitMaskName.
2254
+ func newOperationV128BitMask(shape shape) unionOperation {
2255
+ return unionOperation{Kind: operationKindV128BitMask, B1: shape}
2256
+ }
2257
+
2258
+ // NewOperationV128And is a constructor for unionOperation with operationKindV128And.
2259
+ //
2260
+ // This corresponds to wasm.OpcodeVecV128And.
2261
+ func newOperationV128And() unionOperation {
2262
+ return unionOperation{Kind: operationKindV128And}
2263
+ }
2264
+
2265
+ // NewOperationV128Not is a constructor for unionOperation with operationKindV128Not.
2266
+ //
2267
+ // This corresponds to wasm.OpcodeVecV128Not.
2268
+ func newOperationV128Not() unionOperation {
2269
+ return unionOperation{Kind: operationKindV128Not}
2270
+ }
2271
+
2272
+ // NewOperationV128Or is a constructor for unionOperation with operationKindV128Or.
2273
+ //
2274
+ // This corresponds to wasm.OpcodeVecV128Or.
2275
+ func newOperationV128Or() unionOperation {
2276
+ return unionOperation{Kind: operationKindV128Or}
2277
+ }
2278
+
2279
+ // NewOperationV128Xor is a constructor for unionOperation with operationKindV128Xor.
2280
+ //
2281
+ // This corresponds to wasm.OpcodeVecV128Xor.
2282
+ func newOperationV128Xor() unionOperation {
2283
+ return unionOperation{Kind: operationKindV128Xor}
2284
+ }
2285
+
2286
+ // NewOperationV128Bitselect is a constructor for unionOperation with operationKindV128Bitselect.
2287
+ //
2288
+ // This corresponds to wasm.OpcodeVecV128Bitselect.
2289
+ func newOperationV128Bitselect() unionOperation {
2290
+ return unionOperation{Kind: operationKindV128Bitselect}
2291
+ }
2292
+
2293
+ // NewOperationV128AndNot is a constructor for unionOperation with operationKindV128AndNot.
2294
+ //
2295
+ // This corresponds to wasm.OpcodeVecV128AndNot.
2296
+ func newOperationV128AndNot() unionOperation {
2297
+ return unionOperation{Kind: operationKindV128AndNot}
2298
+ }
2299
+
2300
+ // NewOperationV128Shl is a constructor for unionOperation with operationKindV128Shl.
2301
+ //
2302
+ // This corresponds to
2303
+ //
2304
+ // wasm.OpcodeVecI8x16ShlName wasm.OpcodeVecI16x8ShlName
2305
+ // wasm.OpcodeVecI32x4ShlName wasm.OpcodeVecI64x2ShlName
2306
+ func newOperationV128Shl(shape shape) unionOperation {
2307
+ return unionOperation{Kind: operationKindV128Shl, B1: shape}
2308
+ }
2309
+
2310
+ // NewOperationV128Shr is a constructor for unionOperation with operationKindV128Shr.
2311
+ //
2312
+ // This corresponds to
2313
+ //
2314
+ // wasm.OpcodeVecI8x16ShrSName wasm.OpcodeVecI8x16ShrUName wasm.OpcodeVecI16x8ShrSName
2315
+ // wasm.OpcodeVecI16x8ShrUName wasm.OpcodeVecI32x4ShrSName wasm.OpcodeVecI32x4ShrUName.
2316
+ // wasm.OpcodeVecI64x2ShrSName wasm.OpcodeVecI64x2ShrUName.
2317
+ func newOperationV128Shr(shape shape, signed bool) unionOperation {
2318
+ return unionOperation{Kind: operationKindV128Shr, B1: shape, B3: signed}
2319
+ }
2320
+
2321
+ // NewOperationV128Cmp is a constructor for unionOperation with operationKindV128Cmp.
2322
+ //
2323
+ // This corresponds to
2324
+ //
2325
+ // wasm.OpcodeVecI8x16EqName, wasm.OpcodeVecI8x16NeName, wasm.OpcodeVecI8x16LtSName, wasm.OpcodeVecI8x16LtUName, wasm.OpcodeVecI8x16GtSName,
2326
+ // wasm.OpcodeVecI8x16GtUName, wasm.OpcodeVecI8x16LeSName, wasm.OpcodeVecI8x16LeUName, wasm.OpcodeVecI8x16GeSName, wasm.OpcodeVecI8x16GeUName,
2327
+ // wasm.OpcodeVecI16x8EqName, wasm.OpcodeVecI16x8NeName, wasm.OpcodeVecI16x8LtSName, wasm.OpcodeVecI16x8LtUName, wasm.OpcodeVecI16x8GtSName,
2328
+ // wasm.OpcodeVecI16x8GtUName, wasm.OpcodeVecI16x8LeSName, wasm.OpcodeVecI16x8LeUName, wasm.OpcodeVecI16x8GeSName, wasm.OpcodeVecI16x8GeUName,
2329
+ // wasm.OpcodeVecI32x4EqName, wasm.OpcodeVecI32x4NeName, wasm.OpcodeVecI32x4LtSName, wasm.OpcodeVecI32x4LtUName, wasm.OpcodeVecI32x4GtSName,
2330
+ // wasm.OpcodeVecI32x4GtUName, wasm.OpcodeVecI32x4LeSName, wasm.OpcodeVecI32x4LeUName, wasm.OpcodeVecI32x4GeSName, wasm.OpcodeVecI32x4GeUName,
2331
+ // wasm.OpcodeVecI64x2EqName, wasm.OpcodeVecI64x2NeName, wasm.OpcodeVecI64x2LtSName, wasm.OpcodeVecI64x2GtSName, wasm.OpcodeVecI64x2LeSName,
2332
+ // wasm.OpcodeVecI64x2GeSName, wasm.OpcodeVecF32x4EqName, wasm.OpcodeVecF32x4NeName, wasm.OpcodeVecF32x4LtName, wasm.OpcodeVecF32x4GtName,
2333
+ // wasm.OpcodeVecF32x4LeName, wasm.OpcodeVecF32x4GeName, wasm.OpcodeVecF64x2EqName, wasm.OpcodeVecF64x2NeName, wasm.OpcodeVecF64x2LtName,
2334
+ // wasm.OpcodeVecF64x2GtName, wasm.OpcodeVecF64x2LeName, wasm.OpcodeVecF64x2GeName
2335
+ func newOperationV128Cmp(cmpType v128CmpType) unionOperation {
2336
+ return unionOperation{Kind: operationKindV128Cmp, B1: cmpType}
2337
+ }
2338
+
2339
+ // v128CmpType represents a type of vector comparison operation.
2340
+ type v128CmpType = byte
2341
+
2342
+ const (
2343
+ // v128CmpTypeI8x16Eq corresponds to wasm.OpcodeVecI8x16EqName.
2344
+ v128CmpTypeI8x16Eq v128CmpType = iota
2345
+ // v128CmpTypeI8x16Ne corresponds to wasm.OpcodeVecI8x16NeName.
2346
+ v128CmpTypeI8x16Ne
2347
+ // v128CmpTypeI8x16LtS corresponds to wasm.OpcodeVecI8x16LtSName.
2348
+ v128CmpTypeI8x16LtS
2349
+ // v128CmpTypeI8x16LtU corresponds to wasm.OpcodeVecI8x16LtUName.
2350
+ v128CmpTypeI8x16LtU
2351
+ // v128CmpTypeI8x16GtS corresponds to wasm.OpcodeVecI8x16GtSName.
2352
+ v128CmpTypeI8x16GtS
2353
+ // v128CmpTypeI8x16GtU corresponds to wasm.OpcodeVecI8x16GtUName.
2354
+ v128CmpTypeI8x16GtU
2355
+ // v128CmpTypeI8x16LeS corresponds to wasm.OpcodeVecI8x16LeSName.
2356
+ v128CmpTypeI8x16LeS
2357
+ // v128CmpTypeI8x16LeU corresponds to wasm.OpcodeVecI8x16LeUName.
2358
+ v128CmpTypeI8x16LeU
2359
+ // v128CmpTypeI8x16GeS corresponds to wasm.OpcodeVecI8x16GeSName.
2360
+ v128CmpTypeI8x16GeS
2361
+ // v128CmpTypeI8x16GeU corresponds to wasm.OpcodeVecI8x16GeUName.
2362
+ v128CmpTypeI8x16GeU
2363
+ // v128CmpTypeI16x8Eq corresponds to wasm.OpcodeVecI16x8EqName.
2364
+ v128CmpTypeI16x8Eq
2365
+ // v128CmpTypeI16x8Ne corresponds to wasm.OpcodeVecI16x8NeName.
2366
+ v128CmpTypeI16x8Ne
2367
+ // v128CmpTypeI16x8LtS corresponds to wasm.OpcodeVecI16x8LtSName.
2368
+ v128CmpTypeI16x8LtS
2369
+ // v128CmpTypeI16x8LtU corresponds to wasm.OpcodeVecI16x8LtUName.
2370
+ v128CmpTypeI16x8LtU
2371
+ // v128CmpTypeI16x8GtS corresponds to wasm.OpcodeVecI16x8GtSName.
2372
+ v128CmpTypeI16x8GtS
2373
+ // v128CmpTypeI16x8GtU corresponds to wasm.OpcodeVecI16x8GtUName.
2374
+ v128CmpTypeI16x8GtU
2375
+ // v128CmpTypeI16x8LeS corresponds to wasm.OpcodeVecI16x8LeSName.
2376
+ v128CmpTypeI16x8LeS
2377
+ // v128CmpTypeI16x8LeU corresponds to wasm.OpcodeVecI16x8LeUName.
2378
+ v128CmpTypeI16x8LeU
2379
+ // v128CmpTypeI16x8GeS corresponds to wasm.OpcodeVecI16x8GeSName.
2380
+ v128CmpTypeI16x8GeS
2381
+ // v128CmpTypeI16x8GeU corresponds to wasm.OpcodeVecI16x8GeUName.
2382
+ v128CmpTypeI16x8GeU
2383
+ // v128CmpTypeI32x4Eq corresponds to wasm.OpcodeVecI32x4EqName.
2384
+ v128CmpTypeI32x4Eq
2385
+ // v128CmpTypeI32x4Ne corresponds to wasm.OpcodeVecI32x4NeName.
2386
+ v128CmpTypeI32x4Ne
2387
+ // v128CmpTypeI32x4LtS corresponds to wasm.OpcodeVecI32x4LtSName.
2388
+ v128CmpTypeI32x4LtS
2389
+ // v128CmpTypeI32x4LtU corresponds to wasm.OpcodeVecI32x4LtUName.
2390
+ v128CmpTypeI32x4LtU
2391
+ // v128CmpTypeI32x4GtS corresponds to wasm.OpcodeVecI32x4GtSName.
2392
+ v128CmpTypeI32x4GtS
2393
+ // v128CmpTypeI32x4GtU corresponds to wasm.OpcodeVecI32x4GtUName.
2394
+ v128CmpTypeI32x4GtU
2395
+ // v128CmpTypeI32x4LeS corresponds to wasm.OpcodeVecI32x4LeSName.
2396
+ v128CmpTypeI32x4LeS
2397
+ // v128CmpTypeI32x4LeU corresponds to wasm.OpcodeVecI32x4LeUName.
2398
+ v128CmpTypeI32x4LeU
2399
+ // v128CmpTypeI32x4GeS corresponds to wasm.OpcodeVecI32x4GeSName.
2400
+ v128CmpTypeI32x4GeS
2401
+ // v128CmpTypeI32x4GeU corresponds to wasm.OpcodeVecI32x4GeUName.
2402
+ v128CmpTypeI32x4GeU
2403
+ // v128CmpTypeI64x2Eq corresponds to wasm.OpcodeVecI64x2EqName.
2404
+ v128CmpTypeI64x2Eq
2405
+ // v128CmpTypeI64x2Ne corresponds to wasm.OpcodeVecI64x2NeName.
2406
+ v128CmpTypeI64x2Ne
2407
+ // v128CmpTypeI64x2LtS corresponds to wasm.OpcodeVecI64x2LtSName.
2408
+ v128CmpTypeI64x2LtS
2409
+ // v128CmpTypeI64x2GtS corresponds to wasm.OpcodeVecI64x2GtSName.
2410
+ v128CmpTypeI64x2GtS
2411
+ // v128CmpTypeI64x2LeS corresponds to wasm.OpcodeVecI64x2LeSName.
2412
+ v128CmpTypeI64x2LeS
2413
+ // v128CmpTypeI64x2GeS corresponds to wasm.OpcodeVecI64x2GeSName.
2414
+ v128CmpTypeI64x2GeS
2415
+ // v128CmpTypeF32x4Eq corresponds to wasm.OpcodeVecF32x4EqName.
2416
+ v128CmpTypeF32x4Eq
2417
+ // v128CmpTypeF32x4Ne corresponds to wasm.OpcodeVecF32x4NeName.
2418
+ v128CmpTypeF32x4Ne
2419
+ // v128CmpTypeF32x4Lt corresponds to wasm.OpcodeVecF32x4LtName.
2420
+ v128CmpTypeF32x4Lt
2421
+ // v128CmpTypeF32x4Gt corresponds to wasm.OpcodeVecF32x4GtName.
2422
+ v128CmpTypeF32x4Gt
2423
+ // v128CmpTypeF32x4Le corresponds to wasm.OpcodeVecF32x4LeName.
2424
+ v128CmpTypeF32x4Le
2425
+ // v128CmpTypeF32x4Ge corresponds to wasm.OpcodeVecF32x4GeName.
2426
+ v128CmpTypeF32x4Ge
2427
+ // v128CmpTypeF64x2Eq corresponds to wasm.OpcodeVecF64x2EqName.
2428
+ v128CmpTypeF64x2Eq
2429
+ // v128CmpTypeF64x2Ne corresponds to wasm.OpcodeVecF64x2NeName.
2430
+ v128CmpTypeF64x2Ne
2431
+ // v128CmpTypeF64x2Lt corresponds to wasm.OpcodeVecF64x2LtName.
2432
+ v128CmpTypeF64x2Lt
2433
+ // v128CmpTypeF64x2Gt corresponds to wasm.OpcodeVecF64x2GtName.
2434
+ v128CmpTypeF64x2Gt
2435
+ // v128CmpTypeF64x2Le corresponds to wasm.OpcodeVecF64x2LeName.
2436
+ v128CmpTypeF64x2Le
2437
+ // v128CmpTypeF64x2Ge corresponds to wasm.OpcodeVecF64x2GeName.
2438
+ v128CmpTypeF64x2Ge
2439
+ )
2440
+
2441
+ // NewOperationV128AddSat is a constructor for unionOperation with operationKindV128AddSat.
2442
+ //
2443
+ // This corresponds to wasm.OpcodeVecI8x16AddSatUName wasm.OpcodeVecI8x16AddSatSName
2444
+ //
2445
+ // wasm.OpcodeVecI16x8AddSatUName wasm.OpcodeVecI16x8AddSatSName
2446
+ //
2447
+ // shape is either shapeI8x16 or shapeI16x8.
2448
+ func newOperationV128AddSat(shape shape, signed bool) unionOperation {
2449
+ return unionOperation{Kind: operationKindV128AddSat, B1: shape, B3: signed}
2450
+ }
2451
+
2452
+ // NewOperationV128SubSat is a constructor for unionOperation with operationKindV128SubSat.
2453
+ //
2454
+ // This corresponds to wasm.OpcodeVecI8x16SubSatUName wasm.OpcodeVecI8x16SubSatSName
2455
+ //
2456
+ // wasm.OpcodeVecI16x8SubSatUName wasm.OpcodeVecI16x8SubSatSName
2457
+ //
2458
+ // shape is either shapeI8x16 or shapeI16x8.
2459
+ func newOperationV128SubSat(shape shape, signed bool) unionOperation {
2460
+ return unionOperation{Kind: operationKindV128SubSat, B1: shape, B3: signed}
2461
+ }
2462
+
2463
+ // NewOperationV128Mul is a constructor for unionOperation with operationKindV128Mul
2464
+ //
2465
+ // This corresponds to wasm.OpcodeVecF32x4MulName wasm.OpcodeVecF64x2MulName
2466
+ //
2467
+ // wasm.OpcodeVecI16x8MulName wasm.OpcodeVecI32x4MulName wasm.OpcodeVecI64x2MulName.
2468
+ // shape is either shapeI16x8, shapeI32x4, shapeI64x2, shapeF32x4 or shapeF64x2.
2469
+ func newOperationV128Mul(shape shape) unionOperation {
2470
+ return unionOperation{Kind: operationKindV128Mul, B1: shape}
2471
+ }
2472
+
2473
+ // NewOperationV128Div is a constructor for unionOperation with operationKindV128Div.
2474
+ //
2475
+ // This corresponds to wasm.OpcodeVecF32x4DivName wasm.OpcodeVecF64x2DivName.
2476
+ // shape is either shapeF32x4 or shapeF64x2.
2477
+ func newOperationV128Div(shape shape) unionOperation {
2478
+ return unionOperation{Kind: operationKindV128Div, B1: shape}
2479
+ }
2480
+
2481
+ // NewOperationV128Neg is a constructor for unionOperation with operationKindV128Neg.
2482
+ //
2483
+ // This corresponds to wasm.OpcodeVecI8x16NegName wasm.OpcodeVecI16x8NegName wasm.OpcodeVecI32x4NegName
2484
+ //
2485
+ // wasm.OpcodeVecI64x2NegName wasm.OpcodeVecF32x4NegName wasm.OpcodeVecF64x2NegName.
2486
+ func newOperationV128Neg(shape shape) unionOperation {
2487
+ return unionOperation{Kind: operationKindV128Neg, B1: shape}
2488
+ }
2489
+
2490
+ // NewOperationV128Sqrt is a constructor for unionOperation with 128operationKindV128Sqrt.
2491
+ //
2492
+ // shape is either shapeF32x4 or shapeF64x2.
2493
+ // This corresponds to wasm.OpcodeVecF32x4SqrtName wasm.OpcodeVecF64x2SqrtName.
2494
+ func newOperationV128Sqrt(shape shape) unionOperation {
2495
+ return unionOperation{Kind: operationKindV128Sqrt, B1: shape}
2496
+ }
2497
+
2498
+ // NewOperationV128Abs is a constructor for unionOperation with operationKindV128Abs.
2499
+ //
2500
+ // This corresponds to wasm.OpcodeVecI8x16AbsName wasm.OpcodeVecI16x8AbsName wasm.OpcodeVecI32x4AbsName
2501
+ //
2502
+ // wasm.OpcodeVecI64x2AbsName wasm.OpcodeVecF32x4AbsName wasm.OpcodeVecF64x2AbsName.
2503
+ func newOperationV128Abs(shape shape) unionOperation {
2504
+ return unionOperation{Kind: operationKindV128Abs, B1: shape}
2505
+ }
2506
+
2507
+ // NewOperationV128Popcnt is a constructor for unionOperation with operationKindV128Popcnt.
2508
+ //
2509
+ // This corresponds to wasm.OpcodeVecI8x16PopcntName.
2510
+ func newOperationV128Popcnt(shape shape) unionOperation {
2511
+ return unionOperation{Kind: operationKindV128Popcnt, B1: shape}
2512
+ }
2513
+
2514
+ // NewOperationV128Min is a constructor for unionOperation with operationKindV128Min.
2515
+ //
2516
+ // This corresponds to
2517
+ //
2518
+ // wasm.OpcodeVecI8x16MinSName wasm.OpcodeVecI8x16MinUName wasm.OpcodeVecI16x8MinSName wasm.OpcodeVecI16x8MinUName
2519
+ // wasm.OpcodeVecI32x4MinSName wasm.OpcodeVecI32x4MinUName wasm.OpcodeVecI16x8MinSName wasm.OpcodeVecI16x8MinUName
2520
+ // wasm.OpcodeVecF32x4MinName wasm.OpcodeVecF64x2MinName
2521
+ func newOperationV128Min(shape shape, signed bool) unionOperation {
2522
+ return unionOperation{Kind: operationKindV128Min, B1: shape, B3: signed}
2523
+ }
2524
+
2525
+ // NewOperationV128Max is a constructor for unionOperation with operationKindV128Max.
2526
+ //
2527
+ // This corresponds to
2528
+ //
2529
+ // wasm.OpcodeVecI8x16MaxSName wasm.OpcodeVecI8x16MaxUName wasm.OpcodeVecI16x8MaxSName wasm.OpcodeVecI16x8MaxUName
2530
+ // wasm.OpcodeVecI32x4MaxSName wasm.OpcodeVecI32x4MaxUName wasm.OpcodeVecI16x8MaxSName wasm.OpcodeVecI16x8MaxUName
2531
+ // wasm.OpcodeVecF32x4MaxName wasm.OpcodeVecF64x2MaxName.
2532
+ func newOperationV128Max(shape shape, signed bool) unionOperation {
2533
+ return unionOperation{Kind: operationKindV128Max, B1: shape, B3: signed}
2534
+ }
2535
+
2536
+ // NewOperationV128AvgrU is a constructor for unionOperation with operationKindV128AvgrU.
2537
+ //
2538
+ // This corresponds to wasm.OpcodeVecI8x16AvgrUName.
2539
+ func newOperationV128AvgrU(shape shape) unionOperation {
2540
+ return unionOperation{Kind: operationKindV128AvgrU, B1: shape}
2541
+ }
2542
+
2543
+ // NewOperationV128Pmin is a constructor for unionOperation with operationKindV128Pmin.
2544
+ //
2545
+ // This corresponds to wasm.OpcodeVecF32x4PminName wasm.OpcodeVecF64x2PminName.
2546
+ func newOperationV128Pmin(shape shape) unionOperation {
2547
+ return unionOperation{Kind: operationKindV128Pmin, B1: shape}
2548
+ }
2549
+
2550
+ // NewOperationV128Pmax is a constructor for unionOperation with operationKindV128Pmax.
2551
+ //
2552
+ // This corresponds to wasm.OpcodeVecF32x4PmaxName wasm.OpcodeVecF64x2PmaxName.
2553
+ func newOperationV128Pmax(shape shape) unionOperation {
2554
+ return unionOperation{Kind: operationKindV128Pmax, B1: shape}
2555
+ }
2556
+
2557
+ // NewOperationV128Ceil is a constructor for unionOperation with operationKindV128Ceil.
2558
+ //
2559
+ // This corresponds to wasm.OpcodeVecF32x4CeilName wasm.OpcodeVecF64x2CeilName
2560
+ func newOperationV128Ceil(shape shape) unionOperation {
2561
+ return unionOperation{Kind: operationKindV128Ceil, B1: shape}
2562
+ }
2563
+
2564
+ // NewOperationV128Floor is a constructor for unionOperation with operationKindV128Floor.
2565
+ //
2566
+ // This corresponds to wasm.OpcodeVecF32x4FloorName wasm.OpcodeVecF64x2FloorName
2567
+ func newOperationV128Floor(shape shape) unionOperation {
2568
+ return unionOperation{Kind: operationKindV128Floor, B1: shape}
2569
+ }
2570
+
2571
+ // NewOperationV128Trunc is a constructor for unionOperation with operationKindV128Trunc.
2572
+ //
2573
+ // This corresponds to wasm.OpcodeVecF32x4TruncName wasm.OpcodeVecF64x2TruncName
2574
+ func newOperationV128Trunc(shape shape) unionOperation {
2575
+ return unionOperation{Kind: operationKindV128Trunc, B1: shape}
2576
+ }
2577
+
2578
+ // NewOperationV128Nearest is a constructor for unionOperation with operationKindV128Nearest.
2579
+ //
2580
+ // This corresponds to wasm.OpcodeVecF32x4NearestName wasm.OpcodeVecF64x2NearestName
2581
+ func newOperationV128Nearest(shape shape) unionOperation {
2582
+ return unionOperation{Kind: operationKindV128Nearest, B1: shape}
2583
+ }
2584
+
2585
+ // NewOperationV128Extend is a constructor for unionOperation with operationKindV128Extend.
2586
+ //
2587
+ // This corresponds to
2588
+ //
2589
+ // wasm.OpcodeVecI16x8ExtendLowI8x16SName wasm.OpcodeVecI16x8ExtendHighI8x16SName
2590
+ // wasm.OpcodeVecI16x8ExtendLowI8x16UName wasm.OpcodeVecI16x8ExtendHighI8x16UName
2591
+ // wasm.OpcodeVecI32x4ExtendLowI16x8SName wasm.OpcodeVecI32x4ExtendHighI16x8SName
2592
+ // wasm.OpcodeVecI32x4ExtendLowI16x8UName wasm.OpcodeVecI32x4ExtendHighI16x8UName
2593
+ // wasm.OpcodeVecI64x2ExtendLowI32x4SName wasm.OpcodeVecI64x2ExtendHighI32x4SName
2594
+ // wasm.OpcodeVecI64x2ExtendLowI32x4UName wasm.OpcodeVecI64x2ExtendHighI32x4UName
2595
+ //
2596
+ // originshape is the shape of the original lanes for extension which is
2597
+ // either shapeI8x16, shapeI16x8, or shapeI32x4.
2598
+ // useLow true if it uses the lower half of vector for extension.
2599
+ func newOperationV128Extend(originshape shape, signed bool, useLow bool) unionOperation {
2600
+ op := unionOperation{Kind: operationKindV128Extend}
2601
+ op.B1 = originshape
2602
+ if signed {
2603
+ op.B2 = 1
2604
+ }
2605
+ op.B3 = useLow
2606
+ return op
2607
+ }
2608
+
2609
+ // NewOperationV128ExtMul is a constructor for unionOperation with operationKindV128ExtMul.
2610
+ //
2611
+ // This corresponds to
2612
+ //
2613
+ // wasm.OpcodeVecI16x8ExtMulLowI8x16SName wasm.OpcodeVecI16x8ExtMulLowI8x16UName
2614
+ // wasm.OpcodeVecI16x8ExtMulHighI8x16SName wasm.OpcodeVecI16x8ExtMulHighI8x16UName
2615
+ // wasm.OpcodeVecI32x4ExtMulLowI16x8SName wasm.OpcodeVecI32x4ExtMulLowI16x8UName
2616
+ // wasm.OpcodeVecI32x4ExtMulHighI16x8SName wasm.OpcodeVecI32x4ExtMulHighI16x8UName
2617
+ // wasm.OpcodeVecI64x2ExtMulLowI32x4SName wasm.OpcodeVecI64x2ExtMulLowI32x4UName
2618
+ // wasm.OpcodeVecI64x2ExtMulHighI32x4SName wasm.OpcodeVecI64x2ExtMulHighI32x4UName.
2619
+ //
2620
+ // originshape is the shape of the original lanes for extension which is
2621
+ // either shapeI8x16, shapeI16x8, or shapeI32x4.
2622
+ // useLow true if it uses the lower half of vector for extension.
2623
+ func newOperationV128ExtMul(originshape shape, signed bool, useLow bool) unionOperation {
2624
+ op := unionOperation{Kind: operationKindV128ExtMul}
2625
+ op.B1 = originshape
2626
+ if signed {
2627
+ op.B2 = 1
2628
+ }
2629
+ op.B3 = useLow
2630
+ return op
2631
+ }
2632
+
2633
+ // NewOperationV128Q15mulrSatS is a constructor for unionOperation with operationKindV128Q15mulrSatS.
2634
+ //
2635
+ // This corresponds to wasm.OpcodeVecI16x8Q15mulrSatSName
2636
+ func newOperationV128Q15mulrSatS() unionOperation {
2637
+ return unionOperation{Kind: operationKindV128Q15mulrSatS}
2638
+ }
2639
+
2640
+ // NewOperationV128ExtAddPairwise is a constructor for unionOperation with operationKindV128ExtAddPairwise.
2641
+ //
2642
+ // This corresponds to
2643
+ //
2644
+ // wasm.OpcodeVecI16x8ExtaddPairwiseI8x16SName wasm.OpcodeVecI16x8ExtaddPairwiseI8x16UName
2645
+ // wasm.OpcodeVecI32x4ExtaddPairwiseI16x8SName wasm.OpcodeVecI32x4ExtaddPairwiseI16x8UName.
2646
+ //
2647
+ // originshape is the shape of the original lanes for extension which is
2648
+ // either shapeI8x16, or shapeI16x8.
2649
+ func newOperationV128ExtAddPairwise(originshape shape, signed bool) unionOperation {
2650
+ return unionOperation{Kind: operationKindV128ExtAddPairwise, B1: originshape, B3: signed}
2651
+ }
2652
+
2653
+ // NewOperationV128FloatPromote is a constructor for unionOperation with NewOperationV128FloatPromote.
2654
+ //
2655
+ // This corresponds to wasm.OpcodeVecF64x2PromoteLowF32x4ZeroName
2656
+ // This discards the higher 64-bit of a vector, and promotes two
2657
+ // 32-bit floats in the lower 64-bit as two 64-bit floats.
2658
+ func newOperationV128FloatPromote() unionOperation {
2659
+ return unionOperation{Kind: operationKindV128FloatPromote}
2660
+ }
2661
+
2662
+ // NewOperationV128FloatDemote is a constructor for unionOperation with NewOperationV128FloatDemote.
2663
+ //
2664
+ // This corresponds to wasm.OpcodeVecF32x4DemoteF64x2ZeroName.
2665
+ func newOperationV128FloatDemote() unionOperation {
2666
+ return unionOperation{Kind: operationKindV128FloatDemote}
2667
+ }
2668
+
2669
+ // NewOperationV128FConvertFromI is a constructor for unionOperation with NewOperationV128FConvertFromI.
2670
+ //
2671
+ // This corresponds to
2672
+ //
2673
+ // wasm.OpcodeVecF32x4ConvertI32x4SName wasm.OpcodeVecF32x4ConvertI32x4UName
2674
+ // wasm.OpcodeVecF64x2ConvertLowI32x4SName wasm.OpcodeVecF64x2ConvertLowI32x4UName.
2675
+ //
2676
+ // destinationshape is the shape of the destination lanes for conversion which is
2677
+ // either shapeF32x4, or shapeF64x2.
2678
+ func newOperationV128FConvertFromI(destinationshape shape, signed bool) unionOperation {
2679
+ return unionOperation{Kind: operationKindV128FConvertFromI, B1: destinationshape, B3: signed}
2680
+ }
2681
+
2682
+ // NewOperationV128Dot is a constructor for unionOperation with operationKindV128Dot.
2683
+ //
2684
+ // This corresponds to wasm.OpcodeVecI32x4DotI16x8SName
2685
+ func newOperationV128Dot() unionOperation {
2686
+ return unionOperation{Kind: operationKindV128Dot}
2687
+ }
2688
+
2689
+ // NewOperationV128Narrow is a constructor for unionOperation with operationKindV128Narrow.
2690
+ //
2691
+ // This corresponds to
2692
+ //
2693
+ // wasm.OpcodeVecI8x16NarrowI16x8SName wasm.OpcodeVecI8x16NarrowI16x8UName
2694
+ // wasm.OpcodeVecI16x8NarrowI32x4SName wasm.OpcodeVecI16x8NarrowI32x4UName.
2695
+ //
2696
+ // originshape is the shape of the original lanes for narrowing which is
2697
+ // either shapeI16x8, or shapeI32x4.
2698
+ func newOperationV128Narrow(originshape shape, signed bool) unionOperation {
2699
+ return unionOperation{Kind: operationKindV128Narrow, B1: originshape, B3: signed}
2700
+ }
2701
+
2702
+ // NewOperationV128ITruncSatFromF is a constructor for unionOperation with operationKindV128ITruncSatFromF.
2703
+ //
2704
+ // This corresponds to
2705
+ //
2706
+ // wasm.OpcodeVecI32x4TruncSatF64x2UZeroName wasm.OpcodeVecI32x4TruncSatF64x2SZeroName
2707
+ // wasm.OpcodeVecI32x4TruncSatF32x4UName wasm.OpcodeVecI32x4TruncSatF32x4SName.
2708
+ //
2709
+ // originshape is the shape of the original lanes for truncation which is
2710
+ // either shapeF32x4, or shapeF64x2.
2711
+ func newOperationV128ITruncSatFromF(originshape shape, signed bool) unionOperation {
2712
+ return unionOperation{Kind: operationKindV128ITruncSatFromF, B1: originshape, B3: signed}
2713
+ }
2714
+
2715
+ // atomicArithmeticOp is the type for the operation kind of atomic arithmetic operations.
2716
+ type atomicArithmeticOp byte
2717
+
2718
+ const (
2719
+ // atomicArithmeticOpAdd is the kind for an add operation.
2720
+ atomicArithmeticOpAdd atomicArithmeticOp = iota
2721
+ // atomicArithmeticOpSub is the kind for a sub operation.
2722
+ atomicArithmeticOpSub
2723
+ // atomicArithmeticOpAnd is the kind for a bitwise and operation.
2724
+ atomicArithmeticOpAnd
2725
+ // atomicArithmeticOpOr is the kind for a bitwise or operation.
2726
+ atomicArithmeticOpOr
2727
+ // atomicArithmeticOpXor is the kind for a bitwise xor operation.
2728
+ atomicArithmeticOpXor
2729
+ // atomicArithmeticOpNop is the kind for a nop operation.
2730
+ atomicArithmeticOpNop
2731
+ )
2732
+
2733
+ // NewOperationAtomicMemoryWait is a constructor for unionOperation with operationKindAtomicMemoryWait.
2734
+ //
2735
+ // This corresponds to
2736
+ //
2737
+ // wasm.OpcodeAtomicWait32Name wasm.OpcodeAtomicWait64Name
2738
+ func newOperationAtomicMemoryWait(unsignedType unsignedType, arg memoryArg) unionOperation {
2739
+ return unionOperation{Kind: operationKindAtomicMemoryWait, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2740
+ }
2741
+
2742
+ // NewOperationAtomicMemoryNotify is a constructor for unionOperation with operationKindAtomicMemoryNotify.
2743
+ //
2744
+ // This corresponds to
2745
+ //
2746
+ // wasm.OpcodeAtomicNotifyName
2747
+ func newOperationAtomicMemoryNotify(arg memoryArg) unionOperation {
2748
+ return unionOperation{Kind: operationKindAtomicMemoryNotify, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2749
+ }
2750
+
2751
+ // NewOperationAtomicFence is a constructor for unionOperation with operationKindAtomicFence.
2752
+ //
2753
+ // This corresponds to
2754
+ //
2755
+ // wasm.OpcodeAtomicFenceName
2756
+ func newOperationAtomicFence() unionOperation {
2757
+ return unionOperation{Kind: operationKindAtomicFence}
2758
+ }
2759
+
2760
+ // NewOperationAtomicLoad is a constructor for unionOperation with operationKindAtomicLoad.
2761
+ //
2762
+ // This corresponds to
2763
+ //
2764
+ // wasm.OpcodeAtomicI32LoadName wasm.OpcodeAtomicI64LoadName
2765
+ func newOperationAtomicLoad(unsignedType unsignedType, arg memoryArg) unionOperation {
2766
+ return unionOperation{Kind: operationKindAtomicLoad, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2767
+ }
2768
+
2769
+ // NewOperationAtomicLoad8 is a constructor for unionOperation with operationKindAtomicLoad8.
2770
+ //
2771
+ // This corresponds to
2772
+ //
2773
+ // wasm.OpcodeAtomicI32Load8UName wasm.OpcodeAtomicI64Load8UName
2774
+ func newOperationAtomicLoad8(unsignedType unsignedType, arg memoryArg) unionOperation {
2775
+ return unionOperation{Kind: operationKindAtomicLoad8, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2776
+ }
2777
+
2778
+ // NewOperationAtomicLoad16 is a constructor for unionOperation with operationKindAtomicLoad16.
2779
+ //
2780
+ // This corresponds to
2781
+ //
2782
+ // wasm.OpcodeAtomicI32Load16UName wasm.OpcodeAtomicI64Load16UName
2783
+ func newOperationAtomicLoad16(unsignedType unsignedType, arg memoryArg) unionOperation {
2784
+ return unionOperation{Kind: operationKindAtomicLoad16, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2785
+ }
2786
+
2787
+ // NewOperationAtomicStore is a constructor for unionOperation with operationKindAtomicStore.
2788
+ //
2789
+ // This corresponds to
2790
+ //
2791
+ // wasm.OpcodeAtomicI32StoreName wasm.OpcodeAtomicI64StoreName
2792
+ func newOperationAtomicStore(unsignedType unsignedType, arg memoryArg) unionOperation {
2793
+ return unionOperation{Kind: operationKindAtomicStore, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2794
+ }
2795
+
2796
+ // NewOperationAtomicStore8 is a constructor for unionOperation with operationKindAtomicStore8.
2797
+ //
2798
+ // This corresponds to
2799
+ //
2800
+ // wasm.OpcodeAtomicI32Store8UName wasm.OpcodeAtomicI64Store8UName
2801
+ func newOperationAtomicStore8(unsignedType unsignedType, arg memoryArg) unionOperation {
2802
+ return unionOperation{Kind: operationKindAtomicStore8, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2803
+ }
2804
+
2805
+ // NewOperationAtomicStore16 is a constructor for unionOperation with operationKindAtomicStore16.
2806
+ //
2807
+ // This corresponds to
2808
+ //
2809
+ // wasm.OpcodeAtomicI32Store16UName wasm.OpcodeAtomicI64Store16UName
2810
+ func newOperationAtomicStore16(unsignedType unsignedType, arg memoryArg) unionOperation {
2811
+ return unionOperation{Kind: operationKindAtomicStore16, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2812
+ }
2813
+
2814
+ // NewOperationAtomicRMW is a constructor for unionOperation with operationKindAtomicRMW.
2815
+ //
2816
+ // This corresponds to
2817
+ //
2818
+ // wasm.OpcodeAtomicI32RMWAddName wasm.OpcodeAtomicI64RmwAddName
2819
+ // wasm.OpcodeAtomicI32RMWSubName wasm.OpcodeAtomicI64RmwSubName
2820
+ // wasm.OpcodeAtomicI32RMWAndName wasm.OpcodeAtomicI64RmwAndName
2821
+ // wasm.OpcodeAtomicI32RMWOrName wasm.OpcodeAtomicI64RmwOrName
2822
+ // wasm.OpcodeAtomicI32RMWXorName wasm.OpcodeAtomicI64RmwXorName
2823
+ func newOperationAtomicRMW(unsignedType unsignedType, arg memoryArg, op atomicArithmeticOp) unionOperation {
2824
+ return unionOperation{Kind: operationKindAtomicRMW, B1: byte(unsignedType), B2: byte(op), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2825
+ }
2826
+
2827
+ // NewOperationAtomicRMW8 is a constructor for unionOperation with operationKindAtomicRMW8.
2828
+ //
2829
+ // This corresponds to
2830
+ //
2831
+ // wasm.OpcodeAtomicI32RMW8AddUName wasm.OpcodeAtomicI64Rmw8AddUName
2832
+ // wasm.OpcodeAtomicI32RMW8SubUName wasm.OpcodeAtomicI64Rmw8SubUName
2833
+ // wasm.OpcodeAtomicI32RMW8AndUName wasm.OpcodeAtomicI64Rmw8AndUName
2834
+ // wasm.OpcodeAtomicI32RMW8OrUName wasm.OpcodeAtomicI64Rmw8OrUName
2835
+ // wasm.OpcodeAtomicI32RMW8XorUName wasm.OpcodeAtomicI64Rmw8XorUName
2836
+ func newOperationAtomicRMW8(unsignedType unsignedType, arg memoryArg, op atomicArithmeticOp) unionOperation {
2837
+ return unionOperation{Kind: operationKindAtomicRMW8, B1: byte(unsignedType), B2: byte(op), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2838
+ }
2839
+
2840
+ // NewOperationAtomicRMW16 is a constructor for unionOperation with operationKindAtomicRMW16.
2841
+ //
2842
+ // This corresponds to
2843
+ //
2844
+ // wasm.OpcodeAtomicI32RMW16AddUName wasm.OpcodeAtomicI64Rmw16AddUName
2845
+ // wasm.OpcodeAtomicI32RMW16SubUName wasm.OpcodeAtomicI64Rmw16SubUName
2846
+ // wasm.OpcodeAtomicI32RMW16AndUName wasm.OpcodeAtomicI64Rmw16AndUName
2847
+ // wasm.OpcodeAtomicI32RMW16OrUName wasm.OpcodeAtomicI64Rmw16OrUName
2848
+ // wasm.OpcodeAtomicI32RMW16XorUName wasm.OpcodeAtomicI64Rmw16XorUName
2849
+ func newOperationAtomicRMW16(unsignedType unsignedType, arg memoryArg, op atomicArithmeticOp) unionOperation {
2850
+ return unionOperation{Kind: operationKindAtomicRMW16, B1: byte(unsignedType), B2: byte(op), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2851
+ }
2852
+
2853
+ // NewOperationAtomicRMWCmpxchg is a constructor for unionOperation with operationKindAtomicRMWCmpxchg.
2854
+ //
2855
+ // This corresponds to
2856
+ //
2857
+ // wasm.OpcodeAtomicI32RMWCmpxchgName wasm.OpcodeAtomicI64RmwCmpxchgName
2858
+ func newOperationAtomicRMWCmpxchg(unsignedType unsignedType, arg memoryArg) unionOperation {
2859
+ return unionOperation{Kind: operationKindAtomicRMWCmpxchg, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2860
+ }
2861
+
2862
+ // NewOperationAtomicRMW8Cmpxchg is a constructor for unionOperation with operationKindAtomicRMW8Cmpxchg.
2863
+ //
2864
+ // This corresponds to
2865
+ //
2866
+ // wasm.OpcodeAtomicI32RMW8CmpxchgUName wasm.OpcodeAtomicI64Rmw8CmpxchgUName
2867
+ func newOperationAtomicRMW8Cmpxchg(unsignedType unsignedType, arg memoryArg) unionOperation {
2868
+ return unionOperation{Kind: operationKindAtomicRMW8Cmpxchg, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2869
+ }
2870
+
2871
+ // NewOperationAtomicRMW16Cmpxchg is a constructor for unionOperation with operationKindAtomicRMW16Cmpxchg.
2872
+ //
2873
+ // This corresponds to
2874
+ //
2875
+ // wasm.OpcodeAtomicI32RMW16CmpxchgUName wasm.OpcodeAtomicI64Rmw16CmpxchgUName
2876
+ func newOperationAtomicRMW16Cmpxchg(unsignedType unsignedType, arg memoryArg) unionOperation {
2877
+ return unionOperation{Kind: operationKindAtomicRMW16Cmpxchg, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)}
2878
+ }
2879
+
2880
+ // newOperationTailCallReturnCall is a constructor for unionOperation with operationKindTailCallReturnCall.
2881
+ //
2882
+ // This corresponds to
2883
+ //
2884
+ // wasm.OpcodeTailCallReturnCall.
2885
+ func newOperationTailCallReturnCall(functionIndex uint32) unionOperation {
2886
+ return unionOperation{Kind: operationKindTailCallReturnCall, U1: uint64(functionIndex)}
2887
+ }
2888
+
2889
+ // NewOperationCallIndirect is a constructor for unionOperation with operationKindTailCallReturnCallIndirect.
2890
+ //
2891
+ // This corresponds to
2892
+ //
2893
+ // wasm.OpcodeTailCallReturnCallIndirect.
2894
+ func newOperationTailCallReturnCallIndirect(typeIndex, tableIndex uint32, dropDepth inclusiveRange, l label) unionOperation {
2895
+ return unionOperation{Kind: operationKindTailCallReturnCallIndirect, U1: uint64(typeIndex), U2: uint64(tableIndex), Us: []uint64{dropDepth.AsU64(), uint64(l)}}
2896
+ }
2897
+
2898
+ // newOperationThrow is a constructor for unionOperation with operationKindThrow.
2899
+ // U1 stores the tag index.
2900
+ func newOperationThrow(tagIndex uint32) unionOperation {
2901
+ return unionOperation{Kind: operationKindThrow, U1: uint64(tagIndex)}
2902
+ }
2903
+
2904
+ // newOperationThrowRef is a constructor for unionOperation with operationKindThrowRef.
2905
+ func newOperationThrowRef() unionOperation {
2906
+ return unionOperation{Kind: operationKindThrowRef}
2907
+ }
2908
+
2909
+ // newOperationCallRef is a constructor for operationKindCallRef.
2910
+ // U1 = type index.
2911
+ func newOperationCallRef(typeIndex uint32) unionOperation {
2912
+ return unionOperation{Kind: operationKindCallRef, U1: uint64(typeIndex)}
2913
+ }
2914
+
2915
+ // newOperationReturnCallRef is a constructor for operationKindReturnCallRef.
2916
+ // U1 = type index, U2 = table index (unused), Us = [dropDepth, label].
2917
+ func newOperationReturnCallRef(typeIndex uint32, dropDepth inclusiveRange, l label) unionOperation {
2918
+ return unionOperation{Kind: operationKindReturnCallRef, U1: uint64(typeIndex), Us: []uint64{dropDepth.AsU64(), uint64(l)}}
2919
+ }
2920
+
2921
+ // newOperationRefAsNonNull is a constructor for operationKindRefAsNonNull.
2922
+ func newOperationRefAsNonNull() unionOperation {
2923
+ return unionOperation{Kind: operationKindRefAsNonNull}
2924
+ }
2925
+
2926
+ // newOperationBrOnNull is a constructor for operationKindBrOnNull.
2927
+ // If ref is null, branch to U1 (thenTarget) with drop U3; otherwise continue at U2 (elseTarget).
2928
+ func newOperationBrOnNull(thenTarget, elseTarget label, thenDrop inclusiveRange) unionOperation {
2929
+ return unionOperation{
2930
+ Kind: operationKindBrOnNull,
2931
+ U1: uint64(thenTarget),
2932
+ U2: uint64(elseTarget),
2933
+ U3: thenDrop.AsU64(),
2934
+ }
2935
+ }
2936
+
2937
+ // newOperationBrOnNonNull is a constructor for operationKindBrOnNonNull.
2938
+ // If ref is non-null, branch to U1 (thenTarget) with drop U3; otherwise continue at U2 (elseTarget).
2939
+ func newOperationBrOnNonNull(thenTarget, elseTarget label, thenDrop inclusiveRange) unionOperation {
2940
+ return unionOperation{
2941
+ Kind: operationKindBrOnNonNull,
2942
+ U1: uint64(thenTarget),
2943
+ U2: uint64(elseTarget),
2944
+ U3: thenDrop.AsU64(),
2945
+ }
2946
+ }
2947
+
2948
+ // exceptionTableEntry represents one try_table's exception handling scope.
2949
+ // Built at compile time and stored per compiledFunction.
2950
+ type exceptionTableEntry struct {
2951
+ startPC uint64 // first PC inside the try_table body
2952
+ endPC uint64 // PC of continuation label (exclusive)
2953
+ clauses []exceptionTableCatchClause
2954
+ }
2955
+
2956
+ // exceptionTableCatchClause is a single catch clause within an exception table entry.
2957
+ type exceptionTableCatchClause struct {
2958
+ kind byte // CatchKindCatch, CatchKindCatchRef, CatchKindCatchAll, CatchKindCatchAllRef
2959
+ tagIndex uint32 // tag index for catch/catch_ref
2960
+ targetPC uint64 // resolved PC to jump to on match
2961
+ targetStackDepth int // = targetFrame.originalStackLenWithoutParamUint64
2962
+ }
2963
+
2964
+ // pendingExceptionTableEntry is an unresolved exception table entry built during compilation.
2965
+ // Labels are resolved to final PCs in lowerIR.
2966
+ type pendingExceptionTableEntry struct {
2967
+ startOpIndex int // index in Operations[] of the first instruction inside the try_table body
2968
+ continuationFrameID uint32
2969
+ clauses []pendingCatchClause
2970
+ }
2971
+
2972
+ // pendingCatchClause is an unresolved catch clause within a pending exception table entry.
2973
+ type pendingCatchClause struct {
2974
+ kind byte
2975
+ tagIndex uint32
2976
+ targetLabel label // unresolved label, resolved in lowerIR
2977
+ targetStackDepth int // = targetFrame.originalStackLenWithoutParamUint64
2978
+ }