@swiftbrowser/wasm-sdk 0.0.0-stage → 0.9.0

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 (633) hide show
  1. package/LICENSE.txt +1445 -0
  2. package/README.md +24 -2
  3. package/files.json +631 -0
  4. package/package.json +18 -4
  5. package/wasm32-unknown-wasip1/WASI.sdk/bin/xml2-config +108 -0
  6. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__errno.h +15 -0
  7. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__errno_values.h +84 -0
  8. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__fd_set.h +67 -0
  9. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__function___isatty.h +14 -0
  10. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__functions_malloc.h +29 -0
  11. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__functions_memcpy.h +24 -0
  12. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_dirent.h +44 -0
  13. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_fcntl.h +60 -0
  14. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_inttypes.h +184 -0
  15. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_netinet_in.h +32 -0
  16. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_poll.h +33 -0
  17. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_stdlib.h +21 -0
  18. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_string.h +26 -0
  19. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_sys_ioctl.h +17 -0
  20. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_sys_resource.h +19 -0
  21. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_sys_socket.h +81 -0
  22. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_sys_stat.h +15 -0
  23. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_time.h +31 -0
  24. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__header_unistd.h +29 -0
  25. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__macro_FD_SETSIZE.h +6 -0
  26. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__macro_PAGESIZE.h +24 -0
  27. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__mode_t.h +38 -0
  28. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__seek.h +8 -0
  29. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_dirent.h +14 -0
  30. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_in6_addr.h +8 -0
  31. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_in_addr.h +10 -0
  32. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_iovec.h +12 -0
  33. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_msghdr.h +16 -0
  34. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_pollfd.h +10 -0
  35. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_rusage.h +12 -0
  36. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_sockaddr.h +11 -0
  37. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_sockaddr_in.h +14 -0
  38. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_sockaddr_in6.h +16 -0
  39. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_sockaddr_storage.h +11 -0
  40. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_sockaddr_un.h +10 -0
  41. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_stat.h +35 -0
  42. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_timespec.h +12 -0
  43. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_timeval.h +13 -0
  44. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_tm.h +19 -0
  45. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__struct_tms.h +13 -0
  46. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_DIR.h +6 -0
  47. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_blkcnt_t.h +7 -0
  48. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_blksize_t.h +6 -0
  49. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_clock_t.h +7 -0
  50. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_clockid_t.h +6 -0
  51. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_dev_t.h +7 -0
  52. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_fd_set.h +14 -0
  53. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_gid_t.h +6 -0
  54. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_in_addr_t.h +6 -0
  55. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_in_port_t.h +6 -0
  56. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_ino_t.h +7 -0
  57. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_mode_t.h +6 -0
  58. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_nfds_t.h +6 -0
  59. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_nlink_t.h +7 -0
  60. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_off_t.h +7 -0
  61. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_sa_family_t.h +6 -0
  62. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_sigset_t.h +7 -0
  63. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_socklen_t.h +6 -0
  64. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_ssize_t.h +7 -0
  65. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_suseconds_t.h +8 -0
  66. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_time_t.h +7 -0
  67. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/__typedef_uid_t.h +6 -0
  68. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/alloca.h +19 -0
  69. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/ar.h +25 -0
  70. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/ftp.h +35 -0
  71. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/inet.h +31 -0
  72. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/nameser.h +526 -0
  73. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/nameser_compat.h +2 -0
  74. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/telnet.h +251 -0
  75. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/arpa/tftp.h +31 -0
  76. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/assert.h +23 -0
  77. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/alltypes.h +460 -0
  78. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/dirent.h +1 -0
  79. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/fcntl.h +1 -0
  80. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/fenv.h +10 -0
  81. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/float.h +16 -0
  82. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/hwcap.h +0 -0
  83. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/io.h +0 -0
  84. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/ioctl.h +1 -0
  85. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/ioctl_fix.h +0 -0
  86. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/ipcstat.h +1 -0
  87. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/limits.h +1 -0
  88. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/mman.h +0 -0
  89. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/poll.h +0 -0
  90. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/posix.h +2 -0
  91. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/reg.h +2 -0
  92. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/resource.h +0 -0
  93. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/setjmp.h +1 -0
  94. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/signal.h +40 -0
  95. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/socket.h +0 -0
  96. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/stat.h +1 -0
  97. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/bits/stdint.h +20 -0
  98. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/byteswap.h +26 -0
  99. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/complex.h +143 -0
  100. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/cpio.h +29 -0
  101. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/crypt.h +20 -0
  102. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/ctype.h +77 -0
  103. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/dirent.h +89 -0
  104. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/dlfcn.h +56 -0
  105. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/endian.h +80 -0
  106. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/err.h +25 -0
  107. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/errno.h +32 -0
  108. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/fcntl.h +250 -0
  109. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/features.h +40 -0
  110. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/fenv.h +28 -0
  111. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/float.h +56 -0
  112. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/fmtmsg.h +47 -0
  113. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/fnmatch.h +24 -0
  114. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/fts.h +155 -0
  115. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/ftw.h +45 -0
  116. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/getopt.h +30 -0
  117. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/glob.h +54 -0
  118. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/iconv.h +24 -0
  119. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/ifaddrs.h +35 -0
  120. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/inttypes.h +233 -0
  121. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/iso646.h +20 -0
  122. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/langinfo.h +98 -0
  123. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/libgen.h +15 -0
  124. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/limits.h +178 -0
  125. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/locale.h +93 -0
  126. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/malloc.h +33 -0
  127. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/math.h +459 -0
  128. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/memory.h +1 -0
  129. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/monetary.h +23 -0
  130. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/mqueue.h +41 -0
  131. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/icmp6.h +305 -0
  132. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/igmp.h +45 -0
  133. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/in.h +433 -0
  134. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/in_systm.h +9 -0
  135. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/ip.h +199 -0
  136. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/ip6.h +141 -0
  137. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/ip_icmp.h +193 -0
  138. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/tcp.h +305 -0
  139. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netinet/udp.h +46 -0
  140. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/netpacket/packet.h +62 -0
  141. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/nl_types.h +22 -0
  142. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/poll.h +69 -0
  143. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/pthread.h +267 -0
  144. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/regex.h +62 -0
  145. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sched.h +152 -0
  146. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/search.h +63 -0
  147. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/semaphore.h +39 -0
  148. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/setjmp.h +55 -0
  149. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/signal.h +339 -0
  150. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdalign.h +20 -0
  151. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdbool.h +14 -0
  152. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdc-predef.h +18 -0
  153. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdint.h +117 -0
  154. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdio.h +254 -0
  155. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdio_ext.h +34 -0
  156. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdlib.h +217 -0
  157. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stdnoreturn.h +7 -0
  158. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/string.h +123 -0
  159. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/strings.h +40 -0
  160. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/stropts.h +139 -0
  161. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/dir.h +2 -0
  162. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/errno.h +2 -0
  163. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/eventfd.h +26 -0
  164. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/fcntl.h +2 -0
  165. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/file.h +21 -0
  166. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/ioctl.h +124 -0
  167. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/mman.h +157 -0
  168. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/param.h +37 -0
  169. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/poll.h +2 -0
  170. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/random.h +27 -0
  171. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/reg.h +9 -0
  172. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/resource.h +126 -0
  173. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/select.h +54 -0
  174. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/signal.h +2 -0
  175. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/socket.h +454 -0
  176. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/stat.h +198 -0
  177. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/statvfs.h +57 -0
  178. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/stropts.h +1 -0
  179. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/syscall.h +10 -0
  180. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/sysinfo.h +36 -0
  181. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/time.h +84 -0
  182. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/timeb.h +28 -0
  183. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/times.h +34 -0
  184. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/timex.h +103 -0
  185. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/ttydefaults.h +34 -0
  186. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/types.h +85 -0
  187. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/uio.h +57 -0
  188. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/un.h +39 -0
  189. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sys/utsname.h +29 -0
  190. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/syscall.h +1 -0
  191. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/sysexits.h +21 -0
  192. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/tar.h +33 -0
  193. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/tgmath.h +270 -0
  194. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/threads.h +93 -0
  195. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/time.h +204 -0
  196. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/uchar.h +29 -0
  197. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/unistd.h +589 -0
  198. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/utime.h +29 -0
  199. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/values.h +39 -0
  200. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/api.h +34 -0
  201. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/libc-busywait.h +15 -0
  202. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/libc-environ.h +36 -0
  203. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/libc-find-relpath.h +75 -0
  204. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/libc-nocwd.h +61 -0
  205. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/libc.h +84 -0
  206. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/version.h +17 -0
  207. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/wasip1.h +2130 -0
  208. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/wasip2.h +10 -0
  209. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wasi/wasip3.h +10 -0
  210. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wchar.h +214 -0
  211. package/wasm32-unknown-wasip1/WASI.sdk/include/wasm32-wasip1/wctype.h +79 -0
  212. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/cmake/libxml2-2.11.5/libxml2-config-version.cmake +83 -0
  213. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/cmake/libxml2-2.11.5/libxml2-config.cmake +160 -0
  214. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/cmake/libxml2-2.11.5/libxml2-export-release.cmake +19 -0
  215. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/cmake/libxml2-2.11.5/libxml2-export.cmake +108 -0
  216. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/crt1-command.o +0 -0
  217. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/crt1-reactor.o +0 -0
  218. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/crt1.o +0 -0
  219. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc++.a +0 -0
  220. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc++.modules.json +26 -0
  221. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc++abi.a +0 -0
  222. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc++experimental.a +0 -0
  223. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc-printscan-long-double.a +0 -0
  224. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc-printscan-no-floating-point.a +0 -0
  225. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc.a +0 -0
  226. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libc.so +0 -0
  227. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libcrypt.a +1 -0
  228. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libdl.a +0 -0
  229. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libdl.so +0 -0
  230. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libm.a +1 -0
  231. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libpthread.a +1 -0
  232. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libresolv.a +1 -0
  233. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/librt.a +1 -0
  234. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libsetjmp.a +0 -0
  235. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libsetjmp.so +0 -0
  236. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libutil.a +1 -0
  237. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-getpid.a +0 -0
  238. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-getpid.so +0 -0
  239. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-mman.a +0 -0
  240. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-mman.so +0 -0
  241. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-process-clocks.a +0 -0
  242. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-process-clocks.so +0 -0
  243. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-signal.a +0 -0
  244. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libwasi-emulated-signal.so +0 -0
  245. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libxml2.a +0 -0
  246. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/libxnet.a +1 -0
  247. package/wasm32-unknown-wasip1/WASI.sdk/lib/wasm32-wasip1/pkgconfig/libxml-2.0.pc +13 -0
  248. package/wasm32-unknown-wasip1/swift-sdk.json +13 -0
  249. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/clang/lib/wasip1/libclang_rt.builtins-wasm32.a +0 -0
  250. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/clang/lib/wasip1/libclang_rt.profile-wasm32.a +0 -0
  251. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/apinotes/SwiftWASILibc.apinotes +5 -0
  252. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_builtin_vars.h +121 -0
  253. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_cmath.h +512 -0
  254. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_complex_builtins.h +285 -0
  255. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_device_functions.h +1572 -0
  256. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_intrinsics.h +994 -0
  257. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_libdevice_declares.h +468 -0
  258. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_math.h +353 -0
  259. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_math_forward_declares.h +284 -0
  260. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_runtime_wrapper.h +504 -0
  261. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_cuda_texture_intrinsics.h +1177 -0
  262. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_hip_cmath.h +848 -0
  263. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_hip_libdevice_declares.h +345 -0
  264. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_hip_math.h +1405 -0
  265. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_hip_runtime_wrapper.h +162 -0
  266. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_hip_stdlib.h +43 -0
  267. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__clang_spirv_builtins.h +217 -0
  268. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__float_float.h +165 -0
  269. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__float_header_macro.h +12 -0
  270. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__float_infinity_nan.h +20 -0
  271. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg___gnuc_va_list.h +13 -0
  272. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg___va_copy.h +12 -0
  273. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg_header_macro.h +12 -0
  274. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg_va_arg.h +22 -0
  275. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg_va_copy.h +12 -0
  276. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stdarg_va_list.h +13 -0
  277. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_header_macro.h +12 -0
  278. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_max_align_t.h +27 -0
  279. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_null.h +29 -0
  280. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_nullptr_t.h +29 -0
  281. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_offsetof.h +17 -0
  282. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_ptrdiff_t.h +20 -0
  283. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_rsize_t.h +20 -0
  284. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_size_t.h +20 -0
  285. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_unreachable.h +21 -0
  286. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_wchar_t.h +28 -0
  287. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__stddef_wint_t.h +15 -0
  288. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__wmmintrin_aes.h +140 -0
  289. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/__wmmintrin_pclmul.h +48 -0
  290. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/adcintrin.h +165 -0
  291. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/adxintrin.h +107 -0
  292. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/altivec.h +19364 -0
  293. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amdgpuintrin.h +191 -0
  294. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ammintrin.h +183 -0
  295. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxavx512intrin.h +382 -0
  296. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxbf16transposeintrin.h +94 -0
  297. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxcomplexintrin.h +167 -0
  298. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxcomplextransposeintrin.h +303 -0
  299. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxfp16intrin.h +93 -0
  300. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxfp16transposeintrin.h +94 -0
  301. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxfp8intrin.h +230 -0
  302. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxintrin.h +494 -0
  303. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxmovrsintrin.h +48 -0
  304. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxmovrstransposeintrin.h +200 -0
  305. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxtf32intrin.h +108 -0
  306. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxtf32transposeintrin.h +105 -0
  307. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/amxtransposeintrin.h +248 -0
  308. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/andes_vector.h +16 -0
  309. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm64intr.h +35 -0
  310. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_acle.h +855 -0
  311. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_bf16.h +20 -0
  312. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_cde.h +410 -0
  313. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_cmse.h +217 -0
  314. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_fp16.h +596 -0
  315. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_mve.h +19187 -0
  316. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_neon.h +74047 -0
  317. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_neon_sve_bridge.h +182 -0
  318. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_sme.h +3741 -0
  319. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_sve.h +31898 -0
  320. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/arm_vector_types.h +432 -0
  321. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/armintr.h +31 -0
  322. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/availability_domain.h +51 -0
  323. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512bf16intrin.h +561 -0
  324. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512convertintrin.h +322 -0
  325. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512minmaxintrin.h +127 -0
  326. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512niintrin.h +314 -0
  327. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512satcvtdsintrin.h +307 -0
  328. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2_512satcvtintrin.h +301 -0
  329. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2bf16intrin.h +1085 -0
  330. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2convertintrin.h +3257 -0
  331. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2copyintrin.h +66 -0
  332. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2minmaxintrin.h +232 -0
  333. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2niintrin.h +409 -0
  334. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2satcvtdsintrin.h +376 -0
  335. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx10_2satcvtintrin.h +312 -0
  336. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx2intrin.h +5293 -0
  337. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512bf16intrin.h +283 -0
  338. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512bitalgintrin.h +86 -0
  339. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512bwintrin.h +2014 -0
  340. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512cdintrin.h +125 -0
  341. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512dqintrin.h +1379 -0
  342. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512fintrin.h +9787 -0
  343. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512fp16intrin.h +3353 -0
  344. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512ifmaintrin.h +70 -0
  345. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512ifmavlintrin.h +111 -0
  346. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vbmi2intrin.h +357 -0
  347. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vbmiintrin.h +106 -0
  348. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vbmivlintrin.h +193 -0
  349. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlbf16intrin.h +517 -0
  350. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlbitalgintrin.h +151 -0
  351. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlbwintrin.h +3167 -0
  352. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlcdintrin.h +230 -0
  353. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vldqintrin.h +1173 -0
  354. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlfp16intrin.h +2071 -0
  355. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlintrin.h +8437 -0
  356. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlvbmi2intrin.h +695 -0
  357. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlvnniintrin.h +310 -0
  358. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vlvp2intersectintrin.h +123 -0
  359. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vnniintrin.h +116 -0
  360. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vp2intersectintrin.h +78 -0
  361. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vpopcntdqintrin.h +64 -0
  362. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avx512vpopcntdqvlintrin.h +103 -0
  363. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxifmaintrin.h +177 -0
  364. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxintrin.h +5140 -0
  365. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxneconvertintrin.h +484 -0
  366. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxvnniint16intrin.h +432 -0
  367. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxvnniint8intrin.h +430 -0
  368. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/avxvnniintrin.h +225 -0
  369. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/bmi2intrin.h +253 -0
  370. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/bmiintrin.h +604 -0
  371. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/bounds_safety_soft_traps.h +55 -0
  372. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/builtins.h +19 -0
  373. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cet.h +66 -0
  374. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cetintrin.h +115 -0
  375. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cldemoteintrin.h +36 -0
  376. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/clflushoptintrin.h +36 -0
  377. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/clwbintrin.h +38 -0
  378. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/clzerointrin.h +38 -0
  379. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cmpccxaddintrin.h +70 -0
  380. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cpuid.h +354 -0
  381. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/crc32intrin.h +100 -0
  382. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cuda_wrappers/bits/basic_string.h +9 -0
  383. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cuda_wrappers/bits/c++config.h +61 -0
  384. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cuda_wrappers/bits/shared_ptr_base.h +9 -0
  385. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/cuda_wrappers/cmath +44 -0
  386. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/emmintrin.h +4940 -0
  387. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/enqcmdintrin.h +63 -0
  388. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/f16cintrin.h +162 -0
  389. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/feature-availability.h +17 -0
  390. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/float.h +45 -0
  391. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/fma4intrin.h +218 -0
  392. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/fmaintrin.h +796 -0
  393. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/fuzzer/FuzzedDataProvider.h +397 -0
  394. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/fxsrintrin.h +91 -0
  395. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/gfniintrin.h +233 -0
  396. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/gpuintrin.h +328 -0
  397. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/hexagon_circ_brev_intrinsics.h +298 -0
  398. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/hexagon_protos.h +8439 -0
  399. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/hexagon_types.h +2625 -0
  400. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/hresetintrin.h +49 -0
  401. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/htmintrin.h +212 -0
  402. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/htmxlintrin.h +345 -0
  403. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/hvx_hexagon_protos.h +5610 -0
  404. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ia32intrin.h +863 -0
  405. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/immintrin.h +607 -0
  406. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/intrin.h +487 -0
  407. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/intrin0.h +256 -0
  408. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/inttypes.h +101 -0
  409. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/invpcidintrin.h +23 -0
  410. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/iso646.h +31 -0
  411. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/keylockerintrin.h +518 -0
  412. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/larchintrin.h +260 -0
  413. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/lasxintrin.h +3886 -0
  414. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/lifetimebound.h +37 -0
  415. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/limits.h +133 -0
  416. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/assert.h +34 -0
  417. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/ctype.h +140 -0
  418. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/inttypes.h +34 -0
  419. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/stdio.h +80 -0
  420. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/stdlib.h +53 -0
  421. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/string.h +96 -0
  422. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_libc_wrappers/time.h +34 -0
  423. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_offload_wrappers/__llvm_offload.h +31 -0
  424. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_offload_wrappers/__llvm_offload_device.h +10 -0
  425. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/llvm_offload_wrappers/__llvm_offload_host.h +15 -0
  426. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/lsxintrin.h +3752 -0
  427. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/lwpintrin.h +136 -0
  428. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/lzcntintrin.h +109 -0
  429. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/mm3dnow.h +22 -0
  430. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/mm_malloc.h +67 -0
  431. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/mmintrin.h +1610 -0
  432. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/module.modulemap +393 -0
  433. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/movdirintrin.h +49 -0
  434. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/movrs_avx10_2_512intrin.h +98 -0
  435. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/movrs_avx10_2intrin.h +174 -0
  436. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/movrsintrin.h +59 -0
  437. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/msa.h +573 -0
  438. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/mwaitxintrin.h +62 -0
  439. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/nmmintrin.h +20 -0
  440. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/nvptxintrin.h +219 -0
  441. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/opencl-c-base.h +851 -0
  442. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/opencl-c.h +18630 -0
  443. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/openmp_wrappers/__clang_openmp_device_functions.h +104 -0
  444. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/openmp_wrappers/cmath +132 -0
  445. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/openmp_wrappers/complex.h +35 -0
  446. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/openmp_wrappers/complex_cmath.h +393 -0
  447. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/openmp_wrappers/math.h +61 -0
  448. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/orc/c_api.h +202 -0
  449. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/pconfigintrin.h +40 -0
  450. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/pkuintrin.h +34 -0
  451. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/pmmintrin.h +314 -0
  452. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/popcntintrin.h +59 -0
  453. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/bmi2intrin.h +134 -0
  454. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/bmiintrin.h +165 -0
  455. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/emmintrin.h +2269 -0
  456. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/immintrin.h +27 -0
  457. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/mm_malloc.h +45 -0
  458. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/mmintrin.h +1453 -0
  459. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/nmmintrin.h +26 -0
  460. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/pmmintrin.h +145 -0
  461. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/smmintrin.h +683 -0
  462. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/tmmintrin.h +453 -0
  463. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/x86gprintrin.h +17 -0
  464. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/x86intrin.h +28 -0
  465. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ppc_wrappers/xmmintrin.h +1827 -0
  466. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/prfchiintrin.h +61 -0
  467. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/prfchwintrin.h +57 -0
  468. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/profile/instr_prof_interface.h +88 -0
  469. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ptrauth.h +467 -0
  470. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ptrcheck.h +339 -0
  471. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/ptwriteintrin.h +37 -0
  472. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/raointintrin.h +203 -0
  473. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/rdpruintrin.h +57 -0
  474. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/rdseedintrin.h +105 -0
  475. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/riscv_bitmanip.h +195 -0
  476. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/riscv_corev_alu.h +128 -0
  477. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/riscv_crypto.h +170 -0
  478. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/riscv_ntlh.h +26 -0
  479. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/riscv_vector.h +422 -0
  480. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/rtmintrin.h +45 -0
  481. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/s390intrin.h +25 -0
  482. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/allocator_interface.h +106 -0
  483. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/asan_interface.h +340 -0
  484. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/common_interface_defs.h +492 -0
  485. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/coverage_interface.h +36 -0
  486. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/dfsan_interface.h +220 -0
  487. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/hwasan_interface.h +109 -0
  488. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/linux_syscall_hooks.h +3112 -0
  489. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/lsan_interface.h +89 -0
  490. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/memprof_interface.h +72 -0
  491. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/msan_interface.h +135 -0
  492. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/netbsd_syscall_hooks.h +5005 -0
  493. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/rtsan_interface.h +75 -0
  494. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/scudo_interface.h +38 -0
  495. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/tsan_interface.h +316 -0
  496. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/tsan_interface_atomic.h +223 -0
  497. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sanitizer/ubsan_interface.h +34 -0
  498. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/serializeintrin.h +30 -0
  499. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sgxintrin.h +60 -0
  500. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sha512intrin.h +200 -0
  501. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/shaintrin.h +190 -0
  502. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sifive_vector.h +118 -0
  503. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sm3intrin.h +238 -0
  504. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sm4evexintrin.h +32 -0
  505. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/sm4intrin.h +269 -0
  506. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/smmintrin.h +2334 -0
  507. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdalign.h +24 -0
  508. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdarg.h +75 -0
  509. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdatomic.h +204 -0
  510. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdbool.h +39 -0
  511. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdckdint.h +42 -0
  512. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdcountof.h +15 -0
  513. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stddef.h +144 -0
  514. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdint.h +844 -0
  515. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/stdnoreturn.h +35 -0
  516. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/tbmintrin.h +128 -0
  517. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/tgmath.h +1368 -0
  518. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/tmmintrin.h +810 -0
  519. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/tsxldtrkintrin.h +56 -0
  520. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/uintrintrin.h +157 -0
  521. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/unwind.h +332 -0
  522. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/usermsrintrin.h +51 -0
  523. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/vadefs.h +51 -0
  524. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/vaesintrin.h +87 -0
  525. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/varargs.h +16 -0
  526. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/vecintrin.h +12868 -0
  527. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/velintrin.h +71 -0
  528. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/velintrin_approx.h +120 -0
  529. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/velintrin_gen.h +1257 -0
  530. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/vpclmulqdqintrin.h +30 -0
  531. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/waitpkgintrin.h +42 -0
  532. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/wasm_simd128.h +2143 -0
  533. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/wbnoinvdintrin.h +24 -0
  534. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/wmmintrin.h +23 -0
  535. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/x86gprintrin.h +49 -0
  536. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/x86intrin.h +35 -0
  537. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xmmintrin.h +3201 -0
  538. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xopintrin.h +770 -0
  539. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xray/xray_interface.h +178 -0
  540. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xray/xray_log_interface.h +357 -0
  541. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xray/xray_records.h +134 -0
  542. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xsavecintrin.h +84 -0
  543. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xsaveintrin.h +63 -0
  544. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xsaveoptintrin.h +34 -0
  545. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xsavesintrin.h +44 -0
  546. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/xtestintrin.h +27 -0
  547. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/yvals_core.h +25 -0
  548. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/include/zos_wrappers/builtins.h +18 -0
  549. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/lib/wasip1/libclang_rt.builtins-wasm32.a +0 -0
  550. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/clang/lib/wasip1/libclang_rt.profile-wasm32.a +0 -0
  551. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/AssertionReporting.h +87 -0
  552. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/CoreFoundationShims.h +97 -0
  553. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/EmbeddedShims.h +277 -0
  554. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/FoundationShims.h +65 -0
  555. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/GlobalObjects.h +114 -0
  556. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/HeapObject.h +304 -0
  557. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/KeyPath.h +142 -0
  558. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/LibcOverlayShims.h +141 -0
  559. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/LibcShims.h +198 -0
  560. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/MetadataSections.h +100 -0
  561. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/ObjCShims.h +51 -0
  562. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/Random.h +43 -0
  563. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/RefCount.h +1654 -0
  564. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/Reflection.h +36 -0
  565. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/RuntimeShims.h +161 -0
  566. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/RuntimeStubs.h +61 -0
  567. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/SwiftStdbool.h +23 -0
  568. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/SwiftStddef.h +53 -0
  569. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/SwiftStdint.h +89 -0
  570. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/System.h +227 -0
  571. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/Target.h +45 -0
  572. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/ThreadLocalStorage.h +76 -0
  573. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/Visibility.h +312 -0
  574. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/_SwiftConcurrency.h +33 -0
  575. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/_SwiftDistributed.h +29 -0
  576. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/_SynchronizationShims.h +60 -0
  577. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/shims/module.modulemap +39 -0
  578. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Distributed.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +346 -0
  579. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Distributed.swiftmodule/wasm32-unknown-wasip1.swiftinterface +346 -0
  580. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Distributed.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  581. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Observation.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +173 -0
  582. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Observation.swiftmodule/wasm32-unknown-wasip1.swiftinterface +157 -0
  583. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Observation.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  584. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/RegexBuilder.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +2961 -0
  585. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/RegexBuilder.swiftmodule/wasm32-unknown-wasip1.swiftinterface +2961 -0
  586. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/RegexBuilder.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  587. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Swift.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +58665 -0
  588. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Swift.swiftmodule/wasm32-unknown-wasip1.swiftinterface +57923 -0
  589. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Swift.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  590. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/SwiftOnoneSupport.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +5 -0
  591. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/SwiftOnoneSupport.swiftmodule/wasm32-unknown-wasip1.swiftinterface +5 -0
  592. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/SwiftOnoneSupport.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  593. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Synchronization.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +7122 -0
  594. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Synchronization.swiftmodule/wasm32-unknown-wasip1.swiftinterface +7122 -0
  595. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Synchronization.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  596. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/WASILibc.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +423 -0
  597. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/WASILibc.swiftmodule/wasm32-unknown-wasip1.swiftinterface +423 -0
  598. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/WASILibc.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  599. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Builtin_float.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +51 -0
  600. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Builtin_float.swiftmodule/wasm32-unknown-wasip1.swiftinterface +51 -0
  601. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Builtin_float.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  602. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Concurrency.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +7915 -0
  603. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Concurrency.swiftmodule/wasm32-unknown-wasip1.swiftinterface +7779 -0
  604. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Concurrency.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  605. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Differentiation.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +2257 -0
  606. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Differentiation.swiftmodule/wasm32-unknown-wasip1.swiftinterface +2257 -0
  607. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Differentiation.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  608. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_RegexParser.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +2310 -0
  609. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_RegexParser.swiftmodule/wasm32-unknown-wasip1.swiftinterface +2297 -0
  610. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_RegexParser.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  611. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_StringProcessing.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +573 -0
  612. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_StringProcessing.swiftmodule/wasm32-unknown-wasip1.swiftinterface +372 -0
  613. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_StringProcessing.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  614. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Volatile.swiftmodule/wasm32-unknown-wasip1.private.swiftinterface +46 -0
  615. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Volatile.swiftmodule/wasm32-unknown-wasip1.swiftinterface +46 -0
  616. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_Volatile.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  617. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftCore.a +0 -0
  618. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftDistributed.a +0 -0
  619. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftObservation.a +0 -0
  620. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftRegexBuilder.a +0 -0
  621. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftSwiftOnoneSupport.a +0 -0
  622. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftSynchronization.a +0 -0
  623. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswiftWASILibc.a +0 -0
  624. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_Builtin_float.a +0 -0
  625. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_Concurrency.a +0 -0
  626. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_Differentiation.a +0 -0
  627. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_RegexParser.a +0 -0
  628. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_StringProcessing.a +0 -0
  629. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libswift_Volatile.a +0 -0
  630. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/static-executable-args.lnk +10 -0
  631. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/wasm32/swiftrt.o +0 -0
  632. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/wasm32/wasi-libc.modulemap +95 -0
  633. package/wasm32-unknown-wasip1/toolset.json +9 -0
