@geastack/compiler 1.0.37 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
|
@@ -4,17 +4,16 @@ import { withSharedArrayStorage } from './normalize/shared-array-storage.js';
|
|
|
4
4
|
import { deadEventCallsOf } from './normalize/dead-event-emissions.js';
|
|
5
5
|
import { censusNativeFunctionSignatures } from './native-function-signatures.js';
|
|
6
6
|
import { anyKeyedWriteTypes, prototypeMutatedConstructorTypes, proxyFallbackTypes } from './dynamic-fallback.js';
|
|
7
|
-
import ts from 'typescript';
|
|
7
|
+
import ts from '#typescript';
|
|
8
8
|
import { structuralShapeKey } from './model/structural-types.js';
|
|
9
9
|
import { createPackageDeclarationNames, resolveHostMethod } from './host-methods.js';
|
|
10
10
|
import { componentId, positionKeyOfDeclaration, positionKeyOfNode, regionId } from '../identity/ids.js';
|
|
11
11
|
import { createStructuralTypeTable } from './model/structural-type-table.js';
|
|
12
12
|
import { censusProgram } from './normalize/census.js';
|
|
13
|
-
import { createIdentityTable, rootSpecialization } from './normalize/identities.js';
|
|
13
|
+
import { createIdentityTable, rootSpecialization, walkOrdinals } from './normalize/identities.js';
|
|
14
14
|
import { censusDeclaredIntegers } from './declared-integers.js';
|
|
15
15
|
import { gatingEdges } from './normalize/gating.js';
|
|
16
16
|
import { normalizeProgram } from './normalize/normalize.js';
|
|
17
|
-
import { createEvaluationOrdinals, createOrdinalCounter } from './normalize/producers/mint.js';
|
|
18
17
|
import { intrinsicPropertyCallOf } from './normalize/intrinsic-property-call.js';
|
|
19
18
|
import { createStructuralMapper } from './normalize/structural.js';
|
|
20
19
|
import { createSloppyAbsenceCensus, noSloppyAbsence } from './normalize/sloppy-absence.js';
|
|
@@ -61,7 +60,7 @@ import { censusObjectBagBindings, emptyObjectBagCensus } from './normalize/objec
|
|
|
61
60
|
import { indexValueFlow, sameValueFlowContent } from './normalize/flow/value-flow.js';
|
|
62
61
|
import { attachClosedScriptScope, attachStatedModuleSet } from './normalize/flow/targets.js';
|
|
63
62
|
import { censusRefusalCounts } from './normalize/census-refusal.js';
|
|
64
|
-
import { createCellPolicyRegistry, defaultCellEvidencePolicies, buildCellFactsTable, publishCellFacts } from './normalize/cells/index.js';
|
|
63
|
+
import { createCellPolicyRegistry, defaultCellEvidencePolicies, buildCellFactsTable, cellFactsSummaryOf, publishCellFacts } from './normalize/cells/index.js';
|
|
65
64
|
import { settleBindingCensus } from './normalize/binding-fixpoint.js';
|
|
66
65
|
import { withJsDocTypeNames } from './normalize/jsdoc-type-names.js';
|
|
67
66
|
import { censusReachability, wholeProgram, fileEvaluates, moduleEvaluationOrder, nodeIsReachable } from './normalize/reachability.js';
|
|
@@ -270,6 +269,93 @@ const nativeConstructorCandidatesOf = (file) => {
|
|
|
270
269
|
nativeConstructorCandidates.set(file, found);
|
|
271
270
|
return found;
|
|
272
271
|
};
|
|
272
|
+
const locateFile = (file) => {
|
|
273
|
+
const ordinals = walkOrdinals(file);
|
|
274
|
+
const count = ordinals.size;
|
|
275
|
+
const starts = new Int32Array(count).fill(-1);
|
|
276
|
+
const ends = new Int32Array(count);
|
|
277
|
+
const names = new Int32Array(count).fill(-1);
|
|
278
|
+
const spelledNames = new Map();
|
|
279
|
+
for (const [node, ordinal] of ordinals.entries()) {
|
|
280
|
+
starts[ordinal] = node.getStart(file);
|
|
281
|
+
ends[ordinal] = node.end;
|
|
282
|
+
const name = ts.getNameOfDeclaration(node);
|
|
283
|
+
if (!name || !ts.isIdentifier(name))
|
|
284
|
+
continue;
|
|
285
|
+
const at = ordinals.get(name);
|
|
286
|
+
// An escape is always longer than what it spells, so equal length is equal text.
|
|
287
|
+
if (at !== undefined && name.end - name.getStart(file) === name.text.length)
|
|
288
|
+
names[ordinal] = at;
|
|
289
|
+
else
|
|
290
|
+
spelledNames.set(ordinal, name.text);
|
|
291
|
+
}
|
|
292
|
+
return { fileName: file.fileName, text: file.text, lineStarts: null, starts, ends, names, spelledNames };
|
|
293
|
+
};
|
|
294
|
+
/** TypeScript's own line breaks (`computeLineStarts`): CR LF, CR, LF, LS and PS. */
|
|
295
|
+
const lineStartsOf = (text) => {
|
|
296
|
+
const starts = [0];
|
|
297
|
+
for (let at = 0; at < text.length; at++) {
|
|
298
|
+
const code = text.charCodeAt(at);
|
|
299
|
+
if (code === 13 && text.charCodeAt(at + 1) === 10)
|
|
300
|
+
continue;
|
|
301
|
+
if (code === 10 || code === 13 || code === 0x2028 || code === 0x2029)
|
|
302
|
+
starts.push(at + 1);
|
|
303
|
+
}
|
|
304
|
+
return starts;
|
|
305
|
+
};
|
|
306
|
+
const lineAndCharacterOf = (file, position) => {
|
|
307
|
+
const starts = (file.lineStarts ??= lineStartsOf(file.text));
|
|
308
|
+
let low = 0;
|
|
309
|
+
let high = starts.length - 1;
|
|
310
|
+
while (low < high) {
|
|
311
|
+
const middle = (low + high + 1) >> 1;
|
|
312
|
+
if (starts[middle] <= position)
|
|
313
|
+
low = middle;
|
|
314
|
+
else
|
|
315
|
+
high = middle - 1;
|
|
316
|
+
}
|
|
317
|
+
return { line: low, character: position - starts[low] };
|
|
318
|
+
};
|
|
319
|
+
const createSourceLocator = (files) => {
|
|
320
|
+
const located = new Map();
|
|
321
|
+
for (const [identity, file] of files)
|
|
322
|
+
if (!located.has(identity))
|
|
323
|
+
located.set(identity, locateFile(file));
|
|
324
|
+
const at = (key) => {
|
|
325
|
+
const split = key.lastIndexOf('|');
|
|
326
|
+
const file = split < 0 ? undefined : located.get(key.slice(0, split));
|
|
327
|
+
const text = key.slice(split + 1);
|
|
328
|
+
const ordinal = Number(text);
|
|
329
|
+
if (file === undefined || !Number.isInteger(ordinal) || String(ordinal) !== text || ordinal < 0 || ordinal >= file.starts.length)
|
|
330
|
+
return null;
|
|
331
|
+
return file.starts[ordinal] < 0 ? null : { file, ordinal };
|
|
332
|
+
};
|
|
333
|
+
const locationOf = (found) => {
|
|
334
|
+
if (!found)
|
|
335
|
+
return null;
|
|
336
|
+
const { line, character } = lineAndCharacterOf(found.file, found.file.starts[found.ordinal]);
|
|
337
|
+
return { file: found.file.fileName, line: line + 1, column: character + 1 };
|
|
338
|
+
};
|
|
339
|
+
const textAt = (file, ordinal) => file.text.substring(file.starts[ordinal], file.ends[ordinal]);
|
|
340
|
+
return {
|
|
341
|
+
locationOfNode: (node) => locationOf(at(positionKeyOfNode(node))),
|
|
342
|
+
textOfNode: (node) => {
|
|
343
|
+
const found = at(positionKeyOfNode(node));
|
|
344
|
+
return found ? textAt(found.file, found.ordinal) : null;
|
|
345
|
+
},
|
|
346
|
+
locationOfDeclaration: (declaration) => locationOf(at(positionKeyOfDeclaration(declaration))),
|
|
347
|
+
nameOfDeclaration: (declaration) => {
|
|
348
|
+
const found = at(positionKeyOfDeclaration(declaration));
|
|
349
|
+
if (!found)
|
|
350
|
+
return null;
|
|
351
|
+
const spelled = found.file.spelledNames.get(found.ordinal);
|
|
352
|
+
if (spelled !== undefined)
|
|
353
|
+
return spelled;
|
|
354
|
+
const name = found.file.names[found.ordinal];
|
|
355
|
+
return name < 0 ? null : textAt(found.file, name);
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
};
|
|
273
359
|
export const runFrontend = (input) => {
|
|
274
360
|
const timing = createFrontendTiming('phases');
|
|
275
361
|
const compiled = createProgram({
|
|
@@ -327,6 +413,9 @@ export const runFrontend = (input) => {
|
|
|
327
413
|
verbatimModuleSyntax: compiled.program.getCompilerOptions().verbatimModuleSyntax === true,
|
|
328
414
|
...(input.hostReachedMemberKeys ? { hostReachedMemberKeys: input.hostReachedMemberKeys } : {})
|
|
329
415
|
});
|
|
416
|
+
// The whole-program index exists only to answer reachability's constructor
|
|
417
|
+
// questions, all asked by now; held, it stayed live through every phase below.
|
|
418
|
+
constructionFlow = undefined;
|
|
330
419
|
// Instantiations are censused before anything is normalized, because the
|
|
331
420
|
// answer is whole-program: which type a generic is instantiated at is decided
|
|
332
421
|
// by every call site together, and a walk that learned it as it went would
|
|
@@ -510,7 +599,7 @@ export const runFrontend = (input) => {
|
|
|
510
599
|
// -- no round ever qualified, because the answers
|
|
511
600
|
// move until the very round that settles, and holding the previous index
|
|
512
601
|
// alive across the boundary raised the peak from 7 GB to 11 GB.
|
|
513
|
-
const
|
|
602
|
+
const built = upstream && !process.env['GEA_FLOW_CENSUS_OFF']
|
|
514
603
|
? indexValueFlow(compiled.checker, compiled.sourceFiles, reachable, censusTypeVia(upstream), upstream.callDeclarationAt, upstream.callTargetsAt, buildIsStrict, upstream.explicitThisAt)
|
|
515
604
|
: baseValueFlow;
|
|
516
605
|
// The round that settles the fixpoint rebuilds the very index the round
|
|
@@ -522,9 +611,21 @@ export const runFrontend = (input) => {
|
|
|
522
611
|
// census, while a session depends on nothing but its index
|
|
523
612
|
// (`shareSourceValueSession`). `GEA_SESSION_SHARE_OFF` keeps the
|
|
524
613
|
// rebuild, so the claim stays checkable from one build.
|
|
525
|
-
const
|
|
526
|
-
? roundFlows.find((earlier) => earlier !==
|
|
614
|
+
const contentEqual = process.env['GEA_SESSION_SHARE_OFF'] === undefined
|
|
615
|
+
? roundFlows.find((earlier) => earlier !== built && sameValueFlowContent(earlier, built))
|
|
527
616
|
: undefined;
|
|
617
|
+
// The settling round's index is a new identity over the earlier index's
|
|
618
|
+
// tables, not the rebuilt copy of them. The carried session holds the
|
|
619
|
+
// earlier index -- its solver caches that index's write and call-site
|
|
620
|
+
// objects as query keys and facts -- so keeping the rebuild left two
|
|
621
|
+
// content-equal sets of writes, call sites and lookup tables alive to the
|
|
622
|
+
// end of normalization. A fresh object still keys every per-index cache
|
|
623
|
+
// afresh, and an index is immutable once built, so sharing its tables is
|
|
624
|
+
// sharing nothing a round can change; the session and the round's other
|
|
625
|
+
// consumers now also see one set of write and call-site objects instead
|
|
626
|
+
// of two that are equal only field by field.
|
|
627
|
+
const valueFlow = contentEqual ? { ...contentEqual } : built;
|
|
628
|
+
const sharedFrom = contentEqual && shareSourceValueSession(contentEqual, valueFlow) ? contentEqual : undefined;
|
|
528
629
|
// A round's solver is asked nothing once the next round's index replaces
|
|
529
630
|
// it (`retireSourceValueSession`); keeping it cost ~1 GB per round. A
|
|
530
631
|
// solver handed on above is the new round's own, and stays.
|
|
@@ -970,6 +1071,9 @@ export const runFrontend = (input) => {
|
|
|
970
1071
|
for (const site of sites)
|
|
971
1072
|
actualArgumentSites.add(site);
|
|
972
1073
|
const settledArgumentsObjects = { ...argumentsObjects, actualFrameOf: (node) => actualArgumentSites.has(node) };
|
|
1074
|
+
// Everything a producer reads but the two ordinal counters, which are minted
|
|
1075
|
+
// per normalization below: the counters are read only while operations are
|
|
1076
|
+
// minted, and this context lives as long as the frontend does.
|
|
973
1077
|
const context = {
|
|
974
1078
|
nativeIterableAt: (source, consumer) => {
|
|
975
1079
|
if (!hostMutationFactsSealed)
|
|
@@ -1045,8 +1149,6 @@ export const runFrontend = (input) => {
|
|
|
1045
1149
|
// fact about the build, not about any one file's syntax.
|
|
1046
1150
|
buildIsStrict,
|
|
1047
1151
|
table,
|
|
1048
|
-
ordinals: createOrdinalCounter(),
|
|
1049
|
-
evaluationOrdinals: createEvaluationOrdinals(),
|
|
1050
1152
|
// Overridden per candidate below (`path: candidate.specialization`) --
|
|
1051
1153
|
// `rootSpecialization` here is only to satisfy the type on this shared
|
|
1052
1154
|
// base object, which is never read from directly as a producer context.
|
|
@@ -1321,8 +1423,10 @@ export const runFrontend = (input) => {
|
|
|
1321
1423
|
// view they ask. Everything else -- the checker, the identity table, both
|
|
1322
1424
|
// ordinal counters -- is the one shared context, because those answer
|
|
1323
1425
|
// whole-program questions that a copy must not fork.
|
|
1324
|
-
producers: (candidate) => input.producers({
|
|
1426
|
+
producers: (candidate, { ordinals, evaluationOrdinals }) => input.producers({
|
|
1325
1427
|
...context,
|
|
1428
|
+
ordinals,
|
|
1429
|
+
evaluationOrdinals,
|
|
1326
1430
|
identities: identities.forSpecialization(candidate.specialization),
|
|
1327
1431
|
types: types.forSpecialization(candidate.specialization),
|
|
1328
1432
|
path: candidate.specialization
|
|
@@ -1331,6 +1435,11 @@ export const runFrontend = (input) => {
|
|
|
1331
1435
|
// own answer, so the producer cache, the identity views and the structural
|
|
1332
1436
|
// mappers all agree on what "the same copy" means.
|
|
1333
1437
|
copyKey: (candidate) => identities.copyKeyOf(candidate.specialization),
|
|
1438
|
+
// The final round's solver answers the producers and nothing after them.
|
|
1439
|
+
produced: () => {
|
|
1440
|
+
for (const flow of roundFlows)
|
|
1441
|
+
retireSourceValueSession(flow);
|
|
1442
|
+
},
|
|
1334
1443
|
gates: (operations) => gatingEdges({
|
|
1335
1444
|
files: compiled.sourceFiles,
|
|
1336
1445
|
identities,
|
|
@@ -1344,6 +1453,7 @@ export const runFrontend = (input) => {
|
|
|
1344
1453
|
});
|
|
1345
1454
|
timing.mark('normalization');
|
|
1346
1455
|
timing.report();
|
|
1456
|
+
const fileIdentities = new Map([...identities.sourceFileNames].map(([identity, fileName]) => [fileName, identity]));
|
|
1347
1457
|
// See `FrontendResult.locationOfNode`. Lazy, because a compilation that
|
|
1348
1458
|
// reports nothing must not pay for a whole-program walk to name nodes
|
|
1349
1459
|
// nobody asked about.
|
|
@@ -1356,49 +1466,12 @@ export const runFrontend = (input) => {
|
|
|
1356
1466
|
// resolve a DeclarationId -- which never carries one -- through this SAME
|
|
1357
1467
|
// index instead of a second one built to answer the identical question in a
|
|
1358
1468
|
// different identity currency.
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
continue;
|
|
1366
|
-
const walk = (current) => {
|
|
1367
|
-
let key = null;
|
|
1368
|
-
try {
|
|
1369
|
-
key = positionKeyOfNode(identities.nodeIdOf(current));
|
|
1370
|
-
}
|
|
1371
|
-
catch {
|
|
1372
|
-
key = null;
|
|
1373
|
-
}
|
|
1374
|
-
if (key !== null && !index.has(key))
|
|
1375
|
-
index.set(key, current);
|
|
1376
|
-
ts.forEachChild(current, walk);
|
|
1377
|
-
};
|
|
1378
|
-
walk(file);
|
|
1379
|
-
}
|
|
1380
|
-
nodesByPosition = index;
|
|
1381
|
-
}
|
|
1382
|
-
return nodesByPosition;
|
|
1383
|
-
};
|
|
1384
|
-
const sourceNodeOf = (node) => positionIndex().get(positionKeyOfNode(node)) ?? null;
|
|
1385
|
-
const sourceNodeOfDeclaration = (declaration) => positionIndex().get(positionKeyOfDeclaration(declaration)) ?? null;
|
|
1386
|
-
const locationOfFound = (found) => {
|
|
1387
|
-
if (!found)
|
|
1388
|
-
return null;
|
|
1389
|
-
const file = found.getSourceFile();
|
|
1390
|
-
const { line, character } = file.getLineAndCharacterOfPosition(found.getStart());
|
|
1391
|
-
return { file: file.fileName, line: line + 1, column: character + 1 };
|
|
1392
|
-
};
|
|
1393
|
-
const locationOfNode = (node) => locationOfFound(sourceNodeOf(node));
|
|
1394
|
-
const textOfNode = (node) => sourceNodeOf(node)?.getText() ?? null;
|
|
1395
|
-
/** `locationOfNode`'s twin for a DeclarationId -- see `FrontendResult.locationOfDeclaration`. */
|
|
1396
|
-
const locationOfDeclaration = (declaration) => locationOfFound(sourceNodeOfDeclaration(declaration));
|
|
1397
|
-
const nameOfDeclaration = (declaration) => {
|
|
1398
|
-
const found = sourceNodeOfDeclaration(declaration);
|
|
1399
|
-
const name = found ? ts.getNameOfDeclaration(found) : undefined;
|
|
1400
|
-
return name && ts.isIdentifier(name) ? name.text : null;
|
|
1401
|
-
};
|
|
1469
|
+
const { locationOfNode, textOfNode, locationOfDeclaration, nameOfDeclaration } = createSourceLocator(compiled.sourceFiles.flatMap((file) => {
|
|
1470
|
+
if (file.isDeclarationFile)
|
|
1471
|
+
return [];
|
|
1472
|
+
const identity = fileIdentities.get(file.fileName);
|
|
1473
|
+
return identity === undefined ? [] : [[identity, file]];
|
|
1474
|
+
}));
|
|
1402
1475
|
for (const flow of roundFlows)
|
|
1403
1476
|
retireSourceValueSession(flow);
|
|
1404
1477
|
return {
|
|
@@ -1487,7 +1560,7 @@ export const runFrontend = (input) => {
|
|
|
1487
1560
|
['bags', { bound: bags.boundCount, refusals: censusRefusalCounts(bags.refusals) }]
|
|
1488
1561
|
]),
|
|
1489
1562
|
censusRefusals: [...parameters.refusals, ...collections.refusals, ...bags.refusals],
|
|
1490
|
-
cellFacts,
|
|
1563
|
+
cellFacts: cellFactsSummaryOf(cellFacts),
|
|
1491
1564
|
structuralDisagreements: types.structuralDisagreements,
|
|
1492
1565
|
structuralFormViolations: types.structuralFormViolations,
|
|
1493
1566
|
classCopies: types.classCopies()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import type { NamespacePathCensus } from './normalize/namespace-paths.js';
|
|
3
3
|
import type { DeclarationId, StructuralTypeId } from '../identity/ids.js';
|
|
4
4
|
import type { TypedArrayElementDomain } from '../representation/model.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { inlineJsxCallbackParameterType } from './normalize/callback-parameter-contracts.js';
|
|
3
3
|
import { declaredBaseTypesOf, globalSymbolBehindModuleAmbientConst, isAmbientSymbol } from './ambient.js';
|
|
4
4
|
import { isValueReference } from './normalize/census.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { mergedDeclarationOf } from './normalize/merged-declaration.js';
|
|
3
3
|
// `GEA_ADOPT_DEBUG=<file substring>`: why each object literal in matching files was or was not adopted into a family.
|
|
4
4
|
const adoptionDebug = process.env.GEA_ADOPT_DEBUG;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import type { CompiledProgram } from './program.js';
|
|
3
3
|
/** Project-selected automatic JSX runtime, using the Program's existing module
|
|
4
4
|
* authority. This does not assign any rendering semantics to that provider. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
/** Project-selected automatic JSX runtime, using the Program's existing module
|
|
3
3
|
* authority. This does not assign any rendering semantics to that provider. */
|
|
4
4
|
export const createJsxRuntimeModuleResolver = (compiled) => (containingFile) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
export declare const knownCallerPredicateParameters: (program: ts.Program, checker: ts.TypeChecker) => ReadonlyMap<string, string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
|
-
import ts from 'typescript';
|
|
2
|
+
import ts from '#typescript';
|
|
3
3
|
const hasModifier = (node, kind) => ts.getModifiers(node)?.some((modifier) => modifier.kind === kind) ?? false;
|
|
4
4
|
const isTopType = (type) => (type.flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown | ts.TypeFlags.Never)) !== 0;
|
|
5
5
|
const testedParameterOf = (checker, method) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OperationId, SemanticResultId } from '../../identity/ids.js';
|
|
2
|
+
import type { SemanticOperation } from './operations.js';
|
|
2
3
|
/**
|
|
3
4
|
* Edges between operations.
|
|
4
5
|
*
|
|
@@ -101,3 +102,126 @@ export type SemanticEdge = EvaluationEdge | ValueEdge | EffectEdge | Conditional
|
|
|
101
102
|
export declare const edgeSource: (edge: SemanticEdge, operationOfResult: (result: SemanticResultId) => OperationId) => OperationId;
|
|
102
103
|
/** The operation an edge terminates at. */
|
|
103
104
|
export declare const edgeTarget: (edge: SemanticEdge) => OperationId;
|
|
105
|
+
/**
|
|
106
|
+
* One scope an operation sits inside, as `normalize/gating.ts` states it: the
|
|
107
|
+
* edge it stands for, minus the `to` every operation in that scope shares.
|
|
108
|
+
*/
|
|
109
|
+
export type GateLink = {
|
|
110
|
+
readonly kind: 'guard';
|
|
111
|
+
readonly guard: SemanticResultId;
|
|
112
|
+
readonly takenWhen: ConditionalEdge['takenWhen'];
|
|
113
|
+
} | {
|
|
114
|
+
readonly kind: 'loop';
|
|
115
|
+
readonly loop: OperationId;
|
|
116
|
+
} | {
|
|
117
|
+
readonly kind: 'loop-latch';
|
|
118
|
+
readonly loop: OperationId;
|
|
119
|
+
} | {
|
|
120
|
+
readonly kind: 'region';
|
|
121
|
+
readonly region: OperationId;
|
|
122
|
+
readonly part: RegionEdge['part'];
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Every gated operation with its chain of scopes, outermost first, in the order
|
|
126
|
+
* the gating walk reached them. A chain is shared by every operation the walk
|
|
127
|
+
* found under the same nesting and must never change once recorded.
|
|
128
|
+
*/
|
|
129
|
+
export interface GatedOperations {
|
|
130
|
+
readonly operations: readonly OperationId[];
|
|
131
|
+
readonly chains: readonly (readonly GateLink[])[];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* One scope of a sealed chain: its link, and the chain of scopes enclosing it.
|
|
135
|
+
* Chains that share a prefix share its scopes, so a `switch` whose every clause
|
|
136
|
+
* adds one more failed test to the chain costs one scope per clause rather
|
|
137
|
+
* than one copy of the whole chain per clause.
|
|
138
|
+
*/
|
|
139
|
+
export interface GateScope {
|
|
140
|
+
readonly link: GateLink;
|
|
141
|
+
readonly enclosing: GateScope | null;
|
|
142
|
+
readonly depth: number;
|
|
143
|
+
}
|
|
144
|
+
/** Each gated operation with the innermost scope of its chain, in recording order. */
|
|
145
|
+
export interface SealedGates {
|
|
146
|
+
readonly operations: readonly OperationId[];
|
|
147
|
+
readonly innermost: readonly GateScope[];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* A function sealing one chain into shared scopes. Prefixes are recognised by
|
|
151
|
+
* the identity of their links, which the gating walk reuses for every chain it
|
|
152
|
+
* extends from the same nesting.
|
|
153
|
+
*/
|
|
154
|
+
export declare const gateScopeSealer: () => ((chain: readonly GateLink[]) => GateScope | null);
|
|
155
|
+
/**
|
|
156
|
+
* The sealed graph's edge table, as every consumer reads it: a sequence with a
|
|
157
|
+
* length. A plain array is one; `SemanticEdgeTable` is the sealed graph's own.
|
|
158
|
+
*/
|
|
159
|
+
export interface SemanticEdges extends Iterable<SemanticEdge> {
|
|
160
|
+
readonly length: number;
|
|
161
|
+
find(predicate: (edge: SemanticEdge) => boolean): SemanticEdge | undefined;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* A run of the producers' edges standing for one operation's value edges: one
|
|
165
|
+
* per operand citing a result, in operand order -- what `valueEdgesInto`
|
|
166
|
+
* states for an operation, and most of what the producers state at all.
|
|
167
|
+
*/
|
|
168
|
+
export type StatedEdge = SemanticEdge | SemanticOperation;
|
|
169
|
+
/** The edges one stated entry stands for: itself, or an operation's value edges in operand order. */
|
|
170
|
+
export declare function edgesStatedBy(entry: StatedEdge): Generator<SemanticEdge>;
|
|
171
|
+
/**
|
|
172
|
+
* The edge table of a sealed graph: the producers' own edges, then one edge per
|
|
173
|
+
* scope of every gated operation's chain.
|
|
174
|
+
*
|
|
175
|
+
* The gating walk states a scope once per OPERATION inside it, so an operation
|
|
176
|
+
* nested three scopes deep owns three edges that differ from its siblings' only
|
|
177
|
+
* in `to`. Materialized, that was most of the table -- 820k conditional edges
|
|
178
|
+
* for a 48K-line app, 50 MB that lived from normalization to certification.
|
|
179
|
+
* Here each gated operation holds its innermost scope -- chains share their
|
|
180
|
+
* enclosing scopes -- and the gate edges are minted as a consumer walks past
|
|
181
|
+
* them. A producer's value edges are the operation's own result-citing
|
|
182
|
+
* operands restated, so a run of them that restates exactly that is held as
|
|
183
|
+
* the operation. Either way a consumer sees the same edges, with the same
|
|
184
|
+
* fields in the same order, in the same sequence as the flat table had; one
|
|
185
|
+
* that keeps an edge keeps an ordinary object.
|
|
186
|
+
*/
|
|
187
|
+
export declare class SemanticEdgeTable implements SemanticEdges {
|
|
188
|
+
private readonly stated;
|
|
189
|
+
private readonly gated;
|
|
190
|
+
readonly length: number;
|
|
191
|
+
private readonly byKind;
|
|
192
|
+
constructor(stated: readonly StatedEdge[], gated: SealedGates);
|
|
193
|
+
[Symbol.iterator](): Iterator<SemanticEdge>;
|
|
194
|
+
find(predicate: (edge: SemanticEdge) => boolean): SemanticEdge | undefined;
|
|
195
|
+
/** The producers' own edges of one kind no value run or gate stands for, in table order. */
|
|
196
|
+
edgesOfKind<K extends PlainStatedKind>(kind: K): readonly Extract<SemanticEdge, {
|
|
197
|
+
readonly kind: K;
|
|
198
|
+
}>[];
|
|
199
|
+
/** The producers' own edges: the table's head, in table order. */
|
|
200
|
+
statedEdges(): Generator<SemanticEdge>;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* The producers' own edges, in table order, without walking past the gate
|
|
204
|
+
* edges. The gating walk never states an `evaluation`, `value`, `effect` or
|
|
205
|
+
* `completion` edge, so a scan for one of those kinds sees exactly what a scan
|
|
206
|
+
* of the whole table would -- without minting every gate edge, most of a large
|
|
207
|
+
* program's table, only to look at it and throw it away.
|
|
208
|
+
*/
|
|
209
|
+
export declare const producerEdges: (edges: SemanticEdges) => Iterable<SemanticEdge>;
|
|
210
|
+
/** Kinds only a producer states and no value run stands for. */
|
|
211
|
+
type PlainStatedKind = 'evaluation' | 'effect' | 'completion';
|
|
212
|
+
/**
|
|
213
|
+
* Every edge of one such kind, in table order. A sealed table answers from an
|
|
214
|
+
* index it builds on first use -- a list of the edges it already holds -- so a
|
|
215
|
+
* lookup per `break` or per destructured element no longer walks the table.
|
|
216
|
+
*/
|
|
217
|
+
export declare const edgesOfKind: <K extends PlainStatedKind>(edges: SemanticEdges, kind: K) => Iterable<Extract<SemanticEdge, {
|
|
218
|
+
readonly kind: K;
|
|
219
|
+
}>>;
|
|
220
|
+
/**
|
|
221
|
+
* The producers' edges with every run that restates an operation's value
|
|
222
|
+
* edges -- each result-citing operand in order, nothing else -- replaced by
|
|
223
|
+
* that operation, appended to `stated`. Anything that differs in the
|
|
224
|
+
* slightest stays an edge.
|
|
225
|
+
*/
|
|
226
|
+
export declare const compactStatedEdges: (edges: readonly StatedEdge[], operationOf: (operation: OperationId) => SemanticOperation | undefined, stated?: StatedEdge[]) => StatedEdge[];
|
|
227
|
+
export {};
|