@geastack/compiler 1.0.37 → 1.0.39
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/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-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-record-view.d.ts +9 -0
- package/dist/targets/cpp/emit-record-view.js +12 -1
- package/package.json +7 -1
- package/src/targets/cpp/runtime/gea_runtime.h +6 -1
|
@@ -2,7 +2,7 @@ import { runtimeParametersOf } from './targets.js';
|
|
|
2
2
|
import { seededOriginSolvers } from './seeded-origins.js';
|
|
3
3
|
import { enterHypothesisGuard, answerDependsOn, hypothesisSettledAsTruth, hypothesisStats, exitHypothesisGuard, registerGuardedAnswer, hypothesisGuardIsOpen, whenHypothesisSettles, hypothesisNotes, noteHypothesis, popHypothesisTrail, pushHypothesisTrail } from './proof-hypotheses.js';
|
|
4
4
|
import { unwrapErasedExpression } from '../producers/erasure.js';
|
|
5
|
-
import ts from 'typescript';
|
|
5
|
+
import ts from '#typescript';
|
|
6
6
|
import { isGlobalObjectAssign } from '../derived-expression-type.js';
|
|
7
7
|
import { heritageClassOrInterfaceOf, isClassSpelledSourceClass, isConstructorFunction } from './model.js';
|
|
8
8
|
import { isObjectLiteralPrototypeSetter } from '../assignment-patterns.js';
|
|
@@ -35,6 +35,7 @@ import { computedKeySetOf } from './computed-key-set.js';
|
|
|
35
35
|
import { callableCompletionValuesOf, constructionYieldsCompletionOf } from './callable-completions.js';
|
|
36
36
|
import { sourceValueSessionOf } from './source-value-session.js';
|
|
37
37
|
import { settleProofMemoClaims } from './proof-memo-settlement.js';
|
|
38
|
+
import { KeySet } from '../nullable-memo.js';
|
|
38
39
|
const jointSourceInvocationReceipts = new WeakMap();
|
|
39
40
|
/** The stamp describes provenance; only the exact fact minted by the joint
|
|
40
41
|
* target/frame authority carries permission. Clones and changed frames do not.
|
|
@@ -165,7 +166,31 @@ const ownedConstructionReceiverTypeAt = (checker, flow, given) => {
|
|
|
165
166
|
ownedConstructionReceiverWrappers.add(wrapped);
|
|
166
167
|
return wrapped;
|
|
167
168
|
};
|
|
169
|
+
/**
|
|
170
|
+
* Keyed by the index's call list, not the index: the settling round's index is
|
|
171
|
+
* a new object over the previous round's tables (`frontend.ts`), and the
|
|
172
|
+
* carried source-value session keeps asking with the previous object, so a
|
|
173
|
+
* per-object key built these identical lookups twice (~10 MB on a 48K-line
|
|
174
|
+
* app). Every answer here is a function of `calls` and `allWrites`, which
|
|
175
|
+
* such indices share by identity and no other two indices do.
|
|
176
|
+
*
|
|
177
|
+
* A call's site by call node is the index's own `callSiteOf`, and is asked
|
|
178
|
+
* there rather than copied into a second map per index here; a table of
|
|
179
|
+
* writes by value that nothing read is gone (~11 MB over the two indices
|
|
180
|
+
* alive through normalization on a 48K-line app).
|
|
181
|
+
*/
|
|
168
182
|
const callLookups = new WeakMap();
|
|
183
|
+
const NO_CALL_SITES = [];
|
|
184
|
+
const callSitesIn = (entry) => entry === undefined ? undefined : Array.isArray(entry) ? entry : [entry];
|
|
185
|
+
const withCallSite = (table, key, site) => {
|
|
186
|
+
const entry = table.get(key);
|
|
187
|
+
if (entry === undefined)
|
|
188
|
+
table.set(key, site);
|
|
189
|
+
else if (Array.isArray(entry))
|
|
190
|
+
entry.push(site);
|
|
191
|
+
else
|
|
192
|
+
table.set(key, [entry, site]);
|
|
193
|
+
};
|
|
169
194
|
/** Calls whose callee is a named member access, by key: record method calls
|
|
170
195
|
* the checker cannot attribute are found here and authenticated per proof. */
|
|
171
196
|
const callsByMemberName = new WeakMap();
|
|
@@ -205,44 +230,36 @@ const omittedArgumentOf = (call, position) => {
|
|
|
205
230
|
return value;
|
|
206
231
|
};
|
|
207
232
|
const callsOf = (flow) => {
|
|
208
|
-
const cached = callLookups.get(flow);
|
|
233
|
+
const cached = callLookups.get(flow.calls);
|
|
209
234
|
if (cached)
|
|
210
235
|
return cached;
|
|
211
|
-
const sites = new Map();
|
|
212
236
|
const declarations = new Map();
|
|
213
237
|
const callees = new Map();
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
238
|
+
// A bit per receiver over numbers the binding censuses' memos already gave
|
|
239
|
+
// almost all of them: only membership is asked, of every index alive through
|
|
240
|
+
// normalization (~1.25 MB of set entries each on a 48K-line app).
|
|
241
|
+
const writeReceivers = new KeySet();
|
|
242
|
+
for (const write of flow.allWrites)
|
|
217
243
|
if (write.naming)
|
|
218
244
|
writeReceivers.add(write.naming);
|
|
219
|
-
if (!write.value)
|
|
220
|
-
continue;
|
|
221
|
-
const entries = writes.get(write.value);
|
|
222
|
-
if (entries)
|
|
223
|
-
entries.push(write);
|
|
224
|
-
else
|
|
225
|
-
writes.set(write.value, [write]);
|
|
226
|
-
}
|
|
227
245
|
for (const site of flow.calls) {
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
else
|
|
233
|
-
callees.set(site.operands.callee, [site]);
|
|
234
|
-
for (const declaration of new Set([site.inferredDeclaration ?? site.checkerDeclaration, ...site.targets])) {
|
|
235
|
-
if (!declaration)
|
|
236
|
-
continue;
|
|
237
|
-
const entries = declarations.get(declaration);
|
|
238
|
-
if (entries)
|
|
239
|
-
entries.push(site);
|
|
240
|
-
else
|
|
241
|
-
declarations.set(declaration, [site]);
|
|
242
|
-
}
|
|
246
|
+
withCallSite(callees, site.operands.callee, site);
|
|
247
|
+
for (const declaration of new Set([site.inferredDeclaration ?? site.checkerDeclaration, ...site.targets]))
|
|
248
|
+
if (declaration)
|
|
249
|
+
withCallSite(declarations, declaration, site);
|
|
243
250
|
}
|
|
244
|
-
|
|
245
|
-
|
|
251
|
+
// Each list copied to its exact length: a `push` past the second entry
|
|
252
|
+
// reserves spare slots, and these tables stay alive with the index.
|
|
253
|
+
for (const table of [declarations, callees])
|
|
254
|
+
for (const [key, entry] of table)
|
|
255
|
+
if (Array.isArray(entry) && entry.length > 2)
|
|
256
|
+
table.set(key, entry.slice());
|
|
257
|
+
const result = {
|
|
258
|
+
declarationSites: (declaration) => callSitesIn(declarations.get(declaration)) ?? NO_CALL_SITES,
|
|
259
|
+
calleeSites: (callee) => callSitesIn(callees.get(callee)),
|
|
260
|
+
writeReceivers
|
|
261
|
+
};
|
|
262
|
+
callLookups.set(flow.calls, result);
|
|
246
263
|
return result;
|
|
247
264
|
};
|
|
248
265
|
/**
|
|
@@ -799,15 +816,15 @@ export const hasClosedMemberCallableUses = (...parameters) => {
|
|
|
799
816
|
let byValueMode = byArgumentsUsesAt.get(argumentsUsesAt);
|
|
800
817
|
if (!byValueMode) {
|
|
801
818
|
proofStats.argumentFns++;
|
|
802
|
-
byArgumentsUsesAt.set(argumentsUsesAt, (byValueMode = { named: new Map(), fresh:
|
|
819
|
+
byArgumentsUsesAt.set(argumentsUsesAt, (byValueMode = { named: new Map(), fresh: undefined }));
|
|
803
820
|
}
|
|
804
821
|
const modeKey = valueMode?.identity;
|
|
805
|
-
let answers = valueMode !== undefined && modeKey === undefined ? byValueMode.fresh
|
|
822
|
+
let answers = valueMode !== undefined && modeKey === undefined ? byValueMode.fresh?.get(valueMode) : byValueMode.named.get(modeKey);
|
|
806
823
|
if (!answers) {
|
|
807
824
|
proofStats.valueModes++;
|
|
808
825
|
answers = [];
|
|
809
826
|
if (valueMode !== undefined && modeKey === undefined)
|
|
810
|
-
byValueMode.fresh.set(valueMode, answers);
|
|
827
|
+
(byValueMode.fresh ??= new WeakMap()).set(valueMode, answers);
|
|
811
828
|
else
|
|
812
829
|
byValueMode.named.set(modeKey, answers);
|
|
813
830
|
}
|
|
@@ -1756,7 +1773,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
1756
1773
|
return answer.value;
|
|
1757
1774
|
};
|
|
1758
1775
|
const explicitInvocationIsIntact = (call) => {
|
|
1759
|
-
if (!
|
|
1776
|
+
if (!flow.callSiteOf(call)?.explicitThis)
|
|
1760
1777
|
return false;
|
|
1761
1778
|
const wrapper = unwrapValue(call.expression);
|
|
1762
1779
|
if (!ts.isPropertyAccessExpression(wrapper))
|
|
@@ -1808,7 +1825,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
1808
1825
|
if (ts.isCallExpression(call) && call.expression === use) {
|
|
1809
1826
|
if (counted.has(call))
|
|
1810
1827
|
continue;
|
|
1811
|
-
const site =
|
|
1828
|
+
const site = flow.callSiteOf(call);
|
|
1812
1829
|
if (site === undefined)
|
|
1813
1830
|
return false;
|
|
1814
1831
|
if (!sites.includes(site))
|
|
@@ -1828,14 +1845,14 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
1828
1845
|
return null;
|
|
1829
1846
|
const sites = [];
|
|
1830
1847
|
for (const call of calls) {
|
|
1831
|
-
const source =
|
|
1848
|
+
const source = flow.callSiteOf(call);
|
|
1832
1849
|
if (!source)
|
|
1833
1850
|
return null;
|
|
1834
1851
|
sites.push({ ...source, targets: [declaration], checkerDeclaration: declaration });
|
|
1835
1852
|
}
|
|
1836
1853
|
return sites;
|
|
1837
1854
|
}
|
|
1838
|
-
const own = [...
|
|
1855
|
+
const own = [...callsOf(flow).declarationSites(declaration)];
|
|
1839
1856
|
const allocated = allocationMemberCallerSitesOf(declaration, false, new Set(own.map((site) => site.call)));
|
|
1840
1857
|
if (allocated === null)
|
|
1841
1858
|
return null;
|
|
@@ -1921,7 +1938,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
1921
1938
|
for (const sibling of siblings) {
|
|
1922
1939
|
if (sibling === declaration)
|
|
1923
1940
|
continue;
|
|
1924
|
-
for (const site of callsOf(flow).
|
|
1941
|
+
for (const site of callsOf(flow).declarationSites(sibling))
|
|
1925
1942
|
if (!sites.includes(site))
|
|
1926
1943
|
sites.push(site);
|
|
1927
1944
|
}
|
|
@@ -1969,7 +1986,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
1969
1986
|
continue;
|
|
1970
1987
|
// An importer's call -- `make()`, `ns.make()` -- is a caller even where
|
|
1971
1988
|
// the call index filed it under the import binding instead.
|
|
1972
|
-
const site = imported.includes(reference) ?
|
|
1989
|
+
const site = imported.includes(reference) ? flow.callSiteOf(parent) : undefined;
|
|
1973
1990
|
if (site) {
|
|
1974
1991
|
if (!sites.includes(site))
|
|
1975
1992
|
sites.push(site);
|
|
@@ -1994,7 +2011,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
1994
2011
|
}
|
|
1995
2012
|
const mention = classifyMention(checker, reference, declaration.name);
|
|
1996
2013
|
if (mention.kind === 'call' && counted.has(mention.call)) {
|
|
1997
|
-
const site =
|
|
2014
|
+
const site = flow.callSiteOf(mention.call);
|
|
1998
2015
|
if (site?.explicitThis && unwrapValue(site.explicitThis.callee) === unwrapValue(reference)) {
|
|
1999
2016
|
if (!ts.isCallExpression(mention.call) || !explicitInvocationIsIntact(mention.call))
|
|
2000
2017
|
return null;
|
|
@@ -2200,7 +2217,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
2200
2217
|
return null;
|
|
2201
2218
|
const through = memberNamedCallsOf(key).filter((site) => ts.isCallExpression(site.call) && recordMethodCallTargetsOf(flow, site.call, computedKeyAuthority)?.includes(declaration) === true);
|
|
2202
2219
|
const counted = new Set(through.map((site) => site.call));
|
|
2203
|
-
for (const site of callsOf(flow).
|
|
2220
|
+
for (const site of callsOf(flow).declarationSites(declaration))
|
|
2204
2221
|
counted.add(site.call);
|
|
2205
2222
|
return hasClosedMemberCallableUses(checker, flow, slot, counted, receiverTypeAt, argumentsUsesAt, onOpenUse, nestedMembers, nestedFamilies())
|
|
2206
2223
|
? through
|
|
@@ -3634,7 +3651,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
3634
3651
|
// The shared call inventory still attributes the invocation to this
|
|
3635
3652
|
// slot; counting it consumes no claim about the argument's provenance.
|
|
3636
3653
|
if (ts.isFunctionLike(entry))
|
|
3637
|
-
for (const site of callsOf(flow).
|
|
3654
|
+
for (const site of callsOf(flow).declarationSites(entry))
|
|
3638
3655
|
calls.add(site.call);
|
|
3639
3656
|
for (const reference of flow.referencesToDeclaration(entry)) {
|
|
3640
3657
|
const access = ts.isPropertyAccessExpression(reference.parent) && reference.parent.name === reference ? reference.parent : reference;
|
|
@@ -3881,7 +3898,11 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
3881
3898
|
return false;
|
|
3882
3899
|
return checker.isTypeAssignableTo(carried, declared) || checker.isTypeAssignableTo(declared, carried);
|
|
3883
3900
|
};
|
|
3884
|
-
for (const
|
|
3901
|
+
for (const site of flow.calls) {
|
|
3902
|
+
const node = site.call;
|
|
3903
|
+
// The site `callSiteOf` answers for its call: the last one recorded for it.
|
|
3904
|
+
if (flow.callSiteOf(node) !== site)
|
|
3905
|
+
continue;
|
|
3885
3906
|
if (!ts.isCallExpression(node) && !ts.isNewExpression(node))
|
|
3886
3907
|
continue;
|
|
3887
3908
|
// `receiver.method()` through a callee this walk cannot name hands
|
|
@@ -4740,7 +4761,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
4740
4761
|
}
|
|
4741
4762
|
};
|
|
4742
4763
|
const forwardedInvocationUse = (reference, call, use, path = null) => {
|
|
4743
|
-
const site =
|
|
4764
|
+
const site = flow.callSiteOf(call);
|
|
4744
4765
|
if (!site)
|
|
4745
4766
|
return false;
|
|
4746
4767
|
const callee = site.operands.callee;
|
|
@@ -5409,7 +5430,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
5409
5430
|
const key = accessKeyOf(selected);
|
|
5410
5431
|
if (!ts.isCallExpression(call) || call.expression !== selected || key === null || key !== memberKeyOf(declared))
|
|
5411
5432
|
return false;
|
|
5412
|
-
const site =
|
|
5433
|
+
const site = flow.callSiteOf(call);
|
|
5413
5434
|
if (!site ||
|
|
5414
5435
|
site.explicitThis !== null ||
|
|
5415
5436
|
site.operands.dispatch.kind !== 'member' ||
|
|
@@ -5652,7 +5673,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
5652
5673
|
const sourceValues = sourceValueSessionOf(checker, flow);
|
|
5653
5674
|
if (sourceValues.ownsInvocation(call))
|
|
5654
5675
|
return sourceValues.invocationTargetsOf(call) ?? invocationRefusal(call, 'targets:source-value-session');
|
|
5655
|
-
const site =
|
|
5676
|
+
const site = flow.callSiteOf(call);
|
|
5656
5677
|
if (!site)
|
|
5657
5678
|
return invocationRefusal(call, 'targets:no-site');
|
|
5658
5679
|
const explicit = site.explicitThis;
|
|
@@ -5848,7 +5869,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
5848
5869
|
* asked to reason about.
|
|
5849
5870
|
*/
|
|
5850
5871
|
const memberAccessCalleeBodiesOf = (call) => {
|
|
5851
|
-
const site =
|
|
5872
|
+
const site = flow.callSiteOf(call);
|
|
5852
5873
|
if (!site)
|
|
5853
5874
|
return null;
|
|
5854
5875
|
const explicit = site.explicitThis;
|
|
@@ -5927,7 +5948,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
5927
5948
|
* compiled function it denotes.
|
|
5928
5949
|
*/
|
|
5929
5950
|
const parameterCalleeBodiesOf = (call) => {
|
|
5930
|
-
const site =
|
|
5951
|
+
const site = flow.callSiteOf(call);
|
|
5931
5952
|
if (!site)
|
|
5932
5953
|
return null;
|
|
5933
5954
|
const callee = site.operands.callee;
|
|
@@ -6001,7 +6022,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
6001
6022
|
if (known) {
|
|
6002
6023
|
const sourceValues = sourceValueSessionOf(checker, flow);
|
|
6003
6024
|
const candidate = sourceValues.candidateOrdinaryOwnCallableOperandsOf(call);
|
|
6004
|
-
const current = candidate === null ?
|
|
6025
|
+
const current = candidate === null ? flow.callSiteOf(call)?.operands : sourceValues.ordinaryOwnCallableOperandsOf(call);
|
|
6005
6026
|
// A conditional own-slot proof may become available in a later ledger
|
|
6006
6027
|
// capture. A wrapper frame memo cannot stand in for that exact entry.
|
|
6007
6028
|
if (known.operands === current)
|
|
@@ -6015,7 +6036,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
6015
6036
|
noteAssumption(call);
|
|
6016
6037
|
return invocationRefusal(call, 'recursive-hypothesis');
|
|
6017
6038
|
}
|
|
6018
|
-
const site =
|
|
6039
|
+
const site = flow.callSiteOf(call);
|
|
6019
6040
|
if (!site?.operands)
|
|
6020
6041
|
return invocationRefusal(call, 'no-operands');
|
|
6021
6042
|
const compute = () => {
|
|
@@ -7233,7 +7254,7 @@ const closedMemberCallableUses = (checker, flow, member, countedCalls, givenRece
|
|
|
7233
7254
|
// Receiver publication follows the same target selection as argument
|
|
7234
7255
|
// and result flow. The normalized callee inventory also includes reads
|
|
7235
7256
|
// inside `.call`/`.apply`, where lookup and actual receiver differ.
|
|
7236
|
-
const invocations = callsOf(flow).
|
|
7257
|
+
const invocations = callsOf(flow).calleeSites(parent);
|
|
7237
7258
|
if (invocations?.length)
|
|
7238
7259
|
return traceReceiver(reference, 'invocation-receiver', invocations.every((site) => {
|
|
7239
7260
|
if (!ts.isCallExpression(site.call))
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { heritageClassOrInterfaceOf } from './model.js';
|
|
3
3
|
import { sourceClassKeyReadPlanOf } from './source-class-data.js';
|
|
4
4
|
import { classConstructorKeepsInstanceOf } from './member-call-forwarding.js';
|
|
5
5
|
import { unwrapNaming } from './targets.js';
|
|
6
6
|
import { annotationStatesNothing, isGlobalObjectConstructor, isStandardGlobalValue, isUnusableEvidence } from '../derived-expression-type.js';
|
|
7
|
-
import { createPropertyKeyDomains } from '../property-key-domain.js';
|
|
7
|
+
import { createPropertyKeyDomains, everyWriteReachable } from '../property-key-domain.js';
|
|
8
8
|
import { objectPrototypeMemberNames } from '../../../representation/record-fields.js';
|
|
9
9
|
import { deferredIntrinsicProtocolLedgerOf, intrinsicProtocolRequirementKind } from '../deferred-intrinsic-protocols.js';
|
|
10
10
|
import { computedKeySetOf } from './computed-key-set.js';
|
|
@@ -225,7 +225,7 @@ const writeInventoryOf = (checker, flow) => {
|
|
|
225
225
|
}
|
|
226
226
|
// Every write this index holds is already reachable: the flow walk prunes
|
|
227
227
|
// unreachable members before it records anything.
|
|
228
|
-
const keys = createPropertyKeyDomains(checker, flow,
|
|
228
|
+
const keys = createPropertyKeyDomains(checker, flow, everyWriteReachable);
|
|
229
229
|
// A spread-free object literal is the only source that can be shown not to
|
|
230
230
|
// carry `key`; anything else (a variable, a call result, a spread) may.
|
|
231
231
|
const literalMayNameKey = (expression, key) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { isStandardInterfaceType } from '../derived-expression-type.js';
|
|
3
3
|
import { outermostErasureOf, unwrapErasedExpression } from '../producers/erasure.js';
|
|
4
4
|
import { nativeCollectionProtocolPlanOf } from './native-collection-protocol.js';
|
|
@@ -20,8 +20,23 @@ export interface DependencyComponentNode<K, R> {
|
|
|
20
20
|
readonly domain: DependencyGroundingDomain;
|
|
21
21
|
readonly dependency: K;
|
|
22
22
|
}[];
|
|
23
|
+
/**
|
|
24
|
+
* More grounding edges, all carrying `groundingDomain`, given as their
|
|
25
|
+
* dependencies alone (see `DependencyGroundingKeys`). They follow
|
|
26
|
+
* `groundingDependencies` in edge order.
|
|
27
|
+
*/
|
|
28
|
+
readonly groundingDomain?: DependencyGroundingDomain;
|
|
29
|
+
readonly groundingKeys?: DependencyGroundingKeys<K>;
|
|
23
30
|
}
|
|
24
31
|
export type DependencyGroundingDomain = string | symbol;
|
|
32
|
+
/**
|
|
33
|
+
* Grounding dependencies in one domain: a lone key as itself, more in an
|
|
34
|
+
* array (a key that is itself an array goes inside one). A seal is kept for
|
|
35
|
+
* the life of the solve, and a 48K-line app's ~100K grounded seals carry
|
|
36
|
+
* ~147K edges in its one domain: a `{ domain, dependency }` record per edge is
|
|
37
|
+
* 40 bytes, and a one-element array 56 more to hold a pointer.
|
|
38
|
+
*/
|
|
39
|
+
export type DependencyGroundingKeys<K> = K | readonly K[];
|
|
25
40
|
export type DependencyComponentMode = 'all-dependencies' | 'seeded-origin' | 'grounding-domains';
|
|
26
41
|
export type DependencyRootCause<K, R> = {
|
|
27
42
|
readonly kind: 'opaque';
|
|
@@ -62,6 +77,34 @@ export interface DependencyComponentResult<K, R> {
|
|
|
62
77
|
* An acyclic unseeded node remains a complete, vacuous answer.
|
|
63
78
|
*/
|
|
64
79
|
export declare const dependencyComponentSolver: <K, R>(expand: (key: K) => DependencyComponentNode<K, R>, mode: DependencyComponentMode) => ((key: K) => DependencyComponentResult<K, R>);
|
|
80
|
+
type ComponentAnswer = {
|
|
81
|
+
readonly status: 'complete' | 'refused';
|
|
82
|
+
readonly grounded: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* What the component solve remembers about one node, kept on the record the
|
|
86
|
+
* caller already holds for that node rather than in maps of its own. Five
|
|
87
|
+
* maps keyed by node (the expanded node as a copy of the caller's facts, its
|
|
88
|
+
* answer, its component, its grounding, and whether it was expanded) were
|
|
89
|
+
* each a hash entry per node of a graph that, on a 48K-line app, has ~224K
|
|
90
|
+
* nodes: ~80 MB, a quarter of the whole solver.
|
|
91
|
+
*/
|
|
92
|
+
interface ComponentSlot {
|
|
93
|
+
/** A cached answer has read this node (`invalidate` stops at a node no answer read). */
|
|
94
|
+
componentRead: boolean;
|
|
95
|
+
componentAnswer: ComponentAnswer | null;
|
|
96
|
+
/** `groundingDomainsFrom` settled on no domain, the answer nearly every node it reaches has. */
|
|
97
|
+
groundedInNoDomain: boolean;
|
|
98
|
+
/** `groundedFor`'s settled answer for the first domain the engine walks (`GroundedIn`). */
|
|
99
|
+
groundedInFirstDomain: GroundedIn;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Whether a node reaches a witness of a domain: not settled, or settled
|
|
103
|
+
* either way. Kept on the node for the first domain the engine walks (there
|
|
104
|
+
* is one in this compiler), where a table of settled nodes per domain held
|
|
105
|
+
* an entry per value-origin node -- ~60K on a 48K-line app.
|
|
106
|
+
*/
|
|
107
|
+
type GroundedIn = 0 | 1 | 2;
|
|
65
108
|
/** A node whose fact set is transferred monotonically from discovered dependencies. */
|
|
66
109
|
export type DependencyFactRead<K, V> = (dependency: K) => ReadonlySet<V>;
|
|
67
110
|
/** A discovery edge whose facts are visible but whose completeness is not required. */
|
|
@@ -100,6 +143,12 @@ export type DependencyFactObserve<K, V> = (dependency: K) => ReadonlySet<V>;
|
|
|
100
143
|
* consumer to discard all but the seeded receivers it actually asked about.
|
|
101
144
|
*/
|
|
102
145
|
export type DependencyFactHoldersOf<K, V> = (fact: V) => Iterable<K>;
|
|
146
|
+
/**
|
|
147
|
+
* Both callbacks are handed the node's own key, so one definition object can
|
|
148
|
+
* serve every node: a definition per node, closing over its key, was an object,
|
|
149
|
+
* two closures and their context for the life of every node -- ~350 bytes a
|
|
150
|
+
* node, ~80 MB on a 48K-line app.
|
|
151
|
+
*/
|
|
103
152
|
export interface DependencyFactDefinition<K, V, R> {
|
|
104
153
|
/**
|
|
105
154
|
* Add facts derivable now. `read` registers a required dependency, even when
|
|
@@ -125,7 +174,7 @@ export interface DependencyFactDefinition<K, V, R> {
|
|
|
125
174
|
* implementation already returns a materialised Set built before it
|
|
126
175
|
* returns; this type makes that the only legal shape.
|
|
127
176
|
*/
|
|
128
|
-
readonly transfer: (read: DependencyFactRead<K, V>, observe: DependencyFactObserve<K, V>, holdersOf: DependencyFactHoldersOf<K, V
|
|
177
|
+
readonly transfer: (read: DependencyFactRead<K, V>, observe: DependencyFactObserve<K, V>, holdersOf: DependencyFactHoldersOf<K, V>, key: K) => ReadonlySet<V>;
|
|
129
178
|
/**
|
|
130
179
|
* Called only after transfer propagation reaches a fixed point. Calling
|
|
131
180
|
* `read` or `observe` here registers that edge and causes propagation/sealing
|
|
@@ -137,7 +186,7 @@ export interface DependencyFactDefinition<K, V, R> {
|
|
|
137
186
|
* `observe` here too: it can only ever grow what is locally complete, never
|
|
138
187
|
* shrink it, and it cannot supply a grounding witness either.
|
|
139
188
|
*/
|
|
140
|
-
readonly seal: (read: DependencyFactRead<K, V>, observe: DependencyFactObserve<K, V>, holdersOf: DependencyFactHoldersOf<K, V
|
|
189
|
+
readonly seal: (read: DependencyFactRead<K, V>, observe: DependencyFactObserve<K, V>, holdersOf: DependencyFactHoldersOf<K, V>, key: K) => {
|
|
141
190
|
readonly locallyComplete: boolean;
|
|
142
191
|
readonly causes?: readonly R[];
|
|
143
192
|
readonly seed?: boolean;
|
|
@@ -147,6 +196,8 @@ export interface DependencyFactDefinition<K, V, R> {
|
|
|
147
196
|
readonly domain: DependencyGroundingDomain;
|
|
148
197
|
readonly dependency: K;
|
|
149
198
|
}[];
|
|
199
|
+
readonly groundingDomain?: DependencyGroundingDomain;
|
|
200
|
+
readonly groundingKeys?: DependencyGroundingKeys<K>;
|
|
150
201
|
};
|
|
151
202
|
}
|
|
152
203
|
export type DependencyFactResult<K, V, R> = {
|
|
@@ -199,4 +250,131 @@ export interface DependencyFactSolver<K, V, R> {
|
|
|
199
250
|
*/
|
|
200
251
|
readonly seed: (key: K) => void;
|
|
201
252
|
}
|
|
202
|
-
|
|
253
|
+
/**
|
|
254
|
+
* A small edge collection of states: none, a lone state, or an exactly sized
|
|
255
|
+
* array (grown by `concat`; `push` onto a one-element array reserves 17 slots).
|
|
256
|
+
* A state is a `FactState`, never an array, Map or Set, so the forms are told
|
|
257
|
+
* apart by those tests alone.
|
|
258
|
+
*/
|
|
259
|
+
type EdgeStates<S extends object> = S | readonly S[] | null;
|
|
260
|
+
type FactSeal<K, R> = ReturnType<DependencyFactDefinition<K, never, R>['seal']>;
|
|
261
|
+
/**
|
|
262
|
+
* One node of a `dependencyFactSolver`, which is also its own fact set:
|
|
263
|
+
* `read`/`observe` hand the state itself out as the node's live
|
|
264
|
+
* `ReadonlySet`. A consumer may keep that set to compare its size later (the
|
|
265
|
+
* own-key stamps in `source-value-session.ts`), so it has to be one object for
|
|
266
|
+
* the node's life -- and the state already is.
|
|
267
|
+
*
|
|
268
|
+
* The facts are held inline while there is at most one, in a `Set` only from
|
|
269
|
+
* the second. Half the nodes of a 48K-line app's solve hold no fact and a
|
|
270
|
+
* third hold exactly one, and the smallest `Set` is a 152-byte hash table:
|
|
271
|
+
* ~30 MB of tables for ~200K sets of at most one element. Iteration is in
|
|
272
|
+
* insertion order and `has` is SameValueZero, as for a `Set`.
|
|
273
|
+
*
|
|
274
|
+
* A class, so ~224K instances share one shape and one copy of the methods,
|
|
275
|
+
* and so its two booleans can share one field. Abstract over where the key
|
|
276
|
+
* lives: a caller that interns one record per key can make that record the
|
|
277
|
+
* state itself (`keysAreStates`), and a key record and a state per node were
|
|
278
|
+
* two headers and a pointer each way -- ~9 MB on a 48K-line app.
|
|
279
|
+
*/
|
|
280
|
+
export declare abstract class FactState<K, V, R> implements ReadonlySet<V>, ComponentSlot {
|
|
281
|
+
/**
|
|
282
|
+
* Every scheduled edge, holding the dependency's STATE and not just its
|
|
283
|
+
* key. A transfer re-reads the same edges on every re-evaluation, so
|
|
284
|
+
* resolving the key through the global state map each time was a lookup
|
|
285
|
+
* per edge read across the whole solve -- the single largest self-time
|
|
286
|
+
* entry in a large program's profile. The owner already has to touch this
|
|
287
|
+
* collection to know the edge exists; carrying the state in it makes the
|
|
288
|
+
* repeat read free.
|
|
289
|
+
*
|
|
290
|
+
* This and the two edge collections below are null until the first edge
|
|
291
|
+
* that would go in them, a lone state or an exactly sized array while they
|
|
292
|
+
* are small, and a hash table only past `SMALL_EDGES`. A 48K-line app's
|
|
293
|
+
* solve holds ~224K states; three quarters of them have at most one edge
|
|
294
|
+
* of each kind, and a one-entry Map or Set is ~180 bytes of hash table:
|
|
295
|
+
* ~90 MB of tables for edges a field holds in 8. Insertion order, which
|
|
296
|
+
* `propagate`'s wake-ups and `explain`'s paths follow, is the same in
|
|
297
|
+
* every form.
|
|
298
|
+
*
|
|
299
|
+
* Observed edges never become a table: past `SMALL_EDGES` they are an
|
|
300
|
+
* array of this state's own, grown by `push`, and whether an edge exists is
|
|
301
|
+
* asked of the dependency's `dependents` instead (`observedState`). A
|
|
302
|
+
* key-to-state Map was ~1.3 KB a state for the ~4K states that observe
|
|
303
|
+
* more than eight.
|
|
304
|
+
*/
|
|
305
|
+
observedDependencies: EdgeStates<FactState<K, V, R>>;
|
|
306
|
+
/**
|
|
307
|
+
* Dependents, held as states for the same reason `key` is: `propagate`
|
|
308
|
+
* fires an edge by re-enqueuing its owner, and it already holds that
|
|
309
|
+
* owner's state from the moment the edge was recorded.
|
|
310
|
+
*/
|
|
311
|
+
dependents: EdgeStates<FactState<K, V, R>> | Set<FactState<K, V, R>>;
|
|
312
|
+
/** The last seal, which the component solve reads as this node's local facts. */
|
|
313
|
+
sealed: FactSeal<K, R> | undefined;
|
|
314
|
+
private flags;
|
|
315
|
+
/**
|
|
316
|
+
* No fact, one fact held as itself, two to `SMALL_EDGES` facts in an
|
|
317
|
+
* exactly sized array, more in a `Set`: ~22K of a 48K-line app's ~28K
|
|
318
|
+
* multi-fact states hold at most eight, and the smallest `Set` holding two
|
|
319
|
+
* is ~180 bytes of hash table. One field for all four forms rather than one
|
|
320
|
+
* for the lone fact and one for the collection: a lone fact that could be
|
|
321
|
+
* mistaken for a collection (`isLoneFact`) is held as a one-element array.
|
|
322
|
+
*/
|
|
323
|
+
private facts;
|
|
324
|
+
/**
|
|
325
|
+
* Carried on the state so `dependents` and the propagation queue can hold
|
|
326
|
+
* states directly instead of keys. Both used to hold `K`, and every drain
|
|
327
|
+
* re-resolved `states.get(key)` per edge fire -- on a large program's
|
|
328
|
+
* millions of observe edges, a Map lookup the caller already had the answer
|
|
329
|
+
* to, since the state is in hand at both the point an edge is created
|
|
330
|
+
* (`factsFrom`'s `dependencyState`) and the point it fires (`propagate`'s
|
|
331
|
+
* queue).
|
|
332
|
+
*/
|
|
333
|
+
abstract readonly solverKey: K;
|
|
334
|
+
/** Seeded: this state's facts are visible to `holdersOf`. */
|
|
335
|
+
get indexed(): boolean;
|
|
336
|
+
set indexed(value: boolean);
|
|
337
|
+
get requiresObserved(): boolean;
|
|
338
|
+
set requiresObserved(value: boolean);
|
|
339
|
+
get groundedInFirstDomain(): GroundedIn;
|
|
340
|
+
set groundedInFirstDomain(value: GroundedIn);
|
|
341
|
+
get groundedInNoDomain(): boolean;
|
|
342
|
+
set groundedInNoDomain(value: boolean);
|
|
343
|
+
get minted(): boolean;
|
|
344
|
+
set minted(value: boolean);
|
|
345
|
+
get explicitRequired(): boolean;
|
|
346
|
+
set explicitRequired(value: boolean);
|
|
347
|
+
get componentAnswer(): ComponentAnswer | null;
|
|
348
|
+
set componentAnswer(answer: ComponentAnswer | null);
|
|
349
|
+
get componentRead(): boolean;
|
|
350
|
+
set componentRead(value: boolean);
|
|
351
|
+
get size(): number;
|
|
352
|
+
has(value: V): boolean;
|
|
353
|
+
add(value: V): void;
|
|
354
|
+
/**
|
|
355
|
+
* Holds `other`'s fact collection when it is the same facts in the same
|
|
356
|
+
* order, so iteration is unchanged; both are marked shared, and `add`
|
|
357
|
+
* copies a shared `Set` before writing it (an array is never written: it is
|
|
358
|
+
* replaced). Only collections are shared: none or a lone fact costs nothing.
|
|
359
|
+
*/
|
|
360
|
+
shareFactsOf(other: FactState<K, V, R>): boolean;
|
|
361
|
+
values(): SetIterator<V>;
|
|
362
|
+
keys(): SetIterator<V>;
|
|
363
|
+
[Symbol.iterator](): SetIterator<V>;
|
|
364
|
+
entries(): SetIterator<[V, V]>;
|
|
365
|
+
forEach(callback: (value: V, key: V, set: ReadonlySet<V>) => void, thisArg?: unknown): void;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* `expand` is either one definition for every node (its callbacks are handed
|
|
369
|
+
* the node's key) or a function minting one per node, called once as the node
|
|
370
|
+
* is created.
|
|
371
|
+
*
|
|
372
|
+
* With `keysAreStates`, every key is a `FactState` subclass instance the
|
|
373
|
+
* caller interned once per question, and the key is the node's state: a table
|
|
374
|
+
* keyed by key costs a hash entry per node -- ~7 MB of table for a 48K-line
|
|
375
|
+
* app's ~224K nodes -- and a separate state per key a header and two pointers.
|
|
376
|
+
* Such keys must be private to one solver. Otherwise states are kept in a
|
|
377
|
+
* table keyed by key.
|
|
378
|
+
*/
|
|
379
|
+
export declare const dependencyFactSolver: <K, V, R>(expand: DependencyFactDefinition<K, V, R> | ((key: K) => DependencyFactDefinition<K, V, R>), mode: DependencyComponentMode, keysAreStates?: boolean) => DependencyFactSolver<K, V, R>;
|
|
380
|
+
export {};
|