@scriptc/compiler 0.3.4 → 0.3.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 (316) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +409 -42
  2. package/dist/backend/llvm/array-search.js +1 -1
  3. package/dist/backend/llvm/array-search.js.map +1 -1
  4. package/dist/backend/llvm/call-lifetimes.d.ts +6 -0
  5. package/dist/backend/llvm/call-lifetimes.js +19 -0
  6. package/dist/backend/llvm/call-lifetimes.js.map +1 -1
  7. package/dist/backend/llvm/constant-callbacks.d.ts +2 -21
  8. package/dist/backend/llvm/constant-callbacks.js +36 -219
  9. package/dist/backend/llvm/constant-callbacks.js.map +1 -1
  10. package/dist/backend/llvm/constant-callbacks.test.js +22 -0
  11. package/dist/backend/llvm/constant-callbacks.test.js.map +1 -1
  12. package/dist/backend/llvm/dense-array-access.d.ts +9 -0
  13. package/dist/backend/llvm/dense-array-access.js +27 -1
  14. package/dist/backend/llvm/dense-array-access.js.map +1 -1
  15. package/dist/backend/llvm/dyn.d.ts +6 -0
  16. package/dist/backend/llvm/dyn.js +71 -7
  17. package/dist/backend/llvm/dyn.js.map +1 -1
  18. package/dist/backend/llvm/emitter.d.ts +120 -2
  19. package/dist/backend/llvm/emitter.js +820 -142
  20. package/dist/backend/llvm/emitter.js.map +1 -1
  21. package/dist/backend/llvm/expr-async.js +17 -7
  22. package/dist/backend/llvm/expr-async.js.map +1 -1
  23. package/dist/backend/llvm/expr-bytes.js +1 -1
  24. package/dist/backend/llvm/expr-callbacks.d.ts +11 -0
  25. package/dist/backend/llvm/expr-callbacks.js +53 -0
  26. package/dist/backend/llvm/expr-callbacks.js.map +1 -1
  27. package/dist/backend/llvm/expr-calls.js +88 -2
  28. package/dist/backend/llvm/expr-calls.js.map +1 -1
  29. package/dist/backend/llvm/expr-containers.js +50 -27
  30. package/dist/backend/llvm/expr-containers.js.map +1 -1
  31. package/dist/backend/llvm/expr-dispatch.js +1 -0
  32. package/dist/backend/llvm/expr-dispatch.js.map +1 -1
  33. package/dist/backend/llvm/expr-dynamic.js +25 -1
  34. package/dist/backend/llvm/expr-dynamic.js.map +1 -1
  35. package/dist/backend/llvm/expr-primitives.d.ts +1 -1
  36. package/dist/backend/llvm/expr-primitives.js +20 -1
  37. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  38. package/dist/backend/llvm/expr-stream-bridges.js +4 -0
  39. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
  40. package/dist/backend/llvm/integer-clones.d.ts +103 -0
  41. package/dist/backend/llvm/integer-clones.js +1336 -0
  42. package/dist/backend/llvm/integer-clones.js.map +1 -0
  43. package/dist/backend/llvm/integer-clones.test.d.ts +1 -0
  44. package/dist/backend/llvm/integer-clones.test.js +219 -0
  45. package/dist/backend/llvm/integer-clones.test.js.map +1 -0
  46. package/dist/backend/llvm/lib-datagram.js +14 -0
  47. package/dist/backend/llvm/lib-datagram.js.map +1 -1
  48. package/dist/backend/llvm/lib-dispatch.js +32 -1
  49. package/dist/backend/llvm/lib-dispatch.js.map +1 -1
  50. package/dist/backend/llvm/lib-filesystem.js +61 -1
  51. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  52. package/dist/backend/llvm/lib-network.js +21 -3
  53. package/dist/backend/llvm/lib-network.js.map +1 -1
  54. package/dist/backend/llvm/lib-process.js +34 -0
  55. package/dist/backend/llvm/lib-process.js.map +1 -1
  56. package/dist/backend/llvm/lib-shared.js +77 -2
  57. package/dist/backend/llvm/lib-shared.js.map +1 -1
  58. package/dist/backend/llvm/lib-test.js +16 -3
  59. package/dist/backend/llvm/lib-test.js.map +1 -1
  60. package/dist/backend/llvm/lib-tls.js +6 -0
  61. package/dist/backend/llvm/lib-tls.js.map +1 -1
  62. package/dist/backend/llvm/local-array-reads.js +1 -1
  63. package/dist/backend/llvm/local-array-reads.js.map +1 -1
  64. package/dist/backend/llvm/map-entry-fusion.d.ts +28 -0
  65. package/dist/backend/llvm/map-entry-fusion.js +233 -0
  66. package/dist/backend/llvm/map-entry-fusion.js.map +1 -0
  67. package/dist/backend/llvm/map-entry-fusion.test.d.ts +1 -0
  68. package/dist/backend/llvm/map-entry-fusion.test.js +183 -0
  69. package/dist/backend/llvm/map-entry-fusion.test.js.map +1 -0
  70. package/dist/backend/llvm/map-number-lookup.d.ts +2 -0
  71. package/dist/backend/llvm/map-number-lookup.js +1 -1
  72. package/dist/backend/llvm/map-number-lookup.js.map +1 -1
  73. package/dist/backend/llvm/map-number-lookup.test.js +10 -11
  74. package/dist/backend/llvm/map-number-lookup.test.js.map +1 -1
  75. package/dist/backend/llvm/map-read-lifetimes.d.ts +2 -0
  76. package/dist/backend/llvm/map-read-lifetimes.js +3 -0
  77. package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
  78. package/dist/backend/llvm/map-read-lifetimes.test.js +2 -2
  79. package/dist/backend/llvm/nullable-unions.d.ts +6 -3
  80. package/dist/backend/llvm/nullable-unions.js +2 -0
  81. package/dist/backend/llvm/nullable-unions.js.map +1 -1
  82. package/dist/backend/llvm/publish.d.ts +16 -0
  83. package/dist/backend/llvm/publish.js +81 -10
  84. package/dist/backend/llvm/publish.js.map +1 -1
  85. package/dist/backend/llvm/publish.test.d.ts +1 -0
  86. package/dist/backend/llvm/publish.test.js +94 -0
  87. package/dist/backend/llvm/publish.test.js.map +1 -0
  88. package/dist/backend/llvm/record-results.d.ts +1 -1
  89. package/dist/backend/llvm/record-results.js +78 -4
  90. package/dist/backend/llvm/record-results.js.map +1 -1
  91. package/dist/backend/llvm/record-sources.d.ts +7 -0
  92. package/dist/backend/llvm/record-sources.js +14 -0
  93. package/dist/backend/llvm/record-sources.js.map +1 -0
  94. package/dist/backend/llvm/reference-writes.js +1 -0
  95. package/dist/backend/llvm/reference-writes.js.map +1 -1
  96. package/dist/backend/llvm/shapes.d.ts +12 -3
  97. package/dist/backend/llvm/shapes.js +23 -14
  98. package/dist/backend/llvm/shapes.js.map +1 -1
  99. package/dist/backend/llvm/shapes.test.js +5 -3
  100. package/dist/backend/llvm/shapes.test.js.map +1 -1
  101. package/dist/backend/llvm/speculative-integers.d.ts +74 -0
  102. package/dist/backend/llvm/speculative-integers.js +571 -0
  103. package/dist/backend/llvm/speculative-integers.js.map +1 -0
  104. package/dist/backend/llvm/speculative-integers.test.d.ts +1 -0
  105. package/dist/backend/llvm/speculative-integers.test.js +148 -0
  106. package/dist/backend/llvm/speculative-integers.test.js.map +1 -0
  107. package/dist/backend/llvm/string-lifetimes.test.js +75 -1
  108. package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
  109. package/dist/backend/llvm/walkers.d.ts +17 -0
  110. package/dist/backend/llvm/walkers.js +123 -0
  111. package/dist/backend/llvm/walkers.js.map +1 -1
  112. package/dist/backend/may-throw.js +2 -0
  113. package/dist/backend/may-throw.js.map +1 -1
  114. package/dist/backend/native/contracts.d.ts +2 -1
  115. package/dist/backend/native/executable.js +6 -1
  116. package/dist/backend/native/executable.js.map +1 -1
  117. package/dist/backend/native/runtime-inputs.d.ts +1 -1
  118. package/dist/backend/native/runtime-inputs.js +1 -0
  119. package/dist/backend/native/runtime-inputs.js.map +1 -1
  120. package/dist/backend/runtime-abi.d.ts +2 -2
  121. package/dist/backend/runtime-abi.js +2 -2
  122. package/dist/backend/runtime-pack-targets.test.js +1 -1
  123. package/dist/backend/runtime-pack.d.ts +7 -3
  124. package/dist/backend/runtime-pack.js +12 -6
  125. package/dist/backend/runtime-pack.js.map +1 -1
  126. package/dist/backend/runtime-pack.test.js +16 -7
  127. package/dist/backend/runtime-pack.test.js.map +1 -1
  128. package/dist/contracts/check.js +1 -0
  129. package/dist/contracts/check.js.map +1 -1
  130. package/dist/coverage/surface-manifest.js +3 -3
  131. package/dist/coverage/surface-manifest.js.map +1 -1
  132. package/dist/diagnostics/diagnostic.d.ts +1 -1
  133. package/dist/diagnostics/diagnostic.js +6 -2
  134. package/dist/diagnostics/diagnostic.js.map +1 -1
  135. package/dist/frontend/lowering/builtin-calls.js +13 -0
  136. package/dist/frontend/lowering/builtin-calls.js.map +1 -1
  137. package/dist/frontend/lowering/builtins/callable-aliases.js +82 -8
  138. package/dist/frontend/lowering/builtins/callable-aliases.js.map +1 -1
  139. package/dist/frontend/lowering/builtins/child-process-async.d.ts +8 -6
  140. package/dist/frontend/lowering/builtins/child-process-async.js +45 -29
  141. package/dist/frontend/lowering/builtins/child-process-async.js.map +1 -1
  142. package/dist/frontend/lowering/builtins/compression.d.ts +9 -0
  143. package/dist/frontend/lowering/builtins/compression.js +145 -30
  144. package/dist/frontend/lowering/builtins/compression.js.map +1 -1
  145. package/dist/frontend/lowering/builtins/crypto.js +12 -1
  146. package/dist/frontend/lowering/builtins/crypto.js.map +1 -1
  147. package/dist/frontend/lowering/builtins/errors.js +5 -3
  148. package/dist/frontend/lowering/builtins/errors.js.map +1 -1
  149. package/dist/frontend/lowering/builtins/filesystem-calls.d.ts +6 -0
  150. package/dist/frontend/lowering/builtins/filesystem-calls.js +16 -0
  151. package/dist/frontend/lowering/builtins/filesystem-calls.js.map +1 -1
  152. package/dist/frontend/lowering/builtins/filesystem.d.ts +8 -0
  153. package/dist/frontend/lowering/builtins/filesystem.js +199 -2
  154. package/dist/frontend/lowering/builtins/filesystem.js.map +1 -1
  155. package/dist/frontend/lowering/builtins/fs-streams.d.ts +26 -0
  156. package/dist/frontend/lowering/builtins/fs-streams.js +131 -0
  157. package/dist/frontend/lowering/builtins/fs-streams.js.map +1 -0
  158. package/dist/frontend/lowering/builtins/hash-stream.d.ts +12 -0
  159. package/dist/frontend/lowering/builtins/hash-stream.js +80 -0
  160. package/dist/frontend/lowering/builtins/hash-stream.js.map +1 -0
  161. package/dist/frontend/lowering/builtins/module-calls.js +17 -3
  162. package/dist/frontend/lowering/builtins/module-calls.js.map +1 -1
  163. package/dist/frontend/lowering/builtins/process.js +9 -2
  164. package/dist/frontend/lowering/builtins/process.js.map +1 -1
  165. package/dist/frontend/lowering/builtins/readline.d.ts +45 -13
  166. package/dist/frontend/lowering/builtins/readline.js +812 -47
  167. package/dist/frontend/lowering/builtins/readline.js.map +1 -1
  168. package/dist/frontend/lowering/builtins/workers.d.ts +4 -0
  169. package/dist/frontend/lowering/builtins/workers.js +58 -0
  170. package/dist/frontend/lowering/builtins/workers.js.map +1 -1
  171. package/dist/frontend/lowering/class-dynamic-dispatch.js +150 -8
  172. package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
  173. package/dist/frontend/lowering/class-protocols.d.ts +55 -0
  174. package/dist/frontend/lowering/class-protocols.js +735 -0
  175. package/dist/frontend/lowering/class-protocols.js.map +1 -1
  176. package/dist/frontend/lowering/containers/array-from-async.d.ts +18 -0
  177. package/dist/frontend/lowering/containers/array-from-async.js +282 -0
  178. package/dist/frontend/lowering/containers/array-from-async.js.map +1 -0
  179. package/dist/frontend/lowering/containers/bytes.js +33 -12
  180. package/dist/frontend/lowering/containers/bytes.js.map +1 -1
  181. package/dist/frontend/lowering/containers/collection-grouping.js +2 -1
  182. package/dist/frontend/lowering/containers/collection-grouping.js.map +1 -1
  183. package/dist/frontend/lowering/containers/collection-methods.js +27 -23
  184. package/dist/frontend/lowering/containers/collection-methods.js.map +1 -1
  185. package/dist/frontend/lowering/devirtualize.js +20 -7
  186. package/dist/frontend/lowering/devirtualize.js.map +1 -1
  187. package/dist/frontend/lowering/divergences.js +188 -15
  188. package/dist/frontend/lowering/divergences.js.map +1 -1
  189. package/dist/frontend/lowering/lower-calls.js +129 -25
  190. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  191. package/dist/frontend/lowering/lower-classes.js +46 -1
  192. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  193. package/dist/frontend/lowering/lower-dgram.js +55 -15
  194. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  195. package/dist/frontend/lowering/lower-event-emitter.d.ts +9 -1
  196. package/dist/frontend/lowering/lower-event-emitter.js +88 -1
  197. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
  198. package/dist/frontend/lowering/lower-exprs.d.ts +4 -0
  199. package/dist/frontend/lowering/lower-exprs.js +239 -71
  200. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  201. package/dist/frontend/lowering/lower-inspect.js +49 -3
  202. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  203. package/dist/frontend/lowering/lower-mock.d.ts +11 -1
  204. package/dist/frontend/lowering/lower-mock.js +377 -61
  205. package/dist/frontend/lowering/lower-mock.js.map +1 -1
  206. package/dist/frontend/lowering/lower-modules.js +1 -0
  207. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  208. package/dist/frontend/lowering/lower-server.d.ts +2 -1
  209. package/dist/frontend/lowering/lower-server.js +234 -21
  210. package/dist/frontend/lowering/lower-server.js.map +1 -1
  211. package/dist/frontend/lowering/lower-stmts.js +60 -13
  212. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  213. package/dist/frontend/lowering/lower-stream.d.ts +1 -3
  214. package/dist/frontend/lowering/lower-stream.js +325 -20
  215. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  216. package/dist/frontend/lowering/lower-test.js +147 -48
  217. package/dist/frontend/lowering/lower-test.js.map +1 -1
  218. package/dist/frontend/lowering/lowerer.d.ts +13 -1
  219. package/dist/frontend/lowering/lowerer.js +10 -2
  220. package/dist/frontend/lowering/lowerer.js.map +1 -1
  221. package/dist/frontend/lowering/null-prototype.d.ts +13 -0
  222. package/dist/frontend/lowering/null-prototype.js +33 -0
  223. package/dist/frontend/lowering/null-prototype.js.map +1 -0
  224. package/dist/frontend/lowering/record-sources.d.ts +15 -0
  225. package/dist/frontend/lowering/record-sources.js +46 -0
  226. package/dist/frontend/lowering/record-sources.js.map +1 -0
  227. package/dist/frontend/lowering/surfaces.d.ts +3 -3
  228. package/dist/frontend/lowering/surfaces.js +59 -5
  229. package/dist/frontend/lowering/surfaces.js.map +1 -1
  230. package/dist/frontend/mock-shapes.d.ts +5 -0
  231. package/dist/frontend/mock-shapes.js +27 -2
  232. package/dist/frontend/mock-shapes.js.map +1 -1
  233. package/dist/frontend/program.js +5 -4
  234. package/dist/frontend/program.js.map +1 -1
  235. package/dist/frontend/type-mapper.d.ts +3 -0
  236. package/dist/frontend/type-mapper.js +148 -4
  237. package/dist/frontend/type-mapper.js.map +1 -1
  238. package/dist/index.js +18 -8
  239. package/dist/index.js.map +1 -1
  240. package/dist/ir/analysis.d.ts +10 -0
  241. package/dist/ir/analysis.js +35 -0
  242. package/dist/ir/analysis.js.map +1 -1
  243. package/dist/ir/analysis.test.js +69 -1
  244. package/dist/ir/analysis.test.js.map +1 -1
  245. package/dist/ir/builtin-effects.js +72 -0
  246. package/dist/ir/builtin-effects.js.map +1 -1
  247. package/dist/ir/builtin-signatures.d.ts +1 -1
  248. package/dist/ir/builtin-signatures.js +258 -13
  249. package/dist/ir/builtin-signatures.js.map +1 -1
  250. package/dist/ir/capture-values.d.ts +107 -0
  251. package/dist/ir/capture-values.js +850 -0
  252. package/dist/ir/capture-values.js.map +1 -0
  253. package/dist/ir/capture-values.test.d.ts +1 -0
  254. package/dist/ir/capture-values.test.js +268 -0
  255. package/dist/ir/capture-values.test.js.map +1 -0
  256. package/dist/ir/field-values.d.ts +16 -0
  257. package/dist/ir/field-values.js +128 -0
  258. package/dist/ir/field-values.js.map +1 -0
  259. package/dist/ir/field-values.test.d.ts +1 -0
  260. package/dist/ir/field-values.test.js +160 -0
  261. package/dist/ir/field-values.test.js.map +1 -0
  262. package/dist/ir/final-fields.d.ts +4 -1
  263. package/dist/ir/final-fields.js +11 -3
  264. package/dist/ir/final-fields.js.map +1 -1
  265. package/dist/ir/function-references.test.js +2 -1
  266. package/dist/ir/function-references.test.js.map +1 -1
  267. package/dist/ir/init-only-globals.d.ts +16 -0
  268. package/dist/ir/init-only-globals.js +121 -0
  269. package/dist/ir/init-only-globals.js.map +1 -0
  270. package/dist/ir/init-only-globals.test.d.ts +1 -0
  271. package/dist/ir/init-only-globals.test.js +115 -0
  272. package/dist/ir/init-only-globals.test.js.map +1 -0
  273. package/dist/ir/initializer-bindings.d.ts +18 -1
  274. package/dist/ir/initializer-bindings.js +91 -1
  275. package/dist/ir/initializer-bindings.js.map +1 -1
  276. package/dist/ir/initializer-bindings.test.js +57 -2
  277. package/dist/ir/initializer-bindings.test.js.map +1 -1
  278. package/dist/ir/int32-slots.d.ts +22 -0
  279. package/dist/ir/int32-slots.js +398 -13
  280. package/dist/ir/int32-slots.js.map +1 -1
  281. package/dist/ir/int32-slots.test.js +119 -8
  282. package/dist/ir/int32-slots.test.js.map +1 -1
  283. package/dist/ir/integer-loop-facts.d.ts +27 -1
  284. package/dist/ir/integer-loop-facts.js +239 -7
  285. package/dist/ir/integer-loop-facts.js.map +1 -1
  286. package/dist/ir/integer-ranges.d.ts +8 -5
  287. package/dist/ir/integer-ranges.js +147 -59
  288. package/dist/ir/integer-ranges.js.map +1 -1
  289. package/dist/ir/integer-ranges.test.js +285 -7
  290. package/dist/ir/integer-ranges.test.js.map +1 -1
  291. package/dist/ir/ir.d.ts +22 -1
  292. package/dist/ir/ir.js +4 -0
  293. package/dist/ir/ir.js.map +1 -1
  294. package/dist/ir/property-bags.d.ts +14 -0
  295. package/dist/ir/property-bags.js +121 -0
  296. package/dist/ir/property-bags.js.map +1 -0
  297. package/dist/ir/receiver-readers.d.ts +21 -0
  298. package/dist/ir/receiver-readers.js +217 -0
  299. package/dist/ir/receiver-readers.js.map +1 -0
  300. package/dist/ir/runtime-features.d.ts +3 -1
  301. package/dist/ir/runtime-features.js +102 -7
  302. package/dist/ir/runtime-features.js.map +1 -1
  303. package/dist/ir/runtime-features.test.js +62 -0
  304. package/dist/ir/runtime-features.test.js.map +1 -1
  305. package/dist/ir/traverse.js +4 -0
  306. package/dist/ir/traverse.js.map +1 -1
  307. package/dist/ir/validate.js +71 -3
  308. package/dist/ir/validate.js.map +1 -1
  309. package/dist/ir/validate.test.js +59 -0
  310. package/dist/ir/validate.test.js.map +1 -1
  311. package/dist/library/int-infer.js +3 -0
  312. package/dist/library/int-infer.js.map +1 -1
  313. package/dist/library/ir-policy.js +5 -0
  314. package/dist/library/ir-policy.js.map +1 -1
  315. package/package.json +20 -20
  316. package/surface-manifest.json +57 -19
