visaljs 0.0.4 → 0.0.6

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 (433) hide show
  1. package/cli.js +469 -53
  2. package/node/include/js_node.h +36 -0
  3. package/node/prelude/async_hooks.js +63 -8
  4. package/node/prelude/buffer.js +0 -0
  5. package/node/prelude/diagnostics_channel.js +322 -0
  6. package/node/prelude/dns.js +3 -2
  7. package/node/prelude/events.js +17 -3
  8. package/node/prelude/fs.js +177 -5
  9. package/node/prelude/fs_promises.js +24 -0
  10. package/node/prelude/http.js +13 -4
  11. package/node/prelude/http2.js +0 -0
  12. package/node/prelude/internal/async_context.js +27 -0
  13. package/node/prelude/internal/crypto/asym.js +0 -0
  14. package/node/prelude/internal/crypto/cipher.js +0 -0
  15. package/node/prelude/internal/crypto/kdf.js +0 -0
  16. package/node/prelude/internal/crypto/keys.js +0 -0
  17. package/node/prelude/internal/crypto/random.js +0 -0
  18. package/node/prelude/internal/crypto/util.js +0 -0
  19. package/node/prelude/internal/errors.js +11 -0
  20. package/node/prelude/internal/process_events.js +14 -0
  21. package/node/prelude/internal/process_signals.js +42 -0
  22. package/node/prelude/internal/querystring.js +0 -0
  23. package/node/prelude/internal/timers.js +233 -0
  24. package/node/prelude/internal/timers_global.js +9 -0
  25. package/node/prelude/internal/zlib_brotli.js +6 -0
  26. package/node/prelude/internal/zlib_engines.js +4 -0
  27. package/node/prelude/internal/zlib_zstd.js +6 -0
  28. package/node/prelude/module.js +22 -6
  29. package/node/prelude/net.js +9 -8
  30. package/node/prelude/os.js +0 -0
  31. package/node/prelude/path.js +1599 -186
  32. package/node/prelude/path_posix.js +9 -0
  33. package/node/prelude/path_win32.js +9 -0
  34. package/node/prelude/process.js +3 -0
  35. package/node/prelude/querystring.js +0 -0
  36. package/node/prelude/stream.js +18 -6
  37. package/node/prelude/stream_promises.js +0 -0
  38. package/node/prelude/stream_web.js +0 -0
  39. package/node/prelude/string_decoder.js +0 -0
  40. package/node/prelude/timers.js +92 -0
  41. package/node/prelude/timers_promises.js +133 -0
  42. package/node/prelude/tty.js +0 -0
  43. package/node/prelude/url.js +0 -0
  44. package/node/prelude/util.js +0 -0
  45. package/node/prelude/zlib.js +912 -72
  46. package/node/src/host_brotli.c +157 -0
  47. package/node/src/host_fs.c +95 -1
  48. package/node/src/host_loop.c +10 -4
  49. package/node/src/host_os.c +0 -0
  50. package/node/src/host_signal.c +70 -0
  51. package/node/src/host_sys.c +50 -0
  52. package/node/src/host_zlib.c +314 -0
  53. package/node/src/host_zstd.c +179 -0
  54. package/node/third_party/brotli/LICENSE +19 -0
  55. package/node/third_party/brotli/common/constants.c +15 -0
  56. package/node/third_party/brotli/common/constants.h +201 -0
  57. package/node/third_party/brotli/common/context.c +156 -0
  58. package/node/third_party/brotli/common/context.h +113 -0
  59. package/node/third_party/brotli/common/dictionary.c +5916 -0
  60. package/node/third_party/brotli/common/dictionary.h +64 -0
  61. package/node/third_party/brotli/common/platform.c +23 -0
  62. package/node/third_party/brotli/common/platform.h +541 -0
  63. package/node/third_party/brotli/common/shared_dictionary.c +521 -0
  64. package/node/third_party/brotli/common/shared_dictionary_internal.h +75 -0
  65. package/node/third_party/brotli/common/transform.c +291 -0
  66. package/node/third_party/brotli/common/transform.h +85 -0
  67. package/node/third_party/brotli/common/version.h +51 -0
  68. package/node/third_party/brotli/dec/bit_reader.c +78 -0
  69. package/node/third_party/brotli/dec/bit_reader.h +423 -0
  70. package/node/third_party/brotli/dec/decode.c +2875 -0
  71. package/node/third_party/brotli/dec/huffman.c +342 -0
  72. package/node/third_party/brotli/dec/huffman.h +122 -0
  73. package/node/third_party/brotli/dec/prefix.h +733 -0
  74. package/node/third_party/brotli/dec/state.c +183 -0
  75. package/node/third_party/brotli/dec/state.h +400 -0
  76. package/node/third_party/brotli/enc/backward_references.c +207 -0
  77. package/node/third_party/brotli/enc/backward_references.h +40 -0
  78. package/node/third_party/brotli/enc/backward_references_hq.c +939 -0
  79. package/node/third_party/brotli/enc/backward_references_hq.h +96 -0
  80. package/node/third_party/brotli/enc/backward_references_inc.h +189 -0
  81. package/node/third_party/brotli/enc/bit_cost.c +36 -0
  82. package/node/third_party/brotli/enc/bit_cost.h +64 -0
  83. package/node/third_party/brotli/enc/bit_cost_inc.h +127 -0
  84. package/node/third_party/brotli/enc/block_encoder_inc.h +34 -0
  85. package/node/third_party/brotli/enc/block_splitter.c +217 -0
  86. package/node/third_party/brotli/enc/block_splitter.h +52 -0
  87. package/node/third_party/brotli/enc/block_splitter_inc.h +481 -0
  88. package/node/third_party/brotli/enc/brotli_bit_stream.c +1336 -0
  89. package/node/third_party/brotli/enc/brotli_bit_stream.h +89 -0
  90. package/node/third_party/brotli/enc/cluster.c +57 -0
  91. package/node/third_party/brotli/enc/cluster.h +49 -0
  92. package/node/third_party/brotli/enc/cluster_inc.h +325 -0
  93. package/node/third_party/brotli/enc/command.c +28 -0
  94. package/node/third_party/brotli/enc/command.h +191 -0
  95. package/node/third_party/brotli/enc/compound_dictionary.c +207 -0
  96. package/node/third_party/brotli/enc/compound_dictionary.h +74 -0
  97. package/node/third_party/brotli/enc/compress_fragment.c +800 -0
  98. package/node/third_party/brotli/enc/compress_fragment.h +86 -0
  99. package/node/third_party/brotli/enc/compress_fragment_two_pass.c +657 -0
  100. package/node/third_party/brotli/enc/compress_fragment_two_pass.h +72 -0
  101. package/node/third_party/brotli/enc/dictionary_hash.c +1848 -0
  102. package/node/third_party/brotli/enc/dictionary_hash.h +25 -0
  103. package/node/third_party/brotli/enc/encode.c +1996 -0
  104. package/node/third_party/brotli/enc/encoder_dict.c +640 -0
  105. package/node/third_party/brotli/enc/encoder_dict.h +157 -0
  106. package/node/third_party/brotli/enc/entropy_encode.c +504 -0
  107. package/node/third_party/brotli/enc/entropy_encode.h +123 -0
  108. package/node/third_party/brotli/enc/entropy_encode_static.h +542 -0
  109. package/node/third_party/brotli/enc/fast_log.c +105 -0
  110. package/node/third_party/brotli/enc/fast_log.h +67 -0
  111. package/node/third_party/brotli/enc/find_match_length.h +72 -0
  112. package/node/third_party/brotli/enc/hash.h +728 -0
  113. package/node/third_party/brotli/enc/hash_composite_inc.h +140 -0
  114. package/node/third_party/brotli/enc/hash_forgetful_chain_inc.h +295 -0
  115. package/node/third_party/brotli/enc/hash_longest_match64_inc.h +262 -0
  116. package/node/third_party/brotli/enc/hash_longest_match_inc.h +258 -0
  117. package/node/third_party/brotli/enc/hash_longest_match_quickly_inc.h +266 -0
  118. package/node/third_party/brotli/enc/hash_rolling_inc.h +212 -0
  119. package/node/third_party/brotli/enc/hash_to_binary_tree_inc.h +330 -0
  120. package/node/third_party/brotli/enc/histogram.c +100 -0
  121. package/node/third_party/brotli/enc/histogram.h +64 -0
  122. package/node/third_party/brotli/enc/histogram_inc.h +51 -0
  123. package/node/third_party/brotli/enc/literal_cost.c +180 -0
  124. package/node/third_party/brotli/enc/literal_cost.h +32 -0
  125. package/node/third_party/brotli/enc/memory.c +194 -0
  126. package/node/third_party/brotli/enc/memory.h +131 -0
  127. package/node/third_party/brotli/enc/metablock.c +677 -0
  128. package/node/third_party/brotli/enc/metablock.h +106 -0
  129. package/node/third_party/brotli/enc/metablock_inc.h +185 -0
  130. package/node/third_party/brotli/enc/params.h +47 -0
  131. package/node/third_party/brotli/enc/prefix.h +54 -0
  132. package/node/third_party/brotli/enc/quality.h +202 -0
  133. package/node/third_party/brotli/enc/ringbuffer.h +168 -0
  134. package/node/third_party/brotli/enc/state.h +104 -0
  135. package/node/third_party/brotli/enc/static_dict.c +542 -0
  136. package/node/third_party/brotli/enc/static_dict.h +41 -0
  137. package/node/third_party/brotli/enc/static_dict_lut.h +5866 -0
  138. package/node/third_party/brotli/enc/utf8_util.c +85 -0
  139. package/node/third_party/brotli/enc/utf8_util.h +33 -0
  140. package/node/third_party/brotli/enc/write_bits.h +88 -0
  141. package/node/third_party/brotli/include/brotli/decode.h +409 -0
  142. package/node/third_party/brotli/include/brotli/encode.h +501 -0
  143. package/node/third_party/brotli/include/brotli/port.h +305 -0
  144. package/node/third_party/brotli/include/brotli/shared_dictionary.h +100 -0
  145. package/node/third_party/brotli/include/brotli/types.h +83 -0
  146. package/node/third_party/libuv/LICENSE +0 -0
  147. package/node/third_party/libuv/include/uv/aix.h +0 -0
  148. package/node/third_party/libuv/include/uv/bsd.h +0 -0
  149. package/node/third_party/libuv/include/uv/darwin.h +0 -0
  150. package/node/third_party/libuv/include/uv/errno.h +0 -0
  151. package/node/third_party/libuv/include/uv/linux.h +0 -0
  152. package/node/third_party/libuv/include/uv/os390.h +0 -0
  153. package/node/third_party/libuv/include/uv/posix.h +0 -0
  154. package/node/third_party/libuv/include/uv/sunos.h +0 -0
  155. package/node/third_party/libuv/include/uv/threadpool.h +0 -0
  156. package/node/third_party/libuv/include/uv/tree.h +0 -0
  157. package/node/third_party/libuv/include/uv/unix.h +0 -0
  158. package/node/third_party/libuv/include/uv/version.h +0 -0
  159. package/node/third_party/libuv/include/uv/win.h +0 -0
  160. package/node/third_party/libuv/include/uv.h +0 -0
  161. package/node/third_party/libuv/src/fs-poll.c +0 -0
  162. package/node/third_party/libuv/src/heap-inl.h +0 -0
  163. package/node/third_party/libuv/src/idna.c +0 -0
  164. package/node/third_party/libuv/src/idna.h +0 -0
  165. package/node/third_party/libuv/src/inet.c +0 -0
  166. package/node/third_party/libuv/src/queue.h +0 -0
  167. package/node/third_party/libuv/src/random.c +0 -0
  168. package/node/third_party/libuv/src/strscpy.c +0 -0
  169. package/node/third_party/libuv/src/strscpy.h +0 -0
  170. package/node/third_party/libuv/src/strtok.c +0 -0
  171. package/node/third_party/libuv/src/strtok.h +0 -0
  172. package/node/third_party/libuv/src/thread-common.c +0 -0
  173. package/node/third_party/libuv/src/threadpool.c +0 -0
  174. package/node/third_party/libuv/src/timer.c +0 -0
  175. package/node/third_party/libuv/src/unix/async.c +0 -0
  176. package/node/third_party/libuv/src/unix/bsd-ifaddrs.c +0 -0
  177. package/node/third_party/libuv/src/unix/core.c +0 -0
  178. package/node/third_party/libuv/src/unix/darwin-proctitle.c +0 -0
  179. package/node/third_party/libuv/src/unix/darwin-stub.h +0 -0
  180. package/node/third_party/libuv/src/unix/darwin-syscalls.h +0 -0
  181. package/node/third_party/libuv/src/unix/darwin.c +0 -0
  182. package/node/third_party/libuv/src/unix/dl.c +0 -0
  183. package/node/third_party/libuv/src/unix/fs.c +0 -0
  184. package/node/third_party/libuv/src/unix/fsevents.c +0 -0
  185. package/node/third_party/libuv/src/unix/getaddrinfo.c +0 -0
  186. package/node/third_party/libuv/src/unix/getnameinfo.c +0 -0
  187. package/node/third_party/libuv/src/unix/internal.h +0 -0
  188. package/node/third_party/libuv/src/unix/kqueue.c +0 -0
  189. package/node/third_party/libuv/src/unix/linux.c +0 -0
  190. package/node/third_party/libuv/src/unix/loop-watcher.c +0 -0
  191. package/node/third_party/libuv/src/unix/loop.c +0 -0
  192. package/node/third_party/libuv/src/unix/pipe.c +0 -0
  193. package/node/third_party/libuv/src/unix/poll.c +0 -0
  194. package/node/third_party/libuv/src/unix/process.c +0 -0
  195. package/node/third_party/libuv/src/unix/procfs-exepath.c +0 -0
  196. package/node/third_party/libuv/src/unix/proctitle.c +0 -0
  197. package/node/third_party/libuv/src/unix/random-devurandom.c +0 -0
  198. package/node/third_party/libuv/src/unix/random-getentropy.c +0 -0
  199. package/node/third_party/libuv/src/unix/random-getrandom.c +0 -0
  200. package/node/third_party/libuv/src/unix/random-sysctl-linux.c +0 -0
  201. package/node/third_party/libuv/src/unix/signal.c +0 -0
  202. package/node/third_party/libuv/src/unix/stream.c +0 -0
  203. package/node/third_party/libuv/src/unix/tcp.c +0 -0
  204. package/node/third_party/libuv/src/unix/thread.c +0 -0
  205. package/node/third_party/libuv/src/unix/tty.c +0 -0
  206. package/node/third_party/libuv/src/unix/udp.c +0 -0
  207. package/node/third_party/libuv/src/uv-common.c +0 -0
  208. package/node/third_party/libuv/src/uv-common.h +0 -0
  209. package/node/third_party/libuv/src/uv-data-getter-setters.c +0 -0
  210. package/node/third_party/libuv/src/version.c +0 -0
  211. package/node/third_party/llhttp/LICENSE +0 -0
  212. package/node/third_party/llhttp/api.c +0 -0
  213. package/node/third_party/llhttp/http.c +0 -0
  214. package/node/third_party/llhttp/llhttp.c +0 -0
  215. package/node/third_party/llhttp/llhttp.h +0 -0
  216. package/node/third_party/zlib/LICENSE +19 -0
  217. package/node/third_party/zlib/README.chromium +38 -0
  218. package/node/third_party/zlib/adler32.c +197 -0
  219. package/node/third_party/zlib/chromeconf.h +203 -0
  220. package/node/third_party/zlib/contrib/optimizations/insert_string.h +80 -0
  221. package/node/third_party/zlib/cpu_features.c +213 -0
  222. package/node/third_party/zlib/cpu_features.h +22 -0
  223. package/node/third_party/zlib/crc32.c +1192 -0
  224. package/node/third_party/zlib/crc32.h +9446 -0
  225. package/node/third_party/zlib/deflate.c +2289 -0
  226. package/node/third_party/zlib/deflate.h +407 -0
  227. package/node/third_party/zlib/gzguts.h +214 -0
  228. package/node/third_party/zlib/inffast.c +327 -0
  229. package/node/third_party/zlib/inffast.h +26 -0
  230. package/node/third_party/zlib/inffixed.h +94 -0
  231. package/node/third_party/zlib/inflate.c +1528 -0
  232. package/node/third_party/zlib/inflate.h +126 -0
  233. package/node/third_party/zlib/inftrees.c +299 -0
  234. package/node/third_party/zlib/inftrees.h +62 -0
  235. package/node/third_party/zlib/trees.c +1161 -0
  236. package/node/third_party/zlib/trees.h +128 -0
  237. package/node/third_party/zlib/zconf.h +558 -0
  238. package/node/third_party/zlib/zlib.h +1967 -0
  239. package/node/third_party/zlib/zutil.c +299 -0
  240. package/node/third_party/zlib/zutil.h +275 -0
  241. package/node/third_party/zstd/LICENSE +30 -0
  242. package/node/third_party/zstd/common/allocations.h +55 -0
  243. package/node/third_party/zstd/common/bits.h +205 -0
  244. package/node/third_party/zstd/common/bitstream.h +454 -0
  245. package/node/third_party/zstd/common/compiler.h +464 -0
  246. package/node/third_party/zstd/common/cpu.h +249 -0
  247. package/node/third_party/zstd/common/debug.c +30 -0
  248. package/node/third_party/zstd/common/debug.h +107 -0
  249. package/node/third_party/zstd/common/entropy_common.c +340 -0
  250. package/node/third_party/zstd/common/error_private.c +64 -0
  251. package/node/third_party/zstd/common/error_private.h +158 -0
  252. package/node/third_party/zstd/common/fse.h +625 -0
  253. package/node/third_party/zstd/common/fse_decompress.c +315 -0
  254. package/node/third_party/zstd/common/huf.h +277 -0
  255. package/node/third_party/zstd/common/mem.h +422 -0
  256. package/node/third_party/zstd/common/pool.c +371 -0
  257. package/node/third_party/zstd/common/pool.h +81 -0
  258. package/node/third_party/zstd/common/portability_macros.h +171 -0
  259. package/node/third_party/zstd/common/threading.c +182 -0
  260. package/node/third_party/zstd/common/threading.h +142 -0
  261. package/node/third_party/zstd/common/xxhash.c +18 -0
  262. package/node/third_party/zstd/common/xxhash.h +7094 -0
  263. package/node/third_party/zstd/common/zstd_common.c +48 -0
  264. package/node/third_party/zstd/common/zstd_deps.h +123 -0
  265. package/node/third_party/zstd/common/zstd_internal.h +324 -0
  266. package/node/third_party/zstd/common/zstd_trace.h +156 -0
  267. package/node/third_party/zstd/compress/clevels.h +134 -0
  268. package/node/third_party/zstd/compress/fse_compress.c +625 -0
  269. package/node/third_party/zstd/compress/hist.c +191 -0
  270. package/node/third_party/zstd/compress/hist.h +82 -0
  271. package/node/third_party/zstd/compress/huf_compress.c +1464 -0
  272. package/node/third_party/zstd/compress/zstd_compress.c +7843 -0
  273. package/node/third_party/zstd/compress/zstd_compress_internal.h +1636 -0
  274. package/node/third_party/zstd/compress/zstd_compress_literals.c +235 -0
  275. package/node/third_party/zstd/compress/zstd_compress_literals.h +39 -0
  276. package/node/third_party/zstd/compress/zstd_compress_sequences.c +442 -0
  277. package/node/third_party/zstd/compress/zstd_compress_sequences.h +55 -0
  278. package/node/third_party/zstd/compress/zstd_compress_superblock.c +688 -0
  279. package/node/third_party/zstd/compress/zstd_compress_superblock.h +32 -0
  280. package/node/third_party/zstd/compress/zstd_cwksp.h +765 -0
  281. package/node/third_party/zstd/compress/zstd_double_fast.c +778 -0
  282. package/node/third_party/zstd/compress/zstd_double_fast.h +42 -0
  283. package/node/third_party/zstd/compress/zstd_fast.c +985 -0
  284. package/node/third_party/zstd/compress/zstd_fast.h +30 -0
  285. package/node/third_party/zstd/compress/zstd_lazy.c +2199 -0
  286. package/node/third_party/zstd/compress/zstd_lazy.h +193 -0
  287. package/node/third_party/zstd/compress/zstd_ldm.c +745 -0
  288. package/node/third_party/zstd/compress/zstd_ldm.h +109 -0
  289. package/node/third_party/zstd/compress/zstd_ldm_geartab.h +106 -0
  290. package/node/third_party/zstd/compress/zstd_opt.c +1580 -0
  291. package/node/third_party/zstd/compress/zstd_opt.h +72 -0
  292. package/node/third_party/zstd/compress/zstd_preSplit.c +238 -0
  293. package/node/third_party/zstd/compress/zstd_preSplit.h +33 -0
  294. package/node/third_party/zstd/compress/zstdmt_compress.c +1923 -0
  295. package/node/third_party/zstd/compress/zstdmt_compress.h +102 -0
  296. package/node/third_party/zstd/decompress/huf_decompress.c +1944 -0
  297. package/node/third_party/zstd/decompress/zstd_ddict.c +244 -0
  298. package/node/third_party/zstd/decompress/zstd_ddict.h +44 -0
  299. package/node/third_party/zstd/decompress/zstd_decompress.c +2410 -0
  300. package/node/third_party/zstd/decompress/zstd_decompress_block.c +2209 -0
  301. package/node/third_party/zstd/decompress/zstd_decompress_block.h +73 -0
  302. package/node/third_party/zstd/decompress/zstd_decompress_internal.h +240 -0
  303. package/node/third_party/zstd/zdict.h +481 -0
  304. package/node/third_party/zstd/zstd.h +3198 -0
  305. package/node/third_party/zstd/zstd_errors.h +107 -0
  306. package/package.json +1 -1
  307. package/runtime/include/js_atoms.gen.h +0 -0
  308. package/runtime/include/js_atoms.h +0 -0
  309. package/runtime/include/js_bigint.h +0 -0
  310. package/runtime/include/js_buffer.h +0 -0
  311. package/runtime/include/js_builtins.h +0 -0
  312. package/runtime/include/js_console.h +5 -2
  313. package/runtime/include/js_convert.h +0 -0
  314. package/runtime/include/js_core.def +0 -0
  315. package/runtime/include/js_error.h +0 -0
  316. package/runtime/include/js_exception.h +0 -0
  317. package/runtime/include/js_function.h +0 -0
  318. package/runtime/include/js_gc.h +0 -0
  319. package/runtime/include/js_generator.h +0 -0
  320. package/runtime/include/js_host.h +5 -3
  321. package/runtime/include/js_jobs.h +18 -1
  322. package/runtime/include/js_module.h +0 -0
  323. package/runtime/include/js_object.h +0 -0
  324. package/runtime/include/js_ops.h +0 -0
  325. package/runtime/include/js_promise.h +1 -0
  326. package/runtime/include/js_regexp.h +0 -0
  327. package/runtime/include/js_runtime.h +0 -0
  328. package/runtime/include/js_symbol.h +0 -0
  329. package/runtime/include/js_web.h +0 -0
  330. package/runtime/include/jscell.h +0 -0
  331. package/runtime/include/jscontext.h +14 -0
  332. package/runtime/include/jsnum.h +0 -0
  333. package/runtime/include/jsstring.h +0 -0
  334. package/runtime/include/jsvalue.h +0 -0
  335. package/runtime/src/arguments.c +0 -0
  336. package/runtime/src/array.c +0 -0
  337. package/runtime/src/arraybuffer.c +0 -0
  338. package/runtime/src/async_iter.c +0 -0
  339. package/runtime/src/atoms.c +0 -0
  340. package/runtime/src/base64.c +0 -0
  341. package/runtime/src/bigint.c +0 -0
  342. package/runtime/src/blob.c +0 -0
  343. package/runtime/src/buffer.c +20 -16
  344. package/runtime/src/builtin_table.c +0 -0
  345. package/runtime/src/builtins.c +0 -0
  346. package/runtime/src/builtins_util.h +0 -0
  347. package/runtime/src/collections.c +0 -0
  348. package/runtime/src/components.c +0 -0
  349. package/runtime/src/console.c +15 -2
  350. package/runtime/src/convert.c +0 -0
  351. package/runtime/src/core_all.c +0 -0
  352. package/runtime/src/crypto.c +0 -0
  353. package/runtime/src/crypto_host.c +0 -0
  354. package/runtime/src/crypto_kdf.c +0 -0
  355. package/runtime/src/crypto_key.c +0 -0
  356. package/runtime/src/date.c +0 -0
  357. package/runtime/src/domexception.c +0 -0
  358. package/runtime/src/elements.c +0 -0
  359. package/runtime/src/elements.h +0 -0
  360. package/runtime/src/encoding.c +0 -0
  361. package/runtime/src/error.c +0 -0
  362. package/runtime/src/events.c +1 -1
  363. package/runtime/src/exception.c +0 -0
  364. package/runtime/src/fetch.c +0 -0
  365. package/runtime/src/function.c +0 -0
  366. package/runtime/src/gc.c +2 -0
  367. package/runtime/src/generator.c +0 -0
  368. package/runtime/src/global.c +0 -0
  369. package/runtime/src/headers.c +0 -0
  370. package/runtime/src/inspect.c +0 -0
  371. package/runtime/src/internal.h +0 -0
  372. package/runtime/src/iterate.c +0 -0
  373. package/runtime/src/iterator.c +0 -0
  374. package/runtime/src/jobs.c +123 -44
  375. package/runtime/src/jsnum.c +0 -0
  376. package/runtime/src/json.c +0 -0
  377. package/runtime/src/math.c +0 -0
  378. package/runtime/src/module.c +0 -0
  379. package/runtime/src/number.c +0 -0
  380. package/runtime/src/object.c +0 -0
  381. package/runtime/src/ops.c +0 -0
  382. package/runtime/src/os.c +0 -0
  383. package/runtime/src/os.h +0 -0
  384. package/runtime/src/process.c +92 -8
  385. package/runtime/src/promise.c +7 -2
  386. package/runtime/src/proxy.c +0 -0
  387. package/runtime/src/reflect.c +0 -0
  388. package/runtime/src/regexp.c +0 -0
  389. package/runtime/src/regexp_anchor.h +0 -0
  390. package/runtime/src/regexp_message.h +0 -0
  391. package/runtime/src/shape.c +0 -0
  392. package/runtime/src/shape.h +0 -0
  393. package/runtime/src/streams.c +0 -0
  394. package/runtime/src/streams.h +0 -0
  395. package/runtime/src/string.c +0 -0
  396. package/runtime/src/string_builtins.c +0 -0
  397. package/runtime/src/symbol.c +0 -0
  398. package/runtime/src/test_host.c +0 -0
  399. package/runtime/src/typedarray.c +0 -0
  400. package/runtime/src/tznames.gen.h +0 -0
  401. package/runtime/src/uri.c +0 -0
  402. package/runtime/src/url.c +0 -0
  403. package/runtime/src/weak.c +1 -4
  404. package/runtime/src/web.c +0 -0
  405. package/runtime/src/wrapper.c +0 -0
  406. package/runtime/src/writable.c +0 -0
  407. package/runtime/third_party/ada-idna/LICENSE-MIT +0 -0
  408. package/runtime/third_party/ada-idna/README.md +0 -0
  409. package/runtime/third_party/ada-idna/convert.mjs +0 -0
  410. package/runtime/third_party/ada-idna/idna.c +0 -0
  411. package/runtime/third_party/ada-idna/idna.h +0 -0
  412. package/runtime/third_party/ada-idna/idna_tables.h +0 -0
  413. package/runtime/third_party/quickjs-dtoa/LICENSE +0 -0
  414. package/runtime/third_party/quickjs-dtoa/README.md +0 -0
  415. package/runtime/third_party/quickjs-dtoa/dtoa.c +0 -0
  416. package/runtime/third_party/quickjs-dtoa/dtoa.h +0 -0
  417. package/runtime/third_party/quickjs-dtoa/dtoa_compat.h +0 -0
  418. package/runtime/third_party/quickjs-regexp/LICENSE +0 -0
  419. package/runtime/third_party/quickjs-regexp/README.md +0 -0
  420. package/runtime/third_party/quickjs-regexp/cutils.c +0 -0
  421. package/runtime/third_party/quickjs-regexp/cutils.h +0 -0
  422. package/runtime/third_party/quickjs-regexp/libregexp-opcode.h +0 -0
  423. package/runtime/third_party/quickjs-regexp/libregexp.c +0 -0
  424. package/runtime/third_party/quickjs-regexp/libregexp.h +0 -0
  425. package/runtime/third_party/quickjs-regexp/libunicode-table.h +0 -0
  426. package/runtime/third_party/quickjs-regexp/libunicode.c +0 -0
  427. package/runtime/third_party/quickjs-regexp/libunicode.h +0 -0
  428. package/runtime/third_party/v8-ieee754/LICENSE +0 -0
  429. package/runtime/third_party/v8-ieee754/README.md +0 -0
  430. package/runtime/third_party/v8-ieee754/convert.py +0 -0
  431. package/runtime/third_party/v8-ieee754/ieee754.c +0 -0
  432. package/runtime/third_party/v8-ieee754/ieee754.h +0 -0
  433. package/runtime/tools/regexp_compile.c +0 -0
