@geastack/compiler 1.0.20 → 1.0.21

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 (534) hide show
  1. package/dist/cli-emit.js +11 -1
  2. package/dist/cli-package-source.d.ts +0 -4
  3. package/dist/cli-package-source.js +8 -112
  4. package/dist/cli-refusal-location.d.ts +6 -0
  5. package/dist/cli-refusal-location.js +5 -0
  6. package/dist/cli.js +2 -1
  7. package/dist/compiler.d.ts +4 -0
  8. package/dist/compiler.js +118 -28
  9. package/dist/conversion/algebra.d.ts +16 -1
  10. package/dist/conversion/algebra.js +2 -0
  11. package/dist/conversion/build.js +16 -6
  12. package/dist/conversion/constructor-identity-family.d.ts +49 -0
  13. package/dist/conversion/constructor-identity-family.js +67 -0
  14. package/dist/conversion/derive.js +39 -6
  15. package/dist/conversion/iterable-object-view.d.ts +44 -0
  16. package/dist/conversion/iterable-object-view.js +55 -0
  17. package/dist/conversion/iterator-object-view.d.ts +77 -0
  18. package/dist/conversion/iterator-object-view.js +112 -0
  19. package/dist/conversion/nodes.d.ts +93 -0
  20. package/dist/conversion/nodes.js +262 -5
  21. package/dist/conversion/operand-view.js +41 -0
  22. package/dist/conversion/protocol-iterator.d.ts +84 -0
  23. package/dist/conversion/protocol-iterator.js +88 -0
  24. package/dist/conversion/record-view.d.ts +152 -8
  25. package/dist/conversion/record-view.js +518 -37
  26. package/dist/conversion/registry.d.ts +32 -0
  27. package/dist/ir/borrowed-call-arguments.d.ts +22 -1
  28. package/dist/ir/borrowed-call-arguments.js +102 -1
  29. package/dist/ir/borrowed-callable-uses.d.ts +62 -0
  30. package/dist/ir/borrowed-callable-uses.js +135 -0
  31. package/dist/ir/boxed-bind-assumptions.d.ts +24 -0
  32. package/dist/ir/boxed-bind-assumptions.js +93 -0
  33. package/dist/ir/build.d.ts +18 -7
  34. package/dist/ir/build.js +71 -13
  35. package/dist/ir/call-dispatch.js +474 -10
  36. package/dist/ir/call-entry.d.ts +24 -1
  37. package/dist/ir/call-entry.js +106 -1
  38. package/dist/ir/callable-class-flow.js +15 -5
  39. package/dist/ir/callable-identity-demand.d.ts +20 -1
  40. package/dist/ir/callable-identity-demand.js +157 -18
  41. package/dist/ir/callable-member-candidates.d.ts +11 -1
  42. package/dist/ir/callable-member-candidates.js +82 -3
  43. package/dist/ir/callable-records.js +2 -2
  44. package/dist/ir/callable-site-escape.d.ts +4 -0
  45. package/dist/ir/callable-site-escape.js +228 -0
  46. package/dist/ir/captures.d.ts +10 -1
  47. package/dist/ir/captures.js +219 -4
  48. package/dist/ir/certify/carrier-keys.d.ts +58 -1
  49. package/dist/ir/certify/carrier-keys.js +158 -6
  50. package/dist/ir/certify/property-access-keys.d.ts +17 -0
  51. package/dist/ir/certify/property-access-keys.js +36 -0
  52. package/dist/ir/certify/property-access.js +49 -4
  53. package/dist/ir/certify/runtime-helper.d.ts +4 -0
  54. package/dist/ir/certify/runtime-helper.js +17 -5
  55. package/dist/ir/certify.js +132 -79
  56. package/dist/ir/class-static-fields.d.ts +11 -0
  57. package/dist/ir/class-static-fields.js +28 -0
  58. package/dist/ir/construct-entry.d.ts +2 -1
  59. package/dist/ir/construct-entry.js +3 -2
  60. package/dist/ir/construction-only-fields.d.ts +73 -0
  61. package/dist/ir/construction-only-fields.js +211 -0
  62. package/dist/ir/dominance.d.ts +14 -0
  63. package/dist/ir/dominance.js +18 -4
  64. package/dist/ir/emission-representations.js +4 -1
  65. package/dist/ir/exception-edges.d.ts +17 -0
  66. package/dist/ir/exception-edges.js +75 -0
  67. package/dist/ir/facts.d.ts +54 -3
  68. package/dist/ir/facts.js +182 -5
  69. package/dist/ir/generator-split.js +2 -2
  70. package/dist/ir/instance-reparenting.d.ts +83 -0
  71. package/dist/ir/instance-reparenting.js +167 -0
  72. package/dist/ir/integer-storage.d.ts +29 -0
  73. package/dist/ir/integer-storage.js +188 -79
  74. package/dist/ir/integers.d.ts +16 -0
  75. package/dist/ir/integers.js +327 -8
  76. package/dist/ir/integrity-restrictions.d.ts +42 -9
  77. package/dist/ir/integrity-restrictions.js +335 -42
  78. package/dist/ir/key-order-observation.d.ts +38 -0
  79. package/dist/ir/key-order-observation.js +173 -0
  80. package/dist/ir/literal-set-membership.d.ts +30 -0
  81. package/dist/ir/literal-set-membership.js +277 -0
  82. package/dist/ir/lower-allocation.js +68 -8
  83. package/dist/ir/lower-completion.d.ts +0 -9
  84. package/dist/ir/lower-completion.js +14 -5
  85. package/dist/ir/lower-destructuring.js +24 -2
  86. package/dist/ir/lower-exceptions.js +4 -4
  87. package/dist/ir/lower-flow.d.ts +21 -0
  88. package/dist/ir/lower-flow.js +37 -3
  89. package/dist/ir/lower-graph.d.ts +19 -1
  90. package/dist/ir/lower-graph.js +91 -67
  91. package/dist/ir/lower-invocation.d.ts +16 -0
  92. package/dist/ir/lower-invocation.js +182 -28
  93. package/dist/ir/lower-narrow.d.ts +0 -46
  94. package/dist/ir/lower-narrow.js +63 -1
  95. package/dist/ir/lower-operands.d.ts +52 -2
  96. package/dist/ir/lower-operands.js +491 -8
  97. package/dist/ir/lower-property.d.ts +2 -1
  98. package/dist/ir/lower-property.js +140 -31
  99. package/dist/ir/lower-protocol.js +16 -4
  100. package/dist/ir/lower-proxy.d.ts +65 -0
  101. package/dist/ir/lower-proxy.js +181 -0
  102. package/dist/ir/lower.js +112 -17
  103. package/dist/ir/model.d.ts +228 -18
  104. package/dist/ir/native-class-accessor.d.ts +9 -2
  105. package/dist/ir/native-class-accessor.js +12 -3
  106. package/dist/ir/native-class-construction.d.ts +1 -1
  107. package/dist/ir/native-class-construction.js +2 -1
  108. package/dist/ir/native-class-initialization.js +2 -2
  109. package/dist/ir/object-value-conversions.js +20 -5
  110. package/dist/ir/operation-index.d.ts +16 -0
  111. package/dist/ir/operation-index.js +17 -0
  112. package/dist/ir/pcm-loops.d.ts +11 -0
  113. package/dist/ir/pcm-loops.js +284 -0
  114. package/dist/ir/presence-proof.js +5 -0
  115. package/dist/ir/program-facts.d.ts +10 -20
  116. package/dist/ir/program-facts.js +80 -6
  117. package/dist/ir/proven-branches.d.ts +2 -2
  118. package/dist/ir/proven-branches.js +196 -3
  119. package/dist/ir/queries.js +35 -1
  120. package/dist/ir/reflection-demand.d.ts +9 -4
  121. package/dist/ir/reflection-demand.js +400 -28
  122. package/dist/ir/refusal.d.ts +1 -0
  123. package/dist/ir/refusal.js +2 -1
  124. package/dist/ir/shake.d.ts +94 -1
  125. package/dist/ir/shake.js +209 -12
  126. package/dist/ir/shared-empty-records.d.ts +12 -0
  127. package/dist/ir/shared-empty-records.js +301 -0
  128. package/dist/ir/spread-copy-elision.d.ts +59 -0
  129. package/dist/ir/spread-copy-elision.js +431 -0
  130. package/dist/ir/stable-cell-reads.d.ts +40 -0
  131. package/dist/ir/stable-cell-reads.js +123 -0
  132. package/dist/ir/static-callables.js +50 -0
  133. package/dist/ir/string-layout-reuse.d.ts +16 -1
  134. package/dist/ir/string-layout-reuse.js +66 -0
  135. package/dist/ir/transfer.d.ts +72 -3
  136. package/dist/ir/transfer.js +511 -19
  137. package/dist/ir/typed-property-access.d.ts +18 -2
  138. package/dist/ir/typed-property-access.js +109 -12
  139. package/dist/ir/verify.js +2 -1
  140. package/dist/plugins/apple/plugin.js +3 -2
  141. package/dist/plugins/gea/host.d.ts +7 -0
  142. package/dist/plugins/gea/host.js +30 -1
  143. package/dist/plugins/gea/lower.js +6 -1
  144. package/dist/plugins/gea/plugin.js +7 -4
  145. package/dist/plugins/gea/render-bridge.d.ts +4 -2
  146. package/dist/plugins/gea/render-bridge.js +23 -7
  147. package/dist/plugins/model.d.ts +2 -0
  148. package/dist/project-preparation.d.ts +5 -1
  149. package/dist/project-preparation.js +164 -7
  150. package/dist/projection/bindings.d.ts +5 -2
  151. package/dist/projection/bindings.js +40 -1
  152. package/dist/projection/callee.d.ts +16 -0
  153. package/dist/projection/callee.js +35 -6
  154. package/dist/projection/class-prototype.js +5 -1
  155. package/dist/projection/classes.d.ts +65 -2
  156. package/dist/projection/classes.js +159 -2
  157. package/dist/projection/dispatch.d.ts +69 -18
  158. package/dist/projection/dispatch.js +391 -19
  159. package/dist/projection/fields.d.ts +4 -3
  160. package/dist/projection/fields.js +89 -21
  161. package/dist/projection/instance-test.d.ts +12 -0
  162. package/dist/projection/instance-test.js +40 -10
  163. package/dist/projection/method-value-escapes.d.ts +43 -0
  164. package/dist/projection/method-value-escapes.js +113 -0
  165. package/dist/projection/slots.d.ts +34 -1
  166. package/dist/projection/slots.js +82 -5
  167. package/dist/representation/any-null-record-members.d.ts +41 -0
  168. package/dist/representation/any-null-record-members.js +115 -0
  169. package/dist/representation/collections.d.ts +3 -1
  170. package/dist/representation/collections.js +5 -2
  171. package/dist/representation/derive.d.ts +9 -1
  172. package/dist/representation/derive.js +366 -25
  173. package/dist/representation/difference.js +14 -0
  174. package/dist/representation/embedded-carriers.js +1 -0
  175. package/dist/representation/host-abi.d.ts +15 -0
  176. package/dist/representation/host-abi.js +28 -0
  177. package/dist/representation/host-templates.d.ts +1 -1
  178. package/dist/representation/host-templates.js +7 -3
  179. package/dist/representation/intersection.js +22 -0
  180. package/dist/representation/json-nullable.d.ts +18 -0
  181. package/dist/representation/json-nullable.js +22 -0
  182. package/dist/representation/model.d.ts +141 -0
  183. package/dist/representation/model.js +47 -3
  184. package/dist/representation/object-shape.d.ts +5 -1
  185. package/dist/representation/object-shape.js +5 -2
  186. package/dist/representation/policies.d.ts +66 -1
  187. package/dist/representation/proxy-carriers.d.ts +71 -0
  188. package/dist/representation/proxy-carriers.js +330 -0
  189. package/dist/representation/publish.d.ts +9 -1
  190. package/dist/representation/publish.js +186 -18
  191. package/dist/representation/record-fields.d.ts +5 -0
  192. package/dist/representation/record-fields.js +7 -1
  193. package/dist/representation/static-field-cells.d.ts +61 -0
  194. package/dist/representation/static-field-cells.js +80 -0
  195. package/dist/representation/unassigned-binding-cells.d.ts +32 -0
  196. package/dist/representation/unassigned-binding-cells.js +44 -0
  197. package/dist/representation/union.js +17 -1
  198. package/dist/representation/unwritten-record-members.d.ts +54 -0
  199. package/dist/representation/unwritten-record-members.js +167 -0
  200. package/dist/representation/value-records.js +153 -11
  201. package/dist/semantics/ambient.d.ts +102 -0
  202. package/dist/semantics/ambient.js +183 -0
  203. package/dist/semantics/any-null-member-declarations.d.ts +32 -0
  204. package/dist/semantics/any-null-member-declarations.js +90 -0
  205. package/dist/semantics/borrowed-builtin-call-bind-source-transform.js +14 -0
  206. package/dist/semantics/borrowed-method-receiver-copy-source-transform.d.ts +51 -0
  207. package/dist/semantics/borrowed-method-receiver-copy-source-transform.js +367 -0
  208. package/dist/semantics/call-invalidated-narrowing.d.ts +3 -0
  209. package/dist/semantics/call-invalidated-narrowing.js +715 -0
  210. package/dist/semantics/callable-origins.d.ts +39 -0
  211. package/dist/semantics/callable-origins.js +73 -2
  212. package/dist/semantics/class-alias.d.ts +21 -0
  213. package/dist/semantics/class-alias.js +45 -14
  214. package/dist/semantics/class-heritage.d.ts +64 -0
  215. package/dist/semantics/class-heritage.js +278 -2
  216. package/dist/semantics/commonjs-wrapper.d.ts +1 -1
  217. package/dist/semantics/commonjs-wrapper.js +24 -7
  218. package/dist/semantics/constructor-function-class-source-transform.d.ts +4 -0
  219. package/dist/semantics/constructor-function-class-source-transform.js +327 -0
  220. package/dist/semantics/constructor-slot-subclasses.js +163 -4
  221. package/dist/semantics/declaration-overlay-transform.js +197 -3
  222. package/dist/semantics/frontend.d.ts +31 -0
  223. package/dist/semantics/frontend.js +177 -19
  224. package/dist/semantics/host-methods.d.ts +27 -2
  225. package/dist/semantics/host-methods.js +57 -4
  226. package/dist/semantics/host-protocols.d.ts +19 -8
  227. package/dist/semantics/host-protocols.js +145 -31
  228. package/dist/semantics/interface-families.d.ts +51 -2
  229. package/dist/semantics/interface-families.js +609 -23
  230. package/dist/semantics/interface-implementors.d.ts +20 -0
  231. package/dist/semantics/interface-implementors.js +130 -6
  232. package/dist/semantics/known-caller-predicate-parameters.d.ts +2 -0
  233. package/dist/semantics/known-caller-predicate-parameters.js +161 -0
  234. package/dist/semantics/model/intrinsic-accessor-getters.d.ts +10 -0
  235. package/dist/semantics/model/intrinsic-accessor-getters.js +4 -0
  236. package/dist/semantics/model/operands.d.ts +10 -0
  237. package/dist/semantics/model/operations.d.ts +107 -0
  238. package/dist/semantics/model/selected-signature.d.ts +33 -0
  239. package/dist/semantics/model/structural-type-table.d.ts +15 -0
  240. package/dist/semantics/model/structural-type-table.js +19 -1
  241. package/dist/semantics/model/structural-types.d.ts +99 -0
  242. package/dist/semantics/model/structural-types.js +31 -2
  243. package/dist/semantics/normalize/absent-globals.d.ts +1 -1
  244. package/dist/semantics/normalize/absent-globals.js +3 -3
  245. package/dist/semantics/normalize/bivariant-slot-parameter.d.ts +46 -0
  246. package/dist/semantics/normalize/bivariant-slot-parameter.js +357 -0
  247. package/dist/semantics/normalize/callback-parameter-contracts.d.ts +2 -0
  248. package/dist/semantics/normalize/callback-parameter-contracts.js +21 -0
  249. package/dist/semantics/normalize/census.d.ts +2 -1
  250. package/dist/semantics/normalize/census.js +25 -2
  251. package/dist/semantics/normalize/class-instance-record-statement.d.ts +37 -0
  252. package/dist/semantics/normalize/class-instance-record-statement.js +74 -0
  253. package/dist/semantics/normalize/collection-bindings.js +242 -5
  254. package/dist/semantics/normalize/commonjs-require.d.ts +26 -0
  255. package/dist/semantics/normalize/commonjs-require.js +355 -121
  256. package/dist/semantics/normalize/dead-event-emissions.d.ts +6 -0
  257. package/dist/semantics/normalize/dead-event-emissions.js +866 -0
  258. package/dist/semantics/normalize/dead-method-copies.d.ts +56 -0
  259. package/dist/semantics/normalize/dead-method-copies.js +239 -0
  260. package/dist/semantics/normalize/derived-expression-type.d.ts +149 -2
  261. package/dist/semantics/normalize/derived-expression-type.js +418 -14
  262. package/dist/semantics/normalize/field-bindings.js +139 -4
  263. package/dist/semantics/normalize/flow/callable-reach.js +162 -9
  264. package/dist/semantics/normalize/flow/member-call-forwarding.js +6 -0
  265. package/dist/semantics/normalize/flow/owned-class-receivers.js +40 -2
  266. package/dist/semantics/normalize/flow/source-class-data.d.ts +7 -1
  267. package/dist/semantics/normalize/flow/source-class-data.js +28 -9
  268. package/dist/semantics/normalize/flow/source-value-session.js +32 -13
  269. package/dist/semantics/normalize/flow/targets.d.ts +32 -0
  270. package/dist/semantics/normalize/flow/targets.js +65 -6
  271. package/dist/semantics/normalize/flow/value-flow.d.ts +7 -0
  272. package/dist/semantics/normalize/flow/value-flow.js +30 -2
  273. package/dist/semantics/normalize/fresh-array-result.d.ts +32 -0
  274. package/dist/semantics/normalize/fresh-array-result.js +125 -0
  275. package/dist/semantics/normalize/gating.js +2 -0
  276. package/dist/semantics/normalize/global-host-mutations.d.ts +11 -1
  277. package/dist/semantics/normalize/global-host-mutations.js +691 -27
  278. package/dist/semantics/normalize/host-effect-contracts.d.ts +43 -1
  279. package/dist/semantics/normalize/host-effect-contracts.js +60 -3
  280. package/dist/semantics/normalize/identities.js +49 -3
  281. package/dist/semantics/normalize/intrinsic-accessor-getter.d.ts +59 -0
  282. package/dist/semantics/normalize/intrinsic-accessor-getter.js +129 -0
  283. package/dist/semantics/normalize/local-bindings.js +117 -21
  284. package/dist/semantics/normalize/merged-declaration.d.ts +41 -0
  285. package/dist/semantics/normalize/merged-declaration.js +81 -0
  286. package/dist/semantics/normalize/never-override-result.d.ts +21 -0
  287. package/dist/semantics/normalize/never-override-result.js +64 -0
  288. package/dist/semantics/normalize/null-blind-parameter.d.ts +21 -0
  289. package/dist/semantics/normalize/null-blind-parameter.js +77 -0
  290. package/dist/semantics/normalize/object-bag-bindings.js +10 -0
  291. package/dist/semantics/normalize/override-field-arms.d.ts +33 -0
  292. package/dist/semantics/normalize/override-field-arms.js +362 -0
  293. package/dist/semantics/normalize/parameter-bindings.d.ts +64 -1
  294. package/dist/semantics/normalize/parameter-bindings.js +801 -81
  295. package/dist/semantics/normalize/parameter-slot.d.ts +1 -0
  296. package/dist/semantics/normalize/parameter-slot.js +69 -0
  297. package/dist/semantics/normalize/physical-overload-result.d.ts +45 -0
  298. package/dist/semantics/normalize/physical-overload-result.js +132 -0
  299. package/dist/semantics/normalize/producer-context.d.ts +23 -0
  300. package/dist/semantics/normalize/producers/allocations.d.ts +13 -0
  301. package/dist/semantics/normalize/producers/allocations.js +8 -15
  302. package/dist/semantics/normalize/producers/binding-kind.d.ts +11 -0
  303. package/dist/semantics/normalize/producers/binding-kind.js +31 -0
  304. package/dist/semantics/normalize/producers/bindings.js +16 -1
  305. package/dist/semantics/normalize/producers/boundary.js +21 -1
  306. package/dist/semantics/normalize/producers/class-lifecycle.js +23 -14
  307. package/dist/semantics/normalize/producers/computations.js +8 -67
  308. package/dist/semantics/normalize/producers/control-loops.d.ts +1 -1
  309. package/dist/semantics/normalize/producers/control-loops.js +25 -1
  310. package/dist/semantics/normalize/producers/control.js +87 -60
  311. package/dist/semantics/normalize/producers/declaration-lifecycle.js +5 -0
  312. package/dist/semantics/normalize/producers/enums.d.ts +10 -0
  313. package/dist/semantics/normalize/producers/enums.js +169 -0
  314. package/dist/semantics/normalize/producers/erasure.d.ts +10 -0
  315. package/dist/semantics/normalize/producers/erasure.js +23 -0
  316. package/dist/semantics/normalize/producers/intrinsic-accessor-getter.d.ts +15 -0
  317. package/dist/semantics/normalize/producers/intrinsic-accessor-getter.js +33 -0
  318. package/dist/semantics/normalize/producers/invocations.js +255 -18
  319. package/dist/semantics/normalize/producers/iteration-yield.js +6 -1
  320. package/dist/semantics/normalize/producers/logical-merge-type.d.ts +36 -0
  321. package/dist/semantics/normalize/producers/logical-merge-type.js +163 -0
  322. package/dist/semantics/normalize/producers/properties.js +207 -18
  323. package/dist/semantics/normalize/producers/protocol.d.ts +4 -0
  324. package/dist/semantics/normalize/producers/protocol.js +147 -12
  325. package/dist/semantics/normalize/producers/references.js +50 -9
  326. package/dist/semantics/normalize/producers/shared.d.ts +120 -0
  327. package/dist/semantics/normalize/producers/shared.js +359 -10
  328. package/dist/semantics/normalize/producers/spread-arguments.js +85 -4
  329. package/dist/semantics/normalize/producers/tuple-spread.d.ts +1 -0
  330. package/dist/semantics/normalize/producers/tuple-spread.js +1 -1
  331. package/dist/semantics/normalize/property-key-domain.js +6 -0
  332. package/dist/semantics/normalize/reachability.d.ts +7 -0
  333. package/dist/semantics/normalize/reachability.js +166 -9
  334. package/dist/semantics/normalize/record-home-arms.d.ts +25 -0
  335. package/dist/semantics/normalize/record-home-arms.js +87 -0
  336. package/dist/semantics/normalize/record-link-families.d.ts +74 -0
  337. package/dist/semantics/normalize/record-link-families.js +327 -0
  338. package/dist/semantics/normalize/record-stand-in-arms.d.ts +56 -0
  339. package/dist/semantics/normalize/record-stand-in-arms.js +484 -0
  340. package/dist/semantics/normalize/return-bindings.d.ts +6 -2
  341. package/dist/semantics/normalize/return-bindings.js +60 -7
  342. package/dist/semantics/normalize/script-global-redefinition.js +5 -0
  343. package/dist/semantics/normalize/shared-array-storage.d.ts +42 -0
  344. package/dist/semantics/normalize/shared-array-storage.js +373 -0
  345. package/dist/semantics/normalize/sloppy-absence.d.ts +41 -0
  346. package/dist/semantics/normalize/sloppy-absence.js +199 -0
  347. package/dist/semantics/normalize/specialization.d.ts +40 -0
  348. package/dist/semantics/normalize/specialization.js +770 -36
  349. package/dist/semantics/normalize/structural-array-element.js +196 -6
  350. package/dist/semantics/normalize/structural-array-read.js +12 -0
  351. package/dist/semantics/normalize/structural-creation-order.d.ts +15 -0
  352. package/dist/semantics/normalize/structural-creation-order.js +51 -48
  353. package/dist/semantics/normalize/structural-declarations.d.ts +16 -0
  354. package/dist/semantics/normalize/structural-declarations.js +43 -0
  355. package/dist/semantics/normalize/structural-generics.d.ts +13 -0
  356. package/dist/semantics/normalize/structural-generics.js +22 -0
  357. package/dist/semantics/normalize/structural-indexed-access.js +16 -0
  358. package/dist/semantics/normalize/structural-instantiated-member.js +68 -2
  359. package/dist/semantics/normalize/structural-joins.js +2 -0
  360. package/dist/semantics/normalize/structural-layout-relevance.d.ts +30 -0
  361. package/dist/semantics/normalize/structural-layout-relevance.js +164 -0
  362. package/dist/semantics/normalize/structural-layout-type.js +270 -14
  363. package/dist/semantics/normalize/structural-leaves.d.ts +1 -1
  364. package/dist/semantics/normalize/structural-leaves.js +17 -3
  365. package/dist/semantics/normalize/structural-mutable-method.js +5 -1
  366. package/dist/semantics/normalize/structural-parts.d.ts +18 -5
  367. package/dist/semantics/normalize/structural-parts.js +68 -19
  368. package/dist/semantics/normalize/structural-receiver.d.ts +1 -1
  369. package/dist/semantics/normalize/structural-receiver.js +23 -1
  370. package/dist/semantics/normalize/structural-self-reference.d.ts +1 -1
  371. package/dist/semantics/normalize/structural-self-reference.js +23 -2
  372. package/dist/semantics/normalize/structural.d.ts +12 -1
  373. package/dist/semantics/normalize/structural.js +1420 -53
  374. package/dist/semantics/normalize/suppressed-write-arms.d.ts +47 -0
  375. package/dist/semantics/normalize/suppressed-write-arms.js +393 -0
  376. package/dist/semantics/normalize/unresolvable-names.d.ts +15 -2
  377. package/dist/semantics/normalize/unresolvable-names.js +30 -6
  378. package/dist/semantics/normalize/unshared-array-result.d.ts +32 -0
  379. package/dist/semantics/normalize/unshared-array-result.js +125 -0
  380. package/dist/semantics/package-sources.d.ts +1 -1
  381. package/dist/semantics/package-sources.js +120 -8
  382. package/dist/semantics/program.d.ts +20 -0
  383. package/dist/semantics/program.js +145 -14
  384. package/dist/semantics/stable-checker.d.ts +1 -1
  385. package/dist/semantics/stable-checker.js +7 -2
  386. package/dist/semantics/unchecked-guard-argument-copies.d.ts +67 -0
  387. package/dist/semantics/unchecked-guard-argument-copies.js +163 -0
  388. package/dist/semantics/unchecked-write-member-declarations.d.ts +46 -0
  389. package/dist/semantics/unchecked-write-member-declarations.js +331 -0
  390. package/dist/targets/cpp/balanced-units.d.ts +31 -0
  391. package/dist/targets/cpp/balanced-units.js +57 -0
  392. package/dist/targets/cpp/borrowed-arm-projections.d.ts +31 -0
  393. package/dist/targets/cpp/borrowed-arm-projections.js +106 -0
  394. package/dist/targets/cpp/borrowed-call-entry.d.ts +1 -1
  395. package/dist/targets/cpp/borrowed-call-entry.js +24 -20
  396. package/dist/targets/cpp/captures.js +314 -8
  397. package/dist/targets/cpp/char-code-buffers.d.ts +36 -0
  398. package/dist/targets/cpp/char-code-buffers.js +214 -0
  399. package/dist/targets/cpp/class-layout.d.ts +7 -1
  400. package/dist/targets/cpp/class-layout.js +42 -17
  401. package/dist/targets/cpp/class-properties/computed-method-value.d.ts +17 -2
  402. package/dist/targets/cpp/class-properties/computed-method-value.js +50 -4
  403. package/dist/targets/cpp/class-properties/emit-class-properties.d.ts +31 -1
  404. package/dist/targets/cpp/class-properties/emit-class-properties.js +174 -17
  405. package/dist/targets/cpp/class-ref-transport.d.ts +32 -0
  406. package/dist/targets/cpp/class-ref-transport.js +56 -1
  407. package/dist/targets/cpp/conversions.js +1827 -1502
  408. package/dist/targets/cpp/coroutine-bodies.d.ts +97 -0
  409. package/dist/targets/cpp/coroutine-bodies.js +187 -0
  410. package/dist/targets/cpp/document.js +11 -1
  411. package/dist/targets/cpp/emit-allocation.js +535 -21
  412. package/dist/targets/cpp/emit-arrays.d.ts +10 -0
  413. package/dist/targets/cpp/emit-arrays.js +147 -16
  414. package/dist/targets/cpp/emit-binding-reference.d.ts +26 -2
  415. package/dist/targets/cpp/emit-binding-reference.js +97 -5
  416. package/dist/targets/cpp/emit-bindings.d.ts +9 -1
  417. package/dist/targets/cpp/emit-bindings.js +108 -8
  418. package/dist/targets/cpp/emit-buffers.d.ts +2 -16
  419. package/dist/targets/cpp/emit-buffers.js +124 -25
  420. package/dist/targets/cpp/emit-callable.d.ts +35 -72
  421. package/dist/targets/cpp/emit-callable.js +647 -82
  422. package/dist/targets/cpp/emit-carrier-members.d.ts +13 -2
  423. package/dist/targets/cpp/emit-carrier-members.js +50 -9
  424. package/dist/targets/cpp/emit-constructor-identity-family.d.ts +20 -0
  425. package/dist/targets/cpp/emit-constructor-identity-family.js +45 -0
  426. package/dist/targets/cpp/emit-context.d.ts +329 -15
  427. package/dist/targets/cpp/emit-context.js +104 -13
  428. package/dist/targets/cpp/emit-dynamic-properties.d.ts +44 -0
  429. package/dist/targets/cpp/emit-dynamic-properties.js +256 -37
  430. package/dist/targets/cpp/emit-equality.js +117 -2
  431. package/dist/targets/cpp/emit-error-constructor.d.ts +19 -0
  432. package/dist/targets/cpp/emit-error-constructor.js +73 -0
  433. package/dist/targets/cpp/emit-exceptions.d.ts +25 -3
  434. package/dist/targets/cpp/emit-exceptions.js +215 -26
  435. package/dist/targets/cpp/emit-in.js +52 -5
  436. package/dist/targets/cpp/emit-instanceof.js +59 -11
  437. package/dist/targets/cpp/emit-integers.d.ts +6 -0
  438. package/dist/targets/cpp/emit-integers.js +10 -0
  439. package/dist/targets/cpp/emit-iterable-object-view.d.ts +15 -0
  440. package/dist/targets/cpp/emit-iterable-object-view.js +51 -0
  441. package/dist/targets/cpp/emit-iterator-object-view.d.ts +15 -0
  442. package/dist/targets/cpp/emit-iterator-object-view.js +125 -0
  443. package/dist/targets/cpp/emit-iterator.d.ts +7 -10
  444. package/dist/targets/cpp/emit-iterator.js +361 -24
  445. package/dist/targets/cpp/emit-json.d.ts +7 -1
  446. package/dist/targets/cpp/emit-json.js +595 -55
  447. package/dist/targets/cpp/emit-jsx.d.ts +0 -37
  448. package/dist/targets/cpp/emit-jsx.js +70 -8
  449. package/dist/targets/cpp/emit-narrowing.d.ts +192 -28
  450. package/dist/targets/cpp/emit-narrowing.js +1595 -120
  451. package/dist/targets/cpp/emit-native-selection.js +8 -2
  452. package/dist/targets/cpp/emit-presence.js +13 -0
  453. package/dist/targets/cpp/emit-properties.d.ts +3 -1
  454. package/dist/targets/cpp/emit-properties.js +303 -54
  455. package/dist/targets/cpp/emit-protocol-iterator.d.ts +14 -0
  456. package/dist/targets/cpp/emit-protocol-iterator.js +203 -0
  457. package/dist/targets/cpp/emit-proxy.d.ts +17 -0
  458. package/dist/targets/cpp/emit-proxy.js +35 -0
  459. package/dist/targets/cpp/emit-record-view.d.ts +12 -1
  460. package/dist/targets/cpp/emit-record-view.js +429 -18
  461. package/dist/targets/cpp/emit-return.d.ts +38 -0
  462. package/dist/targets/cpp/emit-return.js +143 -21
  463. package/dist/targets/cpp/emit-scopes.d.ts +78 -0
  464. package/dist/targets/cpp/emit-scopes.js +196 -0
  465. package/dist/targets/cpp/emit-sum-widening.js +6 -3
  466. package/dist/targets/cpp/emit-tonumber.d.ts +40 -1
  467. package/dist/targets/cpp/emit-tonumber.js +75 -4
  468. package/dist/targets/cpp/emit-tostring.d.ts +28 -2
  469. package/dist/targets/cpp/emit-tostring.js +115 -12
  470. package/dist/targets/cpp/emit-typeof.js +2 -2
  471. package/dist/targets/cpp/emit-union-properties.d.ts +9 -0
  472. package/dist/targets/cpp/emit-union-properties.js +375 -46
  473. package/dist/targets/cpp/emit.d.ts +3 -1
  474. package/dist/targets/cpp/emit.js +725 -90
  475. package/dist/targets/cpp/evaluated-once.d.ts +51 -0
  476. package/dist/targets/cpp/evaluated-once.js +140 -0
  477. package/dist/targets/cpp/host/core-globals.d.ts +0 -21
  478. package/dist/targets/cpp/host/core-globals.js +10 -2
  479. package/dist/targets/cpp/host/emit-host-invoke.d.ts +0 -10
  480. package/dist/targets/cpp/host/emit-host-invoke.js +454 -36
  481. package/dist/targets/cpp/host/emit-host-object.js +733 -88
  482. package/dist/targets/cpp/host/emit-host-properties.js +26 -2
  483. package/dist/targets/cpp/host/emit-host-reflect.d.ts +1 -0
  484. package/dist/targets/cpp/host/emit-host-reflect.js +26 -7
  485. package/dist/targets/cpp/host/emit-host-value.d.ts +13 -0
  486. package/dist/targets/cpp/host/emit-host-value.js +47 -3
  487. package/dist/targets/cpp/host/host-members.d.ts +11 -0
  488. package/dist/targets/cpp/host/host-members.js +50 -4
  489. package/dist/targets/cpp/host/native-protocols.js +3 -0
  490. package/dist/targets/cpp/host/object-protocol.d.ts +8 -0
  491. package/dist/targets/cpp/host/object-protocol.js +55 -13
  492. package/dist/targets/cpp/key-order-tracking.d.ts +11 -0
  493. package/dist/targets/cpp/key-order-tracking.js +18 -0
  494. package/dist/targets/cpp/manifest/capabilities.js +107 -8
  495. package/dist/targets/cpp/manifest.js +14 -0
  496. package/dist/targets/cpp/native-collection-base.d.ts +27 -0
  497. package/dist/targets/cpp/native-collection-base.js +202 -0
  498. package/dist/targets/cpp/native-error-base.d.ts +14 -0
  499. package/dist/targets/cpp/native-error-base.js +19 -4
  500. package/dist/targets/cpp/native-promise-base.d.ts +23 -0
  501. package/dist/targets/cpp/native-promise-base.js +30 -0
  502. package/dist/targets/cpp/native-symbol-keys.js +1 -1
  503. package/dist/targets/cpp/prototype/emit-prototype-array.js +258 -20
  504. package/dist/targets/cpp/prototype/emit-prototype-date.js +5 -4
  505. package/dist/targets/cpp/prototype/emit-prototype-invoke.d.ts +9 -1
  506. package/dist/targets/cpp/prototype/emit-prototype-invoke.js +232 -26
  507. package/dist/targets/cpp/prototype/emit-prototype-iterator.d.ts +1 -1
  508. package/dist/targets/cpp/prototype/emit-prototype-iterator.js +111 -13
  509. package/dist/targets/cpp/prototype/emit-prototype-promise.d.ts +33 -4
  510. package/dist/targets/cpp/prototype/emit-prototype-promise.js +218 -10
  511. package/dist/targets/cpp/prototype/emit-prototype-regexp.js +8 -5
  512. package/dist/targets/cpp/prototype/emit-prototype-string.js +24 -7
  513. package/dist/targets/cpp/prototype/prototype-method-reads.js +18 -3
  514. package/dist/targets/cpp/reactive-dependencies.d.ts +2 -0
  515. package/dist/targets/cpp/reactive-dependencies.js +94 -3
  516. package/dist/targets/cpp/realm-storage.d.ts +5 -0
  517. package/dist/targets/cpp/realm-storage.js +12 -0
  518. package/dist/targets/cpp/records.d.ts +151 -1
  519. package/dist/targets/cpp/records.js +1321 -122
  520. package/dist/targets/cpp/recursive-containers.d.ts +4 -1
  521. package/dist/targets/cpp/recursive-containers.js +28 -9
  522. package/dist/targets/cpp/translation-unit.d.ts +10 -0
  523. package/dist/targets/cpp/translation-unit.js +686 -140
  524. package/dist/targets/cpp/types.d.ts +56 -6
  525. package/dist/targets/cpp/types.js +218 -12
  526. package/dist/targets/cpp/virtual-methods.d.ts +3 -3
  527. package/dist/targets/cpp/virtual-methods.js +174 -17
  528. package/package.json +6 -5
  529. package/src/targets/cpp/runtime/gea_dynamic_proxy.h +155 -25
  530. package/src/targets/cpp/runtime/gea_eval.h +3 -0
  531. package/src/targets/cpp/runtime/gea_pcm.h +116 -0
  532. package/src/targets/cpp/runtime/gea_runtime.h +18096 -4876
  533. package/src/targets/cpp/runtime/gea_runtime_builtins.cpp +7 -45
  534. package/src/targets/cpp/runtime/gea_runtime_rtc.h +247 -0
