@geastack/compiler 1.0.20 → 1.0.22
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.
- package/dist/cli-emit.js +11 -1
- package/dist/cli-package-source.d.ts +0 -4
- package/dist/cli-package-source.js +8 -112
- package/dist/cli-refusal-location.d.ts +6 -0
- package/dist/cli-refusal-location.js +5 -0
- package/dist/cli.js +2 -1
- package/dist/compiler.d.ts +4 -0
- package/dist/compiler.js +120 -29
- package/dist/conversion/algebra.d.ts +16 -1
- package/dist/conversion/algebra.js +2 -0
- package/dist/conversion/build.d.ts +12 -0
- package/dist/conversion/build.js +31 -6
- package/dist/conversion/constructor-identity-family.d.ts +49 -0
- package/dist/conversion/constructor-identity-family.js +67 -0
- package/dist/conversion/derive.js +39 -6
- package/dist/conversion/iterable-object-view.d.ts +44 -0
- package/dist/conversion/iterable-object-view.js +55 -0
- package/dist/conversion/iterator-object-view.d.ts +77 -0
- package/dist/conversion/iterator-object-view.js +112 -0
- package/dist/conversion/nodes.d.ts +93 -0
- package/dist/conversion/nodes.js +262 -5
- package/dist/conversion/operand-view.js +41 -0
- package/dist/conversion/protocol-iterator.d.ts +84 -0
- package/dist/conversion/protocol-iterator.js +88 -0
- package/dist/conversion/record-view.d.ts +152 -8
- package/dist/conversion/record-view.js +518 -37
- package/dist/conversion/registry.d.ts +32 -0
- package/dist/ir/borrowed-call-arguments.d.ts +22 -1
- package/dist/ir/borrowed-call-arguments.js +102 -1
- package/dist/ir/borrowed-callable-uses.d.ts +62 -0
- package/dist/ir/borrowed-callable-uses.js +135 -0
- package/dist/ir/boxed-bind-assumptions.d.ts +24 -0
- package/dist/ir/boxed-bind-assumptions.js +93 -0
- package/dist/ir/build.d.ts +18 -7
- package/dist/ir/build.js +71 -13
- package/dist/ir/call-dispatch.js +474 -10
- package/dist/ir/call-entry.d.ts +24 -1
- package/dist/ir/call-entry.js +106 -1
- package/dist/ir/callable-class-flow.d.ts +3 -1
- package/dist/ir/callable-class-flow.js +42 -6
- package/dist/ir/callable-identity-demand.d.ts +20 -1
- package/dist/ir/callable-identity-demand.js +157 -18
- package/dist/ir/callable-member-candidates.d.ts +11 -1
- package/dist/ir/callable-member-candidates.js +82 -3
- package/dist/ir/callable-records.js +2 -2
- package/dist/ir/callable-site-escape.d.ts +4 -0
- package/dist/ir/callable-site-escape.js +228 -0
- package/dist/ir/captures.d.ts +10 -1
- package/dist/ir/captures.js +219 -4
- package/dist/ir/certificate.js +87 -16
- package/dist/ir/certify/carrier-keys.d.ts +58 -1
- package/dist/ir/certify/carrier-keys.js +160 -6
- package/dist/ir/certify/property-access-keys.d.ts +17 -0
- package/dist/ir/certify/property-access-keys.js +36 -0
- package/dist/ir/certify/property-access.js +49 -4
- package/dist/ir/certify/runtime-helper.d.ts +4 -0
- package/dist/ir/certify/runtime-helper.js +17 -5
- package/dist/ir/certify.js +132 -79
- package/dist/ir/class-static-fields.d.ts +11 -0
- package/dist/ir/class-static-fields.js +28 -0
- package/dist/ir/construct-entry.d.ts +2 -1
- package/dist/ir/construct-entry.js +3 -2
- package/dist/ir/construction-only-fields.d.ts +73 -0
- package/dist/ir/construction-only-fields.js +211 -0
- package/dist/ir/dominance.d.ts +14 -0
- package/dist/ir/dominance.js +18 -4
- package/dist/ir/emission-representations.js +4 -1
- package/dist/ir/exception-edges.d.ts +17 -0
- package/dist/ir/exception-edges.js +75 -0
- package/dist/ir/facts.d.ts +54 -3
- package/dist/ir/facts.js +182 -5
- package/dist/ir/generator-split.js +2 -2
- package/dist/ir/instance-reparenting.d.ts +83 -0
- package/dist/ir/instance-reparenting.js +167 -0
- package/dist/ir/integer-storage.d.ts +29 -0
- package/dist/ir/integer-storage.js +188 -79
- package/dist/ir/integers.d.ts +16 -0
- package/dist/ir/integers.js +327 -8
- package/dist/ir/integrity-restrictions.d.ts +42 -9
- package/dist/ir/integrity-restrictions.js +335 -42
- package/dist/ir/key-order-observation.d.ts +38 -0
- package/dist/ir/key-order-observation.js +173 -0
- package/dist/ir/literal-set-membership.d.ts +30 -0
- package/dist/ir/literal-set-membership.js +277 -0
- package/dist/ir/lower-allocation.js +68 -8
- package/dist/ir/lower-completion.d.ts +0 -9
- package/dist/ir/lower-completion.js +14 -5
- package/dist/ir/lower-destructuring.js +24 -2
- package/dist/ir/lower-exceptions.js +4 -4
- package/dist/ir/lower-flow.d.ts +21 -0
- package/dist/ir/lower-flow.js +37 -3
- package/dist/ir/lower-graph.d.ts +19 -1
- package/dist/ir/lower-graph.js +91 -67
- package/dist/ir/lower-invocation.d.ts +16 -0
- package/dist/ir/lower-invocation.js +189 -29
- package/dist/ir/lower-narrow.d.ts +0 -46
- package/dist/ir/lower-narrow.js +63 -1
- package/dist/ir/lower-operands.d.ts +52 -2
- package/dist/ir/lower-operands.js +491 -8
- package/dist/ir/lower-property.d.ts +2 -1
- package/dist/ir/lower-property.js +140 -31
- package/dist/ir/lower-protocol.js +16 -4
- package/dist/ir/lower-proxy.d.ts +65 -0
- package/dist/ir/lower-proxy.js +181 -0
- package/dist/ir/lower.js +112 -17
- package/dist/ir/model.d.ts +228 -18
- package/dist/ir/native-class-accessor.d.ts +9 -2
- package/dist/ir/native-class-accessor.js +12 -3
- package/dist/ir/native-class-construction.d.ts +1 -1
- package/dist/ir/native-class-construction.js +2 -1
- package/dist/ir/native-class-initialization.js +2 -2
- package/dist/ir/object-value-conversions.js +20 -5
- package/dist/ir/operation-index.d.ts +16 -0
- package/dist/ir/operation-index.js +17 -0
- package/dist/ir/pcm-loops.d.ts +11 -0
- package/dist/ir/pcm-loops.js +284 -0
- package/dist/ir/presence-proof.js +5 -0
- package/dist/ir/program-facts.d.ts +10 -20
- package/dist/ir/program-facts.js +80 -6
- package/dist/ir/proven-branches.d.ts +2 -2
- package/dist/ir/proven-branches.js +198 -3
- package/dist/ir/queries.js +35 -1
- package/dist/ir/reflection-demand.d.ts +9 -4
- package/dist/ir/reflection-demand.js +410 -28
- package/dist/ir/refusal.d.ts +1 -0
- package/dist/ir/refusal.js +2 -1
- package/dist/ir/shake.d.ts +94 -1
- package/dist/ir/shake.js +209 -12
- package/dist/ir/shared-empty-records.d.ts +12 -0
- package/dist/ir/shared-empty-records.js +301 -0
- package/dist/ir/spread-copy-elision.d.ts +59 -0
- package/dist/ir/spread-copy-elision.js +431 -0
- package/dist/ir/stable-cell-reads.d.ts +40 -0
- package/dist/ir/stable-cell-reads.js +123 -0
- package/dist/ir/static-callables.js +50 -0
- package/dist/ir/string-layout-reuse.d.ts +16 -1
- package/dist/ir/string-layout-reuse.js +66 -0
- package/dist/ir/transfer.d.ts +72 -3
- package/dist/ir/transfer.js +511 -19
- package/dist/ir/typed-property-access.d.ts +18 -2
- package/dist/ir/typed-property-access.js +109 -12
- package/dist/ir/verify.js +2 -1
- package/dist/plugins/apple/plugin.js +3 -2
- package/dist/plugins/gea/host.d.ts +7 -0
- package/dist/plugins/gea/host.js +30 -1
- package/dist/plugins/gea/lower.js +6 -1
- package/dist/plugins/gea/plugin.js +7 -4
- package/dist/plugins/gea/render-bridge.d.ts +4 -2
- package/dist/plugins/gea/render-bridge.js +23 -7
- package/dist/plugins/model.d.ts +2 -0
- package/dist/project-preparation.d.ts +5 -1
- package/dist/project-preparation.js +184 -7
- package/dist/projection/bindings.d.ts +5 -2
- package/dist/projection/bindings.js +40 -1
- package/dist/projection/callee.d.ts +16 -0
- package/dist/projection/callee.js +35 -6
- package/dist/projection/class-prototype.js +5 -1
- package/dist/projection/classes.d.ts +65 -2
- package/dist/projection/classes.js +159 -2
- package/dist/projection/dispatch.d.ts +69 -18
- package/dist/projection/dispatch.js +391 -19
- package/dist/projection/fields.d.ts +4 -3
- package/dist/projection/fields.js +89 -21
- package/dist/projection/instance-test.d.ts +12 -0
- package/dist/projection/instance-test.js +40 -10
- package/dist/projection/method-value-escapes.d.ts +43 -0
- package/dist/projection/method-value-escapes.js +113 -0
- package/dist/projection/slots.d.ts +34 -1
- package/dist/projection/slots.js +82 -5
- package/dist/representation/any-null-record-members.d.ts +41 -0
- package/dist/representation/any-null-record-members.js +115 -0
- package/dist/representation/collections.d.ts +3 -1
- package/dist/representation/collections.js +5 -2
- package/dist/representation/derive.d.ts +9 -1
- package/dist/representation/derive.js +366 -25
- package/dist/representation/difference.js +14 -0
- package/dist/representation/embedded-carriers.js +1 -0
- package/dist/representation/host-abi.d.ts +15 -0
- package/dist/representation/host-abi.js +28 -0
- package/dist/representation/host-templates.d.ts +1 -1
- package/dist/representation/host-templates.js +7 -3
- package/dist/representation/intersection.js +22 -0
- package/dist/representation/json-nullable.d.ts +18 -0
- package/dist/representation/json-nullable.js +22 -0
- package/dist/representation/model.d.ts +141 -0
- package/dist/representation/model.js +47 -3
- package/dist/representation/object-shape.d.ts +5 -1
- package/dist/representation/object-shape.js +5 -2
- package/dist/representation/policies.d.ts +66 -1
- package/dist/representation/proxy-carriers.d.ts +71 -0
- package/dist/representation/proxy-carriers.js +330 -0
- package/dist/representation/publish.d.ts +9 -1
- package/dist/representation/publish.js +186 -18
- package/dist/representation/record-fields.d.ts +5 -0
- package/dist/representation/record-fields.js +7 -1
- package/dist/representation/static-field-cells.d.ts +61 -0
- package/dist/representation/static-field-cells.js +80 -0
- package/dist/representation/unassigned-binding-cells.d.ts +32 -0
- package/dist/representation/unassigned-binding-cells.js +44 -0
- package/dist/representation/union.js +17 -1
- package/dist/representation/unwritten-record-members.d.ts +54 -0
- package/dist/representation/unwritten-record-members.js +167 -0
- package/dist/representation/value-records.js +153 -11
- package/dist/semantics/ambient.d.ts +102 -0
- package/dist/semantics/ambient.js +183 -0
- package/dist/semantics/any-null-member-declarations.d.ts +32 -0
- package/dist/semantics/any-null-member-declarations.js +90 -0
- package/dist/semantics/borrowed-builtin-call-bind-source-transform.js +14 -0
- package/dist/semantics/borrowed-method-receiver-copy-source-transform.d.ts +51 -0
- package/dist/semantics/borrowed-method-receiver-copy-source-transform.js +367 -0
- package/dist/semantics/call-invalidated-narrowing.d.ts +3 -0
- package/dist/semantics/call-invalidated-narrowing.js +715 -0
- package/dist/semantics/callable-origins.d.ts +39 -0
- package/dist/semantics/callable-origins.js +73 -2
- package/dist/semantics/class-alias.d.ts +36 -0
- package/dist/semantics/class-alias.js +64 -14
- package/dist/semantics/class-heritage.d.ts +64 -0
- package/dist/semantics/class-heritage.js +278 -2
- package/dist/semantics/commonjs-wrapper.d.ts +1 -1
- package/dist/semantics/commonjs-wrapper.js +24 -7
- package/dist/semantics/constructor-function-class-source-transform.d.ts +4 -0
- package/dist/semantics/constructor-function-class-source-transform.js +327 -0
- package/dist/semantics/constructor-slot-subclasses.js +163 -4
- package/dist/semantics/declaration-overlay-transform.js +197 -3
- package/dist/semantics/frontend.d.ts +31 -0
- package/dist/semantics/frontend.js +212 -26
- package/dist/semantics/host-methods.d.ts +27 -2
- package/dist/semantics/host-methods.js +57 -4
- package/dist/semantics/host-protocols.d.ts +19 -8
- package/dist/semantics/host-protocols.js +145 -31
- package/dist/semantics/interface-families.d.ts +51 -2
- package/dist/semantics/interface-families.js +609 -23
- package/dist/semantics/interface-implementors.d.ts +20 -0
- package/dist/semantics/interface-implementors.js +130 -6
- package/dist/semantics/known-caller-predicate-parameters.d.ts +2 -0
- package/dist/semantics/known-caller-predicate-parameters.js +161 -0
- package/dist/semantics/model/intrinsic-accessor-getters.d.ts +10 -0
- package/dist/semantics/model/intrinsic-accessor-getters.js +4 -0
- package/dist/semantics/model/operands.d.ts +10 -0
- package/dist/semantics/model/operations.d.ts +107 -0
- package/dist/semantics/model/selected-signature.d.ts +33 -0
- package/dist/semantics/model/structural-type-table.d.ts +15 -0
- package/dist/semantics/model/structural-type-table.js +19 -1
- package/dist/semantics/model/structural-types.d.ts +99 -0
- package/dist/semantics/model/structural-types.js +31 -2
- package/dist/semantics/normalize/absent-globals.d.ts +1 -1
- package/dist/semantics/normalize/absent-globals.js +3 -3
- package/dist/semantics/normalize/bivariant-slot-parameter.d.ts +46 -0
- package/dist/semantics/normalize/bivariant-slot-parameter.js +372 -0
- package/dist/semantics/normalize/callback-parameter-contracts.d.ts +2 -0
- package/dist/semantics/normalize/callback-parameter-contracts.js +21 -0
- package/dist/semantics/normalize/census.d.ts +2 -1
- package/dist/semantics/normalize/census.js +25 -2
- package/dist/semantics/normalize/class-instance-record-statement.d.ts +37 -0
- package/dist/semantics/normalize/class-instance-record-statement.js +74 -0
- package/dist/semantics/normalize/collection-bindings.js +242 -5
- package/dist/semantics/normalize/commonjs-require.d.ts +35 -5
- package/dist/semantics/normalize/commonjs-require.js +464 -147
- package/dist/semantics/normalize/dead-event-emissions.d.ts +6 -0
- package/dist/semantics/normalize/dead-event-emissions.js +866 -0
- package/dist/semantics/normalize/dead-method-copies.d.ts +56 -0
- package/dist/semantics/normalize/dead-method-copies.js +239 -0
- package/dist/semantics/normalize/derived-expression-type.d.ts +149 -2
- package/dist/semantics/normalize/derived-expression-type.js +418 -14
- package/dist/semantics/normalize/field-bindings.js +139 -4
- package/dist/semantics/normalize/flow/callable-reach.js +162 -9
- package/dist/semantics/normalize/flow/member-call-forwarding.js +6 -0
- package/dist/semantics/normalize/flow/owned-class-receivers.js +40 -2
- package/dist/semantics/normalize/flow/source-class-data.d.ts +7 -1
- package/dist/semantics/normalize/flow/source-class-data.js +28 -9
- package/dist/semantics/normalize/flow/source-value-session.js +32 -13
- package/dist/semantics/normalize/flow/targets.d.ts +32 -0
- package/dist/semantics/normalize/flow/targets.js +65 -6
- package/dist/semantics/normalize/flow/value-flow.d.ts +7 -0
- package/dist/semantics/normalize/flow/value-flow.js +30 -2
- package/dist/semantics/normalize/fresh-array-result.d.ts +32 -0
- package/dist/semantics/normalize/fresh-array-result.js +125 -0
- package/dist/semantics/normalize/gating.js +2 -0
- package/dist/semantics/normalize/global-host-mutations.d.ts +11 -1
- package/dist/semantics/normalize/global-host-mutations.js +691 -27
- package/dist/semantics/normalize/host-effect-contracts.d.ts +43 -1
- package/dist/semantics/normalize/host-effect-contracts.js +60 -3
- package/dist/semantics/normalize/host-mutation-key-reader.js +35 -10
- package/dist/semantics/normalize/identities.js +64 -3
- package/dist/semantics/normalize/intrinsic-accessor-getter.d.ts +59 -0
- package/dist/semantics/normalize/intrinsic-accessor-getter.js +129 -0
- package/dist/semantics/normalize/local-bindings.js +117 -21
- package/dist/semantics/normalize/merged-declaration.d.ts +41 -0
- package/dist/semantics/normalize/merged-declaration.js +81 -0
- package/dist/semantics/normalize/never-override-result.d.ts +21 -0
- package/dist/semantics/normalize/never-override-result.js +64 -0
- package/dist/semantics/normalize/null-blind-parameter.d.ts +21 -0
- package/dist/semantics/normalize/null-blind-parameter.js +77 -0
- package/dist/semantics/normalize/object-bag-bindings.js +26 -2
- package/dist/semantics/normalize/omitted-stated-parameter.d.ts +1 -1
- package/dist/semantics/normalize/omitted-stated-parameter.js +34 -4
- package/dist/semantics/normalize/override-field-arms.d.ts +33 -0
- package/dist/semantics/normalize/override-field-arms.js +362 -0
- package/dist/semantics/normalize/parameter-bindings.d.ts +64 -1
- package/dist/semantics/normalize/parameter-bindings.js +827 -81
- package/dist/semantics/normalize/parameter-slot.d.ts +1 -0
- package/dist/semantics/normalize/parameter-slot.js +69 -0
- package/dist/semantics/normalize/physical-overload-result.d.ts +45 -0
- package/dist/semantics/normalize/physical-overload-result.js +132 -0
- package/dist/semantics/normalize/producer-context.d.ts +23 -0
- package/dist/semantics/normalize/producers/allocations.d.ts +13 -0
- package/dist/semantics/normalize/producers/allocations.js +8 -15
- package/dist/semantics/normalize/producers/binding-kind.d.ts +11 -0
- package/dist/semantics/normalize/producers/binding-kind.js +31 -0
- package/dist/semantics/normalize/producers/bindings.js +16 -1
- package/dist/semantics/normalize/producers/boundary.js +21 -1
- package/dist/semantics/normalize/producers/class-lifecycle.js +23 -14
- package/dist/semantics/normalize/producers/computations.js +8 -67
- package/dist/semantics/normalize/producers/control-loops.d.ts +1 -1
- package/dist/semantics/normalize/producers/control-loops.js +25 -1
- package/dist/semantics/normalize/producers/control.js +87 -60
- package/dist/semantics/normalize/producers/declaration-lifecycle.js +5 -0
- package/dist/semantics/normalize/producers/enums.d.ts +10 -0
- package/dist/semantics/normalize/producers/enums.js +169 -0
- package/dist/semantics/normalize/producers/erasure.d.ts +10 -0
- package/dist/semantics/normalize/producers/erasure.js +23 -0
- package/dist/semantics/normalize/producers/intrinsic-accessor-getter.d.ts +15 -0
- package/dist/semantics/normalize/producers/intrinsic-accessor-getter.js +33 -0
- package/dist/semantics/normalize/producers/invocations.js +255 -18
- package/dist/semantics/normalize/producers/iteration-yield.js +6 -1
- package/dist/semantics/normalize/producers/logical-merge-type.d.ts +36 -0
- package/dist/semantics/normalize/producers/logical-merge-type.js +163 -0
- package/dist/semantics/normalize/producers/properties.js +207 -18
- package/dist/semantics/normalize/producers/protocol.d.ts +4 -0
- package/dist/semantics/normalize/producers/protocol.js +147 -12
- package/dist/semantics/normalize/producers/references.js +50 -9
- package/dist/semantics/normalize/producers/shared.d.ts +120 -0
- package/dist/semantics/normalize/producers/shared.js +359 -10
- package/dist/semantics/normalize/producers/spread-arguments.js +85 -4
- package/dist/semantics/normalize/producers/tuple-spread.d.ts +1 -0
- package/dist/semantics/normalize/producers/tuple-spread.js +1 -1
- package/dist/semantics/normalize/property-key-domain.js +6 -0
- package/dist/semantics/normalize/reachability.d.ts +7 -0
- package/dist/semantics/normalize/reachability.js +166 -9
- package/dist/semantics/normalize/record-home-arms.d.ts +25 -0
- package/dist/semantics/normalize/record-home-arms.js +87 -0
- package/dist/semantics/normalize/record-link-families.d.ts +74 -0
- package/dist/semantics/normalize/record-link-families.js +327 -0
- package/dist/semantics/normalize/record-stand-in-arms.d.ts +56 -0
- package/dist/semantics/normalize/record-stand-in-arms.js +484 -0
- package/dist/semantics/normalize/return-bindings.d.ts +6 -2
- package/dist/semantics/normalize/return-bindings.js +60 -7
- package/dist/semantics/normalize/script-global-redefinition.js +5 -0
- package/dist/semantics/normalize/shared-array-storage.d.ts +42 -0
- package/dist/semantics/normalize/shared-array-storage.js +373 -0
- package/dist/semantics/normalize/sloppy-absence.d.ts +41 -0
- package/dist/semantics/normalize/sloppy-absence.js +199 -0
- package/dist/semantics/normalize/specialization.d.ts +40 -0
- package/dist/semantics/normalize/specialization.js +770 -36
- package/dist/semantics/normalize/structural-array-element.js +196 -6
- package/dist/semantics/normalize/structural-array-read.js +12 -0
- package/dist/semantics/normalize/structural-creation-order.d.ts +15 -0
- package/dist/semantics/normalize/structural-creation-order.js +51 -48
- package/dist/semantics/normalize/structural-declarations.d.ts +16 -0
- package/dist/semantics/normalize/structural-declarations.js +43 -0
- package/dist/semantics/normalize/structural-generics.d.ts +13 -0
- package/dist/semantics/normalize/structural-generics.js +22 -0
- package/dist/semantics/normalize/structural-indexed-access.js +16 -0
- package/dist/semantics/normalize/structural-instantiated-member.js +68 -2
- package/dist/semantics/normalize/structural-joins.js +2 -0
- package/dist/semantics/normalize/structural-layout-relevance.d.ts +30 -0
- package/dist/semantics/normalize/structural-layout-relevance.js +164 -0
- package/dist/semantics/normalize/structural-layout-type.js +270 -14
- package/dist/semantics/normalize/structural-leaves.d.ts +1 -1
- package/dist/semantics/normalize/structural-leaves.js +17 -3
- package/dist/semantics/normalize/structural-mutable-method.js +5 -1
- package/dist/semantics/normalize/structural-parts.d.ts +18 -5
- package/dist/semantics/normalize/structural-parts.js +68 -19
- package/dist/semantics/normalize/structural-receiver.d.ts +1 -1
- package/dist/semantics/normalize/structural-receiver.js +23 -1
- package/dist/semantics/normalize/structural-self-reference.d.ts +1 -1
- package/dist/semantics/normalize/structural-self-reference.js +23 -2
- package/dist/semantics/normalize/structural.d.ts +12 -1
- package/dist/semantics/normalize/structural.js +1437 -53
- package/dist/semantics/normalize/suppressed-write-arms.d.ts +47 -0
- package/dist/semantics/normalize/suppressed-write-arms.js +393 -0
- package/dist/semantics/normalize/unresolvable-names.d.ts +15 -2
- package/dist/semantics/normalize/unresolvable-names.js +30 -6
- package/dist/semantics/normalize/unshared-array-result.d.ts +32 -0
- package/dist/semantics/normalize/unshared-array-result.js +125 -0
- package/dist/semantics/package-sources.d.ts +1 -1
- package/dist/semantics/package-sources.js +120 -8
- package/dist/semantics/program.d.ts +20 -0
- package/dist/semantics/program.js +179 -26
- package/dist/semantics/shared-declaration-files.d.ts +44 -0
- package/dist/semantics/shared-declaration-files.js +42 -0
- package/dist/semantics/stable-checker.d.ts +1 -1
- package/dist/semantics/stable-checker.js +7 -2
- package/dist/semantics/subclass-member-overlay-transform.js +95 -53
- package/dist/semantics/unchecked-guard-argument-copies.d.ts +67 -0
- package/dist/semantics/unchecked-guard-argument-copies.js +163 -0
- package/dist/semantics/unchecked-write-member-declarations.d.ts +46 -0
- package/dist/semantics/unchecked-write-member-declarations.js +331 -0
- package/dist/targets/cpp/balanced-units.d.ts +31 -0
- package/dist/targets/cpp/balanced-units.js +57 -0
- package/dist/targets/cpp/borrowed-arm-projections.d.ts +31 -0
- package/dist/targets/cpp/borrowed-arm-projections.js +106 -0
- package/dist/targets/cpp/borrowed-call-entry.d.ts +1 -1
- package/dist/targets/cpp/borrowed-call-entry.js +24 -20
- package/dist/targets/cpp/captures.js +314 -8
- package/dist/targets/cpp/char-code-buffers.d.ts +36 -0
- package/dist/targets/cpp/char-code-buffers.js +214 -0
- package/dist/targets/cpp/class-layout.d.ts +7 -1
- package/dist/targets/cpp/class-layout.js +42 -17
- package/dist/targets/cpp/class-properties/computed-method-value.d.ts +17 -2
- package/dist/targets/cpp/class-properties/computed-method-value.js +50 -4
- package/dist/targets/cpp/class-properties/emit-class-properties.d.ts +31 -1
- package/dist/targets/cpp/class-properties/emit-class-properties.js +174 -17
- package/dist/targets/cpp/class-ref-transport.d.ts +32 -0
- package/dist/targets/cpp/class-ref-transport.js +56 -1
- package/dist/targets/cpp/conversions.js +1827 -1502
- package/dist/targets/cpp/coroutine-bodies.d.ts +97 -0
- package/dist/targets/cpp/coroutine-bodies.js +187 -0
- package/dist/targets/cpp/document.js +11 -1
- package/dist/targets/cpp/emit-allocation.js +568 -21
- package/dist/targets/cpp/emit-arrays.d.ts +10 -0
- package/dist/targets/cpp/emit-arrays.js +147 -16
- package/dist/targets/cpp/emit-binding-reference.d.ts +26 -2
- package/dist/targets/cpp/emit-binding-reference.js +97 -5
- package/dist/targets/cpp/emit-bindings.d.ts +9 -1
- package/dist/targets/cpp/emit-bindings.js +108 -8
- package/dist/targets/cpp/emit-buffers.d.ts +2 -16
- package/dist/targets/cpp/emit-buffers.js +124 -25
- package/dist/targets/cpp/emit-callable.d.ts +35 -72
- package/dist/targets/cpp/emit-callable.js +647 -82
- package/dist/targets/cpp/emit-carrier-members.d.ts +13 -2
- package/dist/targets/cpp/emit-carrier-members.js +50 -9
- package/dist/targets/cpp/emit-constructor-identity-family.d.ts +20 -0
- package/dist/targets/cpp/emit-constructor-identity-family.js +45 -0
- package/dist/targets/cpp/emit-context.d.ts +329 -15
- package/dist/targets/cpp/emit-context.js +104 -13
- package/dist/targets/cpp/emit-dynamic-properties.d.ts +44 -0
- package/dist/targets/cpp/emit-dynamic-properties.js +256 -37
- package/dist/targets/cpp/emit-equality.js +117 -2
- package/dist/targets/cpp/emit-error-constructor.d.ts +19 -0
- package/dist/targets/cpp/emit-error-constructor.js +73 -0
- package/dist/targets/cpp/emit-exceptions.d.ts +25 -3
- package/dist/targets/cpp/emit-exceptions.js +215 -26
- package/dist/targets/cpp/emit-in.js +52 -5
- package/dist/targets/cpp/emit-instanceof.js +59 -11
- package/dist/targets/cpp/emit-integers.d.ts +6 -0
- package/dist/targets/cpp/emit-integers.js +10 -0
- package/dist/targets/cpp/emit-iterable-object-view.d.ts +15 -0
- package/dist/targets/cpp/emit-iterable-object-view.js +51 -0
- package/dist/targets/cpp/emit-iterator-object-view.d.ts +15 -0
- package/dist/targets/cpp/emit-iterator-object-view.js +125 -0
- package/dist/targets/cpp/emit-iterator.d.ts +7 -10
- package/dist/targets/cpp/emit-iterator.js +361 -24
- package/dist/targets/cpp/emit-json.d.ts +7 -1
- package/dist/targets/cpp/emit-json.js +595 -55
- package/dist/targets/cpp/emit-jsx.d.ts +0 -37
- package/dist/targets/cpp/emit-jsx.js +70 -8
- package/dist/targets/cpp/emit-narrowing.d.ts +192 -28
- package/dist/targets/cpp/emit-narrowing.js +1595 -120
- package/dist/targets/cpp/emit-native-selection.js +8 -2
- package/dist/targets/cpp/emit-presence.js +13 -0
- package/dist/targets/cpp/emit-properties.d.ts +3 -1
- package/dist/targets/cpp/emit-properties.js +303 -54
- package/dist/targets/cpp/emit-protocol-iterator.d.ts +14 -0
- package/dist/targets/cpp/emit-protocol-iterator.js +203 -0
- package/dist/targets/cpp/emit-proxy.d.ts +17 -0
- package/dist/targets/cpp/emit-proxy.js +35 -0
- package/dist/targets/cpp/emit-record-view.d.ts +12 -1
- package/dist/targets/cpp/emit-record-view.js +429 -18
- package/dist/targets/cpp/emit-return.d.ts +38 -0
- package/dist/targets/cpp/emit-return.js +143 -21
- package/dist/targets/cpp/emit-scopes.d.ts +78 -0
- package/dist/targets/cpp/emit-scopes.js +196 -0
- package/dist/targets/cpp/emit-sum-widening.js +6 -3
- package/dist/targets/cpp/emit-tonumber.d.ts +40 -1
- package/dist/targets/cpp/emit-tonumber.js +75 -4
- package/dist/targets/cpp/emit-tostring.d.ts +28 -2
- package/dist/targets/cpp/emit-tostring.js +115 -12
- package/dist/targets/cpp/emit-typeof.js +2 -2
- package/dist/targets/cpp/emit-union-properties.d.ts +9 -0
- package/dist/targets/cpp/emit-union-properties.js +391 -49
- package/dist/targets/cpp/emit.d.ts +3 -1
- package/dist/targets/cpp/emit.js +725 -90
- package/dist/targets/cpp/evaluated-once.d.ts +51 -0
- package/dist/targets/cpp/evaluated-once.js +140 -0
- package/dist/targets/cpp/host/core-globals.d.ts +0 -21
- package/dist/targets/cpp/host/core-globals.js +10 -2
- package/dist/targets/cpp/host/emit-host-invoke.d.ts +0 -10
- package/dist/targets/cpp/host/emit-host-invoke.js +454 -36
- package/dist/targets/cpp/host/emit-host-object.js +733 -88
- package/dist/targets/cpp/host/emit-host-properties.js +26 -2
- package/dist/targets/cpp/host/emit-host-reflect.d.ts +1 -0
- package/dist/targets/cpp/host/emit-host-reflect.js +26 -7
- package/dist/targets/cpp/host/emit-host-value.d.ts +13 -0
- package/dist/targets/cpp/host/emit-host-value.js +47 -3
- package/dist/targets/cpp/host/host-members.d.ts +11 -0
- package/dist/targets/cpp/host/host-members.js +50 -4
- package/dist/targets/cpp/host/native-protocols.js +3 -0
- package/dist/targets/cpp/host/object-protocol.d.ts +8 -0
- package/dist/targets/cpp/host/object-protocol.js +55 -13
- package/dist/targets/cpp/key-order-tracking.d.ts +11 -0
- package/dist/targets/cpp/key-order-tracking.js +18 -0
- package/dist/targets/cpp/manifest/capabilities.js +117 -9
- package/dist/targets/cpp/manifest.js +14 -0
- package/dist/targets/cpp/native-collection-base.d.ts +27 -0
- package/dist/targets/cpp/native-collection-base.js +202 -0
- package/dist/targets/cpp/native-error-base.d.ts +14 -0
- package/dist/targets/cpp/native-error-base.js +19 -4
- package/dist/targets/cpp/native-promise-base.d.ts +23 -0
- package/dist/targets/cpp/native-promise-base.js +30 -0
- package/dist/targets/cpp/native-symbol-keys.js +1 -1
- package/dist/targets/cpp/prototype/emit-prototype-array.js +258 -20
- package/dist/targets/cpp/prototype/emit-prototype-date.js +5 -4
- package/dist/targets/cpp/prototype/emit-prototype-invoke.d.ts +9 -1
- package/dist/targets/cpp/prototype/emit-prototype-invoke.js +232 -26
- package/dist/targets/cpp/prototype/emit-prototype-iterator.d.ts +1 -1
- package/dist/targets/cpp/prototype/emit-prototype-iterator.js +111 -13
- package/dist/targets/cpp/prototype/emit-prototype-promise.d.ts +33 -4
- package/dist/targets/cpp/prototype/emit-prototype-promise.js +218 -10
- package/dist/targets/cpp/prototype/emit-prototype-regexp.js +8 -5
- package/dist/targets/cpp/prototype/emit-prototype-string.js +24 -7
- package/dist/targets/cpp/prototype/prototype-method-reads.js +18 -3
- package/dist/targets/cpp/reactive-dependencies.d.ts +2 -0
- package/dist/targets/cpp/reactive-dependencies.js +94 -3
- package/dist/targets/cpp/realm-storage.d.ts +5 -0
- package/dist/targets/cpp/realm-storage.js +12 -0
- package/dist/targets/cpp/records.d.ts +151 -1
- package/dist/targets/cpp/records.js +1328 -122
- package/dist/targets/cpp/recursive-containers.d.ts +4 -1
- package/dist/targets/cpp/recursive-containers.js +28 -9
- package/dist/targets/cpp/translation-unit.d.ts +10 -0
- package/dist/targets/cpp/translation-unit.js +686 -140
- package/dist/targets/cpp/types.d.ts +56 -6
- package/dist/targets/cpp/types.js +218 -12
- package/dist/targets/cpp/virtual-methods.d.ts +3 -3
- package/dist/targets/cpp/virtual-methods.js +174 -17
- package/package.json +14 -13
- package/src/targets/cpp/runtime/gea_dynamic_proxy.h +155 -25
- package/src/targets/cpp/runtime/gea_eval.h +3 -0
- package/src/targets/cpp/runtime/gea_pcm.h +116 -0
- package/src/targets/cpp/runtime/gea_runtime.h +18159 -4887
- package/src/targets/cpp/runtime/gea_runtime_builtins.cpp +7 -45
- 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
|
-
|
|
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
|
|
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
|
-
*
|
|
1295
|
-
*
|
|
1296
|
-
*
|
|
1297
|
-
*
|
|
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:
|
|
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?:
|
|
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
|
|
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);
|