@@ -1,10 +1,11 @@
1
1
  import { type ArraySearchKind } from "./array-search.js";
2
2
  import type { IrBytesElem, IrExpr, IrFfiImport, IrFunction, IrLocal, IrModule, IrRecordShape, IrStmt, IrType, IrUnionDef, SrcLoc } from "../../ir/ir.js";
3
3
  import { type SplitSpan } from "./split-loops.js";
4
- import { type IntegerRanges } from "../../ir/integer-ranges.js";
4
+ import { type IntegerRange, type IntegerRanges } from "../../ir/integer-ranges.js";
5
5
  import { type Int32Slots } from "../../ir/int32-slots.js";
6
6
  import { type Int32Abi } from "./int32-abi.js";
7
7
  import { type Int32Local } from "./int32-locals.js";
8
+ import { type IntegerClones } from "./integer-clones.js";
8
9
  import { type ConstantNumericTable } from "../../ir/constant-tables.js";
9
10
  import { type FfiCallbackAdapter } from "../ffi-callbacks.js";
10
11
  import { type CallLifetimes } from "./call-lifetimes.js";
@@ -15,6 +16,7 @@ import { InlineUnionFields } from "./inline-unions.js";
15
16
  import { OptionalArrayReads, type LocalArrayRead } from "./local-array-reads.js";
