@geastack/compiler 1.0.37 → 1.0.38

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 (536) hide show
  1. package/dist/cli-emit.js +5 -0
  2. package/dist/cli.js +10 -0
  3. package/dist/compiler.d.ts +10 -3
  4. package/dist/compiler.js +364 -224
  5. package/dist/conversion/build.d.ts +13 -1
  6. package/dist/conversion/build.js +336 -141
  7. package/dist/conversion/graph-validation.d.ts +7 -2
  8. package/dist/conversion/graph-validation.js +36 -22
  9. package/dist/conversion/native-sum.js +106 -17
  10. package/dist/diagnostics/sweep.js +1 -1
  11. package/dist/ir/callable-class-flow.d.ts +0 -11
  12. package/dist/ir/callable-class-flow.js +970 -169
  13. package/dist/ir/certificate.d.ts +1 -1
  14. package/dist/ir/certificate.js +12 -1
  15. package/dist/ir/certify/carrier-keys.d.ts +17 -1
  16. package/dist/ir/certify/carrier-keys.js +35 -2
  17. package/dist/ir/certify/function-source.js +2 -1
  18. package/dist/ir/certify/has-property-key.d.ts +6 -0
  19. package/dist/ir/certify/has-property-key.js +8 -1
  20. package/dist/ir/certify/property-access-keys.js +2 -1
  21. package/dist/ir/certify/runtime-helper.js +2 -1
  22. package/dist/ir/emission-representations.d.ts +2 -2
  23. package/dist/ir/emission-representations.js +9 -3
  24. package/dist/ir/generic-call-entry.d.ts +3 -1
  25. package/dist/ir/logical-receivers.js +29 -1
  26. package/dist/ir/lower-completion.js +11 -6
  27. package/dist/ir/lower-destructuring.js +3 -2
  28. package/dist/ir/native-host-method-reads.d.ts +5 -0
  29. package/dist/ir/native-host-method-reads.js +30 -21
  30. package/dist/ir/operation-conversions.js +4 -1
  31. package/dist/ir/publish-conversion-recipes.js +12 -1
  32. package/dist/plugins/apple/jsx.js +1 -1
  33. package/dist/plugins/gea/component-classes.js +1 -1
  34. package/dist/plugins/gea/component-inline.js +1 -1
  35. package/dist/plugins/gea/contract.d.ts +1 -1
  36. package/dist/plugins/gea/contract.js +1 -1
  37. package/dist/plugins/gea/host.js +27 -1
  38. package/dist/plugins/gea/lower.js +8 -1
  39. package/dist/plugins/gea/producer.js +1 -1
  40. package/dist/plugins/gea/reactive-slots.d.ts +1 -1
  41. package/dist/plugins/gea/reactive-slots.js +1 -1
  42. package/dist/plugins/load.js +51 -22
  43. package/dist/preflight/run.d.ts +12 -1
  44. package/dist/preflight/run.js +65 -29
  45. package/dist/projection/native-callable-data.js +2 -1
  46. package/dist/representation/plan.js +102 -4
  47. package/dist/semantics/alias-this-field-declaration-transform.js +1 -1
  48. package/dist/semantics/ambient-type-realization-transform.js +1 -1
  49. package/dist/semantics/ambient.d.ts +1 -1
  50. package/dist/semantics/ambient.js +1 -1
  51. package/dist/semantics/borrowed-builtin-call-bind-source-transform.js +1 -1
  52. package/dist/semantics/borrowed-method-receiver-copy-source-transform.js +1 -1
  53. package/dist/semantics/call-invalidated-narrowing.d.ts +1 -1
  54. package/dist/semantics/call-invalidated-narrowing.js +4 -2
  55. package/dist/semantics/callable-own-data-slots.d.ts +6 -0
  56. package/dist/semantics/callable-own-data-slots.js +177 -101
  57. package/dist/semantics/class-alias.d.ts +1 -1
  58. package/dist/semantics/class-alias.js +1 -1
  59. package/dist/semantics/class-heritage.d.ts +1 -1
  60. package/dist/semantics/class-heritage.js +1 -1
  61. package/dist/semantics/commonjs-wrapper.d.ts +4 -3
  62. package/dist/semantics/commonjs-wrapper.js +50 -7
  63. package/dist/semantics/constructor-function-class-source-transform.js +1 -1
  64. package/dist/semantics/constructor-slot-subclasses.d.ts +1 -1
  65. package/dist/semantics/constructor-slot-subclasses.js +1 -1
  66. package/dist/semantics/declaration-overlay-transform.js +3 -2
  67. package/dist/semantics/declared-integers.d.ts +1 -1
  68. package/dist/semantics/declared-integers.js +1 -1
  69. package/dist/semantics/define-property-source-transform.js +1 -1
  70. package/dist/semantics/diagnostic-source-preparation.d.ts +1 -1
  71. package/dist/semantics/documentation-ranges.d.ts +1 -1
  72. package/dist/semantics/documentation-ranges.js +1 -1
  73. package/dist/semantics/dynamic-fallback.d.ts +1 -1
  74. package/dist/semantics/dynamic-fallback.js +1 -1
  75. package/dist/semantics/frontend-timing.js +19 -0
  76. package/dist/semantics/frontend.d.ts +2 -2
  77. package/dist/semantics/frontend.js +127 -54
  78. package/dist/semantics/host-declaration-provenance.d.ts +1 -1
  79. package/dist/semantics/host-methods.d.ts +1 -1
  80. package/dist/semantics/host-methods.js +1 -1
  81. package/dist/semantics/host-protocols.d.ts +1 -1
  82. package/dist/semantics/host-protocols.js +1 -1
  83. package/dist/semantics/inherited-accessor.d.ts +1 -1
  84. package/dist/semantics/inherited-accessor.js +1 -1
  85. package/dist/semantics/interface-families.d.ts +1 -1
  86. package/dist/semantics/interface-families.js +1 -1
  87. package/dist/semantics/interface-implementors.d.ts +1 -1
  88. package/dist/semantics/interface-implementors.js +1 -1
  89. package/dist/semantics/jsdoc-namepath-transform.js +1 -1
  90. package/dist/semantics/jsx-runtime-provider.d.ts +1 -1
  91. package/dist/semantics/jsx-runtime-provider.js +1 -1
  92. package/dist/semantics/known-caller-predicate-parameters.d.ts +1 -1
  93. package/dist/semantics/known-caller-predicate-parameters.js +1 -1
  94. package/dist/semantics/model/edges.d.ts +124 -0
  95. package/dist/semantics/model/edges.js +192 -0
  96. package/dist/semantics/model/graph.d.ts +26 -2
  97. package/dist/semantics/model/graph.js +54 -0
  98. package/dist/semantics/model/sealed-facts.d.ts +19 -0
  99. package/dist/semantics/model/sealed-facts.js +221 -0
  100. package/dist/semantics/model/selected-signature.d.ts +1 -1
  101. package/dist/semantics/model/selected-signature.js +1 -1
  102. package/dist/semantics/module-resolution.d.ts +1 -1
  103. package/dist/semantics/module-resolution.js +1 -1
  104. package/dist/semantics/native-function-signatures.d.ts +1 -1
  105. package/dist/semantics/native-function-signatures.js +1 -1
  106. package/dist/semantics/native-object-data-slots.js +20 -4
  107. package/dist/semantics/new-callee-class-tag-source-transform.js +1 -1
  108. package/dist/semantics/node-project.d.ts +1 -1
  109. package/dist/semantics/node-project.js +1 -1
  110. package/dist/semantics/node-source-hooks.js +1 -1
  111. package/dist/semantics/normalize/absent-globals.d.ts +1 -1
  112. package/dist/semantics/normalize/absent-globals.js +1 -1
  113. package/dist/semantics/normalize/any-cast-member-call.d.ts +1 -1
  114. package/dist/semantics/normalize/any-cast-member-call.js +1 -1
  115. package/dist/semantics/normalize/arguments-objects.d.ts +1 -1
  116. package/dist/semantics/normalize/arguments-objects.js +1 -1
  117. package/dist/semantics/normalize/asserted-argument-arms.d.ts +1 -1
  118. package/dist/semantics/normalize/asserted-argument-arms.js +1 -1
  119. package/dist/semantics/normalize/asserted-arm-absence.d.ts +1 -1
  120. package/dist/semantics/normalize/asserted-arm-absence.js +1 -1
  121. package/dist/semantics/normalize/assignment-patterns.d.ts +1 -1
  122. package/dist/semantics/normalize/assignment-patterns.js +1 -1
  123. package/dist/semantics/normalize/bag-absence.d.ts +1 -1
  124. package/dist/semantics/normalize/bag-absence.js +1 -1
  125. package/dist/semantics/normalize/binding-fixpoint.js +9 -2
  126. package/dist/semantics/normalize/bivariant-slot-parameter.d.ts +1 -1
  127. package/dist/semantics/normalize/bivariant-slot-parameter.js +1 -1
  128. package/dist/semantics/normalize/callable-data-write.d.ts +1 -1
  129. package/dist/semantics/normalize/callable-data-write.js +1 -1
  130. package/dist/semantics/normalize/callback-parameter-contracts.d.ts +1 -1
  131. package/dist/semantics/normalize/callback-parameter-contracts.js +1 -1
  132. package/dist/semantics/normalize/cells/agreement.d.ts +18 -1
  133. package/dist/semantics/normalize/cells/agreement.js +8 -0
  134. package/dist/semantics/normalize/cells/candidates.d.ts +1 -1
  135. package/dist/semantics/normalize/cells/candidates.js +1 -1
  136. package/dist/semantics/normalize/cells/facts.d.ts +1 -1
  137. package/dist/semantics/normalize/cells/facts.js +1 -1
  138. package/dist/semantics/normalize/cells/index.d.ts +2 -2
  139. package/dist/semantics/normalize/cells/index.js +1 -1
  140. package/dist/semantics/normalize/cells/model.d.ts +1 -1
  141. package/dist/semantics/normalize/cells/policies/bag.d.ts +1 -1
  142. package/dist/semantics/normalize/cells/policies/collection.d.ts +1 -1
  143. package/dist/semantics/normalize/cells/policies/collection.js +1 -1
  144. package/dist/semantics/normalize/cells/policies/field.d.ts +1 -1
  145. package/dist/semantics/normalize/cells/policies/field.js +1 -1
  146. package/dist/semantics/normalize/cells/policies/index.d.ts +1 -1
  147. package/dist/semantics/normalize/cells/policies/local.d.ts +1 -1
  148. package/dist/semantics/normalize/cells/policies/local.js +1 -1
  149. package/dist/semantics/normalize/cells/policies/parameter.d.ts +1 -1
  150. package/dist/semantics/normalize/cells/policies/parameter.js +1 -1
  151. package/dist/semantics/normalize/cells/policies/return.d.ts +1 -1
  152. package/dist/semantics/normalize/cells/policies/return.js +1 -1
  153. package/dist/semantics/normalize/cells/policies/shared.d.ts +1 -1
  154. package/dist/semantics/normalize/cells/policy.d.ts +1 -1
  155. package/dist/semantics/normalize/census.d.ts +1 -1
  156. package/dist/semantics/normalize/census.js +45 -12
  157. package/dist/semantics/normalize/class-instance-record-statement.d.ts +1 -1
  158. package/dist/semantics/normalize/class-instance-record-statement.js +1 -1
  159. package/dist/semantics/normalize/collection-bindings.d.ts +1 -1
  160. package/dist/semantics/normalize/collection-bindings.js +1 -1
  161. package/dist/semantics/normalize/commonjs-module-record.d.ts +1 -1
  162. package/dist/semantics/normalize/commonjs-module-record.js +1 -1
  163. package/dist/semantics/normalize/commonjs-require.d.ts +1 -1
  164. package/dist/semantics/normalize/commonjs-require.js +1 -1
  165. package/dist/semantics/normalize/contribution.d.ts +4 -3
  166. package/dist/semantics/normalize/contribution.js +145 -42
  167. package/dist/semantics/normalize/dead-event-emissions.d.ts +1 -1
  168. package/dist/semantics/normalize/dead-event-emissions.js +1 -1
  169. package/dist/semantics/normalize/dead-method-copies.d.ts +1 -1
  170. package/dist/semantics/normalize/dead-method-copies.js +1 -1
  171. package/dist/semantics/normalize/dead-typeof-guards.d.ts +1 -1
  172. package/dist/semantics/normalize/dead-typeof-guards.js +1 -1
  173. package/dist/semantics/normalize/deferred-intrinsic-protocols.d.ts +1 -1
  174. package/dist/semantics/normalize/deferred-intrinsic-protocols.js +1 -1
  175. package/dist/semantics/normalize/derived-expression-type.d.ts +1 -1
  176. package/dist/semantics/normalize/derived-expression-type.js +4 -4
  177. package/dist/semantics/normalize/evaluation-order.d.ts +1 -1
  178. package/dist/semantics/normalize/evaluation-order.js +1 -1
  179. package/dist/semantics/normalize/field-bindings.d.ts +1 -1
  180. package/dist/semantics/normalize/field-bindings.js +4 -3
  181. package/dist/semantics/normalize/flow/array-element-continuation.d.ts +1 -1
  182. package/dist/semantics/normalize/flow/array-element-continuation.js +3 -3
  183. package/dist/semantics/normalize/flow/callable-array-origins.d.ts +1 -1
  184. package/dist/semantics/normalize/flow/callable-array-origins.js +1 -1
  185. package/dist/semantics/normalize/flow/callable-completions.d.ts +1 -1
  186. package/dist/semantics/normalize/flow/callable-completions.js +1 -1
  187. package/dist/semantics/normalize/flow/callable-reach.d.ts +1 -1
  188. package/dist/semantics/normalize/flow/callable-reach.js +73 -52
  189. package/dist/semantics/normalize/flow/class-family-member-read.d.ts +1 -1
  190. package/dist/semantics/normalize/flow/class-family-member-read.js +3 -3
  191. package/dist/semantics/normalize/flow/collection-value-continuation.d.ts +1 -1
  192. package/dist/semantics/normalize/flow/collection-value-continuation.js +1 -1
  193. package/dist/semantics/normalize/flow/component-solver.d.ts +181 -3
  194. package/dist/semantics/normalize/flow/component-solver.js +705 -164
  195. package/dist/semantics/normalize/flow/computed-key-set.d.ts +1 -1
  196. package/dist/semantics/normalize/flow/computed-key-set.js +1 -1
  197. package/dist/semantics/normalize/flow/export-importers.d.ts +1 -1
  198. package/dist/semantics/normalize/flow/export-importers.js +13 -3
  199. package/dist/semantics/normalize/flow/host-text-sink.d.ts +1 -1
  200. package/dist/semantics/normalize/flow/host-text-sink.js +1 -1
  201. package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.d.ts +1 -1
  202. package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.js +1 -1
  203. package/dist/semantics/normalize/flow/intrinsic-data-definition.d.ts +1 -1
  204. package/dist/semantics/normalize/flow/intrinsic-data-definition.js +1 -1
  205. package/dist/semantics/normalize/flow/invocation-facts.d.ts +1 -1
  206. package/dist/semantics/normalize/flow/invocation-facts.js +1 -1
  207. package/dist/semantics/normalize/flow/member-call-forwarding.d.ts +1 -1
  208. package/dist/semantics/normalize/flow/member-call-forwarding.js +1 -1
  209. package/dist/semantics/normalize/flow/model.d.ts +1 -1
  210. package/dist/semantics/normalize/flow/model.js +5 -1
  211. package/dist/semantics/normalize/flow/native-collection-protocol.d.ts +1 -1
  212. package/dist/semantics/normalize/flow/native-collection-protocol.js +1 -1
  213. package/dist/semantics/normalize/flow/node-path-token.d.ts +1 -1
  214. package/dist/semantics/normalize/flow/object-binding-continuation.d.ts +1 -1
  215. package/dist/semantics/normalize/flow/object-binding-continuation.js +1 -1
  216. package/dist/semantics/normalize/flow/origin-authority.d.ts +1 -1
  217. package/dist/semantics/normalize/flow/owned-class-receivers.d.ts +1 -1
  218. package/dist/semantics/normalize/flow/owned-class-receivers.js +1 -1
  219. package/dist/semantics/normalize/flow/parameter-values.d.ts +1 -1
  220. package/dist/semantics/normalize/flow/parameter-values.js +1 -1
  221. package/dist/semantics/normalize/flow/record-alias-closure.d.ts +1 -1
  222. package/dist/semantics/normalize/flow/record-alias-closure.js +1 -1
  223. package/dist/semantics/normalize/flow/seeded-origins.d.ts +1 -1
  224. package/dist/semantics/normalize/flow/seeded-origins.js +1 -1
  225. package/dist/semantics/normalize/flow/source-accessor-descriptor.d.ts +1 -1
  226. package/dist/semantics/normalize/flow/source-accessor-descriptor.js +1 -1
  227. package/dist/semantics/normalize/flow/source-callable-own-data.d.ts +1 -1
  228. package/dist/semantics/normalize/flow/source-callable-own-data.js +1 -1
  229. package/dist/semantics/normalize/flow/source-callable-readonly-set.d.ts +1 -1
  230. package/dist/semantics/normalize/flow/source-callable-readonly-set.js +1 -1
  231. package/dist/semantics/normalize/flow/source-class-data.d.ts +1 -1
  232. package/dist/semantics/normalize/flow/source-class-data.js +1 -1
  233. package/dist/semantics/normalize/flow/source-class-instanceof.d.ts +1 -1
  234. package/dist/semantics/normalize/flow/source-class-instanceof.js +1 -1
  235. package/dist/semantics/normalize/flow/source-class-static-data.d.ts +1 -1
  236. package/dist/semantics/normalize/flow/source-class-static-data.js +1 -1
  237. package/dist/semantics/normalize/flow/source-commonjs-exports.d.ts +1 -1
  238. package/dist/semantics/normalize/flow/source-construction-frames.d.ts +1 -1
  239. package/dist/semantics/normalize/flow/source-construction-frames.js +1 -1
  240. package/dist/semantics/normalize/flow/source-descriptor-protocol.d.ts +1 -1
  241. package/dist/semantics/normalize/flow/source-descriptor-protocol.js +1 -1
  242. package/dist/semantics/normalize/flow/source-executing-parameter-values.d.ts +1 -1
  243. package/dist/semantics/normalize/flow/source-executing-parameter-values.js +1 -1
  244. package/dist/semantics/normalize/flow/source-global-binding.d.ts +1 -1
  245. package/dist/semantics/normalize/flow/source-global-binding.js +1 -1
  246. package/dist/semantics/normalize/flow/source-intrinsic-member-data.d.ts +1 -1
  247. package/dist/semantics/normalize/flow/source-intrinsic-member-data.js +1 -1
  248. package/dist/semantics/normalize/flow/source-invocation-frame-layout.d.ts +1 -1
  249. package/dist/semantics/normalize/flow/source-invocation-frame-layout.js +24 -32
  250. package/dist/semantics/normalize/flow/source-invocation-receiver.d.ts +1 -1
  251. package/dist/semantics/normalize/flow/source-invocation-receiver.js +1 -1
  252. package/dist/semantics/normalize/flow/source-native-class-alias.d.ts +1 -1
  253. package/dist/semantics/normalize/flow/source-native-class-alias.js +1 -1
  254. package/dist/semantics/normalize/flow/source-native-iterable-integrity.d.ts +1 -1
  255. package/dist/semantics/normalize/flow/source-native-iterable-integrity.js +1 -1
  256. package/dist/semantics/normalize/flow/source-native-origin.d.ts +1 -1
  257. package/dist/semantics/normalize/flow/source-native-origin.js +1 -1
  258. package/dist/semantics/normalize/flow/source-normal-predecessor.d.ts +1 -1
  259. package/dist/semantics/normalize/flow/source-normal-predecessor.js +1 -1
  260. package/dist/semantics/normalize/flow/source-property-key.d.ts +1 -1
  261. package/dist/semantics/normalize/flow/source-property-key.js +1 -1
  262. package/dist/semantics/normalize/flow/source-prototype-method-identity.d.ts +1 -1
  263. package/dist/semantics/normalize/flow/source-prototype-method-identity.js +1 -1
  264. package/dist/semantics/normalize/flow/source-proxy-operation.d.ts +1 -1
  265. package/dist/semantics/normalize/flow/source-proxy-operation.js +1 -1
  266. package/dist/semantics/normalize/flow/source-raw-constructor-entry.d.ts +1 -1
  267. package/dist/semantics/normalize/flow/source-raw-constructor-entry.js +1 -1
  268. package/dist/semantics/normalize/flow/source-read-protocol.d.ts +1 -1
  269. package/dist/semantics/normalize/flow/source-read-protocol.js +1 -1
  270. package/dist/semantics/normalize/flow/source-record-data.d.ts +1 -1
  271. package/dist/semantics/normalize/flow/source-record-data.js +1 -1
  272. package/dist/semantics/normalize/flow/source-value-session.d.ts +33 -3
  273. package/dist/semantics/normalize/flow/source-value-session.js +381 -173
  274. package/dist/semantics/normalize/flow/standard-prototype-method-source.d.ts +1 -1
  275. package/dist/semantics/normalize/flow/standard-prototype-method-source.js +1 -1
  276. package/dist/semantics/normalize/flow/targets.d.ts +1 -1
  277. package/dist/semantics/normalize/flow/targets.js +1 -1
  278. package/dist/semantics/normalize/flow/value-flow.d.ts +1 -1
  279. package/dist/semantics/normalize/flow/value-flow.js +243 -52
  280. package/dist/semantics/normalize/flow/value-provenance.d.ts +1 -1
  281. package/dist/semantics/normalize/flow/value-provenance.js +1 -1
  282. package/dist/semantics/normalize/fresh-dictionary-storage.d.ts +1 -1
  283. package/dist/semantics/normalize/fresh-dictionary-storage.js +1 -1
  284. package/dist/semantics/normalize/fresh-ordinary-object.d.ts +1 -1
  285. package/dist/semantics/normalize/fresh-ordinary-object.js +1 -1
  286. package/dist/semantics/normalize/fresh-table-last-use.d.ts +1 -1
  287. package/dist/semantics/normalize/fresh-table-last-use.js +1 -1
  288. package/dist/semantics/normalize/gating.d.ts +3 -3
  289. package/dist/semantics/normalize/gating.js +17 -20
  290. package/dist/semantics/normalize/generic-function-choice.d.ts +1 -1
  291. package/dist/semantics/normalize/generic-function-choice.js +1 -1
  292. package/dist/semantics/normalize/global-host-mutations.d.ts +1 -1
  293. package/dist/semantics/normalize/global-host-mutations.js +420 -138
  294. package/dist/semantics/normalize/host-effect-contracts.d.ts +1 -1
  295. package/dist/semantics/normalize/host-effect-contracts.js +1 -1
  296. package/dist/semantics/normalize/host-mutation-computed-keys.d.ts +1 -1
  297. package/dist/semantics/normalize/host-mutation-key-reader.d.ts +1 -1
  298. package/dist/semantics/normalize/host-mutation-key-reader.js +1 -1
  299. package/dist/semantics/normalize/identities.d.ts +41 -1
  300. package/dist/semantics/normalize/identities.js +75 -9
  301. package/dist/semantics/normalize/implicit-arguments-tuple.d.ts +1 -1
  302. package/dist/semantics/normalize/implicit-arguments-tuple.js +1 -1
  303. package/dist/semantics/normalize/implicit-arguments.d.ts +1 -1
  304. package/dist/semantics/normalize/implicit-arguments.js +1 -1
  305. package/dist/semantics/normalize/installed-global-properties.d.ts +1 -1
  306. package/dist/semantics/normalize/installed-global-properties.js +1 -1
  307. package/dist/semantics/normalize/instantiation.d.ts +1 -1
  308. package/dist/semantics/normalize/instantiation.js +1 -1
  309. package/dist/semantics/normalize/intrinsic-accessor-getter.d.ts +1 -1
  310. package/dist/semantics/normalize/intrinsic-accessor-getter.js +1 -1
  311. package/dist/semantics/normalize/intrinsic-property-call.d.ts +1 -1
  312. package/dist/semantics/normalize/intrinsic-property-call.js +1 -1
  313. package/dist/semantics/normalize/intrinsic-prototype.d.ts +1 -1
  314. package/dist/semantics/normalize/intrinsic-prototype.js +1 -1
  315. package/dist/semantics/normalize/intrinsic-return-identity.d.ts +1 -1
  316. package/dist/semantics/normalize/intrinsic-return-identity.js +1 -1
  317. package/dist/semantics/normalize/intrinsic-static-member.d.ts +1 -1
  318. package/dist/semantics/normalize/jsdoc-type-names.d.ts +1 -1
  319. package/dist/semantics/normalize/jsdoc-type-names.js +1 -1
  320. package/dist/semantics/normalize/local-bindings.d.ts +1 -1
  321. package/dist/semantics/normalize/local-bindings.js +3 -2
  322. package/dist/semantics/normalize/logical-object-truthiness.d.ts +1 -1
  323. package/dist/semantics/normalize/logical-object-truthiness.js +1 -1
  324. package/dist/semantics/normalize/logical-result-type.d.ts +1 -1
  325. package/dist/semantics/normalize/logical-result-type.js +1 -1
  326. package/dist/semantics/normalize/merged-declaration.d.ts +1 -1
  327. package/dist/semantics/normalize/merged-declaration.js +1 -1
  328. package/dist/semantics/normalize/namespace-paths.d.ts +1 -1
  329. package/dist/semantics/normalize/namespace-paths.js +1 -1
  330. package/dist/semantics/normalize/never-override-result.d.ts +1 -1
  331. package/dist/semantics/normalize/never-override-result.js +1 -1
  332. package/dist/semantics/normalize/normalize.d.ts +23 -4
  333. package/dist/semantics/normalize/normalize.js +125 -15
  334. package/dist/semantics/normalize/null-blind-parameter.d.ts +1 -1
  335. package/dist/semantics/normalize/null-blind-parameter.js +1 -1
  336. package/dist/semantics/normalize/nullable-memo.d.ts +28 -0
  337. package/dist/semantics/normalize/nullable-memo.js +99 -0
  338. package/dist/semantics/normalize/object-bag-bindings.d.ts +1 -1
  339. package/dist/semantics/normalize/object-bag-bindings.js +15 -4
  340. package/dist/semantics/normalize/omitted-stated-parameter.d.ts +1 -1
  341. package/dist/semantics/normalize/omitted-stated-parameter.js +1 -1
  342. package/dist/semantics/normalize/open-type-form.d.ts +1 -1
  343. package/dist/semantics/normalize/open-type-form.js +1 -1
  344. package/dist/semantics/normalize/override-field-arms.d.ts +1 -1
  345. package/dist/semantics/normalize/override-field-arms.js +1 -1
  346. package/dist/semantics/normalize/parameter-bindings.d.ts +1 -52
  347. package/dist/semantics/normalize/parameter-bindings.js +105 -10
  348. package/dist/semantics/normalize/parameter-slot.d.ts +1 -1
  349. package/dist/semantics/normalize/parameter-slot.js +1 -1
  350. package/dist/semantics/normalize/physical-overload-result.d.ts +1 -1
  351. package/dist/semantics/normalize/physical-overload-result.js +1 -1
  352. package/dist/semantics/normalize/primitive-property-absence.d.ts +1 -1
  353. package/dist/semantics/normalize/producer-context.d.ts +1 -1
  354. package/dist/semantics/normalize/producers/allocations.d.ts +1 -1
  355. package/dist/semantics/normalize/producers/allocations.js +1 -1
  356. package/dist/semantics/normalize/producers/binding-kind.d.ts +1 -1
  357. package/dist/semantics/normalize/producers/binding-kind.js +1 -1
  358. package/dist/semantics/normalize/producers/bindings.d.ts +1 -1
  359. package/dist/semantics/normalize/producers/bindings.js +1 -1
  360. package/dist/semantics/normalize/producers/boundary.d.ts +1 -1
  361. package/dist/semantics/normalize/producers/boundary.js +1 -1
  362. package/dist/semantics/normalize/producers/cited-value-type.d.ts +1 -1
  363. package/dist/semantics/normalize/producers/cited-value-type.js +1 -1
  364. package/dist/semantics/normalize/producers/class-lifecycle.js +1 -1
  365. package/dist/semantics/normalize/producers/computations.js +1 -1
  366. package/dist/semantics/normalize/producers/conditional-guard.d.ts +1 -1
  367. package/dist/semantics/normalize/producers/control-loops.d.ts +1 -1
  368. package/dist/semantics/normalize/producers/control-loops.js +1 -1
  369. package/dist/semantics/normalize/producers/control.d.ts +1 -1
  370. package/dist/semantics/normalize/producers/control.js +1 -1
  371. package/dist/semantics/normalize/producers/declaration-lifecycle.js +1 -1
  372. package/dist/semantics/normalize/producers/destructuring.d.ts +1 -1
  373. package/dist/semantics/normalize/producers/destructuring.js +1 -1
  374. package/dist/semantics/normalize/producers/dynamic-language.js +1 -1
  375. package/dist/semantics/normalize/producers/enums.d.ts +1 -1
  376. package/dist/semantics/normalize/producers/enums.js +1 -1
  377. package/dist/semantics/normalize/producers/erasure.d.ts +1 -1
  378. package/dist/semantics/normalize/producers/erasure.js +1 -1
  379. package/dist/semantics/normalize/producers/exact-arms.d.ts +1 -1
  380. package/dist/semantics/normalize/producers/exact-arms.js +1 -1
  381. package/dist/semantics/normalize/producers/intrinsic-accessor-getter.d.ts +1 -1
  382. package/dist/semantics/normalize/producers/invocations.d.ts +1 -1
  383. package/dist/semantics/normalize/producers/invocations.js +1 -1
  384. package/dist/semantics/normalize/producers/iteration-yield.d.ts +1 -1
  385. package/dist/semantics/normalize/producers/iteration-yield.js +1 -1
  386. package/dist/semantics/normalize/producers/jsx.js +1 -1
  387. package/dist/semantics/normalize/producers/logical-merge-type.d.ts +1 -1
  388. package/dist/semantics/normalize/producers/logical-merge-type.js +1 -1
  389. package/dist/semantics/normalize/producers/mint.js +88 -5
  390. package/dist/semantics/normalize/producers/native-callable-readonly-set.d.ts +1 -1
  391. package/dist/semantics/normalize/producers/native-own-assignment.d.ts +1 -1
  392. package/dist/semantics/normalize/producers/native-own-assignment.js +1 -1
  393. package/dist/semantics/normalize/producers/nullish.d.ts +1 -1
  394. package/dist/semantics/normalize/producers/nullish.js +1 -1
  395. package/dist/semantics/normalize/producers/object-assignment.d.ts +1 -1
  396. package/dist/semantics/normalize/producers/object-assignment.js +1 -1
  397. package/dist/semantics/normalize/producers/object-tag.d.ts +1 -1
  398. package/dist/semantics/normalize/producers/object-tag.js +1 -1
  399. package/dist/semantics/normalize/producers/optional-chain.d.ts +1 -1
  400. package/dist/semantics/normalize/producers/optional-chain.js +1 -1
  401. package/dist/semantics/normalize/producers/properties.d.ts +1 -1
  402. package/dist/semantics/normalize/producers/properties.js +1 -1
  403. package/dist/semantics/normalize/producers/protocol.d.ts +1 -1
  404. package/dist/semantics/normalize/producers/protocol.js +1 -1
  405. package/dist/semantics/normalize/producers/references.d.ts +1 -1
  406. package/dist/semantics/normalize/producers/references.js +1 -1
  407. package/dist/semantics/normalize/producers/shared.d.ts +1 -1
  408. package/dist/semantics/normalize/producers/shared.js +1 -1
  409. package/dist/semantics/normalize/producers/spread-arguments.d.ts +1 -1
  410. package/dist/semantics/normalize/producers/spread-arguments.js +1 -1
  411. package/dist/semantics/normalize/producers/tagged-template.d.ts +1 -1
  412. package/dist/semantics/normalize/producers/tagged-template.js +1 -1
  413. package/dist/semantics/normalize/producers/tuple-spread.d.ts +1 -1
  414. package/dist/semantics/normalize/producers/tuple-spread.js +1 -1
  415. package/dist/semantics/normalize/property-key-domain.d.ts +8 -1
  416. package/dist/semantics/normalize/property-key-domain.js +74 -47
  417. package/dist/semantics/normalize/reachability.d.ts +1 -1
  418. package/dist/semantics/normalize/reachability.js +3 -2
  419. package/dist/semantics/normalize/reassigned-bindings.d.ts +1 -1
  420. package/dist/semantics/normalize/record-home-arms.d.ts +1 -1
  421. package/dist/semantics/normalize/record-home-arms.js +1 -1
  422. package/dist/semantics/normalize/record-link-families.d.ts +1 -1
  423. package/dist/semantics/normalize/record-link-families.js +1 -1
  424. package/dist/semantics/normalize/record-stand-in-arms.d.ts +1 -1
  425. package/dist/semantics/normalize/record-stand-in-arms.js +1 -1
  426. package/dist/semantics/normalize/record-storage-families.d.ts +1 -1
  427. package/dist/semantics/normalize/record-storage-families.js +1 -1
  428. package/dist/semantics/normalize/return-bindings.d.ts +1 -1
  429. package/dist/semantics/normalize/return-bindings.js +1 -1
  430. package/dist/semantics/normalize/return-paths.d.ts +1 -1
  431. package/dist/semantics/normalize/return-paths.js +1 -1
  432. package/dist/semantics/normalize/round-tables.d.ts +21 -0
  433. package/dist/semantics/normalize/round-tables.js +59 -0
  434. package/dist/semantics/normalize/script-global-redefinition.d.ts +1 -1
  435. package/dist/semantics/normalize/script-global-redefinition.js +1 -1
  436. package/dist/semantics/normalize/shared-array-storage.d.ts +1 -1
  437. package/dist/semantics/normalize/shared-array-storage.js +1 -1
  438. package/dist/semantics/normalize/sloppy-absence.d.ts +1 -1
  439. package/dist/semantics/normalize/sloppy-absence.js +1 -1
  440. package/dist/semantics/normalize/source-native-iterable.d.ts +2 -2
  441. package/dist/semantics/normalize/source-native-iterable.js +4 -2
  442. package/dist/semantics/normalize/source-object-prototype-absence.d.ts +1 -1
  443. package/dist/semantics/normalize/source-object-prototype-absence.js +1 -1
  444. package/dist/semantics/normalize/specialization.d.ts +1 -1
  445. package/dist/semantics/normalize/specialization.js +1 -1
  446. package/dist/semantics/normalize/specialized-source-frames.d.ts +1 -1
  447. package/dist/semantics/normalize/specialized-source-frames.js +12 -4
  448. package/dist/semantics/normalize/structural-any-binding-consumer.d.ts +1 -1
  449. package/dist/semantics/normalize/structural-any-binding-consumer.js +1 -1
  450. package/dist/semantics/normalize/structural-array-element.d.ts +1 -1
  451. package/dist/semantics/normalize/structural-array-element.js +1 -1
  452. package/dist/semantics/normalize/structural-array-read.d.ts +1 -1
  453. package/dist/semantics/normalize/structural-array-read.js +1 -1
  454. package/dist/semantics/normalize/structural-callable.d.ts +1 -1
  455. package/dist/semantics/normalize/structural-callable.js +1 -1
  456. package/dist/semantics/normalize/structural-creation-order.d.ts +1 -1
  457. package/dist/semantics/normalize/structural-creation-order.js +1 -1
  458. package/dist/semantics/normalize/structural-declarations.d.ts +1 -1
  459. package/dist/semantics/normalize/structural-declarations.js +1 -1
  460. package/dist/semantics/normalize/structural-declared-body.d.ts +1 -1
  461. package/dist/semantics/normalize/structural-declared-body.js +1 -1
  462. package/dist/semantics/normalize/structural-generics.d.ts +1 -1
  463. package/dist/semantics/normalize/structural-generics.js +1 -1
  464. package/dist/semantics/normalize/structural-indexed-access.d.ts +1 -1
  465. package/dist/semantics/normalize/structural-indexed-access.js +1 -1
  466. package/dist/semantics/normalize/structural-instantiated-member.d.ts +1 -1
  467. package/dist/semantics/normalize/structural-instantiated-member.js +199 -68
  468. package/dist/semantics/normalize/structural-joins.d.ts +1 -1
  469. package/dist/semantics/normalize/structural-layout-relevance.d.ts +1 -1
  470. package/dist/semantics/normalize/structural-layout-relevance.js +1 -1
  471. package/dist/semantics/normalize/structural-layout-type.d.ts +1 -1
  472. package/dist/semantics/normalize/structural-layout-type.js +14 -2
  473. package/dist/semantics/normalize/structural-leaves.d.ts +1 -1
  474. package/dist/semantics/normalize/structural-leaves.js +1 -1
  475. package/dist/semantics/normalize/structural-local-union.d.ts +1 -1
  476. package/dist/semantics/normalize/structural-local-union.js +21 -16
  477. package/dist/semantics/normalize/structural-members.d.ts +1 -1
  478. package/dist/semantics/normalize/structural-members.js +1 -1
  479. package/dist/semantics/normalize/structural-mutable-field.d.ts +1 -2
  480. package/dist/semantics/normalize/structural-mutable-field.js +17 -4
  481. package/dist/semantics/normalize/structural-mutable-method.d.ts +1 -1
  482. package/dist/semantics/normalize/structural-mutable-method.js +1 -1
  483. package/dist/semantics/normalize/structural-parts.d.ts +1 -1
  484. package/dist/semantics/normalize/structural-parts.js +1 -1
  485. package/dist/semantics/normalize/structural-receiver.d.ts +1 -1
  486. package/dist/semantics/normalize/structural-receiver.js +1 -1
  487. package/dist/semantics/normalize/structural-rules.d.ts +4 -4
  488. package/dist/semantics/normalize/structural-rules.js +30 -12
  489. package/dist/semantics/normalize/structural-self-reference.d.ts +1 -1
  490. package/dist/semantics/normalize/structural-self-reference.js +1 -1
  491. package/dist/semantics/normalize/structural.d.ts +1 -1
  492. package/dist/semantics/normalize/structural.js +2467 -2239
  493. package/dist/semantics/normalize/suppressed-write-arms.d.ts +1 -1
  494. package/dist/semantics/normalize/suppressed-write-arms.js +1 -1
  495. package/dist/semantics/normalize/symbol-keyed-this-slots.d.ts +1 -1
  496. package/dist/semantics/normalize/symbol-keyed-this-slots.js +1 -1
  497. package/dist/semantics/normalize/unreduced-type-form.d.ts +1 -1
  498. package/dist/semantics/normalize/unreduced-type-form.js +1 -1
  499. package/dist/semantics/normalize/unresolvable-names.d.ts +1 -1
  500. package/dist/semantics/normalize/unresolvable-names.js +1 -1
  501. package/dist/semantics/normalize/unshared-array-result.d.ts +1 -1
  502. package/dist/semantics/normalize/unshared-array-result.js +1 -1
  503. package/dist/semantics/package-sources.d.ts +1 -1
  504. package/dist/semantics/package-sources.js +1 -1
  505. package/dist/semantics/program.d.ts +1 -1
  506. package/dist/semantics/program.js +11 -5
  507. package/dist/semantics/prototype-install-source-transform.js +1 -1
  508. package/dist/semantics/prototype-object-class-source-transform.js +1 -1
  509. package/dist/semantics/prototype-reparenting.d.ts +1 -1
  510. package/dist/semantics/prototype-reparenting.js +1 -1
  511. package/dist/semantics/shared-declaration-files.d.ts +1 -1
  512. package/dist/semantics/source-transform-exports.js +1 -1
  513. package/dist/semantics/stable-checker.d.ts +9 -1
  514. package/dist/semantics/stable-checker.js +21 -5
  515. package/dist/semantics/subclass-member-overlay-transform.js +46 -5
  516. package/dist/semantics/symbol-keyed-expando-source-transform.js +1 -1
  517. package/dist/semantics/this-constructor-source-transform.js +1 -1
  518. package/dist/semantics/typescript.d.ts +12 -0
  519. package/dist/semantics/typescript.js +12 -0
  520. package/dist/semantics/uncached-jsdoc-tags.d.ts +16 -0
  521. package/dist/semantics/uncached-jsdoc-tags.js +23 -0
  522. package/dist/semantics/unchecked-guard-argument-copies.d.ts +1 -1
  523. package/dist/semantics/unchecked-guard-argument-copies.js +1 -1
  524. package/dist/semantics/unchecked-write-member-declarations.d.ts +1 -1
  525. package/dist/semantics/unchecked-write-member-declarations.js +1 -1
  526. package/dist/semantics/uninstantiable-classes.d.ts +1 -1
  527. package/dist/semantics/uninstantiable-classes.js +1 -1
  528. package/dist/targets/cpp/conversions.js +137 -87
  529. package/dist/targets/cpp/emit-in.js +2 -1
  530. package/dist/targets/cpp/emit-iterator.d.ts +6 -5
  531. package/dist/targets/cpp/emit-iterator.js +23 -13
  532. package/dist/targets/cpp/emit-narrowing.d.ts +8 -0
  533. package/dist/targets/cpp/emit-narrowing.js +11 -1
  534. package/dist/targets/cpp/emit-record-view.d.ts +9 -0
  535. package/dist/targets/cpp/emit-record-view.js +12 -1
  536. package/package.json +7 -1