@@ -1,4 +1,6 @@
1
1
  import type { NativeSelectionHelper } from './native-selection-helpers.js';
2
+ import { type IntegrityRestrictions } from '../../ir/integrity-restrictions.js';
3
+ import type { BorrowedArmProjection } from './borrowed-arm-projections.js';
2
4
  import type { StableBorrowEntry } from './borrowed-call-entry.js';
3
5
  import type { SharedStringLayout } from '../../ir/string-layout-reuse.js';
4
6
  import type { CapabilityKey } from '../../ir/certify.js';
@@ -6,7 +8,7 @@ import type { DeclarationId, FunctionId, IrValueId, RegionId, SemanticResultId }
6
8
  import type { BindingPlacement } from '../../projection/bindings.js';
7
9
  import type { ClassLayout } from '../../projection/classes.js';
8
10
  import type { RecordLayoutPolicy } from '../../representation/policies.js';
9
- import type { CallOperation, ComputeOperation, GetOperation, IrBlockId, IrBody, IrNonTerminatorOperation, IrOperand, IrResult } from '../../ir/model.js';
11
+ import type { CallOperation, ComputeOperation, GetOperation, IrBlockId, IrBody, IrCaptureGroup, IrNonTerminatorOperation, IrOperand, IrOperation, IrResult } from '../../ir/model.js';
10
12
  import type { NumericIntrinsic } from '../../ir/numeric-intrinsics.js';
