@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
|
@@ -1,35 +1,91 @@
|
|
|
1
1
|
import { operationFamilies } from '../../identity/ids.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { operationOfResult } from '../../identity/ids.js';
|
|
3
|
+
import { compactStatedEdges, edgeSource, edgesStatedBy, gateScopeSealer, SemanticEdgeTable } from '../model/edges.js';
|
|
4
|
+
import { PublishedResults, validateGraph } from '../model/graph.js';
|
|
5
|
+
import { internedText, internSealedFacts } from '../model/sealed-facts.js';
|
|
4
6
|
import { publishProgram } from './contribution.js';
|
|
7
|
+
import { createEvaluationOrdinals, createOrdinalCounter } from './producers/mint.js';
|
|
5
8
|
export const normalizeProgram = (input) => {
|
|
6
9
|
// One producer set per copy, built on first use and reused: the set is a
|
|
7
10
|
// dozen closures and rebuilding it per candidate would rebuild it thousands
|
|
8
11
|
// of times for one answer.
|
|
9
12
|
const byCopy = new Map();
|
|
13
|
+
let minting = { ordinals: createOrdinalCounter(), evaluationOrdinals: createEvaluationOrdinals() };
|
|
10
14
|
const producersFor = (candidate) => {
|
|
11
15
|
const key = input.copyKey(candidate);
|
|
12
16
|
const cached = byCopy.get(key);
|
|
13
17
|
if (cached)
|
|
14
18
|
return cached;
|
|
15
|
-
|
|
19
|
+
if (minting === null)
|
|
20
|
+
throw new Error('a producer set was asked for after minting ended');
|
|
21
|
+
const built = new Map(input.producers(candidate, minting).map((producer) => [producer.family, producer]));
|
|
16
22
|
byCopy.set(key, built);
|
|
17
23
|
return built;
|
|
18
24
|
};
|
|
19
|
-
|
|
25
|
+
// Normalization consumes the census. Each family's candidates go once that
|
|
26
|
+
// family has produced; the census itself keeps none of them, nor does the
|
|
27
|
+
// caller's view of it -- a 48K-line app's 211k candidates were otherwise
|
|
28
|
+
// alive to the end of normalization, its peak. Only the first candidate of
|
|
29
|
+
// each family is kept, to answer which families have no producer.
|
|
30
|
+
const firstCandidates = new Map();
|
|
31
|
+
const drained = new Map();
|
|
32
|
+
for (const [family, candidates] of input.census.byFamily) {
|
|
33
|
+
drained.set(family, candidates);
|
|
34
|
+
const first = candidates[0];
|
|
35
|
+
if (first !== undefined)
|
|
36
|
+
firstCandidates.set(family, first);
|
|
37
|
+
}
|
|
38
|
+
;
|
|
39
|
+
input.census.byFamily.clear();
|
|
40
|
+
input.census.candidates.length = 0;
|
|
41
|
+
// Sealed as each candidate contributes rather than once all have: the
|
|
42
|
+
// unsealed copies of every operation's identities and facts were otherwise
|
|
43
|
+
// all alive together at the end of publication, the frontend's peak.
|
|
44
|
+
const published = publishProgram(operationFamilies, producersFor, drained, internSealedFacts());
|
|
45
|
+
// Every producer set exists by now -- each first candidate asked for its own
|
|
46
|
+
// -- so this is answered from the cache, which then goes with the counters
|
|
47
|
+
// its producers closed over, before the graph's tables are built.
|
|
48
|
+
const uninstalledFamilies = operationFamilies.filter((family) => {
|
|
49
|
+
const first = firstCandidates.get(family);
|
|
50
|
+
return first !== undefined && !producersFor(first).has(family);
|
|
51
|
+
});
|
|
52
|
+
byCopy.clear();
|
|
53
|
+
minting = null;
|
|
54
|
+
input.produced();
|
|
20
55
|
const operations = new Map();
|
|
21
|
-
|
|
56
|
+
// Only a result whose identity does not name its own operation needs an
|
|
57
|
+
// entry of its own; every other one is answered by the operation table.
|
|
58
|
+
const foreignResults = new Map();
|
|
59
|
+
let resultCount = 0;
|
|
22
60
|
for (const operation of published.operations) {
|
|
23
61
|
if (operations.has(operation.id)) {
|
|
24
62
|
throw new Error(`operation ${operation.id} was published twice; one source operation must mint one identity`);
|
|
25
63
|
}
|
|
26
64
|
operations.set(operation.id, operation);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
65
|
+
}
|
|
66
|
+
for (const operation of operations.values()) {
|
|
67
|
+
const { results } = operation;
|
|
68
|
+
for (let index = 0; index < results.length; index++) {
|
|
69
|
+
const result = results[index];
|
|
70
|
+
// Two results share an identity only within one operation, or when one
|
|
71
|
+
// of them does not name its own publisher.
|
|
72
|
+
for (let earlier = 0; earlier < index; earlier++)
|
|
73
|
+
if (results[earlier].id === result.id)
|
|
74
|
+
throw new Error(`result ${result.id} was published twice`);
|
|
75
|
+
const named = operations.get(operationOfResult(result.id));
|
|
76
|
+
if (named === operation) {
|
|
77
|
+
if (foreignResults.has(result.id))
|
|
78
|
+
throw new Error(`result ${result.id} was published twice`);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
if (foreignResults.has(result.id) || named?.results.some((other) => other.id === result.id))
|
|
82
|
+
throw new Error(`result ${result.id} was published twice`);
|
|
83
|
+
foreignResults.set(result.id, operation.id);
|
|
84
|
+
}
|
|
85
|
+
resultCount++;
|
|
31
86
|
}
|
|
32
87
|
}
|
|
88
|
+
const results = new PublishedResults(operations, foreignResults, resultCount);
|
|
33
89
|
const regions = new Map();
|
|
34
90
|
for (const region of input.census.regions.values())
|
|
35
91
|
regions.set(region.id, region);
|
|
@@ -48,21 +104,75 @@ export const normalizeProgram = (input) => {
|
|
|
48
104
|
return operations.has(edge.loop);
|
|
49
105
|
return operations.has(edgeSource(edge, (result) => results.get(result) ?? ''));
|
|
50
106
|
};
|
|
107
|
+
// The gating walk's links pass the same filter its materialized edges did,
|
|
108
|
+
// decided once per shared chain rather than once per operation inside it.
|
|
109
|
+
const linkReaches = (link) => {
|
|
110
|
+
if (link.kind === 'guard')
|
|
111
|
+
return results.has(link.guard);
|
|
112
|
+
return operations.has(link.kind === 'region' ? link.region : link.loop);
|
|
113
|
+
};
|
|
114
|
+
const gated = input.gates(operations);
|
|
115
|
+
const sealChain = gateScopeSealer();
|
|
116
|
+
const sealedChains = new Map();
|
|
117
|
+
const gatedOperations = [];
|
|
118
|
+
const innermostScopes = [];
|
|
119
|
+
for (let index = 0; index < gated.operations.length; index++) {
|
|
120
|
+
const chain = gated.chains[index];
|
|
121
|
+
// An operation that was withheld would be every edge's dangling `to`.
|
|
122
|
+
const to = operations.get(gated.operations[index])?.id;
|
|
123
|
+
if (to === undefined)
|
|
124
|
+
continue;
|
|
125
|
+
let innermost = sealedChains.get(chain);
|
|
126
|
+
if (innermost === undefined) {
|
|
127
|
+
const reaching = chain.filter(linkReaches);
|
|
128
|
+
for (const link of reaching)
|
|
129
|
+
if (link.kind === 'guard' && !Object.isFrozen(link))
|
|
130
|
+
link.guard = internedText(link.guard);
|
|
131
|
+
innermost = sealChain(reaching);
|
|
132
|
+
sealedChains.set(chain, innermost);
|
|
133
|
+
}
|
|
134
|
+
if (innermost === null)
|
|
135
|
+
continue;
|
|
136
|
+
gatedOperations.push(to);
|
|
137
|
+
innermostScopes.push(innermost);
|
|
138
|
+
}
|
|
139
|
+
// An operation standing for its value edges stands for them only while all
|
|
140
|
+
// of them reach; otherwise the ones that do are stated one by one, which is
|
|
141
|
+
// what filtering the uncompacted edges kept.
|
|
142
|
+
const reachingEdges = [];
|
|
143
|
+
for (const entry of published.edges) {
|
|
144
|
+
if (!('family' in entry)) {
|
|
145
|
+
if (reaches(entry))
|
|
146
|
+
reachingEdges.push(entry);
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
let all = true;
|
|
150
|
+
for (const edge of edgesStatedBy(entry))
|
|
151
|
+
if (!reaches(edge)) {
|
|
152
|
+
all = false;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
if (all)
|
|
156
|
+
reachingEdges.push(entry);
|
|
157
|
+
else
|
|
158
|
+
for (const edge of edgesStatedBy(entry))
|
|
159
|
+
if (reaches(edge))
|
|
160
|
+
reachingEdges.push(edge);
|
|
161
|
+
}
|
|
51
162
|
const graph = {
|
|
52
163
|
regions,
|
|
53
164
|
structuralTypes: input.types.seal(),
|
|
54
165
|
operations,
|
|
55
|
-
edges:
|
|
166
|
+
edges: new SemanticEdgeTable(compactStatedEdges(reachingEdges, (id) => operations.get(id)), {
|
|
167
|
+
operations: gatedOperations,
|
|
168
|
+
innermost: innermostScopes
|
|
169
|
+
}),
|
|
56
170
|
coverage: published.reports,
|
|
57
171
|
results
|
|
58
172
|
};
|
|
59
173
|
validateGraph(graph);
|
|
60
174
|
return {
|
|
61
175
|
graph,
|
|
62
|
-
uninstalledFamilies
|
|
63
|
-
const candidates = input.census.byFamily.get(family) ?? [];
|
|
64
|
-
const first = candidates[0];
|
|
65
|
-
return first !== undefined && !producersFor(first).has(family);
|
|
66
|
-
})
|
|
176
|
+
uninstalledFamilies
|
|
67
177
|
};
|
|
68
178
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Membership as one bit per key number, over the span of numbers this set has
|
|
3
|
+
* held -- a `Set` spent two slots and a share of a bucket on every key.
|
|
4
|
+
*/
|
|
5
|
+
export declare class KeySet<K extends object> {
|
|
6
|
+
#private;
|
|
7
|
+
has(key: K): boolean;
|
|
8
|
+
add(key: K): void;
|
|
9
|
+
delete(key: K): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A memo of answers that are mostly `null`, as a drop-in for the
|
|
14
|
+
* `Map<K, V | null>` it replaces: misses go to a `KeySet`, a bit per key where
|
|
15
|
+
* the map spent three slots on a key and its `null`.
|
|
16
|
+
*
|
|
17
|
+
* The binding censuses memoize a type per node they are asked about, and on a
|
|
18
|
+
* 48K-line app over 99% of those answers are `null` -- one stated-type memo
|
|
19
|
+
* holds 232K nodes and 512 types -- for the whole compile, since each round's
|
|
20
|
+
* census stays the upstream of the next.
|
|
21
|
+
*/
|
|
22
|
+
export declare class NullableMemo<K extends object, V> {
|
|
23
|
+
#private;
|
|
24
|
+
get(key: K): V | null | undefined;
|
|
25
|
+
has(key: K): boolean;
|
|
26
|
+
set(key: K, value: V | null): this;
|
|
27
|
+
clear(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A dense number for every key any `KeySet` has held, in first-held order.
|
|
3
|
+
*
|
|
4
|
+
* Shared, because the sets that use it hold largely the same keys: the
|
|
5
|
+
* binding censuses' null-answer memos held 652K entries over 169K distinct
|
|
6
|
+
* nodes on a 48K-line app, every one of them alive at the end of production,
|
|
7
|
+
* the frontend's peak. A key is one entry here and one bit in each set that
|
|
8
|
+
* holds it. Weak, so a number goes with its node; numbers are never reused.
|
|
9
|
+
*/
|
|
10
|
+
const keyNumbers = new WeakMap();
|
|
11
|
+
let nextKeyNumber = 0;
|
|
12
|
+
/**
|
|
13
|
+
* Membership as one bit per key number, over the span of numbers this set has
|
|
14
|
+
* held -- a `Set` spent two slots and a share of a bucket on every key.
|
|
15
|
+
*/
|
|
16
|
+
export class KeySet {
|
|
17
|
+
/** Bit `n` is word `(n >>> 5) - #base`, bit `n & 31`. */
|
|
18
|
+
#words = new Uint32Array(0);
|
|
19
|
+
#base = 0;
|
|
20
|
+
has(key) {
|
|
21
|
+
const number = keyNumbers.get(key);
|
|
22
|
+
if (number === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
const word = (number >>> 5) - this.#base;
|
|
25
|
+
return word >= 0 && word < this.#words.length && (this.#words[word] & (1 << (number & 31))) !== 0;
|
|
26
|
+
}
|
|
27
|
+
add(key) {
|
|
28
|
+
let number = keyNumbers.get(key);
|
|
29
|
+
if (number === undefined)
|
|
30
|
+
keyNumbers.set(key, (number = nextKeyNumber++));
|
|
31
|
+
const word = number >>> 5;
|
|
32
|
+
if (this.#words.length === 0) {
|
|
33
|
+
this.#words = new Uint32Array(8);
|
|
34
|
+
this.#base = word;
|
|
35
|
+
}
|
|
36
|
+
else if (word < this.#base || word >= this.#base + this.#words.length) {
|
|
37
|
+
const end = Math.max(this.#base + this.#words.length, word + 1);
|
|
38
|
+
const base = Math.min(this.#base, word);
|
|
39
|
+
// Grown by half again past what is needed, so a set filled in rising
|
|
40
|
+
// number order -- the common case, numbers being handed out as asked --
|
|
41
|
+
// copies its words a logarithmic number of times.
|
|
42
|
+
const words = new Uint32Array(end - base + ((end - base) >>> 1));
|
|
43
|
+
words.set(this.#words, this.#base - base);
|
|
44
|
+
this.#words = words;
|
|
45
|
+
this.#base = base;
|
|
46
|
+
}
|
|
47
|
+
this.#words[word - this.#base] |= 1 << (number & 31);
|
|
48
|
+
}
|
|
49
|
+
delete(key) {
|
|
50
|
+
const number = keyNumbers.get(key);
|
|
51
|
+
if (number === undefined)
|
|
52
|
+
return;
|
|
53
|
+
const word = (number >>> 5) - this.#base;
|
|
54
|
+
if (word >= 0 && word < this.#words.length)
|
|
55
|
+
this.#words[word] &= ~(1 << (number & 31));
|
|
56
|
+
}
|
|
57
|
+
clear() {
|
|
58
|
+
this.#words = new Uint32Array(0);
|
|
59
|
+
this.#base = 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A memo of answers that are mostly `null`, as a drop-in for the
|
|
64
|
+
* `Map<K, V | null>` it replaces: misses go to a `KeySet`, a bit per key where
|
|
65
|
+
* the map spent three slots on a key and its `null`.
|
|
66
|
+
*
|
|
67
|
+
* The binding censuses memoize a type per node they are asked about, and on a
|
|
68
|
+
* 48K-line app over 99% of those answers are `null` -- one stated-type memo
|
|
69
|
+
* holds 232K nodes and 512 types -- for the whole compile, since each round's
|
|
70
|
+
* census stays the upstream of the next.
|
|
71
|
+
*/
|
|
72
|
+
export class NullableMemo {
|
|
73
|
+
#answers = new Map();
|
|
74
|
+
#misses = new KeySet();
|
|
75
|
+
get(key) {
|
|
76
|
+
const answer = this.#answers.get(key);
|
|
77
|
+
if (answer !== undefined)
|
|
78
|
+
return answer;
|
|
79
|
+
return this.#misses.has(key) ? null : undefined;
|
|
80
|
+
}
|
|
81
|
+
has(key) {
|
|
82
|
+
return this.#answers.has(key) || this.#misses.has(key);
|
|
83
|
+
}
|
|
84
|
+
set(key, value) {
|
|
85
|
+
if (value === null) {
|
|
86
|
+
this.#answers.delete(key);
|
|
87
|
+
this.#misses.add(key);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this.#misses.delete(key);
|
|
91
|
+
this.#answers.set(key, value);
|
|
92
|
+
}
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
clear() {
|
|
96
|
+
this.#answers.clear();
|
|
97
|
+
this.#misses.clear();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import type { StructuralTypeId } from '../../identity/ids.js';
|
|
3
3
|
import type { StructuralTypeTable } from '../model/structural-type-table.js';
|
|
4
4
|
import type { StructuralShape } from '../model/structural-types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { censusRefusal } from './census-refusal.js';
|
|
3
3
|
import { disjointUnionTypeOf, isGlobalObjectAssign, jsDocTypeStatesNothing, literalMemberNameOf, widestOf } from './derived-expression-type.js';
|
|
4
4
|
import { emptyParameterBindingCensus } from './parameter-bindings.js';
|
|
@@ -6,6 +6,7 @@ import { definitelyReturns } from './return-paths.js';
|
|
|
6
6
|
import { createBagAbsenceResolver } from './bag-absence.js';
|
|
7
7
|
import { forEachReachableStatement } from './reachability.js';
|
|
8
8
|
import { isObjectLiteralPrototypeSetter } from './assignment-patterns.js';
|
|
9
|
+
import { createRoundTableSharing } from './round-tables.js';
|
|
9
10
|
/** An identity fixpoint that claimed nothing, for callers that state no program. */
|
|
10
11
|
const emptyObjectBagIdentity = {
|
|
11
12
|
roots: new Set(),
|
|
@@ -39,6 +40,8 @@ const emptyEvidence = () => ({
|
|
|
39
40
|
indexRead: false,
|
|
40
41
|
opaqueUse: null
|
|
41
42
|
});
|
|
43
|
+
/** Every round's bag census stays alive beside the next; see `createRoundTableSharing`. */
|
|
44
|
+
const shareBagTables = createRoundTableSharing();
|
|
42
45
|
export const censusObjectBagBindings = (checker, files, reachable, parameters = emptyParameterBindingCensus,
|
|
43
46
|
/**
|
|
44
47
|
* The whole-program value-flow index -- see `flow/model.ts`. This census's
|
|
@@ -400,7 +403,7 @@ flow) => {
|
|
|
400
403
|
// stable storage owner; their aliases are handled by the existing closure.
|
|
401
404
|
const storageWrites = flow.allWrites.filter((write) => write.slot === 'whole');
|
|
402
405
|
const ownerOfWrite = (write) => (write.naming && ts.isPropertyAccessExpression(write.naming) ? ownerDeclOfExpr(write.naming) : null) ?? write.target.declaration;
|
|
403
|
-
|
|
406
|
+
let allocationOwners = new Map();
|
|
404
407
|
for (const write of storageWrites) {
|
|
405
408
|
if (write.value === null ||
|
|
406
409
|
!['declaration-initializer', 'class-field-initializer', 'identifier-assignment', 'property-assignment', 'index-assignment'].includes(write.edge))
|
|
@@ -560,10 +563,10 @@ flow) => {
|
|
|
560
563
|
// The `return` expressions of every function body, and the declarations
|
|
561
564
|
// initialized/assigned from an expression -- both collected once, then
|
|
562
565
|
// replayed until nothing new is claimed.
|
|
563
|
-
|
|
566
|
+
let returnsOf = new Map();
|
|
564
567
|
const assignments = [];
|
|
565
568
|
/** Every write to one declaration, so a claim can be tested against ALL of them and not just the one that made it. */
|
|
566
|
-
|
|
569
|
+
let writesTo = new Map();
|
|
567
570
|
const unknownWrites = new Set();
|
|
568
571
|
const noteWrite = (target, value) => {
|
|
569
572
|
const existing = writesTo.get(target);
|
|
@@ -1227,6 +1230,9 @@ flow) => {
|
|
|
1227
1230
|
shapesByType.set(type, shape);
|
|
1228
1231
|
}
|
|
1229
1232
|
}
|
|
1233
|
+
// Complete from here on: nothing below writes them.
|
|
1234
|
+
;
|
|
1235
|
+
({ writesTo, allocationOwners, returnsOf } = shareBagTables(checker, { writesTo, allocationOwners, returnsOf }));
|
|
1230
1236
|
const absencesAt = createBagAbsenceResolver(checker, ownerDeclOfExpr, calleeDeclarationOf, writesTo, returnsOf);
|
|
1231
1237
|
const valueShape = (root, node) => {
|
|
1232
1238
|
let bag = root ? bound.get(root) : undefined;
|
|
@@ -1238,6 +1244,11 @@ flow) => {
|
|
|
1238
1244
|
bag = shapesByType.get(checker.getTypeAtLocation(node)) ?? undefined;
|
|
1239
1245
|
return bag ? { ...bag, absences: absencesAt(node) } : null;
|
|
1240
1246
|
};
|
|
1247
|
+
// The replay inputs are read only above. The closures returned below share
|
|
1248
|
+
// this function's context, so without this every census held its whole
|
|
1249
|
+
// assignment list for as long as any answer was asked (one per round).
|
|
1250
|
+
assignments.length = 0;
|
|
1251
|
+
memberAssignments.length = 0;
|
|
1241
1252
|
return {
|
|
1242
1253
|
identity: { roots: new Set(literalsByOwner.keys()), bagOf, returnsBag, conflicted, ungrounded },
|
|
1243
1254
|
shapeForType: (type) => shapesByType.get(type) ?? null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { annotationStatesNothing, containsUnstatedPosition, isUnusableEvidence, jsDocTypeStatesNothing, withoutUndefinedMember } from './derived-expression-type.js';
|
|
3
3
|
/** The JSDoc statement of a JavaScript parameter this rule may widen, or `null`. */
|
|
4
4
|
export const omissionStatedTypeOf = (checker, parameter) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { type ImplicitArgumentsTuple } from './implicit-arguments-tuple.js';
|
|
3
3
|
import { type ArgumentsObjectCensus } from './arguments-objects.js';
|
|
4
4
|
import { type CensusRefusal } from './census-refusal.js';
|
|
@@ -6,57 +6,6 @@ import type { ExplicitThisCallFrame, FlowInvocationOperands, ValueFlowIndex } fr
|
|
|
6
6
|
import { type AliasEvidence } from './derived-expression-type.js';
|
|
7
7
|
import type { SpecializationCensus } from './specialization.js';
|
|
8
8
|
import { type ProgramReachability } from './reachability.js';
|
|
9
|
-
/**
|
|
10
|
-
* The type a parameter the program never annotated is actually called with.
|
|
11
|
-
*
|
|
12
|
-
* An unannotated parameter in a JavaScript file is typed `any` by the checker.
|
|
13
|
-
* That answer describes where TypeScript looked, not what the program says:
|
|
14
|
-
* TypeScript infers a parameter's type from its annotation and from nothing
|
|
15
|
-
* else, and never from the arguments a call passes it. A factory `function
|
|
16
|
-
* Textures( gl, extensions, state, ... )` called exactly once in a program,
|
|
17
|
-
* from `Renderer`, with seven arguments whose types are all known -- the
|
|
18
|
-
* types exist, they are simply not written down anywhere the checker consults.
|
|
19
|
-
*
|
|
20
|
-
* This is the same shape of question `structural-layout-type.ts` already
|
|
21
|
-
* answers for an evolving array, one level up: the checker HAS the answer, and
|
|
22
|
-
* this asks it at the location where the checker has one. It is emphatically
|
|
23
|
-
* not the compiler inventing a type. Every type this module produces came out
|
|
24
|
-
* of the checker -- either as an argument's own type at a call site, or as the
|
|
25
|
-
* checker's answer about a member of one. What the module contributes is the
|
|
26
|
-
* connection between the two, which is the part TypeScript does not make.
|
|
27
|
-
*
|
|
28
|
-
* ## Why this is not the boxed carrier's business
|
|
29
|
-
*
|
|
30
|
-
* `representation/model.ts` admits the dynamic carrier for exactly four
|
|
31
|
-
* reasons, one of which is "the program itself declared `any`/`unknown` and
|
|
32
|
-
* never narrowed it". A parameter with no annotation declared NOTHING. Filing
|
|
33
|
-
* it under that reason reads the absence of a statement as a statement, which
|
|
34
|
-
* is how a few hundred unannotated parameters in an untyped JavaScript library
|
|
35
|
-
* came to cascade tens of thousands of boxed carriers through a program whose
|
|
36
|
-
* types are all knowable.
|
|
37
|
-
*
|
|
38
|
-
* A parameter the program DID annotate `: any` is untouched here, and must be:
|
|
39
|
-
* that one is a statement, and honoring it is the rule working.
|
|
40
|
-
*
|
|
41
|
-
* ## What it refuses
|
|
42
|
-
*
|
|
43
|
-
* Every refusal below leaves the parameter exactly as it is today -- `any`,
|
|
44
|
-
* boxed -- because a wrong type is far worse than a boxed one:
|
|
45
|
-
*
|
|
46
|
-
* - a function whose name escapes to any position other than the callee of a
|
|
47
|
-
* call this census resolved back to it. A function held as a value can be
|
|
48
|
-
* called from somewhere this enumeration cannot see, and a parameter bound
|
|
49
|
-
* from a partial view of its callers is bound from a guess.
|
|
50
|
-
* - a parameter assigned anywhere in its own body. Its value is then not the
|
|
51
|
-
* argument's, and the argument's type is not its type.
|
|
52
|
-
* - call sites that disagree. Agreement is never tested by spelling. Two sites
|
|
53
|
-
* passing the same interned checker type describe one value shape; sites
|
|
54
|
-
* passing different types agree only when one of those types provably holds
|
|
55
|
-
* all the others, which the checker itself decides. Anything else is refused
|
|
56
|
-
* rather than merged into a union nobody wrote -- see `widestOf`.
|
|
57
|
-
* - a rest parameter, a destructured parameter, and any argument whose own type
|
|
58
|
-
* is still `any` -- propagating `any` is what this exists to stop.
|
|
59
|
-
*/
|
|
60
9
|
export interface ParameterBindingCensus {
|
|
61
10
|
/** Known executable destinations, including aliases and overrides. Positive evidence, not a proof that no opaque target exists. */
|
|
62
11
|
readonly callTargetsAt?: (call: ts.CallExpression | ts.NewExpression) => readonly ts.SignatureDeclaration[] | null;
|