@@ -1,6 +1,6 @@
1
1
  import type { TargetRuntimeManifest } from '../preflight/obligations.js';
2
2
  import type { SealedRepresentationPlan } from '../representation/plan.js';
3
- import type { SemanticGraph } from '../semantics/model/graph.js';
3
+ import { type SemanticGraph } from '../semantics/model/graph.js';
4
4
  import type { IrCertification } from './certify.js';
5
5
  /**
6
6
  * The whole-pipeline capability certificate.
@@ -1,4 +1,6 @@
1
1
  import { createHash } from 'node:crypto';
2
+ import { SemanticEdgeTable } from '../semantics/model/edges.js';
3
+ import { PublishedResults } from '../semantics/model/graph.js';
2
4
  const sha256 = (input) => createHash('sha256').update(input, 'utf8').digest('hex');
3
5
  // The same digest as `sha256` over the concatenation, without ever holding
4
6
  // the concatenation: the demanded-key list of a large program need not fit in
@@ -65,7 +67,16 @@ const digestOf = (value) => {
65
67
  visit(element);
66
68
  return write(']');
67
69
  }
68
- if (val instanceof Map) {
70
+ // The sealed graph's edge and result tables stand in for the array and
71
+ // the map they replaced, and digest as those: their own fields are a
72
+ // storage layout, and the edge table's grow as lookups memoize.
73
+ if (val instanceof SemanticEdgeTable) {
74
+ write(`A${val.length}[`);
75
+ for (const edge of val)
76
+ visit(edge);
77
+ return write(']');
78
+ }
79
+ if (val instanceof Map || val instanceof PublishedResults) {
69
80
  write(`M${val.size}[`);
70
81
  for (const [key, entry] of val) {
71
82
  visit(key);
@@ -46,6 +46,22 @@ export declare const recordHasIteratorMethodField: (deriver: RepresentationDeriv
46
46
  * cursor can walk -- see `preflight/runtime-helper-key.ts`'s own doc.
47
47
  */