11
13
  import type { DenseAccess, DenseArray, DenseGroup } from '../../ir/dense-loops.js';
12
14
  import type { TypeQueryComparison } from '../../ir/type-query-results.js';
@@ -19,6 +21,7 @@ import type { RepresentationDeriver } from '../../representation/derive.js';
19
21
  import type { HostMethodAlias } from './host/host-method-aliases.js';
20
22
  import type { PrinterDrift } from './emit-narrowing.js';
21
23
  import { type ConversionCensus } from '../../conversion/nodes.js';
24
+ import { type CharCodeBufferFacts } from './char-code-buffers.js';
22
25
  /**
23
26
  * The per-body naming state every emitter helper reads, and the refusal shape
24
27
  * they all raise.
@@ -46,6 +49,7 @@ import { type ConversionCensus } from '../../conversion/nodes.js';
46
49
  * to carry it.
47
50
  */
48
51
  export interface CppEmitBlockedError extends Error {
52
+ lineage?: SemanticResultId;
49
53
  readonly cppEmitBlocked: true;
50
54
  /**
51
55
  * The capability this refusal lacked, in `ir/certify.ts`'s one key
@@ -103,6 +107,49 @@ export interface CaptureSlot {
103
107
  * unchanged.
104
108
  */
105
109
  readonly boxed: boolean;
110
+ /**
111
+ * Set when this declaration lives in its owning body's per-call frame
112
+ * (`CaptureFrame`) instead of in a cell or a field of its own: the closure's
113
+ * environment then carries ONE handle to the frame for every such slot, and
114
+ * reads the value through it. `boxed` keeps saying whether the value can be
115
+ * reassigned; it no longer says anything about how the storage is shaped.
116
+ */
117
+ readonly frame?: {
118
+ readonly frame: CaptureFrame;
119
+ readonly index: number;
120
+ };
121
+ }
122
+ /**
123
+ * One captured declaration that lives in a frame's struct.
124
+ *
125
+ * `boxed` carries `CaptureSlot.boxed` for the declaration: a reassigned or
126
+ * self-referencing cell is written through the frame, an immutable one is
127
+ * written once and read.
128
+ */
129
+ export interface CaptureFrameMember {
130
+ readonly declaration: DeclarationId;
131
+ readonly representation: Representation;
132
+ readonly boxed: boolean;
133
+ }
134
+ /**
135
+ * The captured declarations of ONE body that share a single heap allocation.
136
+ *
137
+ * Without a frame every captured `let` is its own `gea::Ref` cell and every
138
+ * closure copies the handles it needs into an environment block of its own, so
139
+ * a body that creates k cells and m closures costs k + m allocations and each
140
+ * cell pays a header. With one, the body allocates the frame once and a
141
+ * closure's environment is that one handle -- which `packTransientEnvironment`
142
+ * already carries without an allocation of its own when it is all the
143
+ * environment holds.
144
+ *
145
+ * Only declarations that exist exactly once per call may live here: a cell
146
+ * minted per loop iteration (`for (let ...)`, a `let` in a loop body) is a
147
+ * different variable each time round, and one frame slot would collapse them.
148
+ * `captures.ts`'s `buildCaptureIndex` decides membership.
149
+ */
150
+ export interface CaptureFrame {
151
+ readonly owner: FunctionId | RegionId;
152
+ readonly members: readonly CaptureFrameMember[];
106
153
  }
