@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
|
@@ -2,6 +2,57 @@ import { callableOriginsOf, callableWriteTargetsOf, functionPrototypeOriginsOf }
|
|
|
2
2
|
import { identityOperandOf, operandOf } from './model/operands.js';
|
|
3
3
|
import { propertyKeyTextOf } from './property-key.js';
|
|
4
4
|
const constantKey = (operand) => operand?.source.kind === 'constant' ? propertyKeyTextOf(operand.source.literal, operand.source.text) : null;
|
|
5
|
+
/**
|
|
6
|
+
* One blocker per (operation, kind) and one array per distinct blocker
|
|
7
|
+
* sequence, for a whole inventory.
|
|
8
|
+
*
|
|
9
|
+
* A write through an unknown target, into a prototype or to `__proto__`
|
|
10
|
+
* blocks every owner and every one of its keys, so each owner's list repeats
|
|
11
|
+
* the same run of blockers. Allocated per owner and per key, those runs were
|
|
12
|
+
* a gigabyte of identical objects on a large program -- the largest single
|
|
13
|
+
* thing a compile held. Lists are hash-consed along a trie of the blockers
|
|
14
|
+
* appended in order, so owners whose blockers agree share one array, and a
|
|
15
|
+
* list is materialized only when it is finished.
|
|
16
|
+
*/
|
|
17
|
+
const blockerInterner = () => {
|
|
18
|
+
const blockers = new Map();
|
|
19
|
+
const blockerOf = (operation, kind) => {
|
|
20
|
+
let byKind = blockers.get(operation.id);
|
|
21
|
+
if (byKind === undefined)
|
|
22
|
+
blockers.set(operation.id, (byKind = new Map()));
|
|
23
|
+
let blocker = byKind.get(kind);
|
|
24
|
+
if (blocker === undefined)
|
|
25
|
+
byKind.set(kind, (blocker = { operation, kind }));
|
|
26
|
+
return blocker;
|
|
27
|
+
};
|
|
28
|
+
const root = { parent: null, blocker: null, next: new Map(), list: [] };
|
|
29
|
+
const listOf = (path) => {
|
|
30
|
+
if (path.list !== null)
|
|
31
|
+
return path.list;
|
|
32
|
+
const reversed = [];
|
|
33
|
+
for (let at = path; at !== null && at.blocker !== null; at = at.parent)
|
|
34
|
+
reversed.push(at.blocker);
|
|
35
|
+
return (path.list = reversed.reverse());
|
|
36
|
+
};
|
|
37
|
+
/** A list built in insertion order with duplicates dropped, as a `Map` keyed by blocker identity would keep it. */
|
|
38
|
+
return () => {
|
|
39
|
+
let path = root;
|
|
40
|
+
const seen = new Set();
|
|
41
|
+
return {
|
|
42
|
+
add: (operation, kind) => {
|
|
43
|
+
const blocker = blockerOf(operation, kind);
|
|
44
|
+
if (seen.has(blocker))
|
|
45
|
+
return;
|
|
46
|
+
seen.add(blocker);
|
|
47
|
+
let next = path.next.get(blocker);
|
|
48
|
+
if (next === undefined)
|
|
49
|
+
path.next.set(blocker, (next = { parent: path, blocker, next: new Map(), list: null }));
|
|
50
|
+
path = next;
|
|
51
|
+
},
|
|
52
|
+
list: () => listOf(path)
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
5
56
|
/** Inventories only canonical graph objects. No checker spelling or parallel alias classifier is consulted. */
|
|
6
57
|
export const callableOwnDataSlotSchemasOf = (graph) => inventoryOf(graph, null);
|
|
7
58
|
const blockerKey = (blocker) => `${blocker.operation.id}:${blocker.kind}`;
|
|
@@ -23,18 +74,24 @@ export const refineCallableOwnDataCensus = (census, graph, native) => {
|
|
|
23
74
|
return base.every((operation) => seen.has(operation) || observed?.has(operation.id) === false);
|
|
24
75
|
};
|
|
25
76
|
const unionOf = (base, actual) => {
|
|
77
|
+
if (actual.length === 0 || actual === base)
|
|
78
|
+
return base;
|
|
26
79
|
const union = new Map(base.map((blocker) => [blockerKey(blocker), blocker]));
|
|
27
80
|
for (const blocker of actual)
|
|
28
81
|
if (!union.has(blockerKey(blocker)))
|
|
29
82
|
union.set(blockerKey(blocker), blocker);
|
|
30
|
-
return [...union.values()];
|
|
83
|
+
return union.size === base.length ? base : [...union.values()];
|
|
31
84
|
};
|
|
32
85
|
const owners = new Map(refined.owners);
|
|
33
86
|
for (const [functionId, owner] of census.owners) {
|
|
34
87
|
const actual = refined.owners.get(functionId);
|
|
35
88
|
if (actual === undefined ||
|
|
36
89
|
!covers(owner.writes.map((write) => write.operation), actual.writes.map((write) => write.operation)))
|
|
37
|
-
owners.set(functionId, {
|
|
90
|
+
owners.set(functionId, {
|
|
91
|
+
...owner,
|
|
92
|
+
blockers: unionOf(owner.blockers, actual?.blockers ?? []),
|
|
93
|
+
sharedBlockers: unionOf(owner.sharedBlockers, actual?.sharedBlockers ?? [])
|
|
94
|
+
});
|
|
38
95
|
}
|
|
39
96
|
const schemas = new Map(refined.schemas);
|
|
40
97
|
for (const [functionId, keys] of census.schemas) {
|
|
@@ -173,112 +230,123 @@ const inventoryOf = (graph, native) => {
|
|
|
173
230
|
bucket.push(observation);
|
|
174
231
|
observations.set(functionId, bucket);
|
|
175
232
|
};
|
|
233
|
+
const observeAll = (functions, observation) => {
|
|
234
|
+
for (const functionId of functions)
|
|
235
|
+
observe(functionId, observation);
|
|
236
|
+
};
|
|
237
|
+
const exposeAll = (functions, operation) => {
|
|
238
|
+
for (const functionId of functions) {
|
|
239
|
+
const bucket = exposures.get(functionId) ?? [];
|
|
240
|
+
if (!bucket.includes(operation))
|
|
241
|
+
bucket.push(operation);
|
|
242
|
+
exposures.set(functionId, bucket);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
176
245
|
for (const operation of graph.operations.values()) {
|
|
177
246
|
if (native?.observedOperations !== undefined && !native.observedOperations.has(operation.id))
|
|
178
247
|
continue;
|
|
179
248
|
for (const target of operation.operands) {
|
|
180
249
|
if (target.source.kind !== 'result' || target.evaluation.kind === 'provenance')
|
|
181
250
|
continue;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
251
|
+
// Everything below is decided by the operation and operand alone; the
|
|
252
|
+
// functions the operand may hold only receive the answer. One shared
|
|
253
|
+
// observation per operand, not one per possible function: an operand
|
|
254
|
+
// reaching many functions allocated a copy for each, a gigabyte of
|
|
255
|
+
// identical objects on a large program.
|
|
256
|
+
const functions = sourcesOf(target.source.result);
|
|
257
|
+
if (functions.length === 0)
|
|
258
|
+
continue;
|
|
259
|
+
if (operation.family === 'property' && target === operandOf(operation, 'receiver')) {
|
|
260
|
+
if (operation.internalMethod === 'get' ||
|
|
261
|
+
operation.internalMethod === 'has-property' ||
|
|
262
|
+
operation.internalMethod === 'own-property-keys')
|
|
263
|
+
observeAll(functions, {
|
|
264
|
+
operation,
|
|
265
|
+
target,
|
|
266
|
+
key: constantKey(operandOf(operation, 'key')),
|
|
267
|
+
kind: operation.internalMethod === 'own-property-keys'
|
|
268
|
+
? 'keys'
|
|
269
|
+
: operation.internalMethod === 'has-property'
|
|
270
|
+
? 'has'
|
|
271
|
+
: constantKey(operandOf(operation, 'key')) === 'prototype'
|
|
272
|
+
? 'prototype'
|
|
273
|
+
: 'get'
|
|
274
|
+
});
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
if (operation.family === 'invocation' && target === operandOf(operation, 'argument', 0)) {
|
|
278
|
+
if (operation.intrinsicIntegrity !== undefined) {
|
|
279
|
+
exposeAll(functions, operation);
|
|
199
280
|
continue;
|
|
200
281
|
}
|
|
201
|
-
if (operation.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
kind: operation.intrinsicOwnKeys
|
|
218
|
-
? 'keys'
|
|
219
|
-
: operation.intrinsicReflection === 'getOwnPropertyDescriptor'
|
|
220
|
-
? 'descriptor'
|
|
221
|
-
: operation.intrinsicReflection === 'has'
|
|
222
|
-
? 'has'
|
|
223
|
-
: 'get'
|
|
224
|
-
});
|
|
225
|
-
continue;
|
|
226
|
-
}
|
|
227
|
-
if (operation.intrinsicMutation !== undefined || operation.intrinsicReflection === 'deleteProperty')
|
|
228
|
-
continue;
|
|
229
|
-
}
|
|
230
|
-
if (operation.family === 'binding' && operation.external === undefined)
|
|
231
|
-
continue;
|
|
232
|
-
if (operation.family === 'reference')
|
|
233
|
-
continue;
|
|
234
|
-
if (identityOperandOf(operation) === target)
|
|
235
|
-
continue;
|
|
236
|
-
if (operation.family === 'control' && operation.form === 'return' && native?.closedReturns.has(operation.id))
|
|
237
|
-
continue;
|
|
238
|
-
if (operation.family === 'class-lifecycle' &&
|
|
239
|
-
operation.event === 'define-method' &&
|
|
240
|
-
target.role === 'method' &&
|
|
241
|
-
native?.closedInstallations?.has(operation.id))
|
|
242
|
-
continue;
|
|
243
|
-
if (operation.family === 'computation' &&
|
|
244
|
-
(operation.form === 'typeof' || (operation.form === 'equality' && (operation.operator === '===' || operation.operator === '!==')))) {
|
|
245
|
-
observe(functionId, { operation, target, key: null, kind: operation.form === 'typeof' ? 'typeof' : 'identity' });
|
|
282
|
+
if (operation.intrinsicReflection === 'get' ||
|
|
283
|
+
operation.intrinsicReflection === 'has' ||
|
|
284
|
+
operation.intrinsicReflection === 'getOwnPropertyDescriptor' ||
|
|
285
|
+
operation.intrinsicOwnKeys) {
|
|
286
|
+
observeAll(functions, {
|
|
287
|
+
operation,
|
|
288
|
+
target,
|
|
289
|
+
key: constantKey(operandOf(operation, 'argument', 1)),
|
|
290
|
+
kind: operation.intrinsicOwnKeys
|
|
291
|
+
? 'keys'
|
|
292
|
+
: operation.intrinsicReflection === 'getOwnPropertyDescriptor'
|
|
293
|
+
? 'descriptor'
|
|
294
|
+
: operation.intrinsicReflection === 'has'
|
|
295
|
+
? 'has'
|
|
296
|
+
: 'get'
|
|
297
|
+
});
|
|
246
298
|
continue;
|
|
247
299
|
}
|
|
248
|
-
if (
|
|
300
|
+
if (operation.intrinsicMutation !== undefined || operation.intrinsicReflection === 'deleteProperty')
|
|
249
301
|
continue;
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
302
|
+
}
|
|
303
|
+
if (operation.family === 'binding' && operation.external === undefined)
|
|
304
|
+
continue;
|
|
305
|
+
if (operation.family === 'reference')
|
|
306
|
+
continue;
|
|
307
|
+
if (identityOperandOf(operation) === target)
|
|
308
|
+
continue;
|
|
309
|
+
if (operation.family === 'control' && operation.form === 'return' && native?.closedReturns.has(operation.id))
|
|
310
|
+
continue;
|
|
311
|
+
if (operation.family === 'class-lifecycle' &&
|
|
312
|
+
operation.event === 'define-method' &&
|
|
313
|
+
target.role === 'method' &&
|
|
314
|
+
native?.closedInstallations?.has(operation.id))
|
|
315
|
+
continue;
|
|
316
|
+
if (operation.family === 'computation' &&
|
|
317
|
+
(operation.form === 'typeof' || (operation.form === 'equality' && (operation.operator === '===' || operation.operator === '!==')))) {
|
|
318
|
+
observeAll(functions, { operation, target, key: null, kind: operation.form === 'typeof' ? 'typeof' : 'identity' });
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
if (callableStoredValues.has(target))
|
|
322
|
+
continue;
|
|
323
|
+
if (operation.family === 'invocation' && target === operandOf(operation, 'callee'))
|
|
324
|
+
continue;
|
|
325
|
+
if (operation.family === 'invocation' && native?.closedOperandTransfers?.has(operation.id))
|
|
326
|
+
continue;
|
|
327
|
+
if (operation.family === 'invocation' && target === operandOf(operation, 'receiver')) {
|
|
328
|
+
const callee = operandOf(operation, 'callee');
|
|
329
|
+
const producerId = callee?.source.kind === 'result' ? graph.results.get(callee.source.result) : undefined;
|
|
330
|
+
const member = producerId === undefined ? undefined : graph.operations.get(producerId);
|
|
331
|
+
const receiver = member?.family === 'property' && member.internalMethod === 'get' ? operandOf(member, 'receiver') : undefined;
|
|
332
|
+
const key = member?.family === 'property' ? constantKey(operandOf(member, 'key')) : null;
|
|
333
|
+
if (member && key !== null && receiver?.source.kind === 'result' && receiver.source.result === target.source.result) {
|
|
334
|
+
observeAll(functions, { operation, target, key, kind: 'invocation-receiver', memberRead: member });
|
|
253
335
|
continue;
|
|
254
|
-
if (operation.family === 'invocation' && target === operandOf(operation, 'receiver')) {
|
|
255
|
-
const callee = operandOf(operation, 'callee');
|
|
256
|
-
const producerId = callee?.source.kind === 'result' ? graph.results.get(callee.source.result) : undefined;
|
|
257
|
-
const member = producerId === undefined ? undefined : graph.operations.get(producerId);
|
|
258
|
-
const receiver = member?.family === 'property' && member.internalMethod === 'get' ? operandOf(member, 'receiver') : undefined;
|
|
259
|
-
const key = member?.family === 'property' ? constantKey(operandOf(member, 'key')) : null;
|
|
260
|
-
if (member && key !== null && receiver?.source.kind === 'result' && receiver.source.result === target.source.result) {
|
|
261
|
-
observe(functionId, { operation, target, key, kind: 'invocation-receiver', memberRead: member });
|
|
262
|
-
continue;
|
|
263
|
-
}
|
|
264
336
|
}
|
|
265
|
-
const bucket = exposures.get(functionId) ?? [];
|
|
266
|
-
if (!bucket.includes(operation))
|
|
267
|
-
bucket.push(operation);
|
|
268
|
-
exposures.set(functionId, bucket);
|
|
269
|
-
observe(functionId, { operation, target, key: null, kind: 'publication' });
|
|
270
337
|
}
|
|
338
|
+
exposeAll(functions, operation);
|
|
339
|
+
observeAll(functions, { operation, target, key: null, kind: 'publication' });
|
|
271
340
|
}
|
|
272
341
|
}
|
|
342
|
+
const blockerList = blockerInterner();
|
|
273
343
|
const schemas = new Map();
|
|
274
344
|
for (const [functionId, keys] of owned) {
|
|
275
345
|
const perKey = new Map();
|
|
276
346
|
const blockingWrites = blockingWritesOf(functionId);
|
|
277
347
|
for (const [key, writers] of keys) {
|
|
278
|
-
const blockers =
|
|
279
|
-
const add =
|
|
280
|
-
blockers.set(`${operation.id}:${kind}`, { operation, kind });
|
|
281
|
-
};
|
|
348
|
+
const blockers = blockerList();
|
|
349
|
+
const add = blockers.add;
|
|
282
350
|
for (const writer of writers) {
|
|
283
351
|
if (writer.mutation.kind === 'delete' || writer.mutation.kind === 'reflect-delete')
|
|
284
352
|
add(writer.mutation.operation, 'delete');
|
|
@@ -329,27 +397,34 @@ const inventoryOf = (graph, native) => {
|
|
|
329
397
|
const shape = graph.structuralTypes.get(value.type)?.shape;
|
|
330
398
|
return shape?.kind === 'primitive' && (shape.primitive === 'any' || shape.primitive === 'unknown');
|
|
331
399
|
}))),
|
|
332
|
-
blockers:
|
|
400
|
+
blockers: blockers.list()
|
|
333
401
|
});
|
|
334
402
|
}
|
|
335
403
|
schemas.set(functionId, perKey);
|
|
336
404
|
}
|
|
337
405
|
const owners = new Map();
|
|
406
|
+
// The owner-independent half of each shared write's blockers, in `writes`
|
|
407
|
+
// order; `inherited-chain` joins it only where the target is unknown, and
|
|
408
|
+
// `unknown-key` needs ownership, so both stay per owner otherwise.
|
|
409
|
+
const shared = blockerList();
|
|
410
|
+
for (const index of sharedWriteIndexes) {
|
|
411
|
+
const write = writes[index];
|
|
412
|
+
if (unknownTargetWriteSet.has(write))
|
|
413
|
+
shared.add(write.operation, 'unknown-target');
|
|
414
|
+
if (prototypeWriteSet.has(write))
|
|
415
|
+
shared.add(write.operation, 'prototype-mutation');
|
|
416
|
+
if (write.key === '__proto__' && (write.kind === 'set' || write.kind === 'reflect-set') && unknownTargetWriteSet.has(write))
|
|
417
|
+
shared.add(write.operation, 'inherited-chain');
|
|
418
|
+
}
|
|
419
|
+
const sharedBlockers = shared.list();
|
|
338
420
|
for (const functionId of new Set([...allocations.keys(), ...[...origins.values()].flat()])) {
|
|
339
|
-
const blockers =
|
|
340
|
-
const add =
|
|
341
|
-
|
|
342
|
-
};
|
|
343
|
-
for (const index of blockingWritesOf(functionId)) {
|
|
421
|
+
const blockers = blockerList();
|
|
422
|
+
const add = blockers.add;
|
|
423
|
+
for (const index of ownWriteIndexes.get(functionId) ?? []) {
|
|
344
424
|
const write = writes[index];
|
|
345
|
-
|
|
346
|
-
if (own && write.key === null)
|
|
425
|
+
if (write.key === null)
|
|
347
426
|
add(write.operation, 'unknown-key');
|
|
348
|
-
if (unknownTargetWriteSet.has(write))
|
|
349
|
-
add(write.operation, 'unknown-target');
|
|
350
|
-
if (prototypeWriteSet.has(write))
|
|
351
|
-
add(write.operation, 'prototype-mutation');
|
|
352
|
-
if (write.key === '__proto__' && (write.kind === 'set' || write.kind === 'reflect-set') && (own || unknownTargetWriteSet.has(write)))
|
|
427
|
+
if (write.key === '__proto__' && (write.kind === 'set' || write.kind === 'reflect-set') && !unknownTargetWriteSet.has(write))
|
|
353
428
|
add(write.operation, 'inherited-chain');
|
|
354
429
|
}
|
|
355
430
|
for (const operation of exposures.get(functionId) ?? [])
|
|
@@ -362,7 +437,8 @@ const inventoryOf = (graph, native) => {
|
|
|
362
437
|
allocations: allocations.get(functionId) ?? [],
|
|
363
438
|
writes: (ownWriteIndexes.get(functionId) ?? []).map((index) => writes[index]),
|
|
364
439
|
observations: observations.get(functionId) ?? [],
|
|
365
|
-
blockers:
|
|
440
|
+
blockers: blockers.list(),
|
|
441
|
+
sharedBlockers
|
|
366
442
|
});
|
|
367
443
|
}
|
|
368
444
|
return { owners, schemas, unknownTargetWrites, prototypeWrites };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { unwrapErasedExpression } from './normalize/producers/erasure.js';
|
|
3
3
|
const classDeclarationOf = (checker, symbol) => {
|
|
4
4
|
const resolved = (symbol.flags & ts.SymbolFlags.Alias) !== 0 ? checker.getAliasedSymbol(symbol) : symbol;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import type { CommonJsWrapperDeclaration } from '../plugins/model.js';
|
|
3
3
|
export type CommonJsGlobal = 'require' | 'exports' | 'module';
|
|
4
4
|
export type CommonJsIdentifierIdentity = {
|
|
@@ -63,7 +63,8 @@ export declare const withoutBareWrapperRedeclarations: (program: ts.Program, glo
|
|
|
63
63
|
* already introduced that exact parameter cell. No block binding, nested var,
|
|
64
64
|
* local function, import, or caller-owned ambient declaration is admitted.
|
|
65
65
|
*/
|
|
66
|
-
export declare const createCommonJsWrapperIdentity: (checker: ts.TypeChecker, files: readonly ts.SourceFile[], globals: ReadonlyMap<string, CommonJsWrapperDeclaration>, hostProvided?: ReadonlySet<string>) =>
|
|
66
|
+
export declare const createCommonJsWrapperIdentity: (checker: ts.TypeChecker, files: readonly ts.SourceFile[], globals: ReadonlyMap<string, CommonJsWrapperDeclaration>, hostProvided?: ReadonlySet<string>) => CommonJsWrapperIdentity;
|
|
67
|
+
export interface CommonJsWrapperIdentity {
|
|
67
68
|
readonly classify: (identifier: ts.Identifier) => CommonJsIdentifierIdentity;
|
|
68
69
|
readonly globalOfDeclaration: (declaration: ts.Declaration) => CommonJsGlobal | null;
|
|
69
|
-
}
|
|
70
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
|
-
import ts from 'typescript';
|
|
2
|
+
import ts from '#typescript';
|
|
3
|
+
import { KeySet } from './normalize/nullable-memo.js';
|
|
3
4
|
import { noHostProvidedNames, valueSymbolAt } from './normalize/unresolvable-names.js';
|
|
5
|
+
const ordinaryIdentifier = Object.freeze({ kind: 'ordinary' });
|
|
6
|
+
const provenanceFailureIdentifier = Object.freeze({ kind: 'provenance-failure' });
|
|
4
7
|
const resolvedSymbolAt = (checker, node, hostProvided) => {
|
|
5
8
|
// One rule for what a name in value position denotes (`valueSymbolAt`),
|
|
6
9
|
// including checked JavaScript's `module`/`exports`, which the checker binds
|
|
@@ -155,6 +158,28 @@ const wrapperRedeclarationFor = (declaration, configured, formats) => {
|
|
|
155
158
|
* local function, import, or caller-owned ambient declaration is admitted.
|
|
156
159
|
*/
|
|
157
160
|
export const createCommonJsWrapperIdentity = (checker, files, globals, hostProvided = noHostProvidedNames) => {
|
|
161
|
+
// One identity per input, not per caller: the module-record census, the
|
|
162
|
+
// require census it builds and the frontend's own require census each built
|
|
163
|
+
// one over the same checker, files and globals, and each memoized a
|
|
164
|
+
// classification for every identifier it evaluated (~13 MB across the three
|
|
165
|
+
// on a 48K-line app). Its answers are a function of exactly these inputs.
|
|
166
|
+
let byGlobals = wrapperIdentities.get(checker);
|
|
167
|
+
if (!byGlobals)
|
|
168
|
+
wrapperIdentities.set(checker, (byGlobals = new WeakMap()));
|
|
169
|
+
let built = byGlobals.get(globals);
|
|
170
|
+
if (!built)
|
|
171
|
+
byGlobals.set(globals, (built = []));
|
|
172
|
+
const known = built.find((entry) => entry.hostProvided === hostProvided &&
|
|
173
|
+
entry.files.length === files.length &&
|
|
174
|
+
entry.files.every((file, index) => file === files[index]));
|
|
175
|
+
if (known)
|
|
176
|
+
return known.identity;
|
|
177
|
+
const identity = buildCommonJsWrapperIdentity(checker, files, globals, hostProvided);
|
|
178
|
+
built.push({ files: [...files], hostProvided, identity });
|
|
179
|
+
return identity;
|
|
180
|
+
};
|
|
181
|
+
const wrapperIdentities = new WeakMap();
|
|
182
|
+
const buildCommonJsWrapperIdentity = (checker, files, globals, hostProvided) => {
|
|
158
183
|
const configuredByName = new Map();
|
|
159
184
|
for (const [name, configured] of globals) {
|
|
160
185
|
if (name === configured.declarationName && name === configured.global)
|
|
@@ -221,28 +246,46 @@ export const createCommonJsWrapperIdentity = (checker, files, globals, hostProvi
|
|
|
221
246
|
// Every census pass classifies every identifier it evaluates again, and the
|
|
222
247
|
// answer is a function of the identifier alone (its resolved symbol and its
|
|
223
248
|
// file, against tables fixed above), so it is asked of the checker once.
|
|
249
|
+
// Nearly every answer is `ordinary` (~335K identifiers on a 48K-line app),
|
|
250
|
+
// and those are a bit each, over numbers the binding censuses' memos mostly
|
|
251
|
+
// hand out already: a map entry apiece was ~10 MB, alive at the end of
|
|
252
|
+
// production, the frontend's peak.
|
|
253
|
+
const ordinary = new KeySet();
|
|
224
254
|
const classified = new Map();
|
|
225
255
|
const classify = (identifier) => {
|
|
256
|
+
if (ordinary.has(identifier))
|
|
257
|
+
return ordinaryIdentifier;
|
|
226
258
|
const held = classified.get(identifier);
|
|
227
259
|
if (held !== undefined)
|
|
228
260
|
return held;
|
|
229
261
|
const identity = classifyUncached(identifier);
|
|
230
|
-
|
|
262
|
+
if (identity === ordinaryIdentifier)
|
|
263
|
+
ordinary.add(identifier);
|
|
264
|
+
else
|
|
265
|
+
classified.set(identifier, identity);
|
|
231
266
|
return identity;
|
|
232
267
|
};
|
|
268
|
+
// One answer object per distinct answer: readers compare answers by field.
|
|
269
|
+
const wrappers = new Map();
|
|
270
|
+
const wrapper = (global) => {
|
|
271
|
+
let held = wrappers.get(global);
|
|
272
|
+
if (held === undefined)
|
|
273
|
+
wrappers.set(global, (held = { kind: 'wrapper', global }));
|
|
274
|
+
return held;
|
|
275
|
+
};
|
|
233
276
|
const classifyUncached = (identifier) => {
|
|
234
277
|
const symbol = resolvedSymbolAt(checker, identifier, hostProvided);
|
|
235
278
|
if (!symbol)
|
|
236
|
-
return
|
|
279
|
+
return ordinaryIdentifier;
|
|
237
280
|
const redeclared = redeclarations.get(symbol)?.get(identifier.getSourceFile());
|
|
238
281
|
if (redeclared !== undefined)
|
|
239
|
-
return
|
|
282
|
+
return wrapper(redeclared);
|
|
240
283
|
const authenticated = authenticatedSymbols.get(symbol);
|
|
241
284
|
if (authenticated !== undefined)
|
|
242
|
-
return
|
|
285
|
+
return wrapper(authenticated);
|
|
243
286
|
if (failedSymbols.has(symbol))
|
|
244
|
-
return
|
|
245
|
-
return
|
|
287
|
+
return provenanceFailureIdentifier;
|
|
288
|
+
return ordinaryIdentifier;
|
|
246
289
|
};
|
|
247
290
|
return {
|
|
248
291
|
classify,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
|
+
import { uncachedJsDocTags } from './uncached-jsdoc-tags.js';
|
|
2
3
|
import { existsSync, readFileSync } from 'fs';
|
|
3
4
|
import { basename, dirname, join, relative, resolve, sep } from 'path';
|
|
4
5
|
/**
|
|
@@ -2294,7 +2295,7 @@ const memberOverlay = (input) => {
|
|
|
2294
2295
|
edits.push({ at: typeNode.getStart(file), end: typeNode.getEnd(), text: spelled });
|
|
2295
2296
|
};
|
|
2296
2297
|
const scanJsDoc = (node) => {
|
|
2297
|
-
for (const tag of
|
|
2298
|
+
for (const tag of uncachedJsDocTags(node)) {
|
|
2298
2299
|
const typeExpression = tag.typeExpression;
|
|
2299
2300
|
if (typeExpression && ts.isJSDocTypeExpression(typeExpression))
|
|
2300
2301
|
considerStatedType(typeExpression.type);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
/** The plain identifier text of a property name, or `null` for anything computed. */
|
|
3
3
|
const literalPropertyNameOf = (name) => {
|
|
4
4
|
if (ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isNumericLiteral(name))
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { writeHeapSnapshot } from 'v8';
|
|
2
|
+
import { join } from 'path';
|
|
1
3
|
export const createFrontendTiming = (scope) => {
|
|
2
4
|
const enabled = process.env.GEA_FRONTEND_TIMING === '1';
|
|
3
5
|
const rows = new Map();
|
|
@@ -21,6 +23,23 @@ export const createFrontendTiming = (scope) => {
|
|
|
21
23
|
}
|
|
22
24
|
},
|
|
23
25
|
mark: (name) => {
|
|
26
|
+
// The compiler's stage hooks one level finer: `GEA_STAGE_TIMING=gc` prints
|
|
27
|
+
// what the frontend retains after each phase, and
|
|
28
|
+
// `GEA_HEAP_SNAPSHOT_AFTER=frontend:<phase>` snapshots it and
|
|
29
|
+
// `GEA_STOP_AFTER_STAGE=frontend:<phase>` exits there (so `--heap-prof`
|
|
30
|
+
// records what the phase left live) -- the frontend's
|
|
31
|
+
// live peak is inside these phases, not at the stage boundary.
|
|
32
|
+
const collect = globalThis.gc;
|
|
33
|
+
if (process.env['GEA_STAGE_TIMING'] === 'gc' && collect) {
|
|
34
|
+
collect();
|
|
35
|
+
process.stderr.write(`[STAGE] ${scope}:${name} heap ${(process.memoryUsage().heapUsed / 1073741824).toFixed(2)}GB\n`);
|
|
36
|
+
}
|
|
37
|
+
if (process.env['GEA_HEAP_SNAPSHOT_AFTER'] === `frontend:${name}`) {
|
|
38
|
+
const directory = process.env['GEA_HEAP_SNAPSHOT_DIR'] ?? process.cwd();
|
|
39
|
+
process.stderr.write(`[STAGE] heap snapshot ${writeHeapSnapshot(join(directory, `after-frontend-${name}.heapsnapshot`))}\n`);
|
|
40
|
+
}
|
|
41
|
+
if (process.env['GEA_STOP_AFTER_STAGE'] === `frontend:${name}`)
|
|
42
|
+
process.exit(0);
|
|
24
43
|
if (!enabled)
|
|
25
44
|
return;
|
|
26
45
|
const now = performance.now();
|
|
@@ -14,7 +14,7 @@ import type { ProducerContext } from './normalize/producer-context.js';
|
|
|
14
14
|
import { type ClassCopyKey } from './normalize/structural.js';
|
|
15
15
|
import { type DeadTypeofGuardCensus } from './normalize/dead-typeof-guards.js';
|
|
16
16
|
import { type CensusRefusal } from './normalize/census-refusal.js';
|
|
17
|
-
import type {
|
|
17
|
+
import type { CellFactsSummary } from './normalize/cells/index.js';
|
|
18
18
|
import type { StructuralDisagreement, StructuralFormViolation } from './normalize/structural-rules.js';
|
|
19
19
|
import type { DiagnosticSourcePreparationAudit } from './diagnostic-source-preparation.js';
|
|
20
20
|
import type { HostProtocolBinding } from './host-protocols.js';
|
|
@@ -479,7 +479,7 @@ export interface FrontendResult {
|
|
|
479
479
|
* `twoOwnerClaims` row as a typed `CellRefusal` (`normalize/cells/model.ts`)
|
|
480
480
|
* -- still read by nothing downstream, same as the rest of this table.
|
|
481
481
|
*/
|
|
482
|
-
readonly cellFacts:
|
|
482
|
+
readonly cellFacts: CellFactsSummary;
|
|
483
483
|
/**
|
|
484
484
|
* Nodes for which two of `normalize/structural.ts`'s rules both had an
|
|
485
485
|
* answer -- the frontend's own finding channel.
|