48
48
  export declare const isUniformTupleRecord: (representation: Representation) => boolean;
49
+ /**
50
+ * For a tuple whose positions do NOT share one carrier, the arm of the walk's
51
+ * element sum that carries each position, or `null` when any position has no
52
+ * single arm of its own.
53
+ *
54
+ * `[['GiB', 2 ** 30], ['MiB', 2 ** 20]] as const` is a tuple of two
55
+ * structurally identical records that are still two types, so no one cursor
56
+ * element type is every position's. The checker already says what a step
57
+ * yields: the union of the position types, which derives as a tagged union
58
+ * with an arm per distinct position carrier. Each position is then exactly
59
+ * one arm's value, and the cursor publishes that union, tagging each step
60
+ * with its position's arm -- the same value the program reads, never a
61
+ * conversion. A position matching no arm, or two, is refused rather than
62
+ * guessed.
63
+ */
64
+ export declare const tuplePositionArmsOf: (representation: Representation, element: Representation | undefined) => readonly number[] | null;
49
65
  /** Whether a sum's arms are all shared Arrays or Sets -- the only sums `emit-iterator.ts` walks natively. */
50
66
  export declare const isSequenceSum: (representation: Representation) => boolean;
51
67
  /**
@@ -54,7 +70,7 @@ export declare const isSequenceSum: (representation: Representation) => boolean;
54
70
  * reasoning behind the `record(no-iterator-method)`/`record(tuple-values)`
55
71
  * split.
56
72
  */