107
154
  /**
108
155
  * What one capturing function's environment is made of.
@@ -114,6 +161,8 @@ export interface CaptureSlot {
114
161
  */
115
162
  export interface CaptureLayout {
116
163
  readonly slots: readonly CaptureSlot[];
164
+ /** The distinct frames the framed slots live in, in first-use order; the environment holds one handle to each, after its unframed slots. */
165
+ readonly frames: readonly CaptureFrame[];
117
166
  readonly receiver: Representation | null;
118
167
  }
119
168
  /**
@@ -179,6 +228,59 @@ export interface CaptureIndex {
179
228
  * bound to the object it was read from.
180
229
  */
181
230
  readonly readsReceiver: (owner: FunctionId | RegionId) => boolean;
231
+ /**
232
+ * The recursion group this function is a member of (`IrBodyFacts.captureGroup`),
233
+ * or `null`: its environment is then the group's shared one, and a sibling
234
+ * it names is rebuilt from that environment rather than read from a slot.
235
+ */
236
+ readonly groupOf: (owner: FunctionId | RegionId) => IrCaptureGroup | null;
237
+ /**
238
+ * Whether this owner's environment is a record accessor's -- populated at
239
+ * the record's own allocation (`emit-allocation.ts`) and read back with
240
+ * `gea::storedEnvironment`, which has no scratch slot to reconstruct a
241
+ * transiently-packed environment into (`emit-context.ts`'s
242
+ * `storedEnvironmentText`). `translation-unit.ts`'s `thunkOf` asks this to
243
+ * choose the matching unpack: `gea::unpackEnvironment` for an accessor
244
+ * (whose pack call stays `gea::packEnvironment`, unchanged), the transient
245
+ * pair for everything else. `buildCaptureIndex` never admits one owner as
246
+ * both an accessor and an ordinarily-allocated value, so the two pack call
247
+ * sites (`emit-allocation.ts`, `emit-callable.ts`) and this answer always
248
+ * agree about which one owner's environment came from.
249
+ */
250
+ readonly isAccessorEnvironment: (owner: FunctionId | RegionId) => boolean;
251
+ /**
252
+ * Whether this `allocate-callable` result's environment may be built as a
253
+ * stack-resident, non-owning borrow rather than a `gea::HeapEnvironmentBlock`
254
+ * -- `ir/borrowed-callable-uses.ts`'s whole-program proof that the value is
255
+ * used exactly once, as the executor argument of a `new Promise(...)` the
256
+ * runtime already promises to call synchronously and retain nowhere.
257
+ * `emit-callable.ts` still applies the callable-identity gate itself before
258
+ * acting on this, so a `true` here is necessary, not sufficient.
259
+ */
260
+ readonly borrowedExecutorEnvironment: (value: IrValueId) => boolean;
261
+ /** The frame this owner allocates at entry for its captured declarations, or `null`. See `CaptureFrame`. */
262
+ readonly frameOf: (owner: FunctionId | RegionId) => CaptureFrame | null;
263
+ /** The frame slot a declaration lives in, or `null` when it has a cell or field of its own. */
264
+ readonly frameMemberOf: (declaration: DeclarationId) => {
265
+ readonly frame: CaptureFrame;
266
+ readonly index: number;
267
+ } | null;
268
+ /**
269
+ * The closures this owner's frame carries an identity slot for, in slot order.
270
+ *
271
+ * A closure whose whole environment is the frame handle has no block of its
272
+ * own to anchor a lazily minted `FunctionObjectIdentity` in, and without an
273
+ * anchor `identifyCallable` mints one eagerly -- one more cell per closure,
274
+ * which is the cost the frame exists to remove. A slot in the frame is the
275
+ * anchor, and it is sound only for a closure allocated at most once per
276
+ * frame lifetime, since every allocation would share the slot.
277
+ */
278
+ readonly frameIdentitiesOf: (owner: FunctionId | RegionId) => readonly FunctionId[];
279
+ /** The slot `frameIdentitiesOf` reserved for this closure in its owner's frame, or `null`. */
280
+ readonly frameIdentityOf: (functionId: FunctionId) => {
281
+ readonly frame: CaptureFrame;
282
+ readonly index: number;
283
+ } | null;
182
284
  }
