@geastack/compiler 1.0.36 → 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.
- package/dist/cli-emit.js +5 -0
- package/dist/cli.js +10 -0
- package/dist/compiler.d.ts +10 -3
- package/dist/compiler.js +364 -224
- package/dist/conversion/build.d.ts +13 -1
- package/dist/conversion/build.js +336 -141
- package/dist/conversion/graph-validation.d.ts +7 -2
- package/dist/conversion/graph-validation.js +36 -22
- package/dist/conversion/native-sum.js +106 -17
- package/dist/diagnostics/sweep.js +1 -1
- package/dist/ir/callable-class-flow.d.ts +0 -11
- package/dist/ir/callable-class-flow.js +970 -169
- package/dist/ir/certificate.d.ts +1 -1
- package/dist/ir/certificate.js +12 -1
- package/dist/ir/certify/carrier-keys.d.ts +17 -1
- package/dist/ir/certify/carrier-keys.js +35 -2
- package/dist/ir/certify/function-source.js +2 -1
- package/dist/ir/certify/has-property-key.d.ts +6 -0
- package/dist/ir/certify/has-property-key.js +8 -1
- package/dist/ir/certify/property-access-keys.js +2 -1
- package/dist/ir/certify/runtime-helper.js +2 -1
- package/dist/ir/construction-only-fields.d.ts +35 -2
- package/dist/ir/construction-only-fields.js +100 -0
- package/dist/ir/emission-representations.d.ts +2 -2
- package/dist/ir/emission-representations.js +9 -3
- package/dist/ir/generic-call-entry.d.ts +3 -1
- package/dist/ir/logical-receivers.js +29 -1
- package/dist/ir/lower-completion.js +11 -6
- package/dist/ir/lower-destructuring.js +3 -2
- package/dist/ir/native-host-method-reads.d.ts +5 -0
- package/dist/ir/native-host-method-reads.js +30 -21
- package/dist/ir/operation-conversions.js +4 -1
- package/dist/ir/publish-conversion-recipes.js +12 -1
- package/dist/plugins/apple/jsx.js +1 -1
- package/dist/plugins/gea/component-classes.js +1 -1
- package/dist/plugins/gea/component-inline.js +1 -1
- package/dist/plugins/gea/contract.d.ts +1 -1
- package/dist/plugins/gea/contract.js +1 -1
- package/dist/plugins/gea/host.js +27 -1
- package/dist/plugins/gea/lower.js +8 -1
- package/dist/plugins/gea/producer.js +1 -1
- package/dist/plugins/gea/reactive-slots.d.ts +1 -1
- package/dist/plugins/gea/reactive-slots.js +1 -1
- package/dist/plugins/load.js +51 -22
- package/dist/preflight/run.d.ts +12 -1
- package/dist/preflight/run.js +65 -29
- package/dist/projection/native-callable-data.js +2 -1
- package/dist/representation/plan.js +102 -4
- package/dist/semantics/alias-this-field-declaration-transform.js +1 -1
- package/dist/semantics/ambient-type-realization-transform.js +1 -1
- package/dist/semantics/ambient.d.ts +1 -1
- package/dist/semantics/ambient.js +1 -1
- package/dist/semantics/borrowed-builtin-call-bind-source-transform.js +1 -1
- package/dist/semantics/borrowed-method-receiver-copy-source-transform.js +1 -1
- package/dist/semantics/call-invalidated-narrowing.d.ts +1 -1
- package/dist/semantics/call-invalidated-narrowing.js +4 -2
- package/dist/semantics/callable-own-data-slots.d.ts +6 -0
- package/dist/semantics/callable-own-data-slots.js +177 -101
- package/dist/semantics/class-alias.d.ts +1 -1
- package/dist/semantics/class-alias.js +1 -1
- package/dist/semantics/class-heritage.d.ts +1 -1
- package/dist/semantics/class-heritage.js +1 -1
- package/dist/semantics/commonjs-wrapper.d.ts +4 -3
- package/dist/semantics/commonjs-wrapper.js +50 -7
- package/dist/semantics/constructor-function-class-source-transform.js +1 -1
- package/dist/semantics/constructor-slot-subclasses.d.ts +1 -1
- package/dist/semantics/constructor-slot-subclasses.js +1 -1
- package/dist/semantics/declaration-overlay-transform.js +3 -2
- package/dist/semantics/declared-integers.d.ts +1 -1
- package/dist/semantics/declared-integers.js +1 -1
- package/dist/semantics/define-property-source-transform.js +1 -1
- package/dist/semantics/diagnostic-source-preparation.d.ts +1 -1
- package/dist/semantics/documentation-ranges.d.ts +1 -1
- package/dist/semantics/documentation-ranges.js +1 -1
- package/dist/semantics/dynamic-fallback.d.ts +1 -1
- package/dist/semantics/dynamic-fallback.js +1 -1
- package/dist/semantics/frontend-timing.js +19 -0
- package/dist/semantics/frontend.d.ts +2 -2
- package/dist/semantics/frontend.js +127 -54
- package/dist/semantics/host-declaration-provenance.d.ts +1 -1
- package/dist/semantics/host-methods.d.ts +1 -1
- package/dist/semantics/host-methods.js +1 -1
- package/dist/semantics/host-protocols.d.ts +1 -1
- package/dist/semantics/host-protocols.js +1 -1
- package/dist/semantics/inherited-accessor.d.ts +1 -1
- package/dist/semantics/inherited-accessor.js +1 -1
- package/dist/semantics/interface-families.d.ts +1 -1
- package/dist/semantics/interface-families.js +1 -1
- package/dist/semantics/interface-implementors.d.ts +1 -1
- package/dist/semantics/interface-implementors.js +1 -1
- package/dist/semantics/jsdoc-namepath-transform.js +1 -1
- package/dist/semantics/jsx-runtime-provider.d.ts +1 -1
- package/dist/semantics/jsx-runtime-provider.js +1 -1
- package/dist/semantics/known-caller-predicate-parameters.d.ts +1 -1
- package/dist/semantics/known-caller-predicate-parameters.js +1 -1
- package/dist/semantics/model/edges.d.ts +124 -0
- package/dist/semantics/model/edges.js +192 -0
- package/dist/semantics/model/graph.d.ts +26 -2
- package/dist/semantics/model/graph.js +54 -0
- package/dist/semantics/model/sealed-facts.d.ts +19 -0
- package/dist/semantics/model/sealed-facts.js +221 -0
- package/dist/semantics/model/selected-signature.d.ts +1 -1
- package/dist/semantics/model/selected-signature.js +1 -1
- package/dist/semantics/module-resolution.d.ts +1 -1
- package/dist/semantics/module-resolution.js +1 -1
- package/dist/semantics/native-function-signatures.d.ts +1 -1
- package/dist/semantics/native-function-signatures.js +1 -1
- package/dist/semantics/native-object-data-slots.js +20 -4
- package/dist/semantics/new-callee-class-tag-source-transform.js +1 -1
- package/dist/semantics/node-project.d.ts +1 -1
- package/dist/semantics/node-project.js +1 -1
- package/dist/semantics/node-source-hooks.js +1 -1
- package/dist/semantics/normalize/absent-globals.d.ts +1 -1
- package/dist/semantics/normalize/absent-globals.js +1 -1
- package/dist/semantics/normalize/any-cast-member-call.d.ts +1 -1
- package/dist/semantics/normalize/any-cast-member-call.js +1 -1
- package/dist/semantics/normalize/arguments-objects.d.ts +1 -1
- package/dist/semantics/normalize/arguments-objects.js +1 -1
- package/dist/semantics/normalize/asserted-argument-arms.d.ts +1 -1
- package/dist/semantics/normalize/asserted-argument-arms.js +1 -1
- package/dist/semantics/normalize/asserted-arm-absence.d.ts +1 -1
- package/dist/semantics/normalize/asserted-arm-absence.js +1 -1
- package/dist/semantics/normalize/assignment-patterns.d.ts +1 -1
- package/dist/semantics/normalize/assignment-patterns.js +1 -1
- package/dist/semantics/normalize/bag-absence.d.ts +1 -1
- package/dist/semantics/normalize/bag-absence.js +1 -1
- package/dist/semantics/normalize/binding-fixpoint.js +9 -2
- package/dist/semantics/normalize/bivariant-slot-parameter.d.ts +1 -1
- package/dist/semantics/normalize/bivariant-slot-parameter.js +1 -1
- package/dist/semantics/normalize/callable-data-write.d.ts +1 -1
- package/dist/semantics/normalize/callable-data-write.js +1 -1
- package/dist/semantics/normalize/callback-parameter-contracts.d.ts +1 -1
- package/dist/semantics/normalize/callback-parameter-contracts.js +1 -1
- package/dist/semantics/normalize/cells/agreement.d.ts +18 -1
- package/dist/semantics/normalize/cells/agreement.js +8 -0
- package/dist/semantics/normalize/cells/candidates.d.ts +1 -1
- package/dist/semantics/normalize/cells/candidates.js +1 -1
- package/dist/semantics/normalize/cells/facts.d.ts +1 -1
- package/dist/semantics/normalize/cells/facts.js +1 -1
- package/dist/semantics/normalize/cells/index.d.ts +2 -2
- package/dist/semantics/normalize/cells/index.js +1 -1
- package/dist/semantics/normalize/cells/model.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/bag.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/collection.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/collection.js +1 -1
- package/dist/semantics/normalize/cells/policies/field.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/field.js +1 -1
- package/dist/semantics/normalize/cells/policies/index.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/local.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/local.js +1 -1
- package/dist/semantics/normalize/cells/policies/parameter.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/parameter.js +1 -1
- package/dist/semantics/normalize/cells/policies/return.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/return.js +1 -1
- package/dist/semantics/normalize/cells/policies/shared.d.ts +1 -1
- package/dist/semantics/normalize/cells/policy.d.ts +1 -1
- package/dist/semantics/normalize/census.d.ts +1 -1
- package/dist/semantics/normalize/census.js +45 -12
- package/dist/semantics/normalize/class-instance-record-statement.d.ts +1 -1
- package/dist/semantics/normalize/class-instance-record-statement.js +1 -1
- package/dist/semantics/normalize/collection-bindings.d.ts +1 -1
- package/dist/semantics/normalize/collection-bindings.js +1 -1
- package/dist/semantics/normalize/commonjs-module-record.d.ts +1 -1
- package/dist/semantics/normalize/commonjs-module-record.js +1 -1
- package/dist/semantics/normalize/commonjs-require.d.ts +1 -1
- package/dist/semantics/normalize/commonjs-require.js +1 -1
- package/dist/semantics/normalize/contribution.d.ts +4 -3
- package/dist/semantics/normalize/contribution.js +145 -42
- package/dist/semantics/normalize/dead-event-emissions.d.ts +1 -1
- package/dist/semantics/normalize/dead-event-emissions.js +1 -1
- package/dist/semantics/normalize/dead-method-copies.d.ts +1 -1
- package/dist/semantics/normalize/dead-method-copies.js +1 -1
- package/dist/semantics/normalize/dead-typeof-guards.d.ts +1 -1
- package/dist/semantics/normalize/dead-typeof-guards.js +1 -1
- package/dist/semantics/normalize/deferred-intrinsic-protocols.d.ts +1 -1
- package/dist/semantics/normalize/deferred-intrinsic-protocols.js +1 -1
- package/dist/semantics/normalize/derived-expression-type.d.ts +1 -1
- package/dist/semantics/normalize/derived-expression-type.js +4 -4
- package/dist/semantics/normalize/evaluation-order.d.ts +1 -1
- package/dist/semantics/normalize/evaluation-order.js +1 -1
- package/dist/semantics/normalize/field-bindings.d.ts +1 -1
- package/dist/semantics/normalize/field-bindings.js +4 -3
- package/dist/semantics/normalize/flow/array-element-continuation.d.ts +1 -1
- package/dist/semantics/normalize/flow/array-element-continuation.js +3 -3
- package/dist/semantics/normalize/flow/callable-array-origins.d.ts +1 -1
- package/dist/semantics/normalize/flow/callable-array-origins.js +1 -1
- package/dist/semantics/normalize/flow/callable-completions.d.ts +1 -1
- package/dist/semantics/normalize/flow/callable-completions.js +1 -1
- package/dist/semantics/normalize/flow/callable-reach.d.ts +1 -1
- package/dist/semantics/normalize/flow/callable-reach.js +73 -52
- package/dist/semantics/normalize/flow/class-family-member-read.d.ts +1 -1
- package/dist/semantics/normalize/flow/class-family-member-read.js +3 -3
- package/dist/semantics/normalize/flow/collection-value-continuation.d.ts +1 -1
- package/dist/semantics/normalize/flow/collection-value-continuation.js +1 -1
- package/dist/semantics/normalize/flow/component-solver.d.ts +181 -3
- package/dist/semantics/normalize/flow/component-solver.js +705 -164
- package/dist/semantics/normalize/flow/computed-key-set.d.ts +1 -1
- package/dist/semantics/normalize/flow/computed-key-set.js +1 -1
- package/dist/semantics/normalize/flow/export-importers.d.ts +1 -1
- package/dist/semantics/normalize/flow/export-importers.js +13 -3
- package/dist/semantics/normalize/flow/host-text-sink.d.ts +1 -1
- package/dist/semantics/normalize/flow/host-text-sink.js +1 -1
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.d.ts +1 -1
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.js +1 -1
- package/dist/semantics/normalize/flow/intrinsic-data-definition.d.ts +1 -1
- package/dist/semantics/normalize/flow/intrinsic-data-definition.js +1 -1
- package/dist/semantics/normalize/flow/invocation-facts.d.ts +1 -1
- package/dist/semantics/normalize/flow/invocation-facts.js +1 -1
- package/dist/semantics/normalize/flow/member-call-forwarding.d.ts +1 -1
- package/dist/semantics/normalize/flow/member-call-forwarding.js +1 -1
- package/dist/semantics/normalize/flow/model.d.ts +1 -1
- package/dist/semantics/normalize/flow/model.js +5 -1
- package/dist/semantics/normalize/flow/native-collection-protocol.d.ts +1 -1
- package/dist/semantics/normalize/flow/native-collection-protocol.js +1 -1
- package/dist/semantics/normalize/flow/node-path-token.d.ts +1 -1
- package/dist/semantics/normalize/flow/object-binding-continuation.d.ts +1 -1
- package/dist/semantics/normalize/flow/object-binding-continuation.js +1 -1
- package/dist/semantics/normalize/flow/origin-authority.d.ts +1 -1
- package/dist/semantics/normalize/flow/owned-class-receivers.d.ts +1 -1
- package/dist/semantics/normalize/flow/owned-class-receivers.js +1 -1
- package/dist/semantics/normalize/flow/parameter-values.d.ts +1 -1
- package/dist/semantics/normalize/flow/parameter-values.js +1 -1
- package/dist/semantics/normalize/flow/record-alias-closure.d.ts +1 -1
- package/dist/semantics/normalize/flow/record-alias-closure.js +1 -1
- package/dist/semantics/normalize/flow/seeded-origins.d.ts +1 -1
- package/dist/semantics/normalize/flow/seeded-origins.js +1 -1
- package/dist/semantics/normalize/flow/source-accessor-descriptor.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-accessor-descriptor.js +1 -1
- package/dist/semantics/normalize/flow/source-callable-own-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-callable-own-data.js +1 -1
- package/dist/semantics/normalize/flow/source-callable-readonly-set.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-callable-readonly-set.js +1 -1
- package/dist/semantics/normalize/flow/source-class-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-class-data.js +1 -1
- package/dist/semantics/normalize/flow/source-class-instanceof.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-class-instanceof.js +1 -1
- package/dist/semantics/normalize/flow/source-class-static-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-class-static-data.js +1 -1
- package/dist/semantics/normalize/flow/source-commonjs-exports.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-construction-frames.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-construction-frames.js +1 -1
- package/dist/semantics/normalize/flow/source-descriptor-protocol.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-descriptor-protocol.js +1 -1
- package/dist/semantics/normalize/flow/source-executing-parameter-values.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-executing-parameter-values.js +1 -1
- package/dist/semantics/normalize/flow/source-global-binding.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-global-binding.js +1 -1
- package/dist/semantics/normalize/flow/source-intrinsic-member-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-intrinsic-member-data.js +1 -1
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.js +24 -32
- package/dist/semantics/normalize/flow/source-invocation-receiver.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-invocation-receiver.js +1 -1
- package/dist/semantics/normalize/flow/source-native-class-alias.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-native-class-alias.js +1 -1
- package/dist/semantics/normalize/flow/source-native-iterable-integrity.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-native-iterable-integrity.js +1 -1
- package/dist/semantics/normalize/flow/source-native-origin.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-native-origin.js +1 -1
- package/dist/semantics/normalize/flow/source-normal-predecessor.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-normal-predecessor.js +1 -1
- package/dist/semantics/normalize/flow/source-property-key.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-property-key.js +1 -1
- package/dist/semantics/normalize/flow/source-prototype-method-identity.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-prototype-method-identity.js +1 -1
- package/dist/semantics/normalize/flow/source-proxy-operation.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-proxy-operation.js +1 -1
- package/dist/semantics/normalize/flow/source-raw-constructor-entry.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-raw-constructor-entry.js +1 -1
- package/dist/semantics/normalize/flow/source-read-protocol.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-read-protocol.js +1 -1
- package/dist/semantics/normalize/flow/source-record-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-record-data.js +1 -1
- package/dist/semantics/normalize/flow/source-value-session.d.ts +33 -3
- package/dist/semantics/normalize/flow/source-value-session.js +381 -173
- package/dist/semantics/normalize/flow/standard-prototype-method-source.d.ts +1 -1
- package/dist/semantics/normalize/flow/standard-prototype-method-source.js +1 -1
- package/dist/semantics/normalize/flow/targets.d.ts +1 -1
- package/dist/semantics/normalize/flow/targets.js +1 -1
- package/dist/semantics/normalize/flow/value-flow.d.ts +1 -1
- package/dist/semantics/normalize/flow/value-flow.js +243 -52
- package/dist/semantics/normalize/flow/value-provenance.d.ts +1 -1
- package/dist/semantics/normalize/flow/value-provenance.js +1 -1
- package/dist/semantics/normalize/fresh-dictionary-storage.d.ts +1 -1
- package/dist/semantics/normalize/fresh-dictionary-storage.js +1 -1
- package/dist/semantics/normalize/fresh-ordinary-object.d.ts +1 -1
- package/dist/semantics/normalize/fresh-ordinary-object.js +1 -1
- package/dist/semantics/normalize/fresh-table-last-use.d.ts +1 -1
- package/dist/semantics/normalize/fresh-table-last-use.js +1 -1
- package/dist/semantics/normalize/gating.d.ts +3 -3
- package/dist/semantics/normalize/gating.js +17 -20
- package/dist/semantics/normalize/generic-function-choice.d.ts +1 -1
- package/dist/semantics/normalize/generic-function-choice.js +1 -1
- package/dist/semantics/normalize/global-host-mutations.d.ts +1 -1
- package/dist/semantics/normalize/global-host-mutations.js +420 -138
- package/dist/semantics/normalize/host-effect-contracts.d.ts +1 -1
- package/dist/semantics/normalize/host-effect-contracts.js +1 -1
- package/dist/semantics/normalize/host-mutation-computed-keys.d.ts +1 -1
- package/dist/semantics/normalize/host-mutation-key-reader.d.ts +1 -1
- package/dist/semantics/normalize/host-mutation-key-reader.js +1 -1
- package/dist/semantics/normalize/identities.d.ts +41 -1
- package/dist/semantics/normalize/identities.js +75 -9
- package/dist/semantics/normalize/implicit-arguments-tuple.d.ts +1 -1
- package/dist/semantics/normalize/implicit-arguments-tuple.js +1 -1
- package/dist/semantics/normalize/implicit-arguments.d.ts +1 -1
- package/dist/semantics/normalize/implicit-arguments.js +1 -1
- package/dist/semantics/normalize/installed-global-properties.d.ts +1 -1
- package/dist/semantics/normalize/installed-global-properties.js +1 -1
- package/dist/semantics/normalize/instantiation.d.ts +1 -1
- package/dist/semantics/normalize/instantiation.js +1 -1
- package/dist/semantics/normalize/intrinsic-accessor-getter.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-accessor-getter.js +1 -1
- package/dist/semantics/normalize/intrinsic-property-call.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-property-call.js +1 -1
- package/dist/semantics/normalize/intrinsic-prototype.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-prototype.js +1 -1
- package/dist/semantics/normalize/intrinsic-return-identity.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-return-identity.js +1 -1
- package/dist/semantics/normalize/intrinsic-static-member.d.ts +1 -1
- package/dist/semantics/normalize/jsdoc-type-names.d.ts +1 -1
- package/dist/semantics/normalize/jsdoc-type-names.js +1 -1
- package/dist/semantics/normalize/local-bindings.d.ts +1 -1
- package/dist/semantics/normalize/local-bindings.js +3 -2
- package/dist/semantics/normalize/logical-object-truthiness.d.ts +1 -1
- package/dist/semantics/normalize/logical-object-truthiness.js +1 -1
- package/dist/semantics/normalize/logical-result-type.d.ts +1 -1
- package/dist/semantics/normalize/logical-result-type.js +1 -1
- package/dist/semantics/normalize/merged-declaration.d.ts +1 -1
- package/dist/semantics/normalize/merged-declaration.js +1 -1
- package/dist/semantics/normalize/namespace-paths.d.ts +1 -1
- package/dist/semantics/normalize/namespace-paths.js +1 -1
- package/dist/semantics/normalize/never-override-result.d.ts +1 -1
- package/dist/semantics/normalize/never-override-result.js +1 -1
- package/dist/semantics/normalize/normalize.d.ts +23 -4
- package/dist/semantics/normalize/normalize.js +125 -15
- package/dist/semantics/normalize/null-blind-parameter.d.ts +1 -1
- package/dist/semantics/normalize/null-blind-parameter.js +1 -1
- package/dist/semantics/normalize/nullable-memo.d.ts +28 -0
- package/dist/semantics/normalize/nullable-memo.js +99 -0
- package/dist/semantics/normalize/object-bag-bindings.d.ts +1 -1
- package/dist/semantics/normalize/object-bag-bindings.js +15 -4
- package/dist/semantics/normalize/omitted-stated-parameter.d.ts +1 -1
- package/dist/semantics/normalize/omitted-stated-parameter.js +1 -1
- package/dist/semantics/normalize/open-type-form.d.ts +1 -1
- package/dist/semantics/normalize/open-type-form.js +1 -1
- package/dist/semantics/normalize/override-field-arms.d.ts +1 -1
- package/dist/semantics/normalize/override-field-arms.js +1 -1
- package/dist/semantics/normalize/parameter-bindings.d.ts +1 -52
- package/dist/semantics/normalize/parameter-bindings.js +105 -10
- package/dist/semantics/normalize/parameter-slot.d.ts +1 -1
- package/dist/semantics/normalize/parameter-slot.js +1 -1
- package/dist/semantics/normalize/physical-overload-result.d.ts +1 -1
- package/dist/semantics/normalize/physical-overload-result.js +1 -1
- package/dist/semantics/normalize/primitive-property-absence.d.ts +1 -1
- package/dist/semantics/normalize/producer-context.d.ts +1 -1
- package/dist/semantics/normalize/producers/allocations.d.ts +1 -1
- package/dist/semantics/normalize/producers/allocations.js +1 -1
- package/dist/semantics/normalize/producers/binding-kind.d.ts +1 -1
- package/dist/semantics/normalize/producers/binding-kind.js +1 -1
- package/dist/semantics/normalize/producers/bindings.d.ts +1 -1
- package/dist/semantics/normalize/producers/bindings.js +1 -1
- package/dist/semantics/normalize/producers/boundary.d.ts +1 -1
- package/dist/semantics/normalize/producers/boundary.js +1 -1
- package/dist/semantics/normalize/producers/cited-value-type.d.ts +1 -1
- package/dist/semantics/normalize/producers/cited-value-type.js +1 -1
- package/dist/semantics/normalize/producers/class-lifecycle.js +1 -1
- package/dist/semantics/normalize/producers/computations.js +1 -1
- package/dist/semantics/normalize/producers/conditional-guard.d.ts +1 -1
- package/dist/semantics/normalize/producers/control-loops.d.ts +1 -1
- package/dist/semantics/normalize/producers/control-loops.js +1 -1
- package/dist/semantics/normalize/producers/control.d.ts +1 -1
- package/dist/semantics/normalize/producers/control.js +1 -1
- package/dist/semantics/normalize/producers/declaration-lifecycle.js +1 -1
- package/dist/semantics/normalize/producers/destructuring.d.ts +1 -1
- package/dist/semantics/normalize/producers/destructuring.js +1 -1
- package/dist/semantics/normalize/producers/dynamic-language.js +1 -1
- package/dist/semantics/normalize/producers/enums.d.ts +1 -1
- package/dist/semantics/normalize/producers/enums.js +1 -1
- package/dist/semantics/normalize/producers/erasure.d.ts +1 -1
- package/dist/semantics/normalize/producers/erasure.js +1 -1
- package/dist/semantics/normalize/producers/exact-arms.d.ts +1 -1
- package/dist/semantics/normalize/producers/exact-arms.js +1 -1
- package/dist/semantics/normalize/producers/intrinsic-accessor-getter.d.ts +1 -1
- package/dist/semantics/normalize/producers/invocations.d.ts +1 -1
- package/dist/semantics/normalize/producers/invocations.js +1 -1
- package/dist/semantics/normalize/producers/iteration-yield.d.ts +1 -1
- package/dist/semantics/normalize/producers/iteration-yield.js +1 -1
- package/dist/semantics/normalize/producers/jsx.js +1 -1
- package/dist/semantics/normalize/producers/logical-merge-type.d.ts +1 -1
- package/dist/semantics/normalize/producers/logical-merge-type.js +1 -1
- package/dist/semantics/normalize/producers/mint.js +88 -5
- package/dist/semantics/normalize/producers/native-callable-readonly-set.d.ts +1 -1
- package/dist/semantics/normalize/producers/native-own-assignment.d.ts +1 -1
- package/dist/semantics/normalize/producers/native-own-assignment.js +1 -1
- package/dist/semantics/normalize/producers/nullish.d.ts +1 -1
- package/dist/semantics/normalize/producers/nullish.js +1 -1
- package/dist/semantics/normalize/producers/object-assignment.d.ts +1 -1
- package/dist/semantics/normalize/producers/object-assignment.js +1 -1
- package/dist/semantics/normalize/producers/object-tag.d.ts +1 -1
- package/dist/semantics/normalize/producers/object-tag.js +1 -1
- package/dist/semantics/normalize/producers/optional-chain.d.ts +1 -1
- package/dist/semantics/normalize/producers/optional-chain.js +1 -1
- package/dist/semantics/normalize/producers/properties.d.ts +1 -1
- package/dist/semantics/normalize/producers/properties.js +1 -1
- package/dist/semantics/normalize/producers/protocol.d.ts +1 -1
- package/dist/semantics/normalize/producers/protocol.js +1 -1
- package/dist/semantics/normalize/producers/references.d.ts +1 -1
- package/dist/semantics/normalize/producers/references.js +1 -1
- package/dist/semantics/normalize/producers/shared.d.ts +1 -1
- package/dist/semantics/normalize/producers/shared.js +1 -1
- package/dist/semantics/normalize/producers/spread-arguments.d.ts +1 -1
- package/dist/semantics/normalize/producers/spread-arguments.js +1 -1
- package/dist/semantics/normalize/producers/tagged-template.d.ts +1 -1
- package/dist/semantics/normalize/producers/tagged-template.js +1 -1
- package/dist/semantics/normalize/producers/tuple-spread.d.ts +1 -1
- package/dist/semantics/normalize/producers/tuple-spread.js +1 -1
- package/dist/semantics/normalize/property-key-domain.d.ts +8 -1
- package/dist/semantics/normalize/property-key-domain.js +74 -47
- package/dist/semantics/normalize/reachability.d.ts +1 -1
- package/dist/semantics/normalize/reachability.js +3 -2
- package/dist/semantics/normalize/reassigned-bindings.d.ts +1 -1
- package/dist/semantics/normalize/record-home-arms.d.ts +1 -1
- package/dist/semantics/normalize/record-home-arms.js +1 -1
- package/dist/semantics/normalize/record-link-families.d.ts +1 -1
- package/dist/semantics/normalize/record-link-families.js +1 -1
- package/dist/semantics/normalize/record-stand-in-arms.d.ts +1 -1
- package/dist/semantics/normalize/record-stand-in-arms.js +1 -1
- package/dist/semantics/normalize/record-storage-families.d.ts +1 -1
- package/dist/semantics/normalize/record-storage-families.js +1 -1
- package/dist/semantics/normalize/return-bindings.d.ts +1 -1
- package/dist/semantics/normalize/return-bindings.js +1 -1
- package/dist/semantics/normalize/return-paths.d.ts +1 -1
- package/dist/semantics/normalize/return-paths.js +1 -1
- package/dist/semantics/normalize/round-tables.d.ts +21 -0
- package/dist/semantics/normalize/round-tables.js +59 -0
- package/dist/semantics/normalize/script-global-redefinition.d.ts +1 -1
- package/dist/semantics/normalize/script-global-redefinition.js +1 -1
- package/dist/semantics/normalize/shared-array-storage.d.ts +1 -1
- package/dist/semantics/normalize/shared-array-storage.js +1 -1
- package/dist/semantics/normalize/sloppy-absence.d.ts +1 -1
- package/dist/semantics/normalize/sloppy-absence.js +1 -1
- package/dist/semantics/normalize/source-native-iterable.d.ts +2 -2
- package/dist/semantics/normalize/source-native-iterable.js +4 -2
- package/dist/semantics/normalize/source-object-prototype-absence.d.ts +1 -1
- package/dist/semantics/normalize/source-object-prototype-absence.js +1 -1
- package/dist/semantics/normalize/specialization.d.ts +1 -1
- package/dist/semantics/normalize/specialization.js +1 -1
- package/dist/semantics/normalize/specialized-source-frames.d.ts +1 -1
- package/dist/semantics/normalize/specialized-source-frames.js +12 -4
- package/dist/semantics/normalize/structural-any-binding-consumer.d.ts +1 -1
- package/dist/semantics/normalize/structural-any-binding-consumer.js +1 -1
- package/dist/semantics/normalize/structural-array-element.d.ts +1 -1
- package/dist/semantics/normalize/structural-array-element.js +1 -1
- package/dist/semantics/normalize/structural-array-read.d.ts +1 -1
- package/dist/semantics/normalize/structural-array-read.js +1 -1
- package/dist/semantics/normalize/structural-callable.d.ts +1 -1
- package/dist/semantics/normalize/structural-callable.js +1 -1
- package/dist/semantics/normalize/structural-creation-order.d.ts +1 -1
- package/dist/semantics/normalize/structural-creation-order.js +1 -1
- package/dist/semantics/normalize/structural-declarations.d.ts +1 -1
- package/dist/semantics/normalize/structural-declarations.js +1 -1
- package/dist/semantics/normalize/structural-declared-body.d.ts +1 -1
- package/dist/semantics/normalize/structural-declared-body.js +1 -1
- package/dist/semantics/normalize/structural-generics.d.ts +1 -1
- package/dist/semantics/normalize/structural-generics.js +1 -1
- package/dist/semantics/normalize/structural-indexed-access.d.ts +1 -1
- package/dist/semantics/normalize/structural-indexed-access.js +1 -1
- package/dist/semantics/normalize/structural-instantiated-member.d.ts +1 -1
- package/dist/semantics/normalize/structural-instantiated-member.js +199 -68
- package/dist/semantics/normalize/structural-joins.d.ts +1 -1
- package/dist/semantics/normalize/structural-layout-relevance.d.ts +1 -1
- package/dist/semantics/normalize/structural-layout-relevance.js +1 -1
- package/dist/semantics/normalize/structural-layout-type.d.ts +1 -1
- package/dist/semantics/normalize/structural-layout-type.js +14 -2
- package/dist/semantics/normalize/structural-leaves.d.ts +1 -1
- package/dist/semantics/normalize/structural-leaves.js +1 -1
- package/dist/semantics/normalize/structural-local-union.d.ts +1 -1
- package/dist/semantics/normalize/structural-local-union.js +21 -16
- package/dist/semantics/normalize/structural-members.d.ts +1 -1
- package/dist/semantics/normalize/structural-members.js +1 -1
- package/dist/semantics/normalize/structural-mutable-field.d.ts +1 -2
- package/dist/semantics/normalize/structural-mutable-field.js +17 -4
- package/dist/semantics/normalize/structural-mutable-method.d.ts +1 -1
- package/dist/semantics/normalize/structural-mutable-method.js +1 -1
- package/dist/semantics/normalize/structural-parts.d.ts +1 -1
- package/dist/semantics/normalize/structural-parts.js +1 -1
- package/dist/semantics/normalize/structural-receiver.d.ts +1 -1
- package/dist/semantics/normalize/structural-receiver.js +1 -1
- package/dist/semantics/normalize/structural-rules.d.ts +4 -4
- package/dist/semantics/normalize/structural-rules.js +30 -12
- package/dist/semantics/normalize/structural-self-reference.d.ts +1 -1
- package/dist/semantics/normalize/structural-self-reference.js +1 -1
- package/dist/semantics/normalize/structural.d.ts +1 -1
- package/dist/semantics/normalize/structural.js +2467 -2239
- package/dist/semantics/normalize/suppressed-write-arms.d.ts +1 -1
- package/dist/semantics/normalize/suppressed-write-arms.js +1 -1
- package/dist/semantics/normalize/symbol-keyed-this-slots.d.ts +1 -1
- package/dist/semantics/normalize/symbol-keyed-this-slots.js +1 -1
- package/dist/semantics/normalize/unreduced-type-form.d.ts +1 -1
- package/dist/semantics/normalize/unreduced-type-form.js +1 -1
- package/dist/semantics/normalize/unresolvable-names.d.ts +1 -1
- package/dist/semantics/normalize/unresolvable-names.js +1 -1
- package/dist/semantics/normalize/unshared-array-result.d.ts +1 -1
- package/dist/semantics/normalize/unshared-array-result.js +1 -1
- package/dist/semantics/package-sources.d.ts +1 -1
- package/dist/semantics/package-sources.js +1 -1
- package/dist/semantics/program.d.ts +1 -1
- package/dist/semantics/program.js +11 -5
- package/dist/semantics/prototype-install-source-transform.js +1 -1
- package/dist/semantics/prototype-object-class-source-transform.js +1 -1
- package/dist/semantics/prototype-reparenting.d.ts +1 -1
- package/dist/semantics/prototype-reparenting.js +1 -1
- package/dist/semantics/shared-declaration-files.d.ts +1 -1
- package/dist/semantics/source-transform-exports.js +1 -1
- package/dist/semantics/stable-checker.d.ts +9 -1
- package/dist/semantics/stable-checker.js +21 -5
- package/dist/semantics/subclass-member-overlay-transform.js +46 -5
- package/dist/semantics/symbol-keyed-expando-source-transform.js +1 -1
- package/dist/semantics/this-constructor-source-transform.js +1 -1
- package/dist/semantics/typescript.d.ts +12 -0
- package/dist/semantics/typescript.js +12 -0
- package/dist/semantics/uncached-jsdoc-tags.d.ts +16 -0
- package/dist/semantics/uncached-jsdoc-tags.js +23 -0
- package/dist/semantics/unchecked-guard-argument-copies.d.ts +1 -1
- package/dist/semantics/unchecked-guard-argument-copies.js +1 -1
- package/dist/semantics/unchecked-write-member-declarations.d.ts +1 -1
- package/dist/semantics/unchecked-write-member-declarations.js +1 -1
- package/dist/semantics/uninstantiable-classes.d.ts +1 -1
- package/dist/semantics/uninstantiable-classes.js +1 -1
- package/dist/targets/cpp/conversions.js +137 -87
- package/dist/targets/cpp/emit-bindings.js +13 -0
- package/dist/targets/cpp/emit-context.d.ts +13 -0
- package/dist/targets/cpp/emit-context.js +9 -0
- package/dist/targets/cpp/emit-in.js +2 -1
- package/dist/targets/cpp/emit-iterator.d.ts +6 -5
- package/dist/targets/cpp/emit-iterator.js +23 -13
- package/dist/targets/cpp/emit-narrowing.d.ts +8 -0
- package/dist/targets/cpp/emit-narrowing.js +11 -1
- package/dist/targets/cpp/emit-properties.js +9 -0
- package/dist/targets/cpp/emit-record-view.d.ts +9 -0
- package/dist/targets/cpp/emit-record-view.js +12 -1
- package/dist/targets/cpp/emit.js +14 -2
- package/package.json +7 -1
- package/src/targets/cpp/runtime/gea_runtime.h +10 -2
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import type { ConversionNode } from './algebra.js';
|
|
1
|
+
import type { ConversionNode, ConversionNodeId } from './algebra.js';
|
|
2
2
|
/**
|
|
3
3
|
* Validates a whole conversion graph: every node's internal shape via
|
|
4
4
|
* `validateCapability`, plus the one defect a single node can never see on its
|
|
5
5
|
* own -- a `recursive-ref` chain that loops through other nodes forever
|
|
6
6
|
* without ever reaching a materializer.
|
|
7
|
+
*
|
|
8
|
+
* `atoms` names further members of the graph, outside `nodes`, that the
|
|
9
|
+
* caller knows to be plain `atom`s with agreeing domains: each passes
|
|
10
|
+
* `validateCapability` and reaches a materializer by itself, and refers to no
|
|
11
|
+
* other node, so they are members and resolved without being built.
|
|
7
12
|
*/
|
|
8
|
-
export declare const validateConversionGraph: (nodes: readonly ConversionNode[]) => void;
|
|
13
|
+
export declare const validateConversionGraph: (nodes: readonly ConversionNode[], nodeOf?: (id: ConversionNodeId) => ConversionNode | undefined, atoms?: Pick<ReadonlySet<ConversionNodeId>, "has">) => void;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
import { validateCapability } from './algebra.js';
|
|
2
|
-
/**
|
|
3
|
-
* Whether a conversion graph's `recursive-ref` sites actually close.
|
|
4
|
-
*
|
|
5
|
-
* `isMaterializable` in algebra.ts treats every `recursive-ref` as trivially
|
|
6
|
-
* materializable, because a single capability in isolation has no other node
|
|
7
|
-
* to consult. That is correct for that question, but it means a set of nodes
|
|
8
|
-
* that only ever refer to each other -- with no node in the cycle ever
|
|
9
|
-
* reaching a real `Atom`, `Identity`, or a `Product`/`Collection`/`Sum` whose
|
|
10
|
-
* every branch bottoms out -- would still read as materializable. This module
|
|
11
|
-
* is the whole-graph check that catches that: it resolves every node's
|
|
12
|
-
* materializability by consulting the nodes its `recursive-ref`s point to, and
|
|
13
|
-
* rejects a reference into a cycle that never reaches a base case.
|
|
14
|
-
*/
|
|
15
2
|
const capabilityReachesMaterializer = (capability, resolved) => {
|
|
16
3
|
switch (capability.kind) {
|
|
17
4
|
case 'never':
|
|
@@ -31,24 +18,43 @@ const capabilityReachesMaterializer = (capability, resolved) => {
|
|
|
31
18
|
case 'sum':
|
|
32
19
|
return capability.arms.length > 0 && capability.arms.every((arm) => capabilityReachesMaterializer(arm.capability, resolved));
|
|
33
20
|
case 'recursive-ref':
|
|
34
|
-
return resolved
|
|
21
|
+
return resolved(capability.node);
|
|
35
22
|
}
|
|
36
23
|
};
|
|
37
24
|
/**
|
|
38
25
|
* Least fixed point over "does this node's capability reach a materializer".
|
|
39
26
|
* The relation only ever flips a node from `false` to `true`, so it is
|
|
40
27
|
* monotone and converges in at most `nodes.length` passes.
|
|
28
|
+
*
|
|
29
|
+
* With `nodeOf`, the answers are kept per node object and a reference is
|
|
30
|
+
* resolved through it, so no node's id is ever used as a key: keying a table
|
|
31
|
+
* by every id flattened and internalized each one, which on a large
|
|
32
|
+
* application left a flat copy of a quarter of a million ids alive after this
|
|
33
|
+
* check returned. Without it, the ids themselves are the keys.
|
|
41
34
|
*/
|
|
42
|
-
const resolveMaterializability = (nodes) => {
|
|
43
|
-
const
|
|
35
|
+
const resolveMaterializability = (nodes, nodeOf, atoms) => {
|
|
36
|
+
const resolvedNodes = new Set();
|
|
37
|
+
const resolvedIds = new Set();
|
|
38
|
+
const isResolved = (node) => (nodeOf ? resolvedNodes.has(node) : resolvedIds.has(node.id));
|
|
39
|
+
const resolved = nodeOf
|
|
40
|
+
? (id) => {
|
|
41
|
+
if (atoms?.has(id))
|
|
42
|
+
return true;
|
|
43
|
+
const node = nodeOf(id);
|
|
44
|
+
return node !== undefined && resolvedNodes.has(node);
|
|
45
|
+
}
|
|
46
|
+
: (id) => atoms?.has(id) === true || resolvedIds.has(id);
|
|
44
47
|
let changed = true;
|
|
45
48
|
while (changed) {
|
|
46
49
|
changed = false;
|
|
47
50
|
for (const node of nodes) {
|
|
48
|
-
if (
|
|
51
|
+
if (isResolved(node))
|
|
49
52
|
continue;
|
|
50
53
|
if (capabilityReachesMaterializer(node.capability, resolved)) {
|
|
51
|
-
|
|
54
|
+
if (nodeOf)
|
|
55
|
+
resolvedNodes.add(node);
|
|
56
|
+
else
|
|
57
|
+
resolvedIds.add(node.id);
|
|
52
58
|
changed = true;
|
|
53
59
|
}
|
|
54
60
|
}
|
|
@@ -81,15 +87,23 @@ const collectRecursiveRefs = (capability) => {
|
|
|
81
87
|
* `validateCapability`, plus the one defect a single node can never see on its
|
|
82
88
|
* own -- a `recursive-ref` chain that loops through other nodes forever
|
|
83
89
|
* without ever reaching a materializer.
|
|
90
|
+
*
|
|
91
|
+
* `atoms` names further members of the graph, outside `nodes`, that the
|
|
92
|
+
* caller knows to be plain `atom`s with agreeing domains: each passes
|
|
93
|
+
* `validateCapability` and reaches a materializer by itself, and refers to no
|
|
94
|
+
* other node, so they are members and resolved without being built.
|
|
84
95
|
*/
|
|
85
|
-
export const validateConversionGraph = (nodes) => {
|
|
86
|
-
const
|
|
96
|
+
export const validateConversionGraph = (nodes, nodeOf, atoms) => {
|
|
97
|
+
const known = nodeOf
|
|
98
|
+
? { has: (id) => nodeOf(id) !== undefined }
|
|
99
|
+
: new Set(nodes.map((node) => node.id));
|
|
100
|
+
const nodeIds = atoms ? { has: (id) => known.has(id) || atoms.has(id) } : known;
|
|
87
101
|
for (const node of nodes)
|
|
88
102
|
validateCapability(node.capability, nodeIds, node.id);
|
|
89
|
-
const resolved = resolveMaterializability(nodes);
|
|
103
|
+
const resolved = resolveMaterializability(nodes, nodeOf, atoms);
|
|
90
104
|
for (const node of nodes) {
|
|
91
105
|
for (const ref of collectRecursiveRefs(node.capability)) {
|
|
92
|
-
if (!resolved
|
|
106
|
+
if (!resolved(ref)) {
|
|
93
107
|
throw new Error(`conversion node "${node.id}": recursive reference to "${ref}" never reaches a materializer (unclosed cycle)`);
|
|
94
108
|
}
|
|
95
109
|
}
|
|
@@ -3,24 +3,19 @@ import { numberStorageTarget } from './number-storage.js';
|
|
|
3
3
|
export const NATIVE_SUM_CLASSIFIER = 'gea::native-sum::live-alternative';
|
|
4
4
|
export const NATIVE_SUM_MATERIALIZER = 'gea::native-sum::inject-alternative';
|
|
5
5
|
const isSum = (value) => value.kind === 'optional' || value.kind === 'tagged-union';
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* A native sum widens only when EVERY source alternative has a home. Leaves
|
|
8
|
+
* travel by carrier identity, native Number storage conversion, or the nominal
|
|
9
|
+
* class upcast their own ancestry proves. It never boxes, narrows a sum,
|
|
10
|
+
* changes a primitive's JS type, rebrands an absence, or reconstructs an
|
|
11
|
+
* object. Capability admission and rendering share this complete mapping.
|
|
12
|
+
*/
|
|
13
|
+
// No memo: once `nativeSumPlan`'s leaf test has refused the impossible pairs,
|
|
14
|
+
// a large app asks under a million that may widen and repeats 3% of them, so a
|
|
15
|
+
// cache keyed by carrier pair held nearly a million entries to save almost
|
|
16
|
+
// nothing.
|
|
7
17
|
const absences = { null: { kind: 'null' }, undefined: { kind: 'undefined' } };
|
|
8
18
|
const plan = (source, target, sourcePresent = false) => {
|
|
9
|
-
let targets = plans.get(source);
|
|
10
|
-
if (!targets)
|
|
11
|
-
plans.set(source, (targets = new WeakMap()));
|
|
12
|
-
let states = targets.get(target);
|
|
13
|
-
if (!states)
|
|
14
|
-
targets.set(target, (states = {}));
|
|
15
|
-
const key = sourcePresent ? 'present' : 'ordinary';
|
|
16
|
-
const known = states[key];
|
|
17
|
-
if (known !== undefined)
|
|
18
|
-
return known;
|
|
19
|
-
const result = computePlan(source, target, sourcePresent);
|
|
20
|
-
states[key] = result;
|
|
21
|
-
return result;
|
|
22
|
-
};
|
|
23
|
-
const computePlan = (source, target, sourcePresent) => {
|
|
24
19
|
if (representationKey(source) === representationKey(target))
|
|
25
20
|
return { kind: 'identity' };
|
|
26
21
|
// Ref<T> carries distinct null and native undefined states. A destination
|
|
@@ -145,7 +140,101 @@ export const nativeRecordBaseUpcastPlan = (source, target) => source.kind === 'c
|
|
|
145
140
|
representationKey(source.nativeBase) === representationKey(target)
|
|
146
141
|
? { kind: 'class-upcast', target }
|
|
147
142
|
: null;
|
|
148
|
-
|
|
143
|
+
const sumHomes = new WeakMap();
|
|
144
|
+
const sumHomesOf = (target) => {
|
|
145
|
+
const known = sumHomes.get(target);
|
|
146
|
+
if (known !== undefined)
|
|
147
|
+
return known;
|
|
148
|
+
const keys = new Set();
|
|
149
|
+
const classes = [];
|
|
150
|
+
let number = false;
|
|
151
|
+
let nullHome = false;
|
|
152
|
+
let undefinedHome = false;
|
|
153
|
+
const visit = (value) => {
|
|
154
|
+
if (value.kind === 'optional') {
|
|
155
|
+
if (value.absence === 'null')
|
|
156
|
+
nullHome = true;
|
|
157
|
+
else
|
|
158
|
+
undefinedHome = true;
|
|
159
|
+
visit(value.payload);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (value.kind === 'tagged-union') {
|
|
163
|
+
for (const arm of value.arms)
|
|
164
|
+
visit(arm.value);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
keys.add(representationKey(value));
|
|
168
|
+
if (value.kind === 'class-ref') {
|
|
169
|
+
classes.push(value);
|
|
170
|
+
if (value.ownership === 'shared-refcount')
|
|
171
|
+
nullHome = true;
|
|
172
|
+
}
|
|
173
|
+
if (value.kind === 'scalar' && value.domain === 'number')
|
|
174
|
+
number = true;
|
|
175
|
+
};
|
|
176
|
+
visit(target);
|
|
177
|
+
const built = { keys, classes, number, nullHome, undefinedHome };
|
|
178
|
+
sumHomes.set(target, built);
|
|
179
|
+
return built;
|
|
180
|
+
};
|
|
181
|
+
/** A source's leaves: what `plan` splits an optional or a union into. */
|
|
182
|
+
const sumLeaves = new WeakMap();
|
|
183
|
+
const sumLeavesOf = (source) => {
|
|
184
|
+
// A source that is neither is its own one leaf. Remembering that for every
|
|
185
|
+
// carrier ever planned held a table entry and an array per carrier, for an
|
|
186
|
+
// answer cheaper to build than to look up.
|
|
187
|
+
if (source.kind !== 'optional' && source.kind !== 'tagged-union')
|
|
188
|
+
return [source];
|
|
189
|
+
const known = sumLeaves.get(source);
|
|
190
|
+
if (known !== undefined)
|
|
191
|
+
return known;
|
|
192
|
+
const leaves = [];
|
|
193
|
+
const visit = (value) => {
|
|
194
|
+
if (value.kind === 'optional') {
|
|
195
|
+
visit(value.payload);
|
|
196
|
+
leaves.push(absences[value.absence]);
|
|
197
|
+
}
|
|
198
|
+
else if (value.kind === 'tagged-union')
|
|
199
|
+
for (const arm of value.arms)
|
|
200
|
+
visit(arm.value);
|
|
201
|
+
else
|
|
202
|
+
leaves.push(value);
|
|
203
|
+
};
|
|
204
|
+
visit(source);
|
|
205
|
+
sumLeaves.set(source, leaves);
|
|
206
|
+
return leaves;
|
|
207
|
+
};
|
|
208
|
+
const mayHouse = (homes, leaf) => {
|
|
209
|
+
if (homes.keys.has(representationKey(leaf)))
|
|
210
|
+
return true;
|
|
211
|
+
switch (leaf.kind) {
|
|
212
|
+
case 'null':
|
|
213
|
+
return homes.nullHome;
|
|
214
|
+
case 'undefined':
|
|
215
|
+
return homes.undefinedHome;
|
|
216
|
+
case 'class-ref':
|
|
217
|
+
return homes.classes.some((home) => home.ownership === leaf.ownership && leaf.ancestors.includes(home.declaration));
|
|
218
|
+
case 'scalar':
|
|
219
|
+
return leaf.domain === 'number' && homes.number;
|
|
220
|
+
default:
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
// The recast and selection passes ask this of every carrier pair, and almost
|
|
225
|
+
// none can widen: on a large app 14.5 million questions, 90% of them refused.
|
|
226
|
+
// The leaf test answers those from two small per-carrier summaries, so only a
|
|
227
|
+
// pair that may widen reaches `plan` and its cache.
|
|
228
|
+
export const nativeSumPlan = (source, target) => {
|
|
229
|
+
if (!isSum(target))
|
|
230
|
+
return null;
|
|
231
|
+
if (representationKey(source) !== representationKey(target)) {
|
|
232
|
+
const homes = sumHomesOf(target);
|
|
233
|
+
if (!sumLeavesOf(source).every((leaf) => mayHouse(homes, leaf)))
|
|
234
|
+
return null;
|
|
235
|
+
}
|
|
236
|
+
return plan(source, target);
|
|
237
|
+
};
|
|
149
238
|
export const nativeSumWidenable = (source, target) => nativeSumPlan(source, target) !== null;
|
|
150
239
|
/** Numeric casts stay field-free, but must not claim to merely wrap the original payload. */
|
|
151
240
|
export const nativeSumPreservesPayload = (step) => {
|
|
@@ -55,7 +55,7 @@ const preflightDiagnostics = (report, locate) => {
|
|
|
55
55
|
// obligation names a fast path the mandatory generic one already covers, so
|
|
56
56
|
// an unbuilt devirtualization is not a defect in the program or the backend
|
|
57
57
|
// -- and a report that fails a build over one trains its reader to ignore it.
|
|
58
|
-
const rows = report.
|
|
58
|
+
const rows = report.failing.filter((obligation) => !obligation.optional);
|
|
59
59
|
// A blocked row is explained by the failing rows of its own component, so the
|
|
60
60
|
// roots are collected per component before the derived rows cite them.
|
|
61
61
|
const rootsByComponent = new Map();
|
|
@@ -58,17 +58,6 @@ export interface NativeCallableFlow {
|
|
|
58
58
|
/** Exact source bodies and admitted adapters whose complete receiver origin family ignores logical this. */
|
|
59
59
|
readonly ignoredLogicalReceiverValues: ReadonlySet<IrValueId>;
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Flow-insensitive native field provenance. A field write contributes
|
|
63
|
-
* every implementation it can store; it never establishes an immutable-field
|
|
64
|
-
* fact. Unknown calls and publications poison the affected heap, including
|
|
65
|
-
* functions written there in a later solver round. Calls are resolved from
|
|
66
|
-
* allocator identities before treating still-unresolved entries as external.
|
|
67
|
-
*
|
|
68
|
-
* This authority does not consume reflection demand: it proves the origins
|
|
69
|
-
* which that demand needs. Unsupported transports fail closed. In particular,
|
|
70
|
-
* an arbitrary matching callable signature is never an implementation source.
|
|
71
|
-
*/
|
|
72
61
|
declare const computeNativeCallableFlow: (bodies: readonly IrBody[], placements: ReadonlyMap<DeclarationId, BindingPlacement>, classes: ReadonlyMap<DeclarationId, ClassLayout>, conversions?: Pick<ConversionCensus, "nodeById"> & Partial<Pick<ConversionCensus, "nodeFor">>, trace?: (read: Extract<IrOperation, {
|
|
73
62
|
kind: "get";
|
|
74
63
|
}>, reason: string) => void, deriver?: Pick<RepresentationDeriver, "layoutOf"> | null, programConversions?: readonly ProgramConversionRecipe[], constructionTopology?: readonly IrBody[]) => NativeCallableFlow;
|