@@ -0,0 +1,1654 @@
1
+ //===--- RefCount.h ---------------------------------------------*- C++ -*-===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ //===----------------------------------------------------------------------===//
12
+ #ifndef SWIFT_STDLIB_SHIMS_REFCOUNT_H
13
+ #define SWIFT_STDLIB_SHIMS_REFCOUNT_H
14
+
15
+ #include "Visibility.h"
16
+ #include "SwiftStdint.h"
17
+
18
+ // This definition is a placeholder for importing into Swift.
19
+ // It provides size and alignment but cannot be manipulated safely there.
20
+ typedef struct {
21
+ __swift_uintptr_t refCounts;
22
+ } InlineRefCountsPlaceholder;
23
+
24
+ #if defined(__swift__)
25
+
26
+ typedef InlineRefCountsPlaceholder InlineRefCounts;
27
+
28
+ #else
29
+
30
+ #include <type_traits>
31
+ #include <atomic>
32
+ #include <stddef.h>
33
+ #include <stdint.h>
34
+ #include <assert.h>
35
+
36
+ #include "HeapObject.h"
37
+ #include "swift/Basic/type_traits.h"
38
+ #include "swift/Runtime/Atomic.h"
39
+ #include "swift/Runtime/Config.h"
40
+ #include "swift/Runtime/Debug.h"
41
+ #include "swift/Runtime/Heap.h"
42
+
43
+ /*
44
+ An object conceptually has three refcounts. These refcounts
45
+ are stored either "inline" in the field following the isa
46
+ or in a "side table entry" pointed to by the field following the isa.
47
+
48
+ The strong RC counts strong references to the object. When the strong RC
49
+ reaches zero the object is deinited, unowned reference reads become errors,
50
+ and weak reference reads become nil. The strong RC is stored as an extra
51
+ count: when the physical field is 0 the logical value is 1.
52
+
53
+ The unowned RC counts unowned references to the object. The unowned RC
54
+ also has an extra +1 on behalf of the strong references; this +1 is
55
+ decremented after deinit completes. When the unowned RC reaches zero
56
+ the object's allocation is freed.
57
+
58
+ The weak RC counts weak references to the object. The weak RC also has an
59
+ extra +1 on behalf of the unowned references; this +1 is decremented
60
+ after the object's allocation is freed. When the weak RC reaches zero
61
+ the object's side table entry is freed.
62
+
63
+ Objects initially start with no side table. They can gain a side table when:
64
+ * a weak reference is formed
65
+ and pending future implementation:
66
+ * strong RC or unowned RC overflows (inline RCs will be small on 32-bit)
67
+ * associated object storage is needed on an object
68
+ * etc
69
+ Gaining a side table entry is a one-way operation; an object with a side
70
+ table entry never loses it. This prevents some thread races.
71
+
72
+ Strong and unowned variables point at the object.
73
+ Weak variables point at the object's side table.
74
+
75
+
76
+ Storage layout:
77
+
78
+ HeapObject {
79
+ isa
80
+ InlineRefCounts {
81
+ atomic<InlineRefCountBits> {
82
+ strong RC + unowned RC + flags
83
+ OR
84
+ HeapObjectSideTableEntry*
85
+ }
86
+ }
87
+ }
88
+
89
+ HeapObjectSideTableEntry {
90
+ SideTableRefCounts {
91
+ object pointer
92
+ atomic<SideTableRefCountBits> {
93
+ strong RC + unowned RC + weak RC + flags
94
+ }
95
+ }
96
+ }
97
+
98
+ InlineRefCounts and SideTableRefCounts share some implementation
99
+ via RefCounts<T>.
100
+
101
+ InlineRefCountBits and SideTableRefCountBits share some implementation
102
+ via RefCountBitsT<bool>.
103
+
104
+ In general: The InlineRefCounts implementation tries to perform the
105
+ operation inline. If the object has a side table it calls the
106
+ HeapObjectSideTableEntry implementation which in turn calls the
107
+ SideTableRefCounts implementation.
108
+ Downside: this code is a bit twisted.
109
+ Upside: this code has less duplication than it might otherwise
110
+
111
+
112
+ Object lifecycle state machine:
113
+
114
+ LIVE without side table
115
+ The object is alive.
116
+ Object's refcounts are initialized as 1 strong, 1 unowned, 1 weak.
117
+ No side table. No weak RC storage.
118
+ Strong variable operations work normally.
119
+ Unowned variable operations work normally.
120
+ Weak variable load can't happen.
121
+ Weak variable store adds the side table, becoming LIVE with side table.
122
+ When the strong RC reaches zero deinit() is called and the object
123
+ becomes DEINITING.
124
+
125
+ LIVE with side table
126
+ Weak variable operations work normally.
127
+ Everything else is the same as LIVE.
128
+
129
+ DEINITING without side table
130
+ deinit() is in progress on the object.
131
+ Strong variable operations have no effect.
132
+ Unowned variable load halts in swift_abortRetainUnowned().
133
+ Unowned variable store works normally.
134
+ Weak variable load can't happen.
135
+ Weak variable store stores nil.
136
+ When deinit() completes, the generated code calls swift_deallocObject.
137
+ swift_deallocObject calls canBeFreedNow() checking for the fast path
138
+ of no weak or unowned references.
139
+ If canBeFreedNow() the object is freed and it becomes DEAD.
140
+ Otherwise, it decrements the unowned RC and the object becomes DEINITED.
141
+
142
+ DEINITING with side table
143
+ Weak variable load returns nil.
144
+ Weak variable store stores nil.
145
+ canBeFreedNow() is always false, so it never transitions directly to DEAD.
146
+ Everything else is the same as DEINITING.
147
+
148
+ DEINITED without side table
149
+ deinit() has completed but there are unowned references outstanding.
150
+ Strong variable operations can't happen.
151
+ Unowned variable store can't happen.
152
+ Unowned variable load halts in swift_abortRetainUnowned().
153
+ Weak variable operations can't happen.
154
+ When the unowned RC reaches zero, the object is freed and it becomes DEAD.
155
+
156
+ DEINITED with side table
157
+ Weak variable load returns nil.
158
+ Weak variable store can't happen.
159
+ When the unowned RC reaches zero, the object is freed, the weak RC is
160
+ decremented, and the object becomes FREED.
161
+ Everything else is the same as DEINITED.
162
+
163
+ FREED without side table
164
+ This state never happens.
165
+
166
+ FREED with side table
167
+ The object is freed but there are weak refs to the side table outstanding.
168
+ Strong variable operations can't happen.
169
+ Unowned variable operations can't happen.
170
+ Weak variable load returns nil.
171
+ Weak variable store can't happen.
172
+ When the weak RC reaches zero, the side table entry is freed and
173
+ the object becomes DEAD.
174
+
175
+ DEAD
176
+ The object and its side table are gone.
177
+ */
178
+
179
+ namespace swift {
180
+ struct HeapObject;
181
+ class HeapObjectSideTableEntry;
182
+ }
183
+
184
+ // FIXME: HACK: copied from HeapObject.cpp
185
+ extern "C" SWIFT_LIBRARY_VISIBILITY SWIFT_NOINLINE SWIFT_USED SWIFT_REFCOUNT_CC
186
+ void
187
+ _swift_release_dealloc(swift::HeapObject *object);
188
+
189
+ namespace swift {
190
+
191
+ // RefCountIsInline: refcount stored in an object
192
+ // RefCountNotInline: refcount stored in an object's side table entry
193
+ enum RefCountInlinedness { RefCountNotInline = false, RefCountIsInline = true };
194
+
195
+ enum PerformDeinit { DontPerformDeinit = false, DoPerformDeinit = true };
196
+
197
+
198
+ // Raw storage of refcount bits, depending on pointer size and inlinedness.
199
+ // 32-bit inline refcount is 32-bits. All others are 64-bits.
200
+
201
+ template <RefCountInlinedness refcountIsInline, size_t sizeofPointer>
202
+ struct RefCountBitsInt;
203
+
204
+ // 64-bit inline
205
+ // 64-bit out of line
206
+ template <RefCountInlinedness refcountIsInline>
207
+ struct RefCountBitsInt<refcountIsInline, 8> {
208
+ typedef uint64_t Type;
209
+ typedef int64_t SignedType;
210
+ };
211
+
212
+ // 32-bit out of line
213
+ template <>
214
+ struct RefCountBitsInt<RefCountNotInline, 4> {
215
+ typedef uint64_t Type;
216
+ typedef int64_t SignedType;
217
+ };
218
+
219
+ // 32-bit inline
220
+ template <>
221
+ struct RefCountBitsInt<RefCountIsInline, 4> {
222
+ typedef uint32_t Type;
223
+ typedef int32_t SignedType;
224
+ };
225
+
226
+
227
+ // Layout of refcount bits.
228
+ // field value = (bits & mask) >> shift
229
+ // FIXME: redo this abstraction more cleanly
230
+
231
+ # define maskForField(name) (((uint64_t(1)<<name##BitCount)-1) << name##Shift)
232
+ # define shiftAfterField(name) (name##Shift + name##BitCount)
233
+
234
+ template <size_t sizeofPointer>
235
+ struct RefCountBitOffsets;
236
+
237
+ // 64-bit inline
238
+ // 64-bit out of line
239
+ // 32-bit out of line
240
+ template <>
241
+ struct RefCountBitOffsets<8> {
242
+ /*
243
+ The bottom 32 bits (on 64 bit architectures, fewer on 32 bit) of the refcount
244
+ field are effectively a union of two different configurations:
245
+
246
+ ---Normal case---
247
+ Bit 0: Does this object need to call out to the ObjC runtime for deallocation
248
+ Bits 1-31: Unowned refcount
249
+
250
+ ---Immortal case---
251
+ All bits set, the object does not deallocate or have a refcount
252
+ */
253
+ static const size_t PureSwiftDeallocShift = 0;
254
+ static const size_t PureSwiftDeallocBitCount = 1;
255
+ static const uint64_t PureSwiftDeallocMask = maskForField(PureSwiftDealloc);
256
+
257
+ static const size_t UnownedRefCountShift = shiftAfterField(PureSwiftDealloc);
258
+ static const size_t UnownedRefCountBitCount = 31;
259
+ static const uint64_t UnownedRefCountMask = maskForField(UnownedRefCount);
260
+
261
+ static const size_t IsImmortalShift = 0; // overlaps PureSwiftDealloc and UnownedRefCount
262
+ static const size_t IsImmortalBitCount = 32;
263
+ static const uint64_t IsImmortalMask = maskForField(IsImmortal);
264
+
265
+ static const size_t IsDeinitingShift = shiftAfterField(UnownedRefCount);
266
+ static const size_t IsDeinitingBitCount = 1;
267
+ static const uint64_t IsDeinitingMask = maskForField(IsDeiniting);
268
+
269
+ static const size_t StrongExtraRefCountShift = shiftAfterField(IsDeiniting);
270
+ static const size_t StrongExtraRefCountBitCount = 30;
271
+ static const uint64_t StrongExtraRefCountMask = maskForField(StrongExtraRefCount);
272
+
273
+ static const size_t UseSlowRCShift = shiftAfterField(StrongExtraRefCount);
274
+ static const size_t UseSlowRCBitCount = 1;
275
+ static const uint64_t UseSlowRCMask = maskForField(UseSlowRC);
276
+
277
+ static const size_t SideTableShift = 0;
278
+ static const size_t SideTableBitCount = 62;
279
+ static const uint64_t SideTableMask = maskForField(SideTable);
280
+ static const size_t SideTableUnusedLowBits = 3;
281
+
282
+ static const size_t SideTableMarkShift = SideTableBitCount;
283
+ static const size_t SideTableMarkBitCount = 1;
284
+ static const uint64_t SideTableMarkMask = maskForField(SideTableMark);
285
+ };
286
+
287
+ // 32-bit inline
288
+ template <>
289
+ struct RefCountBitOffsets<4> {
290
+ static const size_t PureSwiftDeallocShift = 0;
291
+ static const size_t PureSwiftDeallocBitCount = 1;
292
+ static const uint32_t PureSwiftDeallocMask = maskForField(PureSwiftDealloc);
293
+
294
+ static const size_t UnownedRefCountShift = shiftAfterField(PureSwiftDealloc);
295
+ static const size_t UnownedRefCountBitCount = 7;
296
+ static const uint32_t UnownedRefCountMask = maskForField(UnownedRefCount);
297
+
298
+ static const size_t IsImmortalShift = 0; // overlaps PureSwiftDealloc and UnownedRefCount
299
+ static const size_t IsImmortalBitCount = 8;
300
+ static const uint32_t IsImmortalMask = maskForField(IsImmortal);
301
+
302
+ static const size_t IsDeinitingShift = shiftAfterField(UnownedRefCount);
303
+ static const size_t IsDeinitingBitCount = 1;
304
+ static const uint32_t IsDeinitingMask = maskForField(IsDeiniting);
305
+
306
+ static const size_t StrongExtraRefCountShift = shiftAfterField(IsDeiniting);
307
+ static const size_t StrongExtraRefCountBitCount = 22;
308
+ static const uint32_t StrongExtraRefCountMask = maskForField(StrongExtraRefCount);
309
+
310
+ static const size_t UseSlowRCShift = shiftAfterField(StrongExtraRefCount);
311
+ static const size_t UseSlowRCBitCount = 1;
312
+ static const uint32_t UseSlowRCMask = maskForField(UseSlowRC);
313
+
314
+ static const size_t SideTableShift = 0;
315
+ static const size_t SideTableBitCount = 30;
316
+ static const uint32_t SideTableMask = maskForField(SideTable);
317
+ static const size_t SideTableUnusedLowBits = 2;
318
+
319
+ static const size_t SideTableMarkShift = SideTableBitCount;
320
+ static const size_t SideTableMarkBitCount = 1;
321
+ static const uint32_t SideTableMarkMask = maskForField(SideTableMark);
322
+ };
323
+
324
+
325
+ // FIXME: reinstate these assertions
326
+ #if 0
327
+ static_assert(StrongExtraRefCountShift == IsDeinitingShift + 1,
328
+ "IsDeiniting must be LSB-wards of StrongExtraRefCount");
329
+ static_assert(UseSlowRCShift + UseSlowRCBitCount == sizeof(bits)*8,
330
+ "UseSlowRC must be MSB");
331
+ static_assert(SideTableBitCount + SideTableMarkBitCount +
332
+ UseSlowRCBitCount == sizeof(bits)*8,
333
+ "wrong bit count for RefCountBits side table encoding");
334
+ static_assert(UnownedRefCountBitCount +
335
+ IsDeinitingBitCount + StrongExtraRefCountBitCount +
336
+ UseSlowRCBitCount == sizeof(bits)*8,
337
+ "wrong bit count for RefCountBits refcount encoding");
338
+ #endif
339
+
340
+
341
+ // Basic encoding of refcount and flag data into the object's header.
342
+ template <RefCountInlinedness refcountIsInline>
343
+ class RefCountBitsT {
344
+
345
+ friend class RefCountBitsT<RefCountIsInline>;
346
+ friend class RefCountBitsT<RefCountNotInline>;
347
+
348
+ static const RefCountInlinedness Inlinedness = refcountIsInline;
349
+
350
+ typedef typename RefCountBitsInt<refcountIsInline, sizeof(void*)>::Type
351
+ BitsType;
352
+ typedef typename RefCountBitsInt<refcountIsInline, sizeof(void*)>::SignedType
353
+ SignedBitsType;
354
+ typedef RefCountBitOffsets<sizeof(BitsType)>
355
+ Offsets;
356
+
357
+ BitsType bits;
358
+
359
+ // "Bitfield" accessors.
360
+
361
+ # define getFieldIn(bits, offsets, name) \
362
+ ((bits & offsets::name##Mask) >> offsets::name##Shift)
363
+ # define setFieldIn(bits, offsets, name, val) \
364
+ bits = ((bits & ~offsets::name##Mask) | \
365
+ (((BitsType(val) << offsets::name##Shift) & offsets::name##Mask)))
366
+
367
+ # define getField(name) getFieldIn(bits, Offsets, name)
368
+ # define setField(name, val) setFieldIn(bits, Offsets, name, val)
369
+ # define copyFieldFrom(src, name) \
370
+ setFieldIn(bits, Offsets, name, \
371
+ getFieldIn(src.bits, decltype(src)::Offsets, name))
372
+
373
+ // RefCountBits uses always_inline everywhere
374
+ // to improve performance of debug builds.
375
+
376
+ private:
377
+ SWIFT_ALWAYS_INLINE
378
+ bool getUseSlowRC() const { return bool(getField(UseSlowRC)); }
379
+
380
+ SWIFT_ALWAYS_INLINE
381
+ void setUseSlowRC(bool value) { setField(UseSlowRC, value); }
382
+
383
+ public:
384
+
385
+ enum Immortal_t { Immortal };
386
+
387
+ SWIFT_ALWAYS_INLINE
388
+ bool isImmortal(bool checkSlowRCBit) const {
389
+ if (checkSlowRCBit) {
390
+ return (getField(IsImmortal) == Offsets::IsImmortalMask) &&
391
+ bool(getField(UseSlowRC));
392
+ } else {
393
+ return (getField(IsImmortal) == Offsets::IsImmortalMask);
394
+ }
395
+ }
396
+
397
+ SWIFT_ALWAYS_INLINE
398
+ bool isOverflowingUnownedRefCount(uint32_t oldValue, uint32_t inc) const {
399
+ auto newValue = getUnownedRefCount();
400
+ return newValue != oldValue + inc ||
401
+ newValue == Offsets::UnownedRefCountMask >> Offsets::UnownedRefCountShift;
402
+ }
403
+
404
+ SWIFT_ALWAYS_INLINE
405
+ void setIsImmortal(bool value) {
406
+ assert(value);
407
+ setField(IsImmortal, Offsets::IsImmortalMask);
408
+ setField(UseSlowRC, value);
409
+ }
410
+
411
+ SWIFT_ALWAYS_INLINE
412
+ bool pureSwiftDeallocation() const {
413
+ return bool(getField(PureSwiftDealloc)) && !bool(getField(UseSlowRC));
414
+ }
415
+
416
+ SWIFT_ALWAYS_INLINE
417
+ void setPureSwiftDeallocation(bool value) {
418
+ setField(PureSwiftDealloc, value);
419
+ }
420
+
421
+ SWIFT_ALWAYS_INLINE
422
+ static constexpr BitsType immortalBits() {
423
+ return (BitsType(2) << Offsets::StrongExtraRefCountShift) |
424
+ (BitsType(Offsets::IsImmortalMask)) |
425
+ (BitsType(1) << Offsets::UseSlowRCShift);
426
+ }
427
+
428
+ SWIFT_ALWAYS_INLINE
429
+ RefCountBitsT() = default;
430
+
431
+ SWIFT_ALWAYS_INLINE
432
+ constexpr
433
+ RefCountBitsT(uint32_t strongExtraCount, uint32_t unownedCount)
434
+ : bits((BitsType(strongExtraCount) << Offsets::StrongExtraRefCountShift) |
435
+ (BitsType(1) << Offsets::PureSwiftDeallocShift) |
436
+ (BitsType(unownedCount) << Offsets::UnownedRefCountShift))
437
+ { }
438
+
439
+ SWIFT_ALWAYS_INLINE
440
+ constexpr
441
+ RefCountBitsT(Immortal_t immortal)
442
+ : bits(immortalBits())
443
+ { }
444
+
445
+ SWIFT_ALWAYS_INLINE
446
+ RefCountBitsT(HeapObjectSideTableEntry* side)
447
+ : bits((reinterpret_cast<BitsType>(side) >> Offsets::SideTableUnusedLowBits)
448
+ | (BitsType(1) << Offsets::UseSlowRCShift)
449
+ | (BitsType(1) << Offsets::SideTableMarkShift))
450
+ {
451
+ assert(refcountIsInline);
452
+ }
453
+
454
+ SWIFT_ALWAYS_INLINE
455
+ RefCountBitsT(const RefCountBitsT<RefCountIsInline> *newbitsPtr) {
456
+ bits = 0;
457
+
458
+ assert(newbitsPtr && "expected non null newbits");
459
+ RefCountBitsT<RefCountIsInline> newbits = *newbitsPtr;
460
+
461
+ if (refcountIsInline || sizeof(newbits) == sizeof(*this)) {
462
+ // this and newbits are both inline
463
+ // OR this is out-of-line but the same layout as inline.
464
+ // (FIXME: use something cleaner than sizeof for same-layout test)
465
+ // Copy the bits directly.
466
+ bits = newbits.bits;
467
+ }
468
+ else {
469
+ // this is out-of-line and not the same layout as inline newbits.
470
+ // Copy field-by-field. If it's immortal, just set that.
471
+ if (newbits.isImmortal(false)) {
472
+ setField(IsImmortal, Offsets::IsImmortalMask);
473
+ } else {
474
+ copyFieldFrom(newbits, PureSwiftDealloc);
475
+ copyFieldFrom(newbits, UnownedRefCount);
476
+ copyFieldFrom(newbits, IsDeiniting);
477
+ copyFieldFrom(newbits, StrongExtraRefCount);
478
+ copyFieldFrom(newbits, UseSlowRC);
479
+ }
480
+ }
481
+ }
482
+
483
+ SWIFT_ALWAYS_INLINE
484
+ bool hasSideTable() const {
485
+ bool hasSide = getUseSlowRC() && !isImmortal(false);
486
+
487
+ // Side table refcount must not point to another side table.
488
+ assert((refcountIsInline || !hasSide) &&
489
+ "side table refcount must not have a side table entry of its own");
490
+
491
+ return hasSide;
492
+ }
493
+
494
+ SWIFT_ALWAYS_INLINE
495
+ HeapObjectSideTableEntry *getSideTable() const {
496
+ assert(hasSideTable());
497
+
498
+ // Stored value is a shifted pointer.
499
+ return reinterpret_cast<HeapObjectSideTableEntry *>
500
+ (uintptr_t(getField(SideTable)) << Offsets::SideTableUnusedLowBits);
501
+ }
502
+
503
+ SWIFT_ALWAYS_INLINE
504
+ uint32_t getUnownedRefCount() const {
505
+ assert(!hasSideTable());
506
+ return uint32_t(getField(UnownedRefCount));
507
+ }
508
+
509
+ SWIFT_ALWAYS_INLINE
510
+ bool getIsDeiniting() const {
511
+ assert(!hasSideTable());
512
+ return bool(getField(IsDeiniting));
513
+ }
514
+
515
+ SWIFT_ALWAYS_INLINE
516
+ uint32_t getStrongExtraRefCount() const {
517
+ assert(!hasSideTable());
518
+ return uint32_t(getField(StrongExtraRefCount));
519
+ }
520
+
521
+ SWIFT_ALWAYS_INLINE
522
+ void setHasSideTable(bool value) {
523
+ bits = 0;
524
+ setUseSlowRC(value);
525
+ }
526
+
527
+ SWIFT_ALWAYS_INLINE
528
+ void setSideTable(HeapObjectSideTableEntry *side) {
529
+ assert(hasSideTable());
530
+ // Stored value is a shifted pointer.
531
+ uintptr_t value = reinterpret_cast<uintptr_t>(side);
532
+ uintptr_t storedValue = value >> Offsets::SideTableUnusedLowBits;
533
+ assert(storedValue << Offsets::SideTableUnusedLowBits == value);
534
+ setField(SideTable, storedValue);
535
+ setField(SideTableMark, 1);
536
+ }
537
+
538
+ SWIFT_ALWAYS_INLINE
539
+ void setUnownedRefCount(uint32_t value) {
540
+ assert(!hasSideTable());
541
+ setField(UnownedRefCount, value);
542
+ }
543
+
544
+ SWIFT_ALWAYS_INLINE
545
+ void setIsDeiniting(bool value) {
546
+ assert(!hasSideTable());
547
+ setField(IsDeiniting, value);
548
+ }
549
+
550
+ SWIFT_ALWAYS_INLINE
551
+ void setStrongExtraRefCount(uint32_t value) {
552
+ assert(!hasSideTable());
553
+ setField(StrongExtraRefCount, value);
554
+ }
555
+
556
+
557
+ // Returns true if the increment is a fast-path result.
558
+ // Returns false if the increment should fall back to some slow path
559
+ // (for example, because UseSlowRC is set or because the refcount overflowed).
560
+ SWIFT_NODISCARD SWIFT_ALWAYS_INLINE bool
561
+ incrementStrongExtraRefCount(uint32_t inc) {
562
+ // This deliberately overflows into the UseSlowRC field.
563
+ bits += BitsType(inc) << Offsets::StrongExtraRefCountShift;
564
+ return (SignedBitsType(bits) >= 0);
565
+ }
566
+
567
+ // Returns true if the decrement is a fast-path result.
568
+ // Returns false if the decrement should fall back to some slow path
569
+ // (for example, because UseSlowRC is set
570
+ // or because the refcount is now zero and should deinit).
571
+ SWIFT_NODISCARD SWIFT_ALWAYS_INLINE bool
572
+ decrementStrongExtraRefCount(uint32_t dec) {
573
+ #ifndef NDEBUG
574
+ if (!hasSideTable() && !isImmortal(false)) {
575
+ // Can't check these assertions with side table present.
576
+
577
+ if (getIsDeiniting())
578
+ assert(getStrongExtraRefCount() >= dec &&
579
+ "releasing reference whose refcount is already zero");
580
+ else
581
+ assert(getStrongExtraRefCount() + 1 >= dec &&
582
+ "releasing reference whose refcount is already zero");
583
+ }
584
+ #endif
585
+
586
+ // If we're decrementing by more than 1, then this underflow might end up
587
+ // subtracting away an existing 1 in UseSlowRC. Check that separately. This
588
+ // check should be constant folded away for the swift_release case.
589
+ if (dec > 1 && getUseSlowRC())
590
+ return false;
591
+
592
+ // This deliberately underflows by borrowing from the UseSlowRC field.
593
+ bits -= BitsType(dec) << Offsets::StrongExtraRefCountShift;
594
+ return (SignedBitsType(bits) >= 0);
595
+ }
596
+
597
+ // Returns the old reference count before the increment.
598
+ SWIFT_ALWAYS_INLINE
599
+ uint32_t incrementUnownedRefCount(uint32_t inc) {
600
+ uint32_t old = getUnownedRefCount();
601
+ setUnownedRefCount(old + inc);
602
+ return old;
603
+ }
604
+
605
+ SWIFT_ALWAYS_INLINE
606
+ void decrementUnownedRefCount(uint32_t dec) {
607
+ setUnownedRefCount(getUnownedRefCount() - dec);
608
+ }
609
+
610
+ SWIFT_ALWAYS_INLINE
611
+ bool isUniquelyReferenced() {
612
+ static_assert(Offsets::UnownedRefCountBitCount +
613
+ Offsets::IsDeinitingBitCount +
614
+ Offsets::StrongExtraRefCountBitCount +
615
+ Offsets::PureSwiftDeallocBitCount +
616
+ Offsets::UseSlowRCBitCount == sizeof(bits)*8,
617
+ "inspect isUniquelyReferenced after adding fields");
618
+
619
+ // Unowned: don't care (FIXME: should care and redo initForNotFreeing)
620
+ // IsDeiniting: false
621
+ // StrongExtra: 0
622
+ // UseSlowRC: false
623
+
624
+ // Compiler is clever enough to optimize this.
625
+ return
626
+ !getUseSlowRC() && !getIsDeiniting() && getStrongExtraRefCount() == 0;
627
+ }
628
+
629
+ SWIFT_ALWAYS_INLINE
630
+ BitsType getBitsValue() {
631
+ return bits;
632
+ }
633
+
634
+ # undef getFieldIn
635
+ # undef setFieldIn
636
+ # undef getField
637
+ # undef setField
638
+ # undef copyFieldFrom
639
+ };
640
+
641
+ # undef maskForField
642
+ # undef shiftAfterField
643
+
644
+ typedef RefCountBitsT<RefCountIsInline> InlineRefCountBits;
645
+
646
+ class alignas(sizeof(void*) * 2) SideTableRefCountBits : public RefCountBitsT<RefCountNotInline>
647
+ {
648
+ uint32_t weakBits;
649
+
650
+ public:
651
+ SWIFT_ALWAYS_INLINE
652
+ SideTableRefCountBits() = default;
653
+
654
+ SWIFT_ALWAYS_INLINE
655
+ constexpr SideTableRefCountBits(uint32_t strongExtraCount,
656
+ uint32_t unownedCount)
657
+ : RefCountBitsT<RefCountNotInline>(strongExtraCount, unownedCount)
658
+ // weak refcount starts at 1 on behalf of the unowned count
659
+ ,
660
+ weakBits(1) {}
661
+
662
+ SWIFT_ALWAYS_INLINE
663
+ SideTableRefCountBits(HeapObjectSideTableEntry *side) = delete;
664
+
665
+ SWIFT_ALWAYS_INLINE
666
+ SideTableRefCountBits(InlineRefCountBits newbits)
667
+ : RefCountBitsT<RefCountNotInline>(&newbits), weakBits(1) {}
668
+
669
+ SWIFT_ALWAYS_INLINE
670
+ void incrementWeakRefCount() { weakBits++; }
671
+
672
+ SWIFT_ALWAYS_INLINE
673
+ bool decrementWeakRefCount() {
674
+ assert(weakBits > 0);
675
+ weakBits--;
676
+ return weakBits == 0;
677
+ }
678
+
679
+ SWIFT_ALWAYS_INLINE
680
+ uint32_t getWeakRefCount() {
681
+ return weakBits;
682
+ }
683
+
684
+ // Side table ref count never has a side table of its own.
685
+ SWIFT_ALWAYS_INLINE
686
+ bool hasSideTable() {
687
+ return false;
688
+ }
689
+ };
690
+
691
+
692
+ // Barriers
693
+ //
694
+ // Strong refcount increment is unordered with respect to other memory locations
695
+ //
696
+ // Strong refcount decrement is a release operation with respect to other
697
+ // memory locations. When an object's reference count becomes zero,
698
+ // an acquire fence is performed before beginning Swift deinit or ObjC
699
+ // -dealloc code. This ensures that the deinit code sees all modifications
700
+ // of the object's contents that were made before the object was released.
701
+ //
702
+ // Unowned and weak increment and decrement are all unordered.
703
+ // There is no deinit equivalent for these counts so no fence is needed.
704
+ //
705
+ // Accessing the side table requires that refCounts be accessed with
706
+ // a load-consume. Only code that is guaranteed not to try dereferencing
707
+ // the side table may perform a load-relaxed of refCounts.
708
+ // Similarly, storing the new side table pointer into refCounts is a
709
+ // store-release, but most other stores into refCounts are store-relaxed.
710
+
711
+ template <typename RefCountBits>
712
+ class RefCounts {
713
+ std::atomic<RefCountBits> refCounts;
714
+
715
+ // Out-of-line slow paths.
716
+
717
+ SWIFT_NOINLINE
718
+ SWIFT_REFCOUNT_CC
719
+ HeapObject *incrementSlow(RefCountBits oldbits, uint32_t inc);
720
+
721
+ SWIFT_NOINLINE
722
+ void incrementNonAtomicSlow(RefCountBits oldbits, uint32_t inc);
723
+
724
+ SWIFT_NOINLINE
725
+ bool tryIncrementSlow(RefCountBits oldbits);
726
+
727
+ SWIFT_NOINLINE
728
+ bool tryIncrementNonAtomicSlow(RefCountBits oldbits);
729
+
730
+ SWIFT_NOINLINE
731
+ void incrementUnownedSlow(uint32_t inc);
732
+
733
+ public:
734
+ enum Initialized_t { Initialized };
735
+ enum Immortal_t { Immortal };
736
+
737
+ // RefCounts must be trivially constructible to avoid ObjC++
738
+ // destruction overhead at runtime. Use RefCounts(Initialized)
739
+ // to produce an initialized instance.
740
+ RefCounts() = default;
741
+
742
+ // Refcount of a new object is 1.
743
+ constexpr RefCounts(Initialized_t)
744
+ : refCounts(RefCountBits(0, 1)) {}
745
+
746
+ // Refcount of an immortal object has top and bottom bits set
747
+ constexpr RefCounts(Immortal_t)
748
+ : refCounts(RefCountBits(RefCountBits::Immortal)) {}
749
+
750
+ void init() {
751
+ refCounts.store(RefCountBits(0, 1), std::memory_order_relaxed);
752
+ }
753
+
754
+ // Initialize for a stack promoted object. This prevents that the final
755
+ // release frees the memory of the object.
756
+ // FIXME: need to mark these and assert they never get a side table,
757
+ // because the extra unowned ref will keep the side table alive forever
758
+ void initForNotFreeing() {
759
+ refCounts.store(RefCountBits(0, 2), std::memory_order_relaxed);
760
+ }
761
+
762
+ // Initialize for an object which will never deallocate.
763
+ void initImmortal() {
764
+ refCounts.store(RefCountBits(RefCountBits::Immortal), std::memory_order_relaxed);
765
+ }
766
+
767
+ void setIsImmortal(bool immortal) {
768
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
769
+ if (oldbits.isImmortal(true)) {
770
+ return;
771
+ }
772
+ RefCountBits newbits;
773
+ do {
774
+ newbits = oldbits;
775
+ newbits.setIsImmortal(immortal);
776
+ } while (!refCounts.compare_exchange_weak(oldbits, newbits,
777
+ std::memory_order_relaxed));
778
+ }
779
+
780
+ void setPureSwiftDeallocation(bool nonobjc) {
781
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
782
+
783
+ // Having a side table precludes using bits this way, but also precludes
784
+ // doing the pure Swift deallocation path. So trying to turn this off
785
+ // on something that has a side table is a noop
786
+ if (!nonobjc && oldbits.hasSideTable()) {
787
+ return;
788
+ }
789
+ // Immortal and no objc complications share a bit, so don't let setting
790
+ // the complications one clear the immortal one
791
+ if (oldbits.isImmortal(true) || oldbits.pureSwiftDeallocation() == nonobjc){
792
+ assert(!oldbits.hasSideTable());
793
+ return;
794
+ }
795
+ RefCountBits newbits;
796
+ do {
797
+ newbits = oldbits;
798
+ newbits.setPureSwiftDeallocation(nonobjc);
799
+ } while (!refCounts.compare_exchange_weak(oldbits, newbits,
800
+ std::memory_order_relaxed));
801
+ }
802
+
803
+ bool getPureSwiftDeallocation() {
804
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
805
+ return bits.pureSwiftDeallocation();
806
+ }
807
+
808
+ // Initialize from another refcount bits.
809
+ // Only inline -> out-of-line is allowed (used for new side table entries).
810
+ void init(InlineRefCountBits newBits) {
811
+ refCounts.store(newBits, std::memory_order_relaxed);
812
+ }
813
+
814
+ // Increment the reference count.
815
+ //
816
+ // This returns the enclosing HeapObject so that it the result of this call
817
+ // can be directly returned from swift_retain. This makes the call to
818
+ // incrementSlow() a tail call.
819
+ SWIFT_ALWAYS_INLINE
820
+ HeapObject *increment(HeapObject *returning, uint32_t inc = 1) {
821
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
822
+
823
+ // Constant propagation will remove this in swift_retain, it should only
824
+ // be present in swift_retain_n.
825
+ if (inc != 1 && oldbits.isImmortal(true)) {
826
+ return getHeapObject();
827
+ }
828
+
829
+ RefCountBits newbits;
830
+ do {
831
+ newbits = oldbits;
832
+ bool fast = newbits.incrementStrongExtraRefCount(inc);
833
+ if (SWIFT_UNLIKELY(!fast)) {
834
+ if (oldbits.isImmortal(false))
835
+ return getHeapObject();
836
+ return incrementSlow(oldbits, inc);
837
+ }
838
+ } while (!refCounts.compare_exchange_weak(oldbits, newbits,
839
+ std::memory_order_relaxed));
840
+ return returning;
841
+ }
842
+
843
+ SWIFT_ALWAYS_INLINE
844
+ void incrementNonAtomic(uint32_t inc = 1) {
845
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
846
+
847
+ // Constant propagation will remove this in swift_retain, it should only
848
+ // be present in swift_retain_n.
849
+ if (inc != 1 && oldbits.isImmortal(true)) {
850
+ return;
851
+ }
852
+
853
+ auto newbits = oldbits;
854
+ bool fast = newbits.incrementStrongExtraRefCount(inc);
855
+ if (SWIFT_UNLIKELY(!fast)) {
856
+ if (oldbits.isImmortal(false))
857
+ return;
858
+ return incrementNonAtomicSlow(oldbits, inc);
859
+ }
860
+ refCounts.store(newbits, std::memory_order_relaxed);
861
+ }
862
+
863
+ // Increment the reference count, unless the object is deiniting.
864
+ SWIFT_ALWAYS_INLINE
865
+ bool tryIncrement() {
866
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
867
+ RefCountBits newbits;
868
+ do {
869
+ if (!oldbits.hasSideTable() && oldbits.getIsDeiniting())
870
+ return false;
871
+
872
+ newbits = oldbits;
873
+ bool fast = newbits.incrementStrongExtraRefCount(1);
874
+ if (SWIFT_UNLIKELY(!fast)) {
875
+ if (oldbits.isImmortal(false))
876
+ return true;
877
+ return tryIncrementSlow(oldbits);
878
+ }
879
+ } while (!refCounts.compare_exchange_weak(oldbits, newbits,
880
+ std::memory_order_relaxed));
881
+ return true;
882
+ }
883
+
884
+ SWIFT_ALWAYS_INLINE
885
+ bool tryIncrementNonAtomic() {
886
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
887
+ if (!oldbits.hasSideTable() && oldbits.getIsDeiniting())
888
+ return false;
889
+
890
+ auto newbits = oldbits;
891
+ bool fast = newbits.incrementStrongExtraRefCount(1);
892
+ if (SWIFT_UNLIKELY(!fast)) {
893
+ if (oldbits.isImmortal(false))
894
+ return true;
895
+ return tryIncrementNonAtomicSlow(oldbits);
896
+ }
897
+ refCounts.store(newbits, std::memory_order_relaxed);
898
+ return true;
899
+ }
900
+
901
+ // Decrement the reference count.
902
+ // Return true if the caller should now deinit the object.
903
+ SWIFT_ALWAYS_INLINE
904
+ bool decrementShouldDeinit(uint32_t dec) {
905
+ return doDecrement<DontPerformDeinit>(dec);
906
+ }
907
+
908
+ SWIFT_ALWAYS_INLINE
909
+ bool decrementShouldDeinitNonAtomic(uint32_t dec) {
910
+ return doDecrementNonAtomic<DontPerformDeinit>(dec);
911
+ }
912
+
913
+ SWIFT_ALWAYS_INLINE
914
+ void decrementAndMaybeDeinit(uint32_t dec) {
915
+ doDecrement<DoPerformDeinit>(dec);
916
+ }
917
+
918
+ SWIFT_ALWAYS_INLINE
919
+ void decrementAndMaybeDeinitNonAtomic(uint32_t dec) {
920
+ doDecrementNonAtomic<DoPerformDeinit>(dec);
921
+ }
922
+
923
+ // Non-atomically release the last strong reference and mark the
924
+ // object as deiniting.
925
+ //
926
+ // Precondition: the reference count must be 1.
927
+ SWIFT_ALWAYS_INLINE
928
+ void decrementFromOneNonAtomic() {
929
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
930
+ if (bits.isImmortal(true)) {
931
+ return;
932
+ }
933
+ if (bits.hasSideTable())
934
+ return bits.getSideTable()->decrementFromOneNonAtomic();
935
+
936
+ assert(!bits.getIsDeiniting());
937
+ assert(bits.getStrongExtraRefCount() == 0 && "Expect a refcount of 1");
938
+ bits.setStrongExtraRefCount(0);
939
+ bits.setIsDeiniting(true);
940
+ refCounts.store(bits, std::memory_order_relaxed);
941
+ }
942
+
943
+ // Return the reference count.
944
+ // Once deinit begins the reference count is undefined.
945
+ uint32_t getCount() const {
946
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
947
+ if (bits.hasSideTable())
948
+ return bits.getSideTable()->getCount();
949
+
950
+ return bits.getStrongExtraRefCount() + 1;
951
+ }
952
+
953
+ // Return whether the reference count is exactly 1.
954
+ // Once deinit begins the reference count is undefined.
955
+ bool isUniquelyReferenced() const {
956
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
957
+ if (bits.hasSideTable())
958
+ return bits.getSideTable()->isUniquelyReferenced();
959
+
960
+ assert(!bits.getIsDeiniting());
961
+ return bits.isUniquelyReferenced();
962
+ }
963
+
964
+ // Return true if the object has started deiniting.
965
+ bool isDeiniting() const {
966
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
967
+ if (bits.hasSideTable())
968
+ return bits.getSideTable()->isDeiniting();
969
+ else
970
+ return bits.getIsDeiniting();
971
+ }
972
+
973
+ bool hasSideTable() const {
974
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
975
+ return bits.hasSideTable();
976
+ }
977
+
978
+ void *getSideTable() const {
979
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
980
+ if (!bits.hasSideTable())
981
+ return nullptr;
982
+ return bits.getSideTable();
983
+ }
984
+
985
+ /// Return true if the object can be freed directly right now.
986
+ /// (transition DEINITING -> DEAD)
987
+ /// This is used in swift_deallocObject().
988
+ /// Can be freed now means:
989
+ /// no side table
990
+ /// unowned reference count is 1
991
+ /// The object is assumed to be deiniting with no strong references already.
992
+ bool canBeFreedNow() const {
993
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
994
+ return (!bits.hasSideTable() &&
995
+ bits.getIsDeiniting() &&
996
+ bits.getStrongExtraRefCount() == 0 &&
997
+ bits.getUnownedRefCount() == 1);
998
+ }
999
+
1000
+ private:
1001
+
1002
+ // Second slow path of doDecrement, where the
1003
+ // object may have a side table entry.
1004
+ template <PerformDeinit performDeinit>
1005
+ bool doDecrementSideTable(RefCountBits oldbits, uint32_t dec);
1006
+
1007
+ // Second slow path of doDecrementNonAtomic, where the
1008
+ // object may have a side table entry.
1009
+ template <PerformDeinit performDeinit>
1010
+ bool doDecrementNonAtomicSideTable(RefCountBits oldbits, uint32_t dec);
1011
+
1012
+ // First slow path of doDecrement, where the object may need to be deinited.
1013
+ // Side table is handled in the second slow path, doDecrementSideTable().
1014
+ template <PerformDeinit performDeinit>
1015
+ SWIFT_REFCOUNT_CC
1016
+ bool doDecrementSlow(RefCountBits oldbits, uint32_t dec) {
1017
+ RefCountBits newbits;
1018
+
1019
+ // Constant propagation will remove this in swift_release, it should only
1020
+ // be present in swift_release_n.
1021
+ if (dec != 1 && oldbits.isImmortal(true)) {
1022
+ return false;
1023
+ }
1024
+
1025
+ bool deinitNow;
1026
+ do {
1027
+ newbits = oldbits;
1028
+
1029
+ bool fast =
1030
+ newbits.decrementStrongExtraRefCount(dec);
1031
+ if (fast) {
1032
+ // Decrement completed normally. New refcount is not zero.
1033
+ deinitNow = false;
1034
+ }
1035
+ else if (oldbits.isImmortal(false)) {
1036
+ return false;
1037
+ } else if (oldbits.hasSideTable()) {
1038
+ // Decrement failed because we're on some other slow path.
1039
+ return doDecrementSideTable<performDeinit>(oldbits, dec);
1040
+ }
1041
+ else {
1042
+ // Decrement underflowed. Begin deinit.
1043
+ // LIVE -> DEINITING
1044
+ deinitNow = true;
1045
+ assert(!oldbits.getIsDeiniting()); // FIXME: make this an error?
1046
+ newbits = oldbits; // Undo failed decrement of newbits.
1047
+ newbits.setStrongExtraRefCount(0);
1048
+ newbits.setIsDeiniting(true);
1049
+ }
1050
+ } while (!refCounts.compare_exchange_weak(oldbits, newbits,
1051
+ std::memory_order_release,
1052
+ std::memory_order_relaxed));
1053
+ if (performDeinit && deinitNow) {
1054
+ std::atomic_thread_fence(std::memory_order_acquire);
1055
+ _swift_release_dealloc(getHeapObject());
1056
+ }
1057
+
1058
+ return deinitNow;
1059
+ }
1060
+
1061
+ // First slow path of doDecrementNonAtomic, where the object may need to be deinited.
1062
+ // Side table is handled in the second slow path, doDecrementNonAtomicSideTable().
1063
+ template <PerformDeinit performDeinit>
1064
+ bool doDecrementNonAtomicSlow(RefCountBits oldbits, uint32_t dec) {
1065
+ bool deinitNow;
1066
+ auto newbits = oldbits;
1067
+
1068
+ // Constant propagation will remove this in swift_release, it should only
1069
+ // be present in swift_release_n.
1070
+ if (dec != 1 && oldbits.isImmortal(true)) {
1071
+ return false;
1072
+ }
1073
+
1074
+ bool fast =
1075
+ newbits.decrementStrongExtraRefCount(dec);
1076
+ if (fast) {
1077
+ // Decrement completed normally. New refcount is not zero.
1078
+ deinitNow = false;
1079
+ }
1080
+ else if (oldbits.isImmortal(false)) {
1081
+ return false;
1082
+ }
1083
+ else if (oldbits.hasSideTable()) {
1084
+ // Decrement failed because we're on some other slow path.
1085
+ return doDecrementNonAtomicSideTable<performDeinit>(oldbits, dec);
1086
+ }
1087
+ else {
1088
+ // Decrement underflowed. Begin deinit.
1089
+ // LIVE -> DEINITING
1090
+ deinitNow = true;
1091
+ assert(!oldbits.getIsDeiniting()); // FIXME: make this an error?
1092
+ newbits = oldbits; // Undo failed decrement of newbits.
1093
+ newbits.setStrongExtraRefCount(0);
1094
+ newbits.setIsDeiniting(true);
1095
+ }
1096
+ refCounts.store(newbits, std::memory_order_relaxed);
1097
+ if (performDeinit && deinitNow) {
1098
+ _swift_release_dealloc(getHeapObject());
1099
+ }
1100
+
1101
+ return deinitNow;
1102
+ }
1103
+
1104
+ public: // FIXME: access control hack
1105
+
1106
+ // Fast path of atomic strong decrement.
1107
+ //
1108
+ // Deinit is optionally handled directly instead of always deferring to
1109
+ // the caller because the compiler can optimize this arrangement better.
1110
+ template <PerformDeinit performDeinit>
1111
+ SWIFT_ALWAYS_INLINE
1112
+ bool doDecrement(uint32_t dec) {
1113
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1114
+ RefCountBits newbits;
1115
+
1116
+ // Constant propagation will remove this in swift_release, it should only
1117
+ // be present in swift_release_n.
1118
+ if (dec != 1 && oldbits.isImmortal(true)) {
1119
+ return false;
1120
+ }
1121
+
1122
+ do {
1123
+ newbits = oldbits;
1124
+ bool fast =
1125
+ newbits.decrementStrongExtraRefCount(dec);
1126
+ if (SWIFT_UNLIKELY(!fast)) {
1127
+ if (oldbits.isImmortal(false)) {
1128
+ return false;
1129
+ }
1130
+ // Slow paths include side table; deinit; underflow
1131
+ return doDecrementSlow<performDeinit>(oldbits, dec);
1132
+ }
1133
+ } while (!refCounts.compare_exchange_weak(oldbits, newbits,
1134
+ std::memory_order_release,
1135
+ std::memory_order_relaxed));
1136
+
1137
+ return false; // don't deinit
1138
+ }
1139
+
1140
+ // This is independently specialized below for inline and out-of-line use.
1141
+ template <PerformDeinit performDeinit>
1142
+ bool doDecrementNonAtomic(uint32_t dec);
1143
+
1144
+
1145
+ // UNOWNED
1146
+
1147
+ public:
1148
+ // Increment the unowned reference count.
1149
+ void incrementUnowned(uint32_t inc) {
1150
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1151
+ if (oldbits.isImmortal(true))
1152
+ return;
1153
+ RefCountBits newbits;
1154
+ do {
1155
+ if (oldbits.hasSideTable())
1156
+ return oldbits.getSideTable()->incrementUnowned(inc);
1157
+
1158
+ newbits = oldbits;
1159
+ assert(newbits.getUnownedRefCount() != 0);
1160
+ uint32_t oldValue = newbits.incrementUnownedRefCount(inc);
1161
+
1162
+ // Check overflow and use the side table on overflow.
1163
+ if (newbits.isOverflowingUnownedRefCount(oldValue, inc))
1164
+ return incrementUnownedSlow(inc);
1165
+
1166
+ } while (!refCounts.compare_exchange_weak(oldbits, newbits,
1167
+ std::memory_order_relaxed));
1168
+ }
1169
+
1170
+ void incrementUnownedNonAtomic(uint32_t inc) {
1171
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1172
+ if (oldbits.isImmortal(true))
1173
+ return;
1174
+ if (oldbits.hasSideTable())
1175
+ return oldbits.getSideTable()->incrementUnownedNonAtomic(inc);
1176
+
1177
+ auto newbits = oldbits;
1178
+ assert(newbits.getUnownedRefCount() != 0);
1179
+ uint32_t oldValue = newbits.incrementUnownedRefCount(inc);
1180
+
1181
+ // Check overflow and use the side table on overflow.
1182
+ if (newbits.isOverflowingUnownedRefCount(oldValue, inc))
1183
+ return incrementUnownedSlow(inc);
1184
+
1185
+ refCounts.store(newbits, std::memory_order_relaxed);
1186
+ }
1187
+
1188
+ // Decrement the unowned reference count.
1189
+ // Return true if the caller should free the object.
1190
+ bool decrementUnownedShouldFree(uint32_t dec) {
1191
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1192
+ if (oldbits.isImmortal(true))
1193
+ return false;
1194
+ RefCountBits newbits;
1195
+
1196
+ bool performFree;
1197
+ do {
1198
+ if (oldbits.hasSideTable())
1199
+ return oldbits.getSideTable()->decrementUnownedShouldFree(dec);
1200
+
1201
+ newbits = oldbits;
1202
+ newbits.decrementUnownedRefCount(dec);
1203
+ if (newbits.getUnownedRefCount() == 0) {
1204
+ // DEINITED -> FREED, or DEINITED -> DEAD
1205
+ // Caller will free the object. Weak decrement is handled by
1206
+ // HeapObjectSideTableEntry::decrementUnownedShouldFree.
1207
+ assert(newbits.getIsDeiniting());
1208
+ performFree = true;
1209
+ } else {
1210
+ performFree = false;
1211
+ }
1212
+ // FIXME: underflow check?
1213
+ } while (!refCounts.compare_exchange_weak(oldbits, newbits,
1214
+ std::memory_order_relaxed));
1215
+ return performFree;
1216
+ }
1217
+
1218
+ bool decrementUnownedShouldFreeNonAtomic(uint32_t dec) {
1219
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1220
+ if (oldbits.isImmortal(true))
1221
+ return false;
1222
+ if (oldbits.hasSideTable())
1223
+ return oldbits.getSideTable()->decrementUnownedShouldFreeNonAtomic(dec);
1224
+
1225
+ bool performFree;
1226
+ auto newbits = oldbits;
1227
+ newbits.decrementUnownedRefCount(dec);
1228
+ if (newbits.getUnownedRefCount() == 0) {
1229
+ // DEINITED -> FREED, or DEINITED -> DEAD
1230
+ // Caller will free the object. Weak decrement is handled by
1231
+ // HeapObjectSideTableEntry::decrementUnownedShouldFreeNonAtomic.
1232
+ assert(newbits.getIsDeiniting());
1233
+ performFree = true;
1234
+ } else {
1235
+ performFree = false;
1236
+ }
1237
+ // FIXME: underflow check?
1238
+ refCounts.store(newbits, std::memory_order_relaxed);
1239
+ return performFree;
1240
+ }
1241
+
1242
+ // Return unowned reference count.
1243
+ // Note that this is not equal to the number of outstanding unowned pointers.
1244
+ uint32_t getUnownedCount() const {
1245
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1246
+ if (bits.hasSideTable())
1247
+ return bits.getSideTable()->getUnownedCount();
1248
+ else
1249
+ return bits.getUnownedRefCount();
1250
+ }
1251
+
1252
+
1253
+ // WEAK
1254
+
1255
+ public:
1256
+ // Returns the object's side table entry (creating it if necessary) with
1257
+ // its weak ref count incremented.
1258
+ // Returns nullptr if the object is already deiniting.
1259
+ // Use this when creating a new weak reference to an object.
1260
+ HeapObjectSideTableEntry* formWeakReference();
1261
+
1262
+ // Increment the weak reference count.
1263
+ void incrementWeak() {
1264
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1265
+ RefCountBits newbits;
1266
+ do {
1267
+ newbits = oldbits;
1268
+ assert(newbits.getWeakRefCount() != 0);
1269
+ newbits.incrementWeakRefCount();
1270
+
1271
+ if (newbits.getWeakRefCount() < oldbits.getWeakRefCount())
1272
+ swift_abortWeakRetainOverflow();
1273
+ } while (!refCounts.compare_exchange_weak(oldbits, newbits,
1274
+ std::memory_order_relaxed));
1275
+ }
1276
+
1277
+ bool decrementWeakShouldCleanUp() {
1278
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1279
+ RefCountBits newbits;
1280
+
1281
+ bool performFree;
1282
+ do {
1283
+ newbits = oldbits;
1284
+ performFree = newbits.decrementWeakRefCount();
1285
+ } while (!refCounts.compare_exchange_weak(oldbits, newbits,
1286
+ std::memory_order_relaxed));
1287
+
1288
+ return performFree;
1289
+ }
1290
+
1291
+ bool decrementWeakShouldCleanUpNonAtomic() {
1292
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1293
+
1294
+ auto newbits = oldbits;
1295
+ auto performFree = newbits.decrementWeakRefCount();
1296
+ refCounts.store(newbits, std::memory_order_relaxed);
1297
+
1298
+ return performFree;
1299
+ }
1300
+
1301
+ // Return weak reference count.
1302
+ // Note that this is not equal to the number of outstanding weak pointers.
1303
+ uint32_t getWeakCount() const;
1304
+
1305
+ #ifndef NDEBUG
1306
+ bool isImmutableCOWBuffer();
1307
+ bool setIsImmutableCOWBuffer(bool immutable);
1308
+ #endif
1309
+
1310
+ // DO NOT TOUCH.
1311
+ // This exists for the benefits of the Refcounting.cpp tests. Do not use it
1312
+ // elsewhere.
1313
+ auto getBitsValue()
1314
+ -> decltype(auto) {
1315
+ return refCounts.load(std::memory_order_relaxed).getBitsValue();
1316
+ }
1317
+
1318
+ void dump() const;
1319
+
1320
+ private:
1321
+ HeapObject *getHeapObject();
1322
+
1323
+ HeapObjectSideTableEntry* allocateSideTable(bool failIfDeiniting);
1324
+ };
1325
+
1326
+ typedef RefCounts<InlineRefCountBits> InlineRefCounts;
1327
+ typedef RefCounts<SideTableRefCountBits> SideTableRefCounts;
1328
+
1329
+ static_assert(std::is_trivially_destructible<InlineRefCounts>::value,
1330
+ "InlineRefCounts must be trivially destructible");
1331
+
1332
+ template <>
1333
+ inline uint32_t RefCounts<InlineRefCountBits>::getWeakCount() const;
1334
+ template <>
1335
+ inline uint32_t RefCounts<SideTableRefCountBits>::getWeakCount() const;
1336
+
1337
+ class HeapObjectSideTableEntry {
1338
+ // FIXME: does object need to be atomic?
1339
+ std::atomic<HeapObject*> object;
1340
+ SideTableRefCounts refCounts;
1341
+
1342
+ #ifndef NDEBUG
1343
+ // Used for runtime consistency checking of COW buffers.
1344
+ bool immutableCOWBuffer = false;
1345
+ #endif
1346
+
1347
+ public:
1348
+ HeapObjectSideTableEntry(HeapObject *newObject)
1349
+ : object(newObject),
1350
+ #if __arm__ || __powerpc__ // https://github.com/apple/swift/issues/48416
1351
+ refCounts(SideTableRefCounts::Initialized)
1352
+ #else
1353
+ refCounts()
1354
+ #endif
1355
+ { }
1356
+
1357
+ void *operator new(size_t) = delete;
1358
+ void operator delete(void *) = delete;
1359
+
1360
+ #pragma clang diagnostic push
1361
+ #pragma clang diagnostic ignored "-Winvalid-offsetof"
1362
+ static ptrdiff_t refCountsOffset() {
1363
+ return offsetof(HeapObjectSideTableEntry, refCounts);
1364
+ }
1365
+ #pragma clang diagnostic pop
1366
+
1367
+ HeapObject* tryRetain() {
1368
+ if (refCounts.tryIncrement())
1369
+ return object.load(std::memory_order_relaxed);
1370
+ else
1371
+ return nullptr;
1372
+ }
1373
+
1374
+ void initRefCounts(InlineRefCountBits newbits) {
1375
+ refCounts.init(newbits);
1376
+ }
1377
+
1378
+ HeapObject *unsafeGetObject() const {
1379
+ return object.load(std::memory_order_relaxed);
1380
+ }
1381
+
1382
+ // STRONG
1383
+
1384
+ void incrementStrong(uint32_t inc) {
1385
+ refCounts.increment(nullptr, inc);
1386
+ }
1387
+
1388
+ template <PerformDeinit performDeinit>
1389
+ bool decrementStrong(uint32_t dec) {
1390
+ return refCounts.doDecrement<performDeinit>(dec);
1391
+ }
1392
+
1393
+ template <PerformDeinit performDeinit>
1394
+ bool decrementNonAtomicStrong(uint32_t dec) {
1395
+ return refCounts.doDecrementNonAtomic<performDeinit>(dec);
1396
+ }
1397
+
1398
+ void decrementFromOneNonAtomic() {
1399
+ decrementNonAtomicStrong<DontPerformDeinit>(1);
1400
+ }
1401
+
1402
+ bool isDeiniting() const {
1403
+ return refCounts.isDeiniting();
1404
+ }
1405
+
1406
+ bool tryIncrement() {
1407
+ return refCounts.tryIncrement();
1408
+ }
1409
+
1410
+ bool tryIncrementNonAtomic() {
1411
+ return refCounts.tryIncrementNonAtomic();
1412
+ }
1413
+
1414
+ // Return weak reference count.
1415
+ // Note that this is not equal to the number of outstanding weak pointers.
1416
+ uint32_t getCount() const {
1417
+ return refCounts.getCount();
1418
+ }
1419
+
1420
+ bool isUniquelyReferenced() const {
1421
+ return refCounts.isUniquelyReferenced();
1422
+ }
1423
+
1424
+ // UNOWNED
1425
+
1426
+ void incrementUnowned(uint32_t inc) {
1427
+ return refCounts.incrementUnowned(inc);
1428
+ }
1429
+
1430
+ void incrementUnownedNonAtomic(uint32_t inc) {
1431
+ return refCounts.incrementUnownedNonAtomic(inc);
1432
+ }
1433
+
1434
+ bool decrementUnownedShouldFree(uint32_t dec) {
1435
+ bool shouldFree = refCounts.decrementUnownedShouldFree(dec);
1436
+ if (shouldFree) {
1437
+ // DEINITED -> FREED
1438
+ // Caller will free the object.
1439
+ decrementWeak();
1440
+ }
1441
+
1442
+ return shouldFree;
1443
+ }
1444
+
1445
+ bool decrementUnownedShouldFreeNonAtomic(uint32_t dec) {
1446
+ bool shouldFree = refCounts.decrementUnownedShouldFreeNonAtomic(dec);
1447
+ if (shouldFree) {
1448
+ // DEINITED -> FREED
1449
+ // Caller will free the object.
1450
+ decrementWeakNonAtomic();
1451
+ }
1452
+
1453
+ return shouldFree;
1454
+ }
1455
+
1456
+ uint32_t getUnownedCount() const {
1457
+ return refCounts.getUnownedCount();
1458
+ }
1459
+
1460
+
1461
+ // WEAK
1462
+
1463
+ SWIFT_NODISCARD
1464
+ HeapObjectSideTableEntry* incrementWeak() {
1465
+ // incrementWeak need not be atomic w.r.t. concurrent deinit initiation.
1466
+ // The client can't actually get a reference to the object without
1467
+ // going through tryRetain(). tryRetain is the one that needs to be
1468
+ // atomic w.r.t. concurrent deinit initiation.
1469
+ // The check here is merely an optimization.
1470
+ if (refCounts.isDeiniting())
1471
+ return nullptr;
1472
+ refCounts.incrementWeak();
1473
+ return this;
1474
+ }
1475
+
1476
+ void decrementWeak() {
1477
+ // FIXME: assertions
1478
+ // FIXME: optimize barriers
1479
+ bool cleanup = refCounts.decrementWeakShouldCleanUp();
1480
+ if (!cleanup)
1481
+ return;
1482
+
1483
+ // Weak ref count is now zero. Delete the side table entry.
1484
+ // FREED -> DEAD
1485
+ assert(refCounts.getUnownedCount() == 0);
1486
+ swift_cxx_deleteObject(this);
1487
+ }
1488
+
1489
+ void decrementWeakNonAtomic() {
1490
+ // FIXME: assertions
1491
+ // FIXME: optimize barriers
1492
+ bool cleanup = refCounts.decrementWeakShouldCleanUpNonAtomic();
1493
+ if (!cleanup)
1494
+ return;
1495
+
1496
+ // Weak ref count is now zero. Delete the side table entry.
1497
+ // FREED -> DEAD
1498
+ assert(refCounts.getUnownedCount() == 0);
1499
+ swift_cxx_deleteObject(this);
1500
+ }
1501
+
1502
+ uint32_t getWeakCount() const {
1503
+ return refCounts.getWeakCount();
1504
+ }
1505
+
1506
+ void *getSideTable() {
1507
+ return refCounts.getSideTable();
1508
+ }
1509
+
1510
+ #ifndef NDEBUG
1511
+ bool isImmutableCOWBuffer() const {
1512
+ return immutableCOWBuffer;
1513
+ }
1514
+
1515
+ void setIsImmutableCOWBuffer(bool immutable) {
1516
+ immutableCOWBuffer = immutable;
1517
+ }
1518
+ #endif
1519
+
1520
+ void dumpRefCounts() {
1521
+ refCounts.dump();
1522
+ }
1523
+ };
1524
+
1525
+
1526
+ // Inline version of non-atomic strong decrement.
1527
+ // This version can actually be non-atomic.
1528
+ template <>
1529
+ template <PerformDeinit performDeinit>
1530
+ SWIFT_ALWAYS_INLINE inline bool
1531
+ RefCounts<InlineRefCountBits>::doDecrementNonAtomic(uint32_t dec) {
1532
+
1533
+ // We can get away without atomicity here.
1534
+ // The caller claims that there are no other threads with strong references
1535
+ // to this object.
1536
+ // We can non-atomically check that there are no outstanding unowned or
1537
+ // weak references, and if nobody else has a strong reference then
1538
+ // nobody else can form a new unowned or weak reference.
1539
+ // Therefore there is no other thread that can be concurrently
1540
+ // manipulating this object's retain counts.
1541
+
1542
+ auto oldbits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1543
+
1544
+ // Use slow path if we can't guarantee atomicity.
1545
+ if (oldbits.hasSideTable() || oldbits.getUnownedRefCount() != 1)
1546
+ return doDecrementNonAtomicSlow<performDeinit>(oldbits, dec);
1547
+
1548
+ if (oldbits.isImmortal(true)) {
1549
+ return false;
1550
+ }
1551
+
1552
+ auto newbits = oldbits;
1553
+ bool fast = newbits.decrementStrongExtraRefCount(dec);
1554
+ if (!fast) {
1555
+ return doDecrementNonAtomicSlow<performDeinit>(oldbits, dec);
1556
+ }
1557
+
1558
+ refCounts.store(newbits, std::memory_order_relaxed);
1559
+ return false; // don't deinit
1560
+ }
1561
+
1562
+ // Out-of-line version of non-atomic strong decrement.
1563
+ // This version needs to be atomic because of the
1564
+ // threat of concurrent read of a weak reference.
1565
+ template <>
1566
+ template <PerformDeinit performDeinit>
1567
+ inline bool RefCounts<SideTableRefCountBits>::
1568
+ doDecrementNonAtomic(uint32_t dec) {
1569
+ return doDecrement<performDeinit>(dec);
1570
+ }
1571
+
1572
+
1573
+ template <>
1574
+ template <PerformDeinit performDeinit>
1575
+ inline bool RefCounts<InlineRefCountBits>::
1576
+ doDecrementSideTable(InlineRefCountBits oldbits, uint32_t dec) {
1577
+ auto side = oldbits.getSideTable();
1578
+ return side->decrementStrong<performDeinit>(dec);
1579
+ }
1580
+
1581
+ template <>
1582
+ template <PerformDeinit performDeinit>
1583
+ inline bool RefCounts<InlineRefCountBits>::
1584
+ doDecrementNonAtomicSideTable(InlineRefCountBits oldbits, uint32_t dec) {
1585
+ auto side = oldbits.getSideTable();
1586
+ return side->decrementNonAtomicStrong<performDeinit>(dec);
1587
+ }
1588
+
1589
+ template <>
1590
+ template <PerformDeinit performDeinit>
1591
+ inline bool RefCounts<SideTableRefCountBits>::
1592
+ doDecrementSideTable(SideTableRefCountBits oldbits, uint32_t dec) {
1593
+ swift::crash("side table refcount must not have "
1594
+ "a side table entry of its own");
1595
+ }
1596
+
1597
+ template <>
1598
+ template <PerformDeinit performDeinit>
1599
+ inline bool RefCounts<SideTableRefCountBits>::
1600
+ doDecrementNonAtomicSideTable(SideTableRefCountBits oldbits, uint32_t dec) {
1601
+ swift::crash("side table refcount must not have "
1602
+ "a side table entry of its own");
1603
+ }
1604
+
1605
+ template <>
1606
+ inline uint32_t RefCounts<InlineRefCountBits>::getWeakCount() const {
1607
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1608
+ if (bits.hasSideTable()) {
1609
+ return bits.getSideTable()->getWeakCount();
1610
+ } else {
1611
+ // No weak refcount storage. Return only the weak increment held
1612
+ // on behalf of the unowned count.
1613
+ return bits.getUnownedRefCount() ? 1 : 0;
1614
+ }
1615
+ }
1616
+
1617
+ template <>
1618
+ inline uint32_t RefCounts<SideTableRefCountBits>::getWeakCount() const {
1619
+ auto bits = refCounts.load(SWIFT_MEMORY_ORDER_CONSUME);
1620
+ return bits.getWeakRefCount();
1621
+ }
1622
+
1623
+ template <> inline
1624
+ HeapObject* RefCounts<InlineRefCountBits>::getHeapObject() {
1625
+ auto offset = sizeof(void *);
1626
+ auto prefix = ((char *)this - offset);
1627
+ return (HeapObject *)prefix;
1628
+ }
1629
+
1630
+ template <> inline
1631
+ HeapObject* RefCounts<SideTableRefCountBits>::getHeapObject() {
1632
+ auto offset = HeapObjectSideTableEntry::refCountsOffset();
1633
+ auto prefix = ((char *)this - offset);
1634
+ return *(HeapObject **)prefix;
1635
+ }
1636
+
1637
+
1638
+ // namespace swift
1639
+ }
1640
+
1641
+ // for use by SWIFT_HEAPOBJECT_NON_OBJC_MEMBERS
1642
+ typedef swift::InlineRefCounts InlineRefCounts;
1643
+
1644
+ // These assertions apply to both the C and the C++ declarations.
1645
+ static_assert(sizeof(InlineRefCounts) == sizeof(InlineRefCountsPlaceholder),
1646
+ "InlineRefCounts and InlineRefCountsPlaceholder must match");
1647
+ static_assert(sizeof(InlineRefCounts) == sizeof(__swift_uintptr_t),
1648
+ "InlineRefCounts must be pointer-sized");
1649
+ static_assert(__alignof(InlineRefCounts) == __alignof(__swift_uintptr_t),
1650
+ "InlineRefCounts must be pointer-aligned");
1651
+
1652
+ #endif // !defined(__swift__)
1653
+
1654
+ #endif