57
- export declare const iteratorMethodCarrierKeyOf: (kind: string, representation: Representation | undefined, deriver: RepresentationDeriver) => string;
73
+ export declare const iteratorMethodCarrierKeyOf: (kind: string, representation: Representation | undefined, deriver: RepresentationDeriver, element?: Representation) => string;
58
74
  /**
59
75
  * An indexed record copied into a string-keyed dictionary: its declared fields
60
76
  * unroll as a static record's do, and its string sidecar walks as a
@@ -124,6 +124,37 @@ export const isUniformTupleRecord = (representation) => {
124
124
  const elementKey = representationKey(first.value);
125
125
  return representation.fields.every((field, position) => field.key === String(position) && field.required && representationKey(field.value) === elementKey);
126
126
  };
127
+ /**
128
+ * For a tuple whose positions do NOT share one carrier, the arm of the walk's
129
+ * element sum that carries each position, or `null` when any position has no
130
+ * single arm of its own.
131
+ *
132
+ * `[['GiB', 2 ** 30], ['MiB', 2 ** 20]] as const` is a tuple of two
133
+ * structurally identical records that are still two types, so no one cursor
134
+ * element type is every position's. The checker already says what a step
135
+ * yields: the union of the position types, which derives as a tagged union
136
+ * with an arm per distinct position carrier. Each position is then exactly
137
+ * one arm's value, and the cursor publishes that union, tagging each step
138
+ * with its position's arm -- the same value the program reads, never a
139
+ * conversion. A position matching no arm, or two, is refused rather than
140
+ * guessed.
141
+ */
142
+ export const tuplePositionArmsOf = (representation, element) => {
143
+ if (representation.kind !== 'record' || representation.fields.length === 0 || element?.kind !== 'tagged-union')
144
+ return null;
145
+ const armKeys = element.arms.map((arm) => representationKey(arm.value));
146
+ const arms = [];
147
+ for (const [position, field] of representation.fields.entries()) {
148
+ if (field.key !== String(position) || !field.required)
149
+ return null;
150
+ const key = representationKey(field.value);
151
+ const matching = armKeys.flatMap((armKey, index) => (armKey === key ? [index] : []));
152
+ if (matching.length !== 1)
153
+ return null;
154
+ arms.push(matching[0]);
155
+ }
156
+ return arms;
157
+ };
127
158
  /** Whether a sum's arms are all shared Arrays or Sets -- the only sums `emit-iterator.ts` walks natively. */