16
17
  import { CheckedNarrows } from "./checked-narrows.js";
17
18
  import { type MapReadLifetimes } from "./map-read-lifetimes.js";
19
+ import { type MapEntryFusion } from "./map-entry-fusion.js";
18
20
  import { ReferenceEffects } from "./reference-effects.js";
19
21
  import { ReferenceWrites, type Writes } from "./reference-writes.js";
20
22
  import { StackCallbacks } from "./stack-callbacks.js";
@@ -89,6 +91,10 @@ export declare class LlEmitter {
89
91
  /** The alias tag of a runtime word that emitted code reads and writes
90
92
  * outside every field (the lifetime-region count, owner and cursors). */
91
93
  memoryAliasAttachment(category: string): string;
94
+ /** The `!range` attachment of an array length load: a length is at most
95
+ * 2^32 - 1 (the runtime's SCR_ARR_MAX_LENGTH), so conversions to double
96
+ * and back fold. 32-bit targets load the full range anyway. */
97
+ get arrayLengthRange(): string;
92
98
  fieldAliasAttachment(ptr: string): string;
93
99
  private fieldAliasMetadata;
94
100
  private readonly debug;
@@ -173,6 +179,8 @@ export declare class LlEmitter {
173
179
  /** Interned NUL-terminated C-string constants (scr_jb_puts labels, the
174
180
  * stringify indent text): UTF-8 text → { symbol, byte length }. */
175
181
  private readonly cstrs;
182
+ /** Interned ScrMapOps descriptors (scr_map.h): initializer → symbol. */
183
+ private readonly mapOpsConsts;
176
184
  /** Type-directed walker functions (JSON serializers, the indent
177
185
  * rewriter, union ToString/join) — interned per typeKey/unionId, defs
178
186
  * flushed with the shape helpers. */
@@ -216,6 +224,8 @@ export declare class LlEmitter {
216
224
  callArrayReads: Map<IrExpr, LocalArrayRead>;
217
225
  mapReadLifetimes: MapReadLifetimes;
218
226
  readNumberMapWrites: ReadonlySet<IrExpr>;
227
+ /** The current function's fused string-key Map get-then-set pairs (map-entry-fusion.ts). */
228
+ mapEntryFusion: MapEntryFusion | null;
219
229
  readonly callLifetimes: CallLifetimes;
220
230
  readonly constantCallbacks: Map<string, Map<string, string>>;
221
231
  currentConstantCallbacks: ReadonlyMap<string, string>;
@@ -263,6 +273,9 @@ export declare class LlEmitter {
263
273
  private stableGlobals;
264
274
  private readonly tdzGlobals;
265
275
  readonly constantNumericTables: ReadonlyMap<string, ConstantNumericTable>;
276
+ /** Constant-key reads on checked-dynamic objects, each with its own
277
+ * zero-initialized ScrDynReadIc (scr_runtime.h). */
278
+ private dynReadIcSites;
266
279
  /** May-throw analysis (computeMayThrow): pending
267
280
  * checks are emitted only after calls that can actually raise. */
268
281
  readonly mayThrow: Set<string>;
@@ -374,8 +387,18 @@ export declare class LlEmitter {
374
387
  private readonly initializerBindings;
375
388
  /** Whole-program int32 storage and parameter/result facts. */
376
389
  readonly int32Slots: Int32Slots;
390
+ /** The program has no runtime store into a checked-dynamic value
391
+ * (dynamicFieldStores), so live views of classes and records never
392
+ * commit back into their objects. Library builds keep their commits:
393
+ * their values cross a native boundary. */
394
+ readonly liveViewsReadOnly: boolean;
377
395
  /** Functions whose direct calls use i32 parameters or results. */
378
396
  readonly int32Abis: ReadonlyMap<string, Int32Abi>;
397
+ /** Pure number functions with speculative integer clones. */
398
+ readonly integerClones: IntegerClones;
399
+ /** The IR function being emitted. */
400
+ currentFunctionName: string;
401
+ integerParamRange(fnName: string, localId: string): IntegerRange | null;
379
402
  /** Immutable module constants (contract types) whose graphs become
380
403
  * immortal once initialized: their reads need no reference counting. */
381
404
  readonly immortalGlobals: ReadonlySet<string>;
@@ -395,6 +418,17 @@ export declare class LlEmitter {
395
418
  };
396
419
  }>;
397
420
  private countedLoopsEnabled;
421
+ /** Speculative integer loops (speculative-integers.ts) run in this function. */
422
+ private speculativeLoopsEnabled;
423
+ /** The fast copy of a speculative integer loop being emitted: its
424
+ * integer-computed writes and where each resumes in the ordinary copy. */
425
+ private speculation;
426
+ /** The ordinary copy being emitted: resume labels still to place. */
427
+ private speculationResume;
428
+ /** The function being emitted, for speculative globals. */
429
+ private speculativeFunction;
430
+ /** Every function that writes each number global (computed on demand). */
431
+ private globalWriters;
398
432
  /** Whole-program final reference fields (ir/final-fields.ts). */
399
433
  private finalFields;
400
434
  /** The current function may borrow final fields of borrowable objects:
@@ -407,6 +441,9 @@ export declare class LlEmitter {
407
441
  private byteWindowEntries;
408
442
  bytesBounds: ReadonlySet<IrExpr | IrStmt>;
409
443
  integerViews: Map<string, string>;
444
+ /** Module globals the current function owns outright (initializer
445
+ * bindings): their function-local slot, which stands in for the global. */
446
+ private privateGlobalSlots;
410
447
  /** Number locals of the current function stored only as an i32
411
448
  * (int32-locals.ts); their slots are `alloca i32`. */
412
449
  int32Locals: Map<string, Int32Local>;
@@ -447,7 +484,14 @@ export declare class LlEmitter {
447
484
  finalLabel: string;
448
485
  cleanupLabel: string;
449
486
  suspendLabel: string;
487
+ /** The generator's OUT slot (%ScrGenSlot) for a native body whose
488
+ * yield channel is a number or boolean, which its yields store into
489
+ * inline (see emitGenSlotStore); null otherwise. */
490
+ out: string | null;
450
491
  } | null;
492
+ /** Inline generator slot accesses need the %ScrGenHead/%ScrGenSlot
493
+ * mirrors in the module header. */
494
+ usesGenSlots: boolean;
451
495
  /** The generator channels of the function being emitted (null outside
452
496
  * generator bodies): yieldExpr emission reads them, and emitTryCatch's
453
497
  * catch prologue emits the GENRET sentinel re-unwind exactly here. */
@@ -464,6 +508,8 @@ export declare class LlEmitter {
464
508
  constructor(mod: IrModule, options: LlvmTargetOptions);
465
509
  /** The borrowed parameters of a hierarchy's vtable slot (empty: owned). */
466
510
  virtualSlotBorrowed(rootName: string, slotIndex: number): ReadonlySet<number>;
511
+ /** Optimized emission: no debug-info (dev) posture. */
512
+ get optimizing(): boolean;
467
513
  /** The vtable entry for one implementation (VirtualBorrows.entry). */
468
514
  virtualEntry(implFn: string): string;
469
515
  private implSlotBorrowed;
@@ -582,6 +628,8 @@ export declare class LlEmitter {
582
628
  * stringify-indent currency) — `@`-ref, first-use order. */
583
629
  cstr(text: string): string;
584
630
  needBadTag(): void;
631
+ /** The ScrMapOps descriptor holding these operands (ShapeHost.mapOps). */
632
+ mapOps(operands: readonly string[]): string;
585
633
  /** The interned immortal instance for a UNIT arm of a union — asserts
586
634
  * the arm really is payload-less (undefined/null). Public: class
587
635
  * emission initializes undefined-admitting fields through it
@@ -688,6 +736,31 @@ export declare class LlEmitter {
688
736
  * conditions in expr-calls.ts). */
689
737
  private callTestsPending;
690
738
  private workerLoopBudget;
739
+ /** Emit a loop's condition, body and update through `emitCopy`, twice
740
+ * when speculative-integers.ts plans a fast integer copy. Both copies
741
+ * share the loop's setup and exit; the ordinary copy comes first so the
742
+ * fast copy is only emitted when every resume point exists. */
743
+ private emitLoopCopies;
744
+ private writeBackSpeculativeGlobals;
745
+ /** A number local whose only storage is its own double slot, so an i64
746
+ * shadow beside it can stand for it within one loop. */
747
+ private speculativeLocal;
748
+ /** A module-level number written only by the file's top-level code that
749
+ * is emitting this loop. Calls may still read it: the fast copy keeps its
750
+ * double current. An init function runs once and is never re-entered, so
751
+ * no call from the loop can write the global behind the shadow. */
752
+ private speculativeGlobal;
753
+ /** A module-level number a loop of any function only reads, written by
754
+ * nothing but top-level code: an init function never runs during a loop
755
+ * of another function, so the entry value stays its value. */
756
+ private speculativeInvariantGlobal;
757
+ /** The functions writing a number global a shadow may stand for, or null
758
+ * when the global is not such a number. */
759
+ private numberGlobalWriters;
760
+ /** A speculated write in the fast copy: compute the value as a safe
761
+ * integer, store it to the shadow and its exact double to the local.
762
+ * Any failed check re-executes the statement in the ordinary copy. */
763
+ private emitSpeculativeWrite;
691
764
  /** The amortized cancellation poll, emitted on the loop's back edge (the
692
765
  * continue target), after the body. A poll in the header would be a loop
693
766
  * exit ahead of the body; LLVM then cannot rotate the loop, so loads that
@@ -768,6 +841,9 @@ export declare class LlEmitter {
768
841
  };
769
842
  /** The overflow map's slot pointer on an index-signature shape. */
770
843
  recordOvfPtr(objName: string, shapeId: string): string;
844
+ /** The pointer to ScrMap.flags of an index-signature record's overflow
845
+ * map (byte offset sizeof(size_t) + 3; SCR_MAP_NULL_PROTO is bit 0). */
846
+ recordMapFlagsPtr(objName: string, shapeId: string): string;
771
847
  /** Loads a record field (i8-stored bools trunc to i1). An inline union
772
848
  * field answers a private stack box with the slot's own bits, ABSENT
773
849
  * included: it may only be borrowed. */
@@ -852,11 +928,24 @@ export declare class LlEmitter {
852
928
  * whether the promise waiter list or the ready FIFO owns the continuation;
853
929
  * LLVM keeps all live locals in the coroutine frame. */
854
930
  emitWasiSuspend(promise: string | null): void;
931
+ /** A native generator's OUT slot (scr_async.c's ScrGen.out, mirrored by
932
+ * %ScrGenHead and %ScrGenSlot { kind, f64, b, payload, release_fn }). */
933
+ genOutSlot(gen: string): string;
934
+ /** A yield on a number or boolean channel: scr_gen_slot_f64/bool inline.
935
+ * Such a body's OUT never holds a reference at a yield (only its final
936
+ * completion can park one), so the slot needs no release first. */
937
+ emitGenSlotStore(slot: string, kind: "f64" | "bool", value: string): void;
938
+ /** scr_gen_take_out_f64/bool inline: the slot's value when it holds that
939
+ * kind (otherwise 0 or false), leaving the slot empty. */
940
+ emitGenSlotTake(slot: string, kind: "f64" | "bool"): string;
855
941
  /** Suspend after a target-specific runtime helper already queued the
856
942
  * continuation (used by module awaits, which skip the hop when settled). */
857
943
  emitCoroSuspendPrepared(): void;
858
944
  /** Move a clean async return value into the current fiber's promise. */
859
945
  private emitWasiFulfill;
946
+ /** Number locals declared as a copy of a capture or of a lazily boxed
947
+ * parameter, at the top of the body. */
948
+ private doubleCopies;
860
949
  private emitFunction;
861
950
  /** The double-ABI entry of a function with an i32 entry: every caller
862
951
  * that is not a direct call (closures, dispatch, adapters, the runtime)
@@ -1028,6 +1117,27 @@ export declare class LlEmitter {
1028
1117
  * `s += String.fromCharCode(c)` appends the character without building
1029
1118
  * the one-character string; null for any other suffix. */
1030
1119
  private emitSingleCharCode;
1120
+ /**
1121
+ * Lower `recv.f = recv.f + suffix` on a plain string field like
1122
+ * emitStringSelfConcatAssign does for locals. The field's old value is
1123
+ * snapshotted (+1) and the suffix evaluated in JavaScript order; then the
1124
+ * field unlinks and releases its CURRENT value, so the snapshot is unique
1125
+ * unless a real alias exists and the concat appends in place instead of
1126
+ * copying the whole string on every append. Returns false (emitting
1127
+ * nothing) for every other store.
1128
+ */
1129
+ private emitFieldSelfConcat;
1130
+ /** A snapshot the current statement frames own (+1), or an immortal
1131
+ * value: it stays valid after its container releases the same string. */
1132
+ private ownsSnapshot;
1133
+ /**
1134
+ * `a[i] = a[i] + suffix` on a string array (the canonical statement form
1135
+ * of `a[i] += suffix`): the old element is snapshotted (+1) and the
1136
+ * suffix evaluated in JavaScript order; then, when the slot still holds
1137
+ * the snapshot, the array lets go of it (emitDenseSlotUnlink) so the
1138
+ * concat can append in place, and the result is stored as usual.
1139
+ */
1140
+ private emitArraySelfConcat;
1031
1141
  /** `local = local + suffix` when the suffix cannot read or write the
1032
1142
  * local (an unboxed binding is only reachable through this function's own
1033
1143
  * expressions): reading the binding after the suffix gives the value the
@@ -1039,7 +1149,7 @@ export declare class LlEmitter {
1039
1149
  /** A direct async call an enclosing `await` consumes whole: emitted
1040
1150
  * through the callee's await-call entry, yielding the awaited value. */
1041
1151
  emitAwaitedCall(e: ExprOf<"call">, adopt?: boolean): LlValue;
1042
- emitRecordExpr(e: ExprOf<"fieldGet" | "recordGet" | "recordLit" | "recordClone" | "recordKeyGet" | "recordOvfKeys" | "recordOvfHas" | "recordHas" | "fieldAbsent">): LlValue;
1152
+ emitRecordExpr(e: ExprOf<"fieldGet" | "recordGet" | "recordLit" | "recordClone" | "recordKeyGet" | "recordOvfKeys" | "recordOvfHas" | "recordNullProto" | "recordHas" | "fieldAbsent">): LlValue;
1043
1153
  emitDynamicExpr(e: ExprOf<"dynFrom" | "dynCall" | "dynInvoke" | "dynArrLit" | "dynObjLit" | "unionWrap" | "unionNarrow" | "unionDisc" | "unionKeyGet" | "unionIsTag" | "dynKeyGet" | "dynHasKey" | "dynScalarEq" | "dynTest" | "unionEq" | "unionFuncEq" | "caughtTest" | "caughtCheck" | "caughtNarrow" | "caughtToDyn">): LlValue;
1044
1154
  emitIntrinsicExpr(e: ExprOf<"intrinsic">): LlValue;
1045
1155
  /** InternTable's runtime calls (scr_itable.c). Table and entry handles
@@ -1164,6 +1274,8 @@ export declare class LlEmitter {
1164
1274
  borrowableNullableWrap(e: IrExpr): "unit" | "ref" | null;
1165
1275
  materializeSplitLocal(localId: string): void;
1166
1276
  emitExpr(e: IrExpr): LlValue;
1277
+ /** A fresh read-site cache for one constant-key dyn read. */
1278
+ dynReadIcSite(): string;
1167
1279
  dynKind(d: string): string;
1168
1280
  raceAdapterFor(from: IrType, to: IrType): string;
1169
1281
  genResultThunkFor(genT: IrType & {
@@ -1189,6 +1301,12 @@ export declare class LlEmitter {
1189
1301
  fn: string;
1190
1302
  shim: string;
1191
1303
  };
1304
+ emitterOnceAdapter(boxerT: IrType & {
1305
+ kind: "func";
1306
+ }): {
1307
+ fn: string;
1308
+ shim: string;
1309
+ };
1192
1310
  wrapEmitterListener(target: string, adapterFn: string): string;
1193
1311
  unwrapNullableClosure(u: string, funcTag: number): string;
1194
1312
  closeBindThunkFor(cbUnion: IrType, retServer: boolean): string;