183
285
  /** The index a body with no capture information at all reads as: every owner closes over nothing. */
184
286
  export declare const emptyCaptureIndex: CaptureIndex;
@@ -289,7 +391,29 @@ export interface VirtualCallee {
289
391
  export interface UnionMethodArm {
290
392
  readonly path: readonly number[];
291
393
  readonly receiverRepresentation: Representation;
292
- readonly callable: FunctionId;
394
+ /**
395
+ * The body this arm calls, or `null` for a primitive arm's own
396
+ * `%Number%/%String%/%Boolean%.prototype.valueOf`, which answers the
397
+ * primitive itself -- `Int32 | number`'s `valueOf()` (bson's serializer).
398
+ */
399
+ readonly callable: FunctionId | null;
400
+ /**
401
+ * A class arm whose chain declares no such member and whose native base's
402
+ * intrinsic prototype does: the call goes to that native member on the arm
403
+ * viewed as its base. mongodb's `DEFAULT_OPTIONS.entries()` over the union
404
+ * of `CaseInsensitiveMap<T> extends Map<string, T>`'s layout copies.
405
+ */
406
+ readonly nativeBase?: {
407
+ readonly carrier: Representation;
408
+ readonly member: string;
409
+ };
410
+ /**
411
+ * A `null`/`undefined` arm: reading any member off it is the TypeError of
412
+ * 13.3.2.1 step 3 (`RequireObjectCoercible`), which this arm renders. Only
413
+ * admitted beside a native-base arm, which has no per-arm value recipe to
414
+ * fall back to (`deferredUnionMethodClaim`).
415
+ */
416
+ readonly nullish?: 'null' | 'undefined';
293
417
  }
294
418
  /** A method read through a tagged union, by the union it was read through and the arms that answer it. */
295
419
  export interface UnionMethodRead {
@@ -424,7 +548,7 @@ export interface PrototypeMethodRead {
424
548
  * typed the call with, and the call no longer has the receiver.
425
549
  */
426
550
  readonly iteratorCarrier?: Extract<Representation, {
427
- kind: 'iterator';
551
+ kind: 'iterator' | 'async-generator';
428
552
  }>;
429
553
  /** The typed-array-only tagged union deferred with a shared prototype method. */
430
554
  readonly typedArrayUnionCarrier?: Extract<Representation, {
@@ -495,6 +619,12 @@ export type CapacitySource = {
495
619
  } | {
496
620
  readonly kind: 'literal';
497
621
  readonly text: string;
622
+ }
623
+ /** `end - start`: a loop that does not begin at zero runs for the difference, not for its bound. */
624
+ | {
625
+ readonly kind: 'span';
626
+ readonly end: CapacitySource;
627
+ readonly start: CapacitySource;
498
628
  };
499
629
  /**
500
630
  * A counted `push` loop the emitter renders as one bulk append.
@@ -507,7 +637,8 @@ export type CapacitySource = {
507
637
  * so a constant is carried as its own text and any other value has to have been
508
638
  * defined before the loop.
509
639
  */
510
- export interface FillLoop {
640
+ export interface AppendFillLoop {
641
+ readonly kind: 'append';
511
642
  readonly exit: IrBlockId;
512
643
  readonly counter: string;
513
644
  readonly bound: IrOperand;
@@ -518,6 +649,17 @@ export interface FillLoop {
518
649
  /** The array's own element carrier, which a restated `literal` has to be spelled in. */
519
650
  readonly element: Representation;
520
651
  }
652
+ export interface PcmFillLoop {
653
+ readonly kind: 'pcm';
654
+ readonly exit: IrBlockId;
655
+ readonly counter: string;
656
+ readonly bound: IrOperand;
657
+ readonly source: string;
658
+ readonly target: string;
659
+ readonly sourceOffset: string;
660
+ readonly targetOffset: string;
661
+ }
662
+ export type FillLoop = AppendFillLoop | PcmFillLoop;
521
663
  /**
522
664
  * Every per-body fact `emitBody` settles before it renders a single line,
523
665
  * bundled as one argument to `createEmitContext` instead of twelve fields a
@@ -559,10 +701,18 @@ export interface FillLoop {
559
701
  export interface EmitBodyFacts {
560
702
  /** Whether this body is a `function*` -- see `EmitContext.generatorBody`. */
561
703
  readonly generatorBody: boolean;
704
+ /** See `EmitContext.asyncCoroutineBody`. */
705
+ readonly asyncCoroutineBody: boolean;
706
+ /** See `EmitContext.returnsUnderFinallyGuard`. */
707
+ readonly returnsUnderFinallyGuard: boolean;
562
708
  /** See `EmitContext.receiverValues`. */
563
709
  readonly receiverValues: ReadonlySet<IrValueId>;
564
710
  /** See `EmitContext.bindingWriteCounts`. */
565
711
  readonly bindingWriteCounts: ReadonlyMap<DeclarationId, number>;
712
+ /** See `EmitContext.stableCellReads`. */
713
+ readonly stableCellReads: ReadonlySet<IrValueId>;
714
+ /** See `EmitContext.stableFieldReads`. */
715
+ readonly stableFieldReads: ReadonlySet<IrValueId>;
566
716
  /** See `EmitContext.constructorOf`. */
567
717
  readonly constructorOf: {
568
718
  readonly layout: ClassLayout;
@@ -571,12 +721,18 @@ export interface EmitBodyFacts {
571
721
  } | null;
572
722
  /** See `EmitContext.ownedDyingValues`. */
573
723
  readonly ownedDyingValues: ReadonlySet<IrValueId>;
724
+ /** See `EmitContext.transferDyingValues`. */
725
+ readonly transferDyingValues: ReadonlySet<IrValueId>;
726
+ /** See `EmitContext.receiverRenames`. */
727
+ readonly receiverRenames: ReadonlyMap<IrValueId, IrValueId>;
574
728
  /** See `EmitContext.consumingFormalConversions`. */
575
729
  readonly consumingFormalConversions: ReadonlySet<IrValueId>;
576
730
  /** See `EmitContext.classTableRoots`. */
577
731
  readonly classTableRoots: ReadonlyMap<IrValueId, IrValueId>;
578
732
  /** See `EmitContext.stableBorrowActuals`. */
579
733
  readonly stableBorrowActuals: ReadonlySet<IrValueId>;
734
+ /** See `EmitContext.borrowedArmProjections`. */
735
+ readonly borrowedArmProjections: ReadonlyMap<IrValueId, BorrowedArmProjection>;
580
736
  /** See `EmitContext.computeOrigins`. */
581
737
  readonly computeOrigins: ReadonlyMap<IrValueId, ComputeOperation>;
582
738
  /** See `EmitContext.propertyReadOrigins`. */
@@ -604,6 +760,14 @@ export interface EmitBodyFacts {
604
760
  readonly recordFieldSources: ReadonlyMap<IrValueId, ReadonlyMap<string, IrOperand>>;
605
761
  /** See `EmitContext.thunkValues`. */
606
762
  readonly thunkValues: ReadonlyMap<IrValueId, FunctionId>;
763
+ /** See `EmitContext.freshReceiverStores`. */
764
+ readonly freshReceiverStores: ReadonlySet<IrOperation>;
765
+ /** See `EmitContext.outOfOrderFreshStores`. */
766
+ readonly outOfOrderFreshStores: ReadonlyMap<IrOperation, readonly string[]>;
767
+ /** See `EmitContext.orderedFreshStores`. */
768
+ readonly orderedFreshStores: ReadonlySet<IrOperation>;
769
+ /** See `EmitContext.spreadPriorKeys`. */
770
+ readonly spreadPriorKeys: ReadonlyMap<IrOperation, readonly string[]>;
607
771
  /** See `EmitContext.hostClassReads`. */
608
772
  readonly hostClassReads: ReadonlyMap<IrValueId, {
609
773
  readonly kind: 'class' | 'singleton';
@@ -676,6 +840,28 @@ export interface EmitContext {
676
840
  * context after building it.
677
841
  */
678
842
  readonly generatorBody: boolean;
843
+ /**
844
+ * Whether this body is an async function emitted as a C++20 coroutine
845
+ * (`coroutine-bodies.ts`'s `isAsyncCoroutineBody`): every `await` renders as
846
+ * `co_await`, every return -- the fall-off included -- as `co_return` of the
847
+ * promise's PAYLOAD, and a throw reaches the promise's `unhandled_exception`
848
+ * and rejects it rather than leaving the call.
849
+ *
850
+ * Everything that renders a suspension or a return asks this, and nothing
851
+ * else: the async-generator and `for await` renderers read it to decide
852
+ * whether a step may be `co_await`ed in place. `false` for an async body with
853
+ * no suspension, which keeps the plain-function rendering (see that
854
+ * predicate's comment), and for a module body, whose top-level `await` is the
855
+ * one site that still reads a promise with `.awaited()`.
856
+ */
857
+ readonly asyncCoroutineBody: boolean;
858
+ /**
859
+ * Whether this body has a try statement with a finally clause, which may be
860
+ * rendered as a scope guard that runs AFTER a `return`'s value is formed.
861
+ * A returned cell is then copied rather than implicitly moved, so the clause
862
+ * still reads it (`runtime/gea_runtime.h`'s `detail::returnCopy`).
863
+ */
864
+ readonly returnsUnderFinallyGuard: boolean;
679
865
  /** The conventions of emitted bodies, shared with their signature renderer. */
680
866
  readonly abiOfCallable: (callable: FunctionId) => CallableAbi | null;
681
867
  /**
@@ -714,10 +900,51 @@ export interface EmitContext {
714
900
  readonly deriver: RepresentationDeriver;
715
901
  /** The record layout policy the conversion registry decides with (`projection/fields.ts`'s `recordLayoutPolicyOf`): the printer renders record views from the same plan. */
716
902
  readonly layouts: RecordLayoutPolicy;
903
+ /**
904
+ * The record shapes whose key creation order nothing in the program reads
905
+ * (`ir/key-order-observation.ts`). A store, literal, spread or assign into
906
+ * one keeps no creation-order bookkeeping at all.
907
+ */
908
+ readonly keyOrderUnobserved: ReadonlySet<string>;
909
+ /**
910
+ * The async bodies that are ALSO emitted as a `_task` twin returning a
911
+ * `gea::Task<V>` (`taskTwinOf`, `coroutine-bodies.ts`), by C++ body name.
912
+ * A call to one of them whose result the very next operation awaits, and
913
+ * nothing else reads, calls the twin (`emit-callable.ts`).
914
+ */
915
+ readonly taskBodies: ReadonlySet<string>;
916
+ /** Call results that are awaited by the operation right after the call and read nowhere else (`fusedAwaitCallsOf`). */
917
+ readonly fusableAwaitCalls: ReadonlySet<IrValueId>;
918
+ /** The call results actually rendered as a `gea::Task`: the await that consumes one moves it. */
919
+ readonly taskValues: Set<IrValueId>;
717
920
  readonly valueNames: Map<IrValueId, string>;
718
921
  readonly ownedValues: Set<IrValueId>;
922
+ /**
923
+ * The synthetic operands `emitYield` mints for a `.return(v)` delivered at
924
+ * a paused yield (`detail::YieldResumption::completion`). `emit-return.ts`'s
925
+ * `generatorCompletionOf` returns one WITHOUT the Await a written
926
+ * `return x` performs in an `async function*`: 27.6.3.7 already awaited
927
+ * the value before it reached the yield (the runtime's `Core::resume` job).
928
+ */
929
+ readonly deliveredReturnValues: Set<IrValueId>;
719
930
  /** Settled from `EmitBodyFacts.ownedDyingValues` -- see that type's own doc. */
720
931
  readonly ownedDyingValues: ReadonlySet<IrValueId>;
932
+ /**
933
+ * The values `transferOf` may move: those dying at their one transferring
934
+ * use (`ir/transfer.ts`'s `dyingTransferUsesOf`), plus the by-value formals
935
+ * that die at their one use. A superset of `ownedDyingValues`, and only for
936
+ * the roles a renderer moves from -- the in-place string append reads
937
+ * `ownedDyingValues`, whose members have no other use at all, because it
938
+ * moves at a `compute` operand.
939
+ */
940
+ readonly transferDyingValues: ReadonlySet<IrValueId>;
941
+ /**
942
+ * A store's result mapped to the value whose storage it renames
943
+ * (`ir/transfer.ts`'s `receiverRenamesOf`): `transferOf` asks the ROOT
944
+ * whether the name is owned, since the rename was defined as an alias of
945
+ * the root's text and owns nothing of its own.
946
+ */
947
+ readonly receiverRenames: ReadonlyMap<IrValueId, IrValueId>;
721
948
  /** Settled from `EmitBodyFacts.consumingFormalConversions` -- see that type's own doc. */
722
949
  readonly consumingFormalConversions: ReadonlySet<IrValueId>;
723
950
  /**
@@ -1025,6 +1252,8 @@ export interface EmitContext {
1025
1252
  readonly stableBorrowEntries: ReadonlyMap<string, StableBorrowEntry>;
1026
1253
  /** Settled from `EmitBodyFacts.stableBorrowActuals` -- see that type's own doc. */
1027
1254
  readonly stableBorrowActuals: ReadonlySet<IrValueId>;
1255
+ /** Converts rendered as a reference to one arm of a borrowed union formal (`borrowed-arm-projections.ts`). Each is also a stable actual. */
1256
+ readonly borrowedArmProjections: ReadonlyMap<IrValueId, BorrowedArmProjection>;
1028
1257
  readonly callableMemberCandidates: ReadonlyMap<string, FunctionId>;
1029
1258
  readonly directCallableBindings: ReadonlyMap<DeclarationId, FunctionId>;
1030
1259
  /** Constructor cells this unit constructs through repeatedly, and the class each names -- see `buildRepeatedConstructorIndex`. */
@@ -1220,6 +1449,24 @@ export interface EmitContext {
1220
1449
  */
1221
1450
  readonly lazyCalleeReads: ReadonlySet<IrValueId>;
1222
1451
  readonly bindingNames: Map<DeclarationId, string>;
1452
+ /**
1453
+ * The local holding each recursion group's shared environment this body has
1454
+ * built, by `IrCaptureGroup.id`: minted at the group's first member
1455
+ * allocation and reused by every later one (`emit-callable.ts`).
1456
+ */
1457
+ readonly sharedEnvironments: Map<FunctionId, string>;
1458
+ /**
1459
+ * The function a C++ expression is known to run, by the expression's text:
1460
+ * a closure allocation's value name (`v14`), or the frame cell an immutable
1461
+ * closure was stored into (`gea_frame->m6`). Recorded as each is rendered, so
1462
+ * a conversion that must call the closure through an adapter can call its
1463
+ * entry directly on the environment it already has instead of holding a copy
1464
+ * of the callable in a block of its own (`CallableObject::adaptSourceInPlace`).
1465
+ * An absent text is an unknown callable, never a negative fact.
1466
+ */
1467
+ readonly callableEntryTexts: Map<string, FunctionId>;
1468
+ /** The function `text` is known to run (`callableEntryTexts`), looking through a `std::move`. */
1469
+ readonly knownCallableEntry: (text: string) => FunctionId | null;
1223
1470
  /**
1224
1471
  * Values whose one emitted statement may be rendered at their single use
1225
1472
  * instead of into storage of their own.
@@ -1264,6 +1511,19 @@ export interface EmitContext {
1264
1511
  * word "render-time" was wrong, which is exactly the word nothing checks.
1265
1512
  */
1266
1513
  readonly deferrable: ReadonlySet<IrValueId>;
1514
+ /**
1515
+ * Reads of a local cell that no write to that cell can separate from any of
1516
+ * their uses (`ir/stable-cell-reads.ts`), so the read renders as the cell
1517
+ * itself even when the body writes the cell many times. Settled the same way
1518
+ * as `hoistedResults`.
1519
+ */
1520
+ readonly stableCellReads: ReadonlySet<IrValueId>;
1521
+ /**
1522
+ * Reads of a construction-only field of this body's own receiver that no
1523
+ * suspension separates from their uses (`ir/construction-only-fields.ts`),
1524
+ * so the read renders as the field itself rather than a counted copy.
1525
+ */
1526
+ readonly stableFieldReads: ReadonlySet<IrValueId>;
1267
1527
  /** Dominating native length results, selected by the IR reuse proof. Settled the same way as `hoistedResults`. */
1268
1528
  readonly reusedStringLengths: ReadonlyMap<IrValueId, IrOperand>;
1269
1529
  /** Withheld values whose single reader is a call, and which therefore reach exactly one operand position -- see `emit.ts`'s `consumedByCall`. Settled the same way as `hoistedResults`. */
@@ -1291,12 +1551,12 @@ export interface EmitContext {
1291
1551
  /** Whether a callable allocation must mint its function-object identity -- see `ir/callable-identity-demand.ts`; `observesEveryCallableIdentity` for a context built without the program census. */
1292
1552
  readonly callableIdentityDemand: CallableIdentityDemand;
1293
1553
  /**
1294
- * Whether any operation in the unit can freeze, seal or redefine a native
1295
- * object's properties (`ir/integrity-restrictions.ts`). `false` lets a
1296
- * native field store skip its writability guard; `true` -- the default for
1297
- * a context built without the census -- keeps every guard.
1554
+ * Which native objects an operation in the unit can freeze, seal or
1555
+ * redefine a property of (`ir/integrity-restrictions.ts`). A store onto a
1556
+ * carrier it does not restrict skips its writability guard; a context built
1557
+ * without the census restricts every carrier and keeps every guard.
1298
1558
  */
1299
- readonly nativeIntegrityRestricted: boolean;
1559
+ readonly nativeIntegrityRestricted: IntegrityRestrictions;
1300
1560
  /**
1301
1561
  * Whether a required field's presence bit is a program-wide constant
1302
1562
  * (`ir/program-facts.ts`'s `fixedFieldStateConstant`: nothing deletes,
@@ -1305,6 +1565,8 @@ export interface EmitContext {
1305
1565
  * made a `static` member; `false` keeps the store.
1306
1566
  */
1307
1567
  readonly fixedFieldStateConstant: boolean;
1568
+ /** `ir/program-facts.ts`'s `definitionCells`: cells holding one allocated function or class for the whole program. */
1569
+ readonly definitionCells: ReadonlySet<DeclarationId>;
1308
1570
  /** Settled from `EmitBodyFacts.classTableRoots` -- see that type's own doc. */
1309
1571
  readonly classTableRoots: ReadonlyMap<IrValueId, IrValueId>;
1310
1572
  /** One candidate table's withheld lines, keyed by the table's own value. See `classTableRoots`. */
@@ -1349,6 +1611,8 @@ export interface EmitContext {
1349
1611
  * ts`) through `ctx` directly -- same follow-up as `formalCells`.
1350
1612
  */
1351
1613
  readonly capacityHints: ReadonlyMap<IrValueId, CapacitySource>;
1614
+ /** The local arrays proved to be nothing but a `String.fromCharCode` argument list; see `char-code-buffers.ts`. */
1615
+ readonly charCodeBuffers: CharCodeBufferFacts;
1352
1616
  /**
1353
1617
  * The counted loops whose entire body is one `push` of an unchanging value,
1354
1618
  * keyed by the loop header whose terminator becomes the append
@@ -1396,6 +1660,16 @@ export interface EmitContext {
1396
1660
  readonly loopInvariantValues: ReadonlySet<IrValueId>;
1397
1661
  /** Settled the same way as `hoistedResults`. */
1398
1662
  readonly remainderForms: ReadonlyMap<IrValueId, 'restated' | 'dynamic'>;
1663
+ /** Settled the same way as `hoistedResults`; see `IntegerNarrowing.roundingArithmetic`. */
1664
+ readonly roundingArithmetic: ReadonlySet<IrValueId>;
1665
+ /**
1666
+ * Call results the integer census narrowed from a guarded candidate's returns
1667
+ * (`IntegerStorageFacts.guarded`), with the bound each is checked against.
1668
+ * Settled the same way as `hoistedResults`.
1669
+ */
1670
+ readonly integerCallChecks: ReadonlyMap<IrValueId, number>;
1671
+ /** The members of `integerCallChecks` a rendered call actually checked; the body refuses if one was not. */
1672
+ readonly checkedIntegerCalls: Set<IrValueId>;
1399
1673
  /**
1400
1674
  * The dense-loop windows this body admitted, and which window each element
1401
1675
  * access renders against (`ir/dense-loops.ts`).
@@ -1428,6 +1702,19 @@ export interface EmitContext {
1428
1702
  * rendering the very operation it indexes.
1429
1703
  */
1430
1704
  readonly computeOrigins: ReadonlyMap<IrValueId, ComputeOperation>;
1705
+ /**
1706
+ * The stores whose receiver is a fresh, still-private object of this block
1707
+ * (`ir/facts.ts`'s `freshReceiverStores`): their integrity guard is
1708
+ * statically true, so they render as the bare store even where
1709
+ * `nativeIntegrityRestricted` keeps the guard on every other store.
1710
+ */
1711
+ readonly freshReceiverStores: ReadonlySet<IrOperation>;
1712
+ /** `ir/facts.ts`'s `outOfOrderFreshStores`: the fresh stores that create a key out of layout order. */
1713
+ readonly outOfOrderFreshStores: ReadonlyMap<IrOperation, readonly string[]>;
1714
+ /** `ir/facts.ts`'s `orderedFreshStores`: the fresh stores whose place in the creation order is decided statically. */
1715
+ readonly orderedFreshStores: ReadonlySet<IrOperation>;
1716
+ /** `ir/facts.ts`'s `spreadPriorKeys`: the keys a literal created before a spread, in creation order. */
1717
+ readonly spreadPriorKeys: ReadonlyMap<IrOperation, readonly string[]>;
1431
1718
  /**
1432
1719
  * Plain property read origins used to prove that a string store appends to
1433
1720
  * its own field. Settled from `EmitBodyFacts.propertyReadOrigins` -- see
@@ -1598,6 +1885,8 @@ export interface EmitBodyPrepassFacts {
1598
1885
  readonly typeQueryBindings: Set<DeclarationId>;
1599
1886
  readonly typeQueryComparisons: Map<ComputeOperation, TypeQueryComparison>;
1600
1887
  readonly remainderForms: Map<IrValueId, 'restated' | 'dynamic'>;
1888
+ readonly roundingArithmetic: Set<IrValueId>;
1889
+ readonly integerCallChecks: Map<IrValueId, number>;
1601
1890
  readonly deadValues: Set<IrValueId>;
1602
1891
  readonly unreadValues: Set<IrValueId>;
1603
1892
  readonly booleanConstants: Map<IrValueId, boolean>;
@@ -1617,6 +1906,7 @@ export interface EmitBodyPrepassFacts {
1617
1906
  readonly directBindingSinks: Map<IrValueId, DeclarationId>;
1618
1907
  readonly forwardedBindings: Map<DeclarationId, ForwardedBinding>;
1619
1908
  readonly capacityHints: Map<IrValueId, CapacitySource>;
1909
+ readonly charCodeBuffers: CharCodeBufferFacts;
1620
1910
  readonly fillLoops: Map<IrBlockId, FillLoop>;
1621
1911
  readonly denseArrays: DenseArray[];
1622
1912
  readonly denseAccesses: Map<IrNonTerminatorOperation, DenseAccess>;
@@ -1629,7 +1919,7 @@ export declare const directCalleesOf: (body: IrBody, abiOfCallable: (callable: F
1629
1919
  readonly directCallees: ReadonlyMap<IrValueId, string>;
1630
1920
  readonly directCalleeAbis: ReadonlyMap<IrValueId, CallableAbi>;
1631
1921
  };
1632
- export declare const createEmitContext: (abi: CallableAbi | null, owner: FunctionId | RegionId, placements: ReadonlyMap<DeclarationId, BindingPlacement>, classes: ReadonlyMap<DeclarationId, ClassLayout>, hosts: HostSpellings, deriver: RepresentationDeriver, bodyFacts: EmitBodyFacts, wellKnownSymbols?: ReadonlyMap<DeclarationId, string>, captures?: CaptureIndex, symbolKeys?: Map<string, string>, templateObjects?: Map<string, TemplateObjectDefinition>, directCallableBindings?: ReadonlyMap<DeclarationId, FunctionId>, virtualDispatch?: ReadonlyMap<string, CallableAbi>, narrowedFormals?: ReadonlySet<number>, repeatedConstructors?: ReadonlyMap<DeclarationId, DeclarationId>, dyingArguments?: ReadonlySet<IrValueId>, instantiation?: InstantiationFacts, abiOfCallable?: (callable: FunctionId) => CallableAbi | null, functionFacts?: ReadonlyMap<FunctionId, CallableFactsSpelling>, hostMethodAliases?: ReadonlyMap<DeclarationId, HostMethodAlias>, callableMemberCandidates?: ReadonlyMap<string, FunctionId>, borrowableMemberBodies?: ReadonlySet<FunctionId>, stableBorrowEntries?: ReadonlyMap<string, StableBorrowEntry>, printerDrift?: PrinterDrift[], conversions?: ConversionCensus | null, nativeSelections?: ReadonlyMap<string, NativeSelectionHelper> | undefined, callableIdentityDemand?: CallableIdentityDemand, nativeIntegrityRestricted?: boolean, fixedFieldStateConstant?: boolean) => {
1922
+ export declare const createEmitContext: (abi: CallableAbi | null, owner: FunctionId | RegionId, placements: ReadonlyMap<DeclarationId, BindingPlacement>, classes: ReadonlyMap<DeclarationId, ClassLayout>, hosts: HostSpellings, deriver: RepresentationDeriver, bodyFacts: EmitBodyFacts, wellKnownSymbols?: ReadonlyMap<DeclarationId, string>, captures?: CaptureIndex, symbolKeys?: Map<string, string>, templateObjects?: Map<string, TemplateObjectDefinition>, directCallableBindings?: ReadonlyMap<DeclarationId, FunctionId>, virtualDispatch?: ReadonlyMap<string, CallableAbi>, narrowedFormals?: ReadonlySet<number>, repeatedConstructors?: ReadonlyMap<DeclarationId, DeclarationId>, dyingArguments?: ReadonlySet<IrValueId>, instantiation?: InstantiationFacts, abiOfCallable?: (callable: FunctionId) => CallableAbi | null, functionFacts?: ReadonlyMap<FunctionId, CallableFactsSpelling>, hostMethodAliases?: ReadonlyMap<DeclarationId, HostMethodAlias>, callableMemberCandidates?: ReadonlyMap<string, FunctionId>, borrowableMemberBodies?: ReadonlySet<FunctionId>, stableBorrowEntries?: ReadonlyMap<string, StableBorrowEntry>, printerDrift?: PrinterDrift[], conversions?: ConversionCensus | null, nativeSelections?: ReadonlyMap<string, NativeSelectionHelper> | undefined, callableIdentityDemand?: CallableIdentityDemand, nativeIntegrityRestricted?: IntegrityRestrictions, fixedFieldStateConstant?: boolean, definitionCells?: ReadonlySet<DeclarationId>, keyOrderUnobserved?: ReadonlySet<string>, taskBodies?: ReadonlySet<string>, fusableAwaitCalls?: ReadonlySet<IrValueId>) => {
1633
1923
  readonly ctx: EmitContext;
1634
1924
  readonly prepass: EmitBodyPrepassFacts;
1635
1925
  };
@@ -1720,6 +2010,16 @@ export declare const nameOfValue: (ctx: EmitContext, value: IrValueId) => string
1720
2010
  * any use of it other than as a callee is refused here, by name, rather than
1721
2011
  * crashing on a value that was never minted.
1722
2012
  */
2013
+ /**
2014
+ * Whether a suspension may be written in place in this body: an async
2015
+ * coroutine (`asyncCoroutineBody`) or an `async function*`, whose
2016
+ * `gea::AsyncGenerator` frame is a coroutine too and suspends at every `await`
2017
+ * the same way (`co_await` of a promise resumes from one promise job). Every
2018
+ * `await` and every `for await` step asks this; a body that answers `false`
2019
+ * may only read a promise with `.awaited()`, which is legal solely at the top
2020
+ * level of a module.
2021
+ */
2022
+ export declare const suspendsInPlace: (ctx: EmitContext) => boolean;
1723
2023
  export declare const operandText: (ctx: EmitContext, operand: IrOperand) => string;
1724
2024
  /**
1725
2025
  * The receiver a deferred prototype-method call renders on.
@@ -1775,7 +2075,7 @@ export interface CallableFactsSpelling {
1775
2075
  * object can be asked for its facts, so registering there preserves every
1776
2076
  * observable answer and pins nothing else.
1777
2077
  */
1778
- export declare const cppThunkEntryText: (ctx: EmitContext, functionId: FunctionId) => string;
2078
+ export declare const cppThunkEntryText: (ctx: Pick<EmitContext, "functionFacts">, functionId: FunctionId) => string;
1779
2079
  /** The thunk that adapts one class's construct function to the environment-passing construct pointer a constructor carrier holds. */
1780
2080
  export declare const cppConstructThunkName: (declaration: DeclarationId) => string;
1781
2081
  /**
@@ -1795,6 +2095,20 @@ export declare const cppConstructedThunkName: (functionId: string) => string;
1795
2095
  * field every closure ever captures, most of them unused in most instances.
1796
2096
  */
1797
2097
  export declare const cppEnvironmentStructName: (functionId: string) => string;
2098
+ /** The environment struct a body is entered with: its recursion group's shared one when it is a member, else its own. */
2099
+ export declare const cppEnvironmentStructOf: (captures: Pick<CaptureIndex, "groupOf">, owner: FunctionId | RegionId) => string;
2100
+ /** A recursion group member's own identity slot in the shared environment, by its index in `IrCaptureGroup.members`. */
2101
+ export declare const cppSharedIdentityFieldName: (index: number) => string;
2102
+ /** The shared environment's record of its own block (`gea::SharedEnvironmentAnchor`). */
2103
+ export declare const cppSharedAnchorFieldName = "gea_anchor";
2104
+ /** The struct a body's captured declarations share (`CaptureFrame`). */
2105
+ export declare const cppFrameStructName: (owner: string) => string;
2106
+ /** The local holding the frame in the body that owns it. */
2107
+ export declare const cppFrameLocalName = "gea_frame";
2108
+ /** One declaration's field inside its frame struct. */
2109
+ export declare const cppFrameMemberName: (index: number) => string;
2110
+ /** The environment field holding a handle to the index-th frame the environment references. */
2111
+ export declare const cppCaptureFrameFieldName: (index: number) => string;
1798
2112
  /** One captured cell's field inside its function's environment struct, in capture order. `translation-unit.ts`'s thunk unpacking spells the same name. */
1799
2113
  export declare const cppCaptureFieldName: (index: number) => string;
1800
2114
  /** The captured-receiver's own field, kept apart from `cppCaptureFieldName` because it has no capture-order index -- there is at most one per environment. */
@@ -1868,7 +2182,7 @@ export declare const paddedArguments: (abi: CallableAbi, args: readonly string[]
1868
2182
  * program rather than a build error. The text is still in the name because a
1869
2183
  * reader of the emitted C++ should be able to see which key a static is.
1870
2184
  */
1871
- export declare const internSymbolKey: (symbolKeys: Map<string, string>, key: string) => string;
2185
+ export declare const internSymbolKey: (symbolKeys: Map<string, string>, key: string, realm?: boolean) => string;
1872
2186
  /**
1873
2187
  * The namespace-scope definitions for every key this unit interned.
1874
2188
  *
@@ -1880,7 +2194,7 @@ export declare const internSymbolKey: (symbolKeys: Map<string, string>, key: str
1880
2194
  * Emitted ahead of every body, because C++ requires a name to be declared
1881
2195
  * before it is used and these are used from inside bodies.
1882
2196
  */
1883
- export declare const symbolKeyDefinitions: (symbolKeys: ReadonlyMap<string, string>) => readonly string[];
2197
+ export declare const symbolKeyDefinitions: (symbolKeys: ReadonlyMap<string, string>, realm?: boolean) => readonly string[];
1884
2198
  /**
1885
2199
  * One tagged-template site's per-site template object: the accessor a body
1886
2200
  * calls, and the namespace-scope definition that holds the object itself.
@@ -1911,9 +2225,9 @@ export interface TemplateObjectDefinition {
1911
2225
  export declare const internTemplateObject: (templateObjects: Map<string, TemplateObjectDefinition>, operation: {
1912
2226
  readonly lineage: SemanticResultId | null;
1913
2227
  readonly result: IrResult;
1914
- }, holder: string, body: readonly string[]) => string;
2228
+ }, holder: string, body: readonly string[], realm?: boolean) => string;
1915
2229
  /** The namespace-scope definitions for every tagged-template site this unit reached, emitted ahead of the bodies that call them. */
1916
2230
  export declare const templateObjectDefinitions: (templateObjects: ReadonlyMap<string, TemplateObjectDefinition>) => readonly string[];
1917
- export { bindingReference } from './emit-binding-reference.js';
2231
+ export { bindingReference, frameHandleText } from './emit-binding-reference.js';
1918
2232
  /** Seals every fact collection on `ctx` for the caller's render, and returns the undo. */
1919
2233
  export declare const sealFactFieldsForRender: (ctx: EmitContext) => (() => void);