@@ -0,0 +1,19 @@
1
+ version 1.2.12, March 27th, 2022
2
+
3
+ Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
4
+
5
+ This software is provided 'as-is', without any express or implied
6
+ warranty. In no event will the authors be held liable for any damages
7
+ arising from the use of this software.
8
+
9
+ Permission is granted to anyone to use this software for any purpose,
10
+ including commercial applications, and to alter it and redistribute it
11
+ freely, subject to the following restrictions:
12
+
13
+ 1. The origin of this software must not be misrepresented; you must not
14
+ claim that you wrote the original software. If you use this software
15
+ in a product, an acknowledgment in the product documentation would be
16
+ appreciated but is not required.
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+ 3. This notice may not be removed or altered from any source distribution.
@@ -0,0 +1,38 @@
1
+ Name: zlib
2
+ Short Name: zlib
3
+ URL: https://github.com/madler/zlib
4
+ Version: 1.3.1
5
+ Revision: 51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf
6
+ Update Mechanism: Manual (https://crbug.com/422348588)
7
+ CPEPrefix: cpe:/a:zlib:zlib:1.3.1
8
+ Security Critical: yes
9
+ Shipped: yes
10
+ License: Zlib
11
+ License File: LICENSE
12
+ License Android Compatible: yes
13
+
14
+ Description:
15
+ "A massively spiffy yet delicately unobtrusive compression library."
16
+
17
+ zlib is a free, general-purpose, legally unencumbered lossless data-compression
18
+ library. zlib implements the "deflate" compression algorithm described by RFC
19
+ 1951, which combines the LZ77 (Lempel-Ziv) algorithm with Huffman coding. zlib
20
+ also implements the zlib (RFC 1950) and gzip (RFC 1952) wrapper formats.
21
+
22
+ Local Modifications:
23
+ - Only source code from the http://zlib.net distribution used to build the zlib
24
+ and minizip libraries are present. Many other files have been omitted. Only *.c
25
+ and *.h files from the upstream root directory, contrib/minizip and
26
+ examples/zpipe.c were imported.
27
+ - The files named '*simd*' are original x86/Arm/RISC-V specific optimizations.
28
+ - The contents of the google directory are original Chromium-specific
29
+ additions.
30
+ - The contents of the 'contrib' of directory are either Chromium-specific
31
+ additions or heavily patched zlib files (e.g. inffast_chunk*).
32
+ - Added chromeconf.h
33
+ - Plus the changes in 'patches' folder.
34
+ - Code in contrib/ other than contrib/minizip was added to match zlib's
35
+ contributor layout.
36
+ - In sync with 1.3.1 official release
37
+ - ZIP reader modified to allow for progress callbacks during extraction.
38
+ - ZIP reader modified to add detection of AES encrypted content.
@@ -0,0 +1,197 @@
1
+ /* adler32.c -- compute the Adler-32 checksum of a data stream
2
+ * Copyright (C) 1995-2011, 2016 Mark Adler
3
+ * For conditions of distribution and use, see copyright notice in zlib.h
4
+ */
5
+
6
+ /* @(#) $Id$ */
7
+
8
+ #include "zutil.h"
9
+
10
+ #define BASE 65521U /* largest prime smaller than 65536 */
11
+ #define NMAX 5552
12
+ /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
13
+
14
+ #define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
15
+ #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
16
+ #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
17
+ #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
18
+ #define DO16(buf) DO8(buf,0); DO8(buf,8);
19
+
20
+ /* use NO_DIVIDE if your processor does not do division in hardware --
21
+ try it both ways to see which is faster */
22
+ #ifdef NO_DIVIDE
23
+ /* note that this assumes BASE is 65521, where 65536 % 65521 == 15
24
+ (thank you to John Reiser for pointing this out) */
25
+ # define CHOP(a) \
26
+ do { \
27
+ unsigned long tmp = a >> 16; \
28
+ a &= 0xffffUL; \
29
+ a += (tmp << 4) - tmp; \
30
+ } while (0)
31
+ # define MOD28(a) \
32
+ do { \
33
+ CHOP(a); \
34
+ if (a >= BASE) a -= BASE; \
35
+ } while (0)
36
+ # define MOD(a) \
37
+ do { \
38
+ CHOP(a); \
39
+ MOD28(a); \
40
+ } while (0)
41
+ # define MOD63(a) \
42
+ do { /* this assumes a is not negative */ \
43
+ z_off64_t tmp = a >> 32; \
44
+ a &= 0xffffffffL; \
45
+ a += (tmp << 8) - (tmp << 5) + tmp; \
46
+ tmp = a >> 16; \
47
+ a &= 0xffffL; \
48
+ a += (tmp << 4) - tmp; \
49
+ tmp = a >> 16; \
50
+ a &= 0xffffL; \
51
+ a += (tmp << 4) - tmp; \
52
+ if (a >= BASE) a -= BASE; \
53
+ } while (0)
54
+ #else
55
+ # define MOD(a) a %= BASE
56
+ # define MOD28(a) a %= BASE
57
+ # define MOD63(a) a %= BASE
58
+ #endif
59
+
60
+ #include "cpu_features.h"
61
+ #if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON) || defined(ADLER32_SIMD_RVV)
62
+ #include "adler32_simd.h"
63
+ #endif
64
+
65
+ /* ========================================================================= */
66
+ uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
67
+ unsigned long sum2;
68
+ unsigned n;
69
+ /* TODO(cavalcantii): verify if this lengths are optimal for current CPUs. */
70
+ #if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON) \
71
+ || defined(ADLER32_SIMD_RVV)
72
+ #if defined(ADLER32_SIMD_SSSE3)
73
+ if (buf != Z_NULL && len >= 64 && x86_cpu_enable_ssse3)
74
+ #elif defined(ADLER32_SIMD_NEON)
75
+ if (buf != Z_NULL && len >= 64)
76
+ #elif defined(ADLER32_SIMD_RVV)
77
+ if (buf != Z_NULL && len >= 32 && riscv_cpu_enable_rvv)
78
+ #endif
79
+ return adler32_simd_(adler, buf, len);
80
+ #endif
81
+
82
+ /* split Adler-32 into component sums */
83
+ sum2 = (adler >> 16) & 0xffff;
84
+ adler &= 0xffff;
85
+
86
+ /* in case user likes doing a byte at a time, keep it fast */
87
+ if (len == 1) {
88
+ adler += buf[0];
89
+ if (adler >= BASE)
90
+ adler -= BASE;
91
+ sum2 += adler;
92
+ if (sum2 >= BASE)
93
+ sum2 -= BASE;
94
+ return adler | (sum2 << 16);
95
+ }
96
+
97
+ #if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON) \
98
+ || defined(RISCV_RVV)
99
+ /*
100
+ * Use SIMD to compute the adler32. Since this function can be
101
+ * freely used, check CPU features here. zlib convention is to
102
+ * call adler32(0, NULL, 0), before making calls to adler32().
103
+ * So this is a good early (and infrequent) place to cache CPU
104
+ * features for those later, more interesting adler32() calls.
105
+ */
106
+ if (buf == Z_NULL) {
107
+ if (!len) /* Assume user is calling adler32(0, NULL, 0); */
108
+ cpu_check_features();
109
+ return 1L;
110
+ }
111
+ #else
112
+ /* initial Adler-32 value (deferred check for len == 1 speed) */
113
+ if (buf == Z_NULL)
114
+ return 1L;
115
+ #endif
116
+
117
+ /* in case short lengths are provided, keep it somewhat fast */
118
+ if (len < 16) {
119
+ while (len--) {
120
+ adler += *buf++;
121
+ sum2 += adler;
122
+ }
123
+ if (adler >= BASE)
124
+ adler -= BASE;
125
+ MOD28(sum2); /* only added so many BASE's */
126
+ return adler | (sum2 << 16);
127
+ }
128
+
129
+ /* do length NMAX blocks -- requires just one modulo operation */
130
+ while (len >= NMAX) {
131
+ len -= NMAX;
132
+ n = NMAX / 16; /* NMAX is divisible by 16 */
133
+ do {
134
+ DO16(buf); /* 16 sums unrolled */
135
+ buf += 16;
136
+ } while (--n);
137
+ MOD(adler);
138
+ MOD(sum2);
139
+ }
140
+
141
+ /* do remaining bytes (less than NMAX, still just one modulo) */
142
+ if (len) { /* avoid modulos if none remaining */
143
+ while (len >= 16) {
144
+ len -= 16;
145
+ DO16(buf);
146
+ buf += 16;
147
+ }
148
+ while (len--) {
149
+ adler += *buf++;
150
+ sum2 += adler;
151
+ }
152
+ MOD(adler);
153
+ MOD(sum2);
154
+ }
155
+
156
+ /* return recombined sums */
157
+ return adler | (sum2 << 16);
158
+ }
159
+
160
+ /* ========================================================================= */
161
+ uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
162
+ return adler32_z(adler, buf, len);
163
+ }
164
+
165
+ /* ========================================================================= */
166
+ local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) {
167
+ unsigned long sum1;
168
+ unsigned long sum2;
169
+ unsigned rem;
170
+
171
+ /* for negative len, return invalid adler32 as a clue for debugging */
172
+ if (len2 < 0)
173
+ return 0xffffffffUL;
174
+
175
+ /* the derivation of this formula is left as an exercise for the reader */
176
+ MOD63(len2); /* assumes len2 >= 0 */
177
+ rem = (unsigned)len2;
178
+ sum1 = adler1 & 0xffff;
179
+ sum2 = rem * sum1;
180
+ MOD(sum2);
181
+ sum1 += (adler2 & 0xffff) + BASE - 1;
182
+ sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
183
+ if (sum1 >= BASE) sum1 -= BASE;
184
+ if (sum1 >= BASE) sum1 -= BASE;
185
+ if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1);
186
+ if (sum2 >= BASE) sum2 -= BASE;
187
+ return sum1 | (sum2 << 16);
188
+ }
189
+
190
+ /* ========================================================================= */
191
+ uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) {
192
+ return adler32_combine_(adler1, adler2, len2);
193
+ }
194
+
195
+ uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) {
196
+ return adler32_combine_(adler1, adler2, len2);
197
+ }
@@ -0,0 +1,203 @@
1
+ /* Copyright 2017 The Chromium Authors
2
+ * Use of this source code is governed by a BSD-style license that can be
3
+ * found in the LICENSE file. */
4
+
5
+ #ifndef THIRD_PARTY_ZLIB_CHROMECONF_H_
6
+ #define THIRD_PARTY_ZLIB_CHROMECONF_H_
7
+
8
+ #if defined(COMPONENT_BUILD)
9
+ #if defined(WIN32)
10
+ #if defined(ZLIB_IMPLEMENTATION)
11
+ #define ZEXTERN __declspec(dllexport)
12
+ #else
13
+ #define ZEXTERN __declspec(dllimport)
14
+ #endif
15
+ #elif defined(ZLIB_IMPLEMENTATION)
16
+ #define ZEXTERN __attribute__((visibility("default")))
17
+ #endif
18
+ #endif
19
+
20
+ /* Rename all zlib names with a Cr_z_ prefix. This is based on the Z_PREFIX
21
+ * option from zconf.h, but with a custom prefix. Where zconf.h would rename
22
+ * both a macro and its underscore-suffixed internal implementation (such as
23
+ * deflateInit2 and deflateInit2_), only the implementation is renamed here.
24
+ * The Byte type is also omitted.
25
+ *
26
+ * To generate this list, run
27
+ * sed -rn -e 's/^# *define +([^ ]+) +(z_[^ ]+)$/#define \1 Cr_\2/p' zconf.h
28
+ * (use -E instead of -r on macOS).
29
+ *
30
+ * gzread is also addressed by modifications in gzread.c and zlib.h. */
31
+
32
+ #define Z_CR_PREFIX_SET
33
+
34
+ #define _dist_code Cr_z__dist_code
35
+ #define _length_code Cr_z__length_code
36
+ #define _tr_align Cr_z__tr_align
37
+ #define _tr_flush_bits Cr_z__tr_flush_bits
38
+ #define _tr_flush_block Cr_z__tr_flush_block
39
+ #define _tr_init Cr_z__tr_init
40
+ #define _tr_stored_block Cr_z__tr_stored_block
41
+ #define _tr_tally Cr_z__tr_tally
42
+ #define adler32 Cr_z_adler32
43
+ #define adler32_combine Cr_z_adler32_combine
44
+ #define adler32_combine64 Cr_z_adler32_combine64
45
+ #define adler32_z Cr_z_adler32_z
46
+ #define compress Cr_z_compress
47
+ #define compress2 Cr_z_compress2
48
+ #define compressBound Cr_z_compressBound
49
+ #define crc32 Cr_z_crc32
50
+ #define crc32_combine Cr_z_crc32_combine
51
+ #define crc32_combine64 Cr_z_crc32_combine64
52
+ #define crc32_combine_gen64 Cr_z_crc32_combine_gen64
53
+ #define crc32_combine_gen Cr_z_crc32_combine_gen
54
+ #define crc32_combine_op Cr_z_crc32_combine_op
55
+ #define crc32_z Cr_z_crc32_z
56
+ #define deflate Cr_z_deflate
57
+ #define deflateBound Cr_z_deflateBound
58
+ #define deflateCopy Cr_z_deflateCopy
59
+ #define deflateEnd Cr_z_deflateEnd
60
+ #define deflateGetDictionary Cr_z_deflateGetDictionary
61
+ /* #undef deflateInit */
62
+ /* #undef deflateInit2 */
63
+ #define deflateInit2_ Cr_z_deflateInit2_
64
+ #define deflateInit_ Cr_z_deflateInit_
65
+ #define deflateParams Cr_z_deflateParams
66
+ #define deflatePending Cr_z_deflatePending
67
+ #define deflatePrime Cr_z_deflatePrime
68
+ #define deflateReset Cr_z_deflateReset
69
+ #define deflateResetKeep Cr_z_deflateResetKeep
70
+ #define deflateSetDictionary Cr_z_deflateSetDictionary
71
+ #define deflateSetHeader Cr_z_deflateSetHeader
72
+ #define deflateTune Cr_z_deflateTune
73
+ #define deflate_copyright Cr_z_deflate_copyright
74
+ #define get_crc_table Cr_z_get_crc_table
75
+ #define gz_error Cr_z_gz_error
76
+ #define gz_intmax Cr_z_gz_intmax
77
+ #define gz_strwinerror Cr_z_gz_strwinerror
78
+ #define gzbuffer Cr_z_gzbuffer
79
+ #define gzclearerr Cr_z_gzclearerr
80
+ #define gzclose Cr_z_gzclose
81
+ #define gzclose_r Cr_z_gzclose_r
82
+ #define gzclose_w Cr_z_gzclose_w
83
+ #define gzdirect Cr_z_gzdirect
84
+ #define gzdopen Cr_z_gzdopen
85
+ #define gzeof Cr_z_gzeof
86
+ #define gzerror Cr_z_gzerror
87
+ #define gzflush Cr_z_gzflush
88
+ #define gzfread Cr_z_gzfread
89
+ #define gzfwrite Cr_z_gzfwrite
90
+ #define gzgetc Cr_z_gzgetc
91
+ #define gzgetc_ Cr_z_gzgetc_
92
+ #define gzgets Cr_z_gzgets
93
+ #define gzoffset Cr_z_gzoffset
94
+ #define gzoffset64 Cr_z_gzoffset64
95
+ #define gzopen Cr_z_gzopen
96
+ #define gzopen64 Cr_z_gzopen64
97
+ #define gzopen_w Cr_z_gzopen_w
98
+ #define gzprintf Cr_z_gzprintf
99
+ #define gzputc Cr_z_gzputc
100
+ #define gzputs Cr_z_gzputs
101
+ #define gzread Cr_z_gzread
102
+ #define gzrewind Cr_z_gzrewind
103
+ #define gzseek Cr_z_gzseek
104
+ #define gzseek64 Cr_z_gzseek64
105
+ #define gzsetparams Cr_z_gzsetparams
106
+ #define gztell Cr_z_gztell
107
+ #define gztell64 Cr_z_gztell64
108
+ #define gzungetc Cr_z_gzungetc
109
+ #define gzvprintf Cr_z_gzvprintf
110
+ #define gzwrite Cr_z_gzwrite
111
+ #define inflate Cr_z_inflate
112
+ #define inflateBack Cr_z_inflateBack
113
+ #define inflateBackEnd Cr_z_inflateBackEnd
114
+ /* #undef inflateBackInit */
115
+ #define inflateBackInit_ Cr_z_inflateBackInit_
116
+ #define inflateCodesUsed Cr_z_inflateCodesUsed
117
+ #define inflateCopy Cr_z_inflateCopy
118
+ #define inflateEnd Cr_z_inflateEnd
119
+ #define inflateGetDictionary Cr_z_inflateGetDictionary
120
+ #define inflateGetHeader Cr_z_inflateGetHeader
121
+ /* #undef inflateInit */
122
+ /* #undef inflateInit2 */
123
+ #define inflateInit2_ Cr_z_inflateInit2_
124
+ #define inflateInit_ Cr_z_inflateInit_
125
+ #define inflateMark Cr_z_inflateMark
126
+ #define inflatePrime Cr_z_inflatePrime
127
+ #define inflateReset Cr_z_inflateReset
128
+ #define inflateReset2 Cr_z_inflateReset2
129
+ #define inflateResetKeep Cr_z_inflateResetKeep
130
+ #define inflateSetDictionary Cr_z_inflateSetDictionary
131
+ #define inflateSync Cr_z_inflateSync
132
+ #define inflateSyncPoint Cr_z_inflateSyncPoint
133
+ #define inflateUndermine Cr_z_inflateUndermine
134
+ #define inflateValidate Cr_z_inflateValidate
135
+ #define inflate_copyright Cr_z_inflate_copyright
136
+ #define inflate_fast Cr_z_inflate_fast
137
+ #define inflate_table Cr_z_inflate_table
138
+ #define uncompress Cr_z_uncompress
139
+ #define uncompress2 Cr_z_uncompress2
140
+ #define zError Cr_z_zError
141
+ #define zcalloc Cr_z_zcalloc
142
+ #define zcfree Cr_z_zcfree
143
+ #define zlibCompileFlags Cr_z_zlibCompileFlags
144
+ #define zlibVersion Cr_z_zlibVersion
145
+ /* #undef Byte */
146
+ #define Bytef Cr_z_Bytef
147
+ #define alloc_func Cr_z_alloc_func
148
+ #define charf Cr_z_charf
149
+ #define free_func Cr_z_free_func
150
+ #define gzFile Cr_z_gzFile
151
+ #define gz_header Cr_z_gz_header
152
+ #define gz_headerp Cr_z_gz_headerp
153
+ #define in_func Cr_z_in_func
154
+ #define intf Cr_z_intf
155
+ #define out_func Cr_z_out_func
156
+ #define uInt Cr_z_uInt
157
+ #define uIntf Cr_z_uIntf
158
+ #define uLong Cr_z_uLong
159
+ #define uLongf Cr_z_uLongf
160
+ #define voidp Cr_z_voidp
161
+ #define voidpc Cr_z_voidpc
162
+ #define voidpf Cr_z_voidpf
163
+ #define gz_header_s Cr_z_gz_header_s
164
+ /* #undef internal_state */
165
+ /* #undef z_off64_t */
166
+
167
+ /* An exported symbol that isn't handled by Z_PREFIX in zconf.h */
168
+ #define z_errmsg Cr_z_z_errmsg
169
+
170
+ /* Symbols added in simd.patch */
171
+ #define copy_with_crc Cr_z_copy_with_crc
172
+ #define crc_finalize Cr_z_crc_finalize
173
+ #define crc_fold_512to32 Cr_z_crc_fold_512to32
174
+ #define crc_fold_copy Cr_z_crc_fold_copy
175
+ #define crc_fold_init Cr_z_crc_fold_init
176
+ #define crc_reset Cr_z_crc_reset
177
+ #define fill_window_sse Cr_z_fill_window_sse
178
+ #define deflate_read_buf Cr_z_deflate_read_buf
179
+ #define x86_check_features Cr_z_x86_check_features
180
+ #define x86_cpu_enable_simd Cr_z_x86_cpu_enable_simd
181
+
182
+ /* Symbols added by adler_simd.c */
183
+ #define adler32_simd_ Cr_z_adler32_simd_
184
+ #define x86_cpu_enable_ssse3 Cr_z_x86_cpu_enable_ssse3
185
+
186
+ /* Symbols added by contrib/optimizations/inffast_chunk */
187
+ #define inflate_fast_chunk_ Cr_z_inflate_fast_chunk_
188
+
189
+ /* Symbols added by crc32_simd.c */
190
+ #define crc32_sse42_simd_ Cr_z_crc32_sse42_simd_
191
+
192
+ /* Symbols added by armv8_crc32 */
193
+ #define arm_cpu_enable_crc32 Cr_z_arm_cpu_enable_crc32
194
+ #define arm_cpu_enable_pmull Cr_z_arm_cpu_enable_pmull
195
+ #define arm_check_features Cr_z_arm_check_features
196
+ #define armv8_crc32_little Cr_z_armv8_crc32_little
197
+ #define armv8_crc32_pmull_little Cr_z_armv8_crc32_pmull_little
198
+
199
+ /* Symbols added by cpu_features.c */
200
+ #define cpu_check_features Cr_z_cpu_check_features
201
+ #define x86_cpu_enable_sse2 Cr_z_x86_cpu_enable_sse2
202
+
203
+ #endif /* THIRD_PARTY_ZLIB_CHROMECONF_H_ */
@@ -0,0 +1,80 @@
1
+ /* insert_string.h
2
+ *
3
+ * Copyright 2019 The Chromium Authors
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the Chromium source repository LICENSE file.
6
+ */
7
+
8
+ #ifndef INSERT_STRING_H
9
+ #define INSERT_STRING_H
10
+
11
+ #ifndef INLINE
12
+ #if defined(_MSC_VER) && !defined(__clang__)
13
+ #define INLINE __inline
14
+ #else
15
+ #define INLINE inline
16
+ #endif
17
+ #endif
18
+
19
+ #include <stdint.h>
20
+
21
+ /**
22
+ * Some applications need to match zlib DEFLATE output exactly [3]. Use the
23
+ * canonical zlib Rabin-Karp rolling hash [1,2] in that case.
24
+ *
25
+ * [1] For a description of the Rabin and Karp algorithm, see "Algorithms"
26
+ * book by R. Sedgewick, Addison-Wesley, p252.
27
+ * [2] https://www.euccas.me/zlib/#zlib_rabin_karp and also "rolling hash"
28
+ * https://en.wikipedia.org/wiki/Rolling_hash
29
+ * [3] crbug.com/1316541 AOSP incremental client APK package OTA upgrades.
30
+ */
31
+ #ifdef CHROMIUM_ZLIB_NO_CASTAGNOLI
32
+ #define USE_ZLIB_RABIN_KARP_ROLLING_HASH
33
+ #endif
34
+
35
+ /* ===========================================================================
36
+ * Update a hash value with the given input byte (Rabin-Karp rolling hash).
37
+ * IN assertion: all calls to UPDATE_HASH are made with consecutive input
38
+ * characters, so that a running hash key can be computed from the previous
39
+ * key instead of complete recalculation each time.
40
+ */
41
+ #define UPDATE_HASH(s, h, c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
42
+
43
+ /* ===========================================================================
44
+ * Insert string str in the dictionary and set match_head to the previous head
45
+ * of the hash chain (the most recent string with same hash key). Return
46
+ * the previous length of the hash chain.
47
+ * If this file is compiled with -DFASTEST, the compression level is forced
48
+ * to 1, and no hash chains are maintained.
49
+ * IN assertion: all calls to INSERT_STRING are made with consecutive input
50
+ * characters and the first MIN_MATCH bytes of str are valid (except for
51
+ * the last MIN_MATCH-1 bytes of the input file).
52
+ */
53
+ local INLINE Pos insert_string(deflate_state* const s, const Pos str) {
54
+ Pos ret;
55
+ /* insert_string dictionary insertion: ANZAC++ hasher
56
+ * significantly improves data compression speed.
57
+ *
58
+ * Note: the generated compressed output is a valid DEFLATE stream, but will
59
+ * differ from canonical zlib output.
60
+ */
61
+ #if defined(USE_ZLIB_RABIN_KARP_ROLLING_HASH)
62
+ UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH - 1)]);
63
+ #else
64
+ uint32_t value;
65
+ // Validated for little endian archs (i.e. x86, Arm). YMMV for big endian.
66
+ zmemcpy(&value, &s->window[str], sizeof(value));
67
+ s->ins_h = ((value * 66521 + 66521) >> 16) & s->hash_mask;
68
+ #endif
69
+
70
+ #ifdef FASTEST
71
+ ret = s->head[s->ins_h];
72
+ #else
73
+ ret = s->prev[str & s->w_mask] = s->head[s->ins_h];
74
+ #endif
75
+ s->head[s->ins_h] = str;
76
+
77
+ return ret;
78
+ }
79
+
80
+ #endif /* INSERT_STRING_H */