128
159
  export const isSequenceSum = (representation) => representation.kind === 'tagged-union' &&
129
160
  representation.arms.length > 0 &&
@@ -143,7 +174,7 @@ const optionalIterationSourceKeyOf = (kind, representation) => {
143
174
  * reasoning behind the `record(no-iterator-method)`/`record(tuple-values)`
144
175
  * split.
145
176
  */
146
- export const iteratorMethodCarrierKeyOf = (kind, representation, deriver) => {
177
+ export const iteratorMethodCarrierKeyOf = (kind, representation, deriver, element) => {
147
178
  const wrapped = optionalIterationSourceKeyOf(kind, representation);
148
179
  if (wrapped !== null)
149
180
  return wrapped;
@@ -160,7 +191,9 @@ export const iteratorMethodCarrierKeyOf = (kind, representation, deriver) => {
160
191
  return kind;
161
192
  if (kind === 'native-record-ref')
162
193
  return 'native-record-ref(no-iterator-method)';
163
- return isUniformTupleRecord(representation) ? 'record(tuple-values)' : 'record(no-iterator-method)';
194
+ return isUniformTupleRecord(representation) || tuplePositionArmsOf(representation, element) !== null
195
+ ? 'record(tuple-values)'
196
+ : 'record(no-iterator-method)';
164
197
  };
165
198
  /** Whether a `record`/`class-ref` is a shape `emitSpreadCopy` can copy without calling user code -- see `runtime-helper-key.ts`'s doc. */
166
199
  const isCopyableSpreadRecord = (deriver, representation) => {
@@ -1,3 +1,4 @@
1
+ import { producerEdges } from '../../semantics/model/edges.js';
1
2
  import { operandOf } from '../../semantics/model/operands.js';
2
3
  /** Only direct calls are implemented: an extracted builtin must not bind itself to the original function. */
3
4
  export const isDirectFunctionSourceRead = (graph, operation) => {
@@ -11,7 +12,7 @@ export const isDirectFunctionSourceRead = (graph, operation) => {
11
12
  if (!result)
12
13
  return false;
13
14
  let calls = 0;
14
- for (const edge of graph.edges) {
15
+ for (const edge of producerEdges(graph.edges)) {
15
16
  if (edge.kind !== 'value' || edge.result !== result.id)
16
17
  continue;
17
18
  const user = graph.operations.get(edge.to);
@@ -65,6 +65,12 @@ export declare const generatedSharedObjectCarrier: (representation: Representati
65
65
  * key is only known at runtime. Classes deliberately stay out of this
66
66
  * predicate: an arbitrary string can name an inherited program method, and
67
67
  * that prototype question is not recoverable from the record sidecar.
68
+ *
69
+ * A NAMED record (`native-record-ref` with no host name) is the same generated
70
+ * struct behind the same handle, so `gea::nativeDynamicHasProperty` answers it
71
+ * identically: its own slots, its index, its expando, a live view's original,
72
+ * and the ordinary prototype. An interface narrowed out of `unknown` by a type
73
+ * guard and probed with `key in value` is that receiver.
68
74
  */
69
75
  export declare const generatedSharedRecordCarrier: (representation: Representation) => boolean;
70
76
  /** Any compiler-owned ordinary object carrier, including by-value records with no expando identity. */
@@ -77,8 +77,15 @@ export const generatedSharedObjectCarrier = (representation) => {
77
77
  * key is only known at runtime. Classes deliberately stay out of this
78
78
  * predicate: an arbitrary string can name an inherited program method, and
79
79
  * that prototype question is not recoverable from the record sidecar.
80
+ *
81
+ * A NAMED record (`native-record-ref` with no host name) is the same generated
82
+ * struct behind the same handle, so `gea::nativeDynamicHasProperty` answers it
83
+ * identically: its own slots, its index, its expando, a live view's original,
84
+ * and the ordinary prototype. An interface narrowed out of `unknown` by a type
85
+ * guard and probed with `key in value` is that receiver.
80
86
  */
81
- export const generatedSharedRecordCarrier = (representation) => (representation.kind === 'record' || representation.kind === 'record-with-index') && representation.ownership === 'shared-refcount';
87
+ export const generatedSharedRecordCarrier = (representation) => ((representation.kind === 'record' || representation.kind === 'record-with-index') && representation.ownership === 'shared-refcount') ||
88
+ (representation.kind === 'native-record-ref' && representation.native === null && representation.ownership === 'shared-refcount');
82
89
  /** Any compiler-owned ordinary object carrier, including by-value records with no expando identity. */
83
90
  export const generatedObjectCarrier = (representation) => representation.kind === 'record' ||
84
91
  representation.kind === 'record-with-index' ||
@@ -1,4 +1,5 @@
1
1
  import { withoutSpecialization } from '../../identity/ids.js';
2
+ import { producerEdges } from '../../semantics/model/edges.js';
2
3
  import { operandOf } from '../../semantics/model/operands.js';
3
4
  import { callableBuiltinResolution, callableMutationFactsOf, callableOriginsOf } from '../../semantics/callable-origins.js';
4
5
  /**
@@ -248,7 +249,7 @@ export const isDirectCallableBuiltinRead = (graph, operation, member) => {
248
249
  if (!result)
249
250
  return false;
250
251
  let calls = 0;
251
- for (const edge of graph.edges) {
252
+ for (const edge of producerEdges(graph.edges)) {
252
253
  if (edge.kind !== 'value' || edge.result !== result.id)
253
254
  continue;
254
255
  const user = graph.operations.get(edge.to);
@@ -90,9 +90,10 @@ const ownKindDemandsOf = (operation, ctx) => {
90
90
  const semantic = ctx.semanticOperationOf(operation.lineage);
91
91
  if (semantic?.family === 'protocol') {
92
92
  const receiver = operation.receiver.representation;
93
+ const result = operation.result.representation;
93
94
  const carrier = operation.protocol === 'enumerate'
94
95
  ? enumerateGetIteratorCarrierKeyOf(receiver.kind, receiver)
95
- : iteratorMethodCarrierKeyOf(receiver.kind, receiver, ctx.deriver);
96
+ : iteratorMethodCarrierKeyOf(receiver.kind, receiver, ctx.deriver, result.kind === 'iterator' ? result.element : undefined);
96
97
  return [helper(`protocol:${operation.protocol}:get-iterator:${carrier}`)];
97
98
  }
98
99
  // The array-pattern SOURCE step's own Set/string snapshot and dynamic
@@ -12,7 +12,7 @@ export interface EmissionRepresentationReason {
12
12
  readonly owner: string;
13
13
  readonly detail: string;
14
14
  }
15
- /** One carrier in the readonly closure, with all provenance that retained it. */
15
+ /** One carrier in the readonly closure, with the first reason of each kind that retained it. */
16
16
  export interface EmissionRepresentationEntry {
17
17
  readonly representation: Representation;
18
18
  readonly reasons: readonly EmissionRepresentationReason[];
@@ -46,7 +46,7 @@ export interface EmissionRepresentationPublication {
46
46
  readonly roots: readonly EmissionRepresentationEntry[];
47
47
  /** Closure entries keyed by representationKey plus recursive role where needed, including root reasons. */
48
48
  readonly closure: ReadonlyMap<string, EmissionRepresentationEntry>;
49
- /** Every reason a carrier was retained, keyed by the closure key. */
49
+ /** The first reason of each kind a carrier was retained for, keyed by the closure key. */
50
50
  readonly reasons: ReadonlyMap<string, readonly EmissionRepresentationReason[]>;
51
51
  /** Final class declarations reached from retained carriers or retained member bodies. */
52
52
  readonly retainedClasses: ReadonlySet<DeclarationId>;
@@ -44,7 +44,11 @@ export const publishEmissionRepresentationsOf = (input) => {
44
44
  const citedConversionIds = new Set();
45
45
  const missingConversions = new Set();
46
46
  const missingDefinitions = new Set();
47
- const reasonKeyOf = (reason) => `${reason.kind}|${reason.owner}|${reason.detail}`;
47
+ // One reason of each kind per carrier, the first found: provenance for a
48
+ // reader asking why a carrier is retained. Keeping every reason kept one
49
+ // per operation, body and conversion that named the carrier -- 1.1 million
50
+ // on a large app, alive to the end of the compile for no consumer.
51
+ const reasonKeyOf = (reason) => reason.kind;
48
52
  const addReason = (table, representation, reason) => {
49
53
  const key = closureKeyOf(representation);
50
54
  const existing = table.get(key);
@@ -52,7 +56,8 @@ export const publishEmissionRepresentationsOf = (input) => {
52
56
  table.set(key, { representation, reasons: new Map([[reasonKeyOf(reason), reason]]) });
53
57
  return;
54
58
  }
55
- existing.reasons.set(reasonKeyOf(reason), reason);
59
+ if (!existing.reasons.has(reasonKeyOf(reason)))
60
+ existing.reasons.set(reasonKeyOf(reason), reason);
56
61
  };
57
62
  const enqueue = (representation, reason, root = false) => {
58
63
  addReason(root ? rootEntries : entries, representation, reason);
@@ -372,7 +377,8 @@ export const publishEmissionRepresentationsOf = (input) => {
372
377
  }
373
378
  const unique = new Map();
374
379
  for (const reason of [...(nested?.reasons.values() ?? []), ...(direct?.reasons.values() ?? [])])
375
- unique.set(reasonKeyOf(reason), reason);
380
+ if (!unique.has(reasonKeyOf(reason)))
381
+ unique.set(reasonKeyOf(reason), reason);
376
382
  closure.set(key, { representation: nested?.representation ?? direct.representation, reasons: Object.freeze([...unique.values()]) });
377
383
  }
378
384
  const reasons = new Map();
@@ -12,7 +12,9 @@ export declare const nativeGenericSelectorMatches: (source: Representation, targ
12
12
  * the selected specialization and every actual physical frame.
13
13
  * @semanticCategory generic-primitive
14
14
  */
15
- export declare const nativeGenericCallEntriesOf: (operation: CallOperation, origins: ReadonlySet<FunctionId>, bodyOf: (id: FunctionId) => IrBody | null | undefined, conversions?: Pick<ConversionCensus, "nodeById">) => readonly {
15
+ export declare const nativeGenericCallEntriesOf: (operation: CallOperation, origins: Iterable<FunctionId> & {
16
+ readonly size: number;
17
+ }, bodyOf: (id: FunctionId) => IrBody | null | undefined, conversions?: Pick<ConversionCensus, "nodeById">) => readonly {
16
18
  readonly functionId: FunctionId;
17
19
  readonly arguments: readonly IrOperand[];
18
20
  }[] | null;
@@ -56,6 +56,34 @@ const rewrite = (bodies, operation) => new Map([...bodies].map(([id, body]) => [
56
56
  ]))
57
57
  }
58
58
  ]));
59
+ /**
60
+ * `rewrite` for a generation that lives only as long as one solve: a block
61
+ * none of whose operations changed is the input's own block, and a body none
62
+ * of whose blocks changed is the input's own body. A whole fresh copy of the
63
+ * program beside the input, which the caller still holds, was the largest
64
+ * thing alive at the solve over it.
65
+ */
66
+ const rewriteSharing = (bodies, operation) => {
67
+ const result = new Map();
68
+ for (const [id, body] of bodies) {
69
+ let blocks = null;
70
+ for (const [blockId, block] of body.blocks) {
71
+ let operations = null;
72
+ for (let at = 0; at < block.operations.length; at++) {
73
+ const value = block.operations[at];
74
+ const next = operation(value);
75
+ if (next !== value)
76
+ (operations ??= block.operations.slice())[at] = next;
77
+ }
78
+ if (operations === null)
79
+ continue;
80
+ blocks ??= new Map(body.blocks);
81
+ blocks.set(blockId, { ...block, operations });
82
+ }
83
+ result.set(id, blocks === null ? body : { ...body, blocks });
84
+ }
85
+ return result;
86
+ };
59
87
  /** Close receiver irrelevance before shaking decides which operands require runtime values. */
60
88
  export const publishLogicalReceivers = (bodies, placements, classes, conversions, deriver, hosts) => {
61
89
  const keyTexts = new Map();
@@ -64,7 +92,7 @@ export const publishLogicalReceivers = (bodies, placements, classes, conversions
64
92
  for (const operation of block.operations)
65
93
  if (operation.kind === 'constant' && operation.literal === 'string')
66
94
  keyTexts.set(operation.result.id, operation.text);
67
- const marked = rewrite(bodies, (operation) => {
95
+ const marked = rewriteSharing(bodies, (operation) => {
68
96
  if (operation.kind !== 'get')
69
97
  return operation;
70
98
  if (hostReadIgnoresLogicalReceiver(operation, hosts, keyTexts.get(operation.key.value) ?? null))
@@ -1,3 +1,4 @@
1
+ import { edgesOfKind } from '../semantics/model/edges.js';
1
2
  import { IrLoweringBlockedError } from './lower-graph.js';
2
3
  /**
3
4
  * Where a `break` or `continue` lands.
@@ -14,12 +15,16 @@ import { IrLoweringBlockedError } from './lower-graph.js';
14
15
  * the try region, which the emitter reroutes through the clause (the scope
15
16
  * guard, or the exit dispatch of a finally that suspends).
16
17
  */
17
- const transferEdgeOf = (graph, from, completion) => graph.edges.find((candidate) => {
18
- if (candidate.kind !== 'completion' || candidate.from !== from || candidate.completion !== completion)
19
- return false;
20
- const target = graph.operations.get(candidate.to);
21
- return !(target?.family === 'boundary' && target.boundary === 'finally-region');
22
- });
18
+ const transferEdgeOf = (graph, from, completion) => {
19
+ for (const candidate of edgesOfKind(graph.edges, 'completion')) {
20
+ if (candidate.from !== from || candidate.completion !== completion)
21
+ continue;
22
+ const target = graph.operations.get(candidate.to);
23
+ if (!(target?.family === 'boundary' && target.boundary === 'finally-region'))
24
+ return candidate;
25
+ }
26
+ return undefined;
27
+ };
23
28
  /** The operation a `break`/`continue` transfers to, as the graph states it. */
24
29
  export const completionTargetOf = (graph, from, completion) => transferEdgeOf(graph, from, completion)?.to ?? null;
25
30
  export const findCompletionTargetBlock = (graph, blockStarts, from, completion) => {
@@ -1,5 +1,6 @@
1
1
  import { operationOfResult } from '../identity/ids.js';
2
2
  import { carriesUndefined, representationKey } from '../representation/model.js';
3
+ import { edgesOfKind } from '../semantics/model/edges.js';
3
4
  import { operandOf } from '../semantics/model/operands.js';
4
5
  import { IrLoweringBlockedError } from './lower-graph.js';
5
6
  import { mergeIncoming } from './lower-narrow.js';
@@ -49,8 +50,8 @@ import { convertTo, namedOperand, reactiveFieldReadOf, recordLayoutOf, registerR
49
50
  * allocation.
50
51
  */
51
52
  const chainSuccessorOf = (graph, id) => {
52
- for (const edge of graph.edges) {
53
- if (edge.kind === 'evaluation' && edge.from === id)
53
+ for (const edge of edgesOfKind(graph.edges, 'evaluation')) {
54
+ if (edge.from === id)
54
55
  return edge.to;
55
56
  }
56
57
  return null;
@@ -9,5 +9,10 @@ import { type GetOperation, type IrBody } from './model.js';
9
9
  export declare const nativeHostMethodReadProofsOf: (body: IrBody, rendering: CalleeRenderingInput | undefined, hosts?: HostMemberTable) => ReadonlyMap<GetOperation, AuthenticatedNativeHostMethodRead>;
10
10
  /** Publish before callable, field-presence or reflection flow first runs;
11
11
  * every subsequent rewrite recomputes rather than inherits this receipt.
12
+ *
13
+ * A Get that carries no receipt and earns none is kept as it is, and so is a
14
+ * block or body with nothing republished: a whole fresh copy of the program
15
+ * beside the input, which every caller still holds, sat under the callable
16
+ * flow solved over it.
12
17
  */
13
18
  export declare const publishNativeHostMethodReads: (bodies: ReadonlyMap<PhysicalBodyId, IrBody>, rendering: CalleeRenderingInput | undefined, hosts?: HostMemberTable) => ReadonlyMap<PhysicalBodyId, IrBody>;
@@ -28,26 +28,35 @@ export const nativeHostMethodReadProofsOf = (body, rendering, hosts) => {
28
28
  };
29
29
  /** Publish before callable, field-presence or reflection flow first runs;
30
30
  * every subsequent rewrite recomputes rather than inherits this receipt.
31
+ *
32
+ * A Get that carries no receipt and earns none is kept as it is, and so is a
33
+ * block or body with nothing republished: a whole fresh copy of the program
34
+ * beside the input, which every caller still holds, sat under the callable
35
+ * flow solved over it.
31
36
  */
32
- export const publishNativeHostMethodReads = (bodies, rendering, hosts) => new Map([...bodies].map(([id, body]) => {
33
- const proofs = nativeHostMethodReadProofsOf(body, rendering, hosts);
34
- return [
35
- id,
36
- {
37
- ...body,
38
- blocks: new Map([...body.blocks].map(([blockId, block]) => [
39
- blockId,
40
- {
41
- ...block,
42
- operations: block.operations.map((operation) => {
43
- if (operation.kind !== 'get')
44
- return operation;
45
- const { nativeHostMethodRead: _previous, ...current } = operation;
46
- const proof = proofs.get(operation);
47
- return proof === undefined ? current : { ...current, nativeHostMethodRead: proof.receipt };
48
- })
49
- }
50
- ]))
37
+ export const publishNativeHostMethodReads = (bodies, rendering, hosts) => {
38
+ const result = new Map();
39
+ for (const [id, body] of bodies) {
40
+ const proofs = nativeHostMethodReadProofsOf(body, rendering, hosts);
41
+ let blocks = null;
42
+ for (const [blockId, block] of body.blocks) {
43
+ let operations = null;
44
+ for (let at = 0; at < block.operations.length; at++) {
45
+ const operation = block.operations[at];
46
+ if (operation.kind !== 'get')
47
+ continue;
48
+ const proof = proofs.get(operation);
49
+ if (proof === undefined && !Object.prototype.hasOwnProperty.call(operation, 'nativeHostMethodRead'))
50
+ continue;
51
+ const { nativeHostMethodRead: _previous, ...current } = operation;
52
+ (operations ??= block.operations.slice())[at] = proof === undefined ? current : { ...current, nativeHostMethodRead: proof.receipt };
53
+ }
54
+ if (operations === null)
55
+ continue;
56
+ blocks ??= new Map(body.blocks);
57
+ blocks.set(blockId, { ...block, operations });
51
58
  }
52
- ];
53
- }));
59
+ result.set(id, blocks === null ? body : { ...body, blocks });
60
+ }
61
+ return result;
62
+ };
@@ -482,7 +482,10 @@ const conversionNodeOf = (input, conversions) => input.nativeCallableEntry
482
482
  : input.role === 'call-argument' || input.role === 'construct-argument'
483
483
  ? conversions.callArgumentFor(input.source, input.target)
484
484
  : conversions.nodeFor(input.source, input.target);
485
- export const operationConversionsOf = (inputs, conversions) => inputs.map((input) => ({ ...input, conversion: conversionNodeOf(input, conversions).id }));
485
+ // Most operations convert nothing; one shared empty list instead of one per
486
+ // operation, which on a large app was 900 thousand arrays held to the end.
487
+ const noOperationConversions = Object.freeze([]);
488
+ export const operationConversionsOf = (inputs, conversions) => inputs.length === 0 ? noOperationConversions : inputs.map((input) => ({ ...input, conversion: conversionNodeOf(input, conversions).id }));
486
489
  export const operationConversionsMatch = (expected, actual, conversions) => expected.length === actual.length &&
487
490
  expected.every((input, index) => {
488
491
  const value = actual[index];
@@ -126,7 +126,18 @@ export const methodValueRecipesMatch = (expected, actual, conversions) => expect
126
126
  /** Publish after all body rewrites, so the certificate and the printer name the same adaptations. */
127
127
  export const publishConversionRecipes = (input) => {
128
128
  const nativeBodies = publishNativeHostMethodReads(input.bodies, input.calleeRendering, input.hosts.members);
129
- let callableFlow;
129
+ // Solved before the first body is published, when any call will ask for it:
130
+ // asked lazily, the solve ran beside the half-built output generation, the
131
+ // largest thing alive in this pass.
132
+ const asksCallableFlow = [...nativeBodies.values()].some((body) => [...body.blocks.values()].some((block) => allOperationsOf(block).some((operation) => {
133
+ if (operation.kind !== 'call')
134
+ return false;
135
+ const receiver = genericNativeLogicalReceiverOf(operation);
136
+ return receiver !== null && !nativeLogicalReceiverProtocolSupported(nativeLogicalReceiverProtocolOf(receiver.representation));
137
+ })));
138
+ let callableFlow = asksCallableFlow
139
+ ? nativeCallableFlowOf([...nativeBodies.values()], input.placements, input.classes, input.conversions, undefined, input.deriver)
140
+ : undefined;
130
141
  const virtualFrames = settledVirtualCallFramesOf(input.bodies.values(), input.classes, input.conversions);
131
142
  const hostMethodAliases = buildHostMethodAliasIndex([...input.bodies.values()], input.placements, input.hosts);
132
143
  const bodies = new Map();
@@ -1,4 +1,4 @@
1
- import ts from 'typescript';
1
+ import ts from '#typescript';
2
2
  import { appleNativeTypes } from './host.js';
3
3
  import { appleHostMembers, appleMethodParameters } from './members.js';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import ts from 'typescript';
1
+ import ts from '#typescript';
2
2
  import { normalCompletion } from '../../semantics/model/operands.js';
3
3
  import { createClassLifecycleProducer } from '../../semantics/normalize/producers/class-lifecycle.js';
4
4
  import { mintOperationId, mintResult, operand } from '../../semantics/normalize/producers/mint.js';
@@ -1,4 +1,4 @@
1
- import ts from 'typescript';
1
+ import ts from '#typescript';
2
2
  import { geaRenderMemberName } from './contract.js';
3
3
  import { isReactiveComponentChild, openingOf, namesAComponent } from './reactive-slots.js';
4
4
  const unwrapParentheses = (expression) => ts.isParenthesizedExpression(expression) ? unwrapParentheses(expression.expression) : expression;
@@ -1,4 +1,4 @@
1
- import ts from 'typescript';
1
+ import ts from '#typescript';
2
2
  import type { ProducerContext } from '../../semantics/normalize/producer-context.js';
3
3
  /**
4
4
  * What gea says a JSX element means.
@@ -1,4 +1,4 @@
1
- import ts from 'typescript';
1
+ import ts from '#typescript';
2
2
  import { resolve } from 'node:path';
3
3
  import { geaCoreDeclarationFileName } from './host.js';
4
4
  import { declaredBaseTypesOf } from '../../semantics/ambient.js';
@@ -486,6 +486,32 @@ export const geaEmbeddedIncludeGuard = () => {
486
486
  }
487
487
  return [];
488
488
  };
489
+ /**
490
+ * `head`, then one more line computed the first time anything reads it.
491
+ *
492
+ * The canvas block is generated by the package's `cpp-ir` module, which
493
+ * imports the package's own copy of TypeScript: loading it for every plugin
494
+ * instance put a second TypeScript in the heap of every compile, ~7 MB for
495
+ * the rest of the run, although only a unit that names a canvas spelling ever
496
+ * reads the block. The line is an accessor until that first read, so every
497
+ * reader -- iteration, a spread, an index -- sees exactly the array it saw
498
+ * before, and a package that cannot generate the block still throws, at the
499
+ * unit that needs it.
500
+ */
501
+ const withLazyLine = (head, line) => {
502
+ const lines = [...head];
503
+ const at = head.length;
504
+ Object.defineProperty(lines, at, {
505
+ configurable: true,
506
+ enumerable: true,
507
+ get: () => {
508
+ const value = line();
509
+ Object.defineProperty(lines, at, { value, configurable: false, enumerable: true, writable: false });
510
+ return value;
511
+ }
512
+ });
513
+ return lines;
514
+ };
489
515
  export const geaHostPreambles = () => {
490
516
  const rows = new Map();
491
517
  const guard = [];
@@ -506,7 +532,7 @@ export const geaHostPreambles = () => {
506
532
  // are visited in. One string, not one per line: the preamble is unioned
507
533
  // into a set, and a 283-line block whose blank lines and closing braces
508
534
  // repeat cannot survive that.
509
- const lines = [...guard, geaCanvasInterop().join('\n')];
535
+ const lines = withLazyLine(guard, () => geaCanvasInterop().join('\n'));
510
536
  for (const spelling of canvas)
511
537
  rows.set(spelling, lines);
512
538
  }
@@ -92,7 +92,14 @@ const lowerClassComponent = (ctx, block, operation, facts, tag, keys, children,
92
92
  `"${representationKey(render.result)}"; an element is exactly what its render produces`);
93
93
  }
94
94
  const built = render.parameters.map((parameter) => buildPropsRecord(ctx, block, operation, keys, children, parameter.value));
95
- requireEveryAttributeConsumed(keys, children, built);
95
+ // A render declaring no parameter is `template()` handed `template(props)`:
96
+ // the attributes were evaluated as operands above and, exactly as an extra
97
+ // argument to any JavaScript function, nothing can read them. The checker
98
+ // accepted them against the class's own `Props`, and a native class has no
99
+ // `props` field for them to reach some other way. Only a render that DOES
100
+ // take props can leave one with nowhere to go.
101
+ if (render.parameters.length > 0)
102
+ requireEveryAttributeConsumed(keys, children, built);
96
103
  const created = ctx.builder.construct(block, lineage, tag, tag, { kind: 'open', evidence: ['plugin-lowered-jsx-class-component'] }, [], instance);
97
104
  const receiver = { value: created, representation: instance };
98
105
  // The render member's function object, allocated with no environment: a
@@ -1,4 +1,4 @@
1
- import ts from 'typescript';
1
+ import ts from '#typescript';
2
2
  import { createElementProducer } from '../../semantics/normalize/producers/jsx.js';
3
3
  import { elementFactsOf } from './contract.js';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import ts from 'typescript';
1
+ import ts from '#typescript';
2
2
  import type { PluginSourceFile } from '../model.js';
3
3
  /**
4
4
  * Whether this tag names a VALUE rather than an intrinsic name.
@@ -1,4 +1,4 @@
1
- import ts from 'typescript';
1
+ import ts from '#typescript';
2
2
  /**
3
3
  * A JSX expression that computes its value from other values, rewritten into an
4
4
  * immediately-invoked arrow over the same expression.