@geastack/compiler 1.0.36 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-emit.js +5 -0
- package/dist/cli.js +10 -0
- package/dist/compiler.d.ts +10 -3
- package/dist/compiler.js +364 -224
- package/dist/conversion/build.d.ts +13 -1
- package/dist/conversion/build.js +336 -141
- package/dist/conversion/graph-validation.d.ts +7 -2
- package/dist/conversion/graph-validation.js +36 -22
- package/dist/conversion/native-sum.js +106 -17
- package/dist/diagnostics/sweep.js +1 -1
- package/dist/ir/callable-class-flow.d.ts +0 -11
- package/dist/ir/callable-class-flow.js +970 -169
- package/dist/ir/certificate.d.ts +1 -1
- package/dist/ir/certificate.js +12 -1
- package/dist/ir/certify/carrier-keys.d.ts +17 -1
- package/dist/ir/certify/carrier-keys.js +35 -2
- package/dist/ir/certify/function-source.js +2 -1
- package/dist/ir/certify/has-property-key.d.ts +6 -0
- package/dist/ir/certify/has-property-key.js +8 -1
- package/dist/ir/certify/property-access-keys.js +2 -1
- package/dist/ir/certify/runtime-helper.js +2 -1
- package/dist/ir/construction-only-fields.d.ts +35 -2
- package/dist/ir/construction-only-fields.js +100 -0
- package/dist/ir/emission-representations.d.ts +2 -2
- package/dist/ir/emission-representations.js +9 -3
- package/dist/ir/generic-call-entry.d.ts +3 -1
- package/dist/ir/logical-receivers.js +29 -1
- package/dist/ir/lower-completion.js +11 -6
- package/dist/ir/lower-destructuring.js +3 -2
- package/dist/ir/native-host-method-reads.d.ts +5 -0
- package/dist/ir/native-host-method-reads.js +30 -21
- package/dist/ir/operation-conversions.js +4 -1
- package/dist/ir/publish-conversion-recipes.js +12 -1
- package/dist/plugins/apple/jsx.js +1 -1
- package/dist/plugins/gea/component-classes.js +1 -1
- package/dist/plugins/gea/component-inline.js +1 -1
- package/dist/plugins/gea/contract.d.ts +1 -1
- package/dist/plugins/gea/contract.js +1 -1
- package/dist/plugins/gea/host.js +27 -1
- package/dist/plugins/gea/lower.js +8 -1
- package/dist/plugins/gea/producer.js +1 -1
- package/dist/plugins/gea/reactive-slots.d.ts +1 -1
- package/dist/plugins/gea/reactive-slots.js +1 -1
- package/dist/plugins/load.js +51 -22
- package/dist/preflight/run.d.ts +12 -1
- package/dist/preflight/run.js +65 -29
- package/dist/projection/native-callable-data.js +2 -1
- package/dist/representation/plan.js +102 -4
- package/dist/semantics/alias-this-field-declaration-transform.js +1 -1
- package/dist/semantics/ambient-type-realization-transform.js +1 -1
- package/dist/semantics/ambient.d.ts +1 -1
- package/dist/semantics/ambient.js +1 -1
- package/dist/semantics/borrowed-builtin-call-bind-source-transform.js +1 -1
- package/dist/semantics/borrowed-method-receiver-copy-source-transform.js +1 -1
- package/dist/semantics/call-invalidated-narrowing.d.ts +1 -1
- package/dist/semantics/call-invalidated-narrowing.js +4 -2
- package/dist/semantics/callable-own-data-slots.d.ts +6 -0
- package/dist/semantics/callable-own-data-slots.js +177 -101
- package/dist/semantics/class-alias.d.ts +1 -1
- package/dist/semantics/class-alias.js +1 -1
- package/dist/semantics/class-heritage.d.ts +1 -1
- package/dist/semantics/class-heritage.js +1 -1
- package/dist/semantics/commonjs-wrapper.d.ts +4 -3
- package/dist/semantics/commonjs-wrapper.js +50 -7
- package/dist/semantics/constructor-function-class-source-transform.js +1 -1
- package/dist/semantics/constructor-slot-subclasses.d.ts +1 -1
- package/dist/semantics/constructor-slot-subclasses.js +1 -1
- package/dist/semantics/declaration-overlay-transform.js +3 -2
- package/dist/semantics/declared-integers.d.ts +1 -1
- package/dist/semantics/declared-integers.js +1 -1
- package/dist/semantics/define-property-source-transform.js +1 -1
- package/dist/semantics/diagnostic-source-preparation.d.ts +1 -1
- package/dist/semantics/documentation-ranges.d.ts +1 -1
- package/dist/semantics/documentation-ranges.js +1 -1
- package/dist/semantics/dynamic-fallback.d.ts +1 -1
- package/dist/semantics/dynamic-fallback.js +1 -1
- package/dist/semantics/frontend-timing.js +19 -0
- package/dist/semantics/frontend.d.ts +2 -2
- package/dist/semantics/frontend.js +127 -54
- package/dist/semantics/host-declaration-provenance.d.ts +1 -1
- package/dist/semantics/host-methods.d.ts +1 -1
- package/dist/semantics/host-methods.js +1 -1
- package/dist/semantics/host-protocols.d.ts +1 -1
- package/dist/semantics/host-protocols.js +1 -1
- package/dist/semantics/inherited-accessor.d.ts +1 -1
- package/dist/semantics/inherited-accessor.js +1 -1
- package/dist/semantics/interface-families.d.ts +1 -1
- package/dist/semantics/interface-families.js +1 -1
- package/dist/semantics/interface-implementors.d.ts +1 -1
- package/dist/semantics/interface-implementors.js +1 -1
- package/dist/semantics/jsdoc-namepath-transform.js +1 -1
- package/dist/semantics/jsx-runtime-provider.d.ts +1 -1
- package/dist/semantics/jsx-runtime-provider.js +1 -1
- package/dist/semantics/known-caller-predicate-parameters.d.ts +1 -1
- package/dist/semantics/known-caller-predicate-parameters.js +1 -1
- package/dist/semantics/model/edges.d.ts +124 -0
- package/dist/semantics/model/edges.js +192 -0
- package/dist/semantics/model/graph.d.ts +26 -2
- package/dist/semantics/model/graph.js +54 -0
- package/dist/semantics/model/sealed-facts.d.ts +19 -0
- package/dist/semantics/model/sealed-facts.js +221 -0
- package/dist/semantics/model/selected-signature.d.ts +1 -1
- package/dist/semantics/model/selected-signature.js +1 -1
- package/dist/semantics/module-resolution.d.ts +1 -1
- package/dist/semantics/module-resolution.js +1 -1
- package/dist/semantics/native-function-signatures.d.ts +1 -1
- package/dist/semantics/native-function-signatures.js +1 -1
- package/dist/semantics/native-object-data-slots.js +20 -4
- package/dist/semantics/new-callee-class-tag-source-transform.js +1 -1
- package/dist/semantics/node-project.d.ts +1 -1
- package/dist/semantics/node-project.js +1 -1
- package/dist/semantics/node-source-hooks.js +1 -1
- package/dist/semantics/normalize/absent-globals.d.ts +1 -1
- package/dist/semantics/normalize/absent-globals.js +1 -1
- package/dist/semantics/normalize/any-cast-member-call.d.ts +1 -1
- package/dist/semantics/normalize/any-cast-member-call.js +1 -1
- package/dist/semantics/normalize/arguments-objects.d.ts +1 -1
- package/dist/semantics/normalize/arguments-objects.js +1 -1
- package/dist/semantics/normalize/asserted-argument-arms.d.ts +1 -1
- package/dist/semantics/normalize/asserted-argument-arms.js +1 -1
- package/dist/semantics/normalize/asserted-arm-absence.d.ts +1 -1
- package/dist/semantics/normalize/asserted-arm-absence.js +1 -1
- package/dist/semantics/normalize/assignment-patterns.d.ts +1 -1
- package/dist/semantics/normalize/assignment-patterns.js +1 -1
- package/dist/semantics/normalize/bag-absence.d.ts +1 -1
- package/dist/semantics/normalize/bag-absence.js +1 -1
- package/dist/semantics/normalize/binding-fixpoint.js +9 -2
- package/dist/semantics/normalize/bivariant-slot-parameter.d.ts +1 -1
- package/dist/semantics/normalize/bivariant-slot-parameter.js +1 -1
- package/dist/semantics/normalize/callable-data-write.d.ts +1 -1
- package/dist/semantics/normalize/callable-data-write.js +1 -1
- package/dist/semantics/normalize/callback-parameter-contracts.d.ts +1 -1
- package/dist/semantics/normalize/callback-parameter-contracts.js +1 -1
- package/dist/semantics/normalize/cells/agreement.d.ts +18 -1
- package/dist/semantics/normalize/cells/agreement.js +8 -0
- package/dist/semantics/normalize/cells/candidates.d.ts +1 -1
- package/dist/semantics/normalize/cells/candidates.js +1 -1
- package/dist/semantics/normalize/cells/facts.d.ts +1 -1
- package/dist/semantics/normalize/cells/facts.js +1 -1
- package/dist/semantics/normalize/cells/index.d.ts +2 -2
- package/dist/semantics/normalize/cells/index.js +1 -1
- package/dist/semantics/normalize/cells/model.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/bag.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/collection.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/collection.js +1 -1
- package/dist/semantics/normalize/cells/policies/field.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/field.js +1 -1
- package/dist/semantics/normalize/cells/policies/index.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/local.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/local.js +1 -1
- package/dist/semantics/normalize/cells/policies/parameter.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/parameter.js +1 -1
- package/dist/semantics/normalize/cells/policies/return.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/return.js +1 -1
- package/dist/semantics/normalize/cells/policies/shared.d.ts +1 -1
- package/dist/semantics/normalize/cells/policy.d.ts +1 -1
- package/dist/semantics/normalize/census.d.ts +1 -1
- package/dist/semantics/normalize/census.js +45 -12
- package/dist/semantics/normalize/class-instance-record-statement.d.ts +1 -1
- package/dist/semantics/normalize/class-instance-record-statement.js +1 -1
- package/dist/semantics/normalize/collection-bindings.d.ts +1 -1
- package/dist/semantics/normalize/collection-bindings.js +1 -1
- package/dist/semantics/normalize/commonjs-module-record.d.ts +1 -1
- package/dist/semantics/normalize/commonjs-module-record.js +1 -1
- package/dist/semantics/normalize/commonjs-require.d.ts +1 -1
- package/dist/semantics/normalize/commonjs-require.js +1 -1
- package/dist/semantics/normalize/contribution.d.ts +4 -3
- package/dist/semantics/normalize/contribution.js +145 -42
- package/dist/semantics/normalize/dead-event-emissions.d.ts +1 -1
- package/dist/semantics/normalize/dead-event-emissions.js +1 -1
- package/dist/semantics/normalize/dead-method-copies.d.ts +1 -1
- package/dist/semantics/normalize/dead-method-copies.js +1 -1
- package/dist/semantics/normalize/dead-typeof-guards.d.ts +1 -1
- package/dist/semantics/normalize/dead-typeof-guards.js +1 -1
- package/dist/semantics/normalize/deferred-intrinsic-protocols.d.ts +1 -1
- package/dist/semantics/normalize/deferred-intrinsic-protocols.js +1 -1
- package/dist/semantics/normalize/derived-expression-type.d.ts +1 -1
- package/dist/semantics/normalize/derived-expression-type.js +4 -4
- package/dist/semantics/normalize/evaluation-order.d.ts +1 -1
- package/dist/semantics/normalize/evaluation-order.js +1 -1
- package/dist/semantics/normalize/field-bindings.d.ts +1 -1
- package/dist/semantics/normalize/field-bindings.js +4 -3
- package/dist/semantics/normalize/flow/array-element-continuation.d.ts +1 -1
- package/dist/semantics/normalize/flow/array-element-continuation.js +3 -3
- package/dist/semantics/normalize/flow/callable-array-origins.d.ts +1 -1
- package/dist/semantics/normalize/flow/callable-array-origins.js +1 -1
- package/dist/semantics/normalize/flow/callable-completions.d.ts +1 -1
- package/dist/semantics/normalize/flow/callable-completions.js +1 -1
- package/dist/semantics/normalize/flow/callable-reach.d.ts +1 -1
- package/dist/semantics/normalize/flow/callable-reach.js +73 -52
- package/dist/semantics/normalize/flow/class-family-member-read.d.ts +1 -1
- package/dist/semantics/normalize/flow/class-family-member-read.js +3 -3
- package/dist/semantics/normalize/flow/collection-value-continuation.d.ts +1 -1
- package/dist/semantics/normalize/flow/collection-value-continuation.js +1 -1
- package/dist/semantics/normalize/flow/component-solver.d.ts +181 -3
- package/dist/semantics/normalize/flow/component-solver.js +705 -164
- package/dist/semantics/normalize/flow/computed-key-set.d.ts +1 -1
- package/dist/semantics/normalize/flow/computed-key-set.js +1 -1
- package/dist/semantics/normalize/flow/export-importers.d.ts +1 -1
- package/dist/semantics/normalize/flow/export-importers.js +13 -3
- package/dist/semantics/normalize/flow/host-text-sink.d.ts +1 -1
- package/dist/semantics/normalize/flow/host-text-sink.js +1 -1
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.d.ts +1 -1
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.js +1 -1
- package/dist/semantics/normalize/flow/intrinsic-data-definition.d.ts +1 -1
- package/dist/semantics/normalize/flow/intrinsic-data-definition.js +1 -1
- package/dist/semantics/normalize/flow/invocation-facts.d.ts +1 -1
- package/dist/semantics/normalize/flow/invocation-facts.js +1 -1
- package/dist/semantics/normalize/flow/member-call-forwarding.d.ts +1 -1
- package/dist/semantics/normalize/flow/member-call-forwarding.js +1 -1
- package/dist/semantics/normalize/flow/model.d.ts +1 -1
- package/dist/semantics/normalize/flow/model.js +5 -1
- package/dist/semantics/normalize/flow/native-collection-protocol.d.ts +1 -1
- package/dist/semantics/normalize/flow/native-collection-protocol.js +1 -1
- package/dist/semantics/normalize/flow/node-path-token.d.ts +1 -1
- package/dist/semantics/normalize/flow/object-binding-continuation.d.ts +1 -1
- package/dist/semantics/normalize/flow/object-binding-continuation.js +1 -1
- package/dist/semantics/normalize/flow/origin-authority.d.ts +1 -1
- package/dist/semantics/normalize/flow/owned-class-receivers.d.ts +1 -1
- package/dist/semantics/normalize/flow/owned-class-receivers.js +1 -1
- package/dist/semantics/normalize/flow/parameter-values.d.ts +1 -1
- package/dist/semantics/normalize/flow/parameter-values.js +1 -1
- package/dist/semantics/normalize/flow/record-alias-closure.d.ts +1 -1
- package/dist/semantics/normalize/flow/record-alias-closure.js +1 -1
- package/dist/semantics/normalize/flow/seeded-origins.d.ts +1 -1
- package/dist/semantics/normalize/flow/seeded-origins.js +1 -1
- package/dist/semantics/normalize/flow/source-accessor-descriptor.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-accessor-descriptor.js +1 -1
- package/dist/semantics/normalize/flow/source-callable-own-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-callable-own-data.js +1 -1
- package/dist/semantics/normalize/flow/source-callable-readonly-set.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-callable-readonly-set.js +1 -1
- package/dist/semantics/normalize/flow/source-class-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-class-data.js +1 -1
- package/dist/semantics/normalize/flow/source-class-instanceof.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-class-instanceof.js +1 -1
- package/dist/semantics/normalize/flow/source-class-static-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-class-static-data.js +1 -1
- package/dist/semantics/normalize/flow/source-commonjs-exports.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-construction-frames.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-construction-frames.js +1 -1
- package/dist/semantics/normalize/flow/source-descriptor-protocol.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-descriptor-protocol.js +1 -1
- package/dist/semantics/normalize/flow/source-executing-parameter-values.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-executing-parameter-values.js +1 -1
- package/dist/semantics/normalize/flow/source-global-binding.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-global-binding.js +1 -1
- package/dist/semantics/normalize/flow/source-intrinsic-member-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-intrinsic-member-data.js +1 -1
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.js +24 -32
- package/dist/semantics/normalize/flow/source-invocation-receiver.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-invocation-receiver.js +1 -1
- package/dist/semantics/normalize/flow/source-native-class-alias.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-native-class-alias.js +1 -1
- package/dist/semantics/normalize/flow/source-native-iterable-integrity.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-native-iterable-integrity.js +1 -1
- package/dist/semantics/normalize/flow/source-native-origin.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-native-origin.js +1 -1
- package/dist/semantics/normalize/flow/source-normal-predecessor.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-normal-predecessor.js +1 -1
- package/dist/semantics/normalize/flow/source-property-key.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-property-key.js +1 -1
- package/dist/semantics/normalize/flow/source-prototype-method-identity.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-prototype-method-identity.js +1 -1
- package/dist/semantics/normalize/flow/source-proxy-operation.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-proxy-operation.js +1 -1
- package/dist/semantics/normalize/flow/source-raw-constructor-entry.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-raw-constructor-entry.js +1 -1
- package/dist/semantics/normalize/flow/source-read-protocol.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-read-protocol.js +1 -1
- package/dist/semantics/normalize/flow/source-record-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-record-data.js +1 -1
- package/dist/semantics/normalize/flow/source-value-session.d.ts +33 -3
- package/dist/semantics/normalize/flow/source-value-session.js +381 -173
- package/dist/semantics/normalize/flow/standard-prototype-method-source.d.ts +1 -1
- package/dist/semantics/normalize/flow/standard-prototype-method-source.js +1 -1
- package/dist/semantics/normalize/flow/targets.d.ts +1 -1
- package/dist/semantics/normalize/flow/targets.js +1 -1
- package/dist/semantics/normalize/flow/value-flow.d.ts +1 -1
- package/dist/semantics/normalize/flow/value-flow.js +243 -52
- package/dist/semantics/normalize/flow/value-provenance.d.ts +1 -1
- package/dist/semantics/normalize/flow/value-provenance.js +1 -1
- package/dist/semantics/normalize/fresh-dictionary-storage.d.ts +1 -1
- package/dist/semantics/normalize/fresh-dictionary-storage.js +1 -1
- package/dist/semantics/normalize/fresh-ordinary-object.d.ts +1 -1
- package/dist/semantics/normalize/fresh-ordinary-object.js +1 -1
- package/dist/semantics/normalize/fresh-table-last-use.d.ts +1 -1
- package/dist/semantics/normalize/fresh-table-last-use.js +1 -1
- package/dist/semantics/normalize/gating.d.ts +3 -3
- package/dist/semantics/normalize/gating.js +17 -20
- package/dist/semantics/normalize/generic-function-choice.d.ts +1 -1
- package/dist/semantics/normalize/generic-function-choice.js +1 -1
- package/dist/semantics/normalize/global-host-mutations.d.ts +1 -1
- package/dist/semantics/normalize/global-host-mutations.js +420 -138
- package/dist/semantics/normalize/host-effect-contracts.d.ts +1 -1
- package/dist/semantics/normalize/host-effect-contracts.js +1 -1
- package/dist/semantics/normalize/host-mutation-computed-keys.d.ts +1 -1
- package/dist/semantics/normalize/host-mutation-key-reader.d.ts +1 -1
- package/dist/semantics/normalize/host-mutation-key-reader.js +1 -1
- package/dist/semantics/normalize/identities.d.ts +41 -1
- package/dist/semantics/normalize/identities.js +75 -9
- package/dist/semantics/normalize/implicit-arguments-tuple.d.ts +1 -1
- package/dist/semantics/normalize/implicit-arguments-tuple.js +1 -1
- package/dist/semantics/normalize/implicit-arguments.d.ts +1 -1
- package/dist/semantics/normalize/implicit-arguments.js +1 -1
- package/dist/semantics/normalize/installed-global-properties.d.ts +1 -1
- package/dist/semantics/normalize/installed-global-properties.js +1 -1
- package/dist/semantics/normalize/instantiation.d.ts +1 -1
- package/dist/semantics/normalize/instantiation.js +1 -1
- package/dist/semantics/normalize/intrinsic-accessor-getter.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-accessor-getter.js +1 -1
- package/dist/semantics/normalize/intrinsic-property-call.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-property-call.js +1 -1
- package/dist/semantics/normalize/intrinsic-prototype.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-prototype.js +1 -1
- package/dist/semantics/normalize/intrinsic-return-identity.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-return-identity.js +1 -1
- package/dist/semantics/normalize/intrinsic-static-member.d.ts +1 -1
- package/dist/semantics/normalize/jsdoc-type-names.d.ts +1 -1
- package/dist/semantics/normalize/jsdoc-type-names.js +1 -1
- package/dist/semantics/normalize/local-bindings.d.ts +1 -1
- package/dist/semantics/normalize/local-bindings.js +3 -2
- package/dist/semantics/normalize/logical-object-truthiness.d.ts +1 -1
- package/dist/semantics/normalize/logical-object-truthiness.js +1 -1
- package/dist/semantics/normalize/logical-result-type.d.ts +1 -1
- package/dist/semantics/normalize/logical-result-type.js +1 -1
- package/dist/semantics/normalize/merged-declaration.d.ts +1 -1
- package/dist/semantics/normalize/merged-declaration.js +1 -1
- package/dist/semantics/normalize/namespace-paths.d.ts +1 -1
- package/dist/semantics/normalize/namespace-paths.js +1 -1
- package/dist/semantics/normalize/never-override-result.d.ts +1 -1
- package/dist/semantics/normalize/never-override-result.js +1 -1
- package/dist/semantics/normalize/normalize.d.ts +23 -4
- package/dist/semantics/normalize/normalize.js +125 -15
- package/dist/semantics/normalize/null-blind-parameter.d.ts +1 -1
- package/dist/semantics/normalize/null-blind-parameter.js +1 -1
- package/dist/semantics/normalize/nullable-memo.d.ts +28 -0
- package/dist/semantics/normalize/nullable-memo.js +99 -0
- package/dist/semantics/normalize/object-bag-bindings.d.ts +1 -1
- package/dist/semantics/normalize/object-bag-bindings.js +15 -4
- package/dist/semantics/normalize/omitted-stated-parameter.d.ts +1 -1
- package/dist/semantics/normalize/omitted-stated-parameter.js +1 -1
- package/dist/semantics/normalize/open-type-form.d.ts +1 -1
- package/dist/semantics/normalize/open-type-form.js +1 -1
- package/dist/semantics/normalize/override-field-arms.d.ts +1 -1
- package/dist/semantics/normalize/override-field-arms.js +1 -1
- package/dist/semantics/normalize/parameter-bindings.d.ts +1 -52
- package/dist/semantics/normalize/parameter-bindings.js +105 -10
- package/dist/semantics/normalize/parameter-slot.d.ts +1 -1
- package/dist/semantics/normalize/parameter-slot.js +1 -1
- package/dist/semantics/normalize/physical-overload-result.d.ts +1 -1
- package/dist/semantics/normalize/physical-overload-result.js +1 -1
- package/dist/semantics/normalize/primitive-property-absence.d.ts +1 -1
- package/dist/semantics/normalize/producer-context.d.ts +1 -1
- package/dist/semantics/normalize/producers/allocations.d.ts +1 -1
- package/dist/semantics/normalize/producers/allocations.js +1 -1
- package/dist/semantics/normalize/producers/binding-kind.d.ts +1 -1
- package/dist/semantics/normalize/producers/binding-kind.js +1 -1
- package/dist/semantics/normalize/producers/bindings.d.ts +1 -1
- package/dist/semantics/normalize/producers/bindings.js +1 -1
- package/dist/semantics/normalize/producers/boundary.d.ts +1 -1
- package/dist/semantics/normalize/producers/boundary.js +1 -1
- package/dist/semantics/normalize/producers/cited-value-type.d.ts +1 -1
- package/dist/semantics/normalize/producers/cited-value-type.js +1 -1
- package/dist/semantics/normalize/producers/class-lifecycle.js +1 -1
- package/dist/semantics/normalize/producers/computations.js +1 -1
- package/dist/semantics/normalize/producers/conditional-guard.d.ts +1 -1
- package/dist/semantics/normalize/producers/control-loops.d.ts +1 -1
- package/dist/semantics/normalize/producers/control-loops.js +1 -1
- package/dist/semantics/normalize/producers/control.d.ts +1 -1
- package/dist/semantics/normalize/producers/control.js +1 -1
- package/dist/semantics/normalize/producers/declaration-lifecycle.js +1 -1
- package/dist/semantics/normalize/producers/destructuring.d.ts +1 -1
- package/dist/semantics/normalize/producers/destructuring.js +1 -1
- package/dist/semantics/normalize/producers/dynamic-language.js +1 -1
- package/dist/semantics/normalize/producers/enums.d.ts +1 -1
- package/dist/semantics/normalize/producers/enums.js +1 -1
- package/dist/semantics/normalize/producers/erasure.d.ts +1 -1
- package/dist/semantics/normalize/producers/erasure.js +1 -1
- package/dist/semantics/normalize/producers/exact-arms.d.ts +1 -1
- package/dist/semantics/normalize/producers/exact-arms.js +1 -1
- package/dist/semantics/normalize/producers/intrinsic-accessor-getter.d.ts +1 -1
- package/dist/semantics/normalize/producers/invocations.d.ts +1 -1
- package/dist/semantics/normalize/producers/invocations.js +1 -1
- package/dist/semantics/normalize/producers/iteration-yield.d.ts +1 -1
- package/dist/semantics/normalize/producers/iteration-yield.js +1 -1
- package/dist/semantics/normalize/producers/jsx.js +1 -1
- package/dist/semantics/normalize/producers/logical-merge-type.d.ts +1 -1
- package/dist/semantics/normalize/producers/logical-merge-type.js +1 -1
- package/dist/semantics/normalize/producers/mint.js +88 -5
- package/dist/semantics/normalize/producers/native-callable-readonly-set.d.ts +1 -1
- package/dist/semantics/normalize/producers/native-own-assignment.d.ts +1 -1
- package/dist/semantics/normalize/producers/native-own-assignment.js +1 -1
- package/dist/semantics/normalize/producers/nullish.d.ts +1 -1
- package/dist/semantics/normalize/producers/nullish.js +1 -1
- package/dist/semantics/normalize/producers/object-assignment.d.ts +1 -1
- package/dist/semantics/normalize/producers/object-assignment.js +1 -1
- package/dist/semantics/normalize/producers/object-tag.d.ts +1 -1
- package/dist/semantics/normalize/producers/object-tag.js +1 -1
- package/dist/semantics/normalize/producers/optional-chain.d.ts +1 -1
- package/dist/semantics/normalize/producers/optional-chain.js +1 -1
- package/dist/semantics/normalize/producers/properties.d.ts +1 -1
- package/dist/semantics/normalize/producers/properties.js +1 -1
- package/dist/semantics/normalize/producers/protocol.d.ts +1 -1
- package/dist/semantics/normalize/producers/protocol.js +1 -1
- package/dist/semantics/normalize/producers/references.d.ts +1 -1
- package/dist/semantics/normalize/producers/references.js +1 -1
- package/dist/semantics/normalize/producers/shared.d.ts +1 -1
- package/dist/semantics/normalize/producers/shared.js +1 -1
- package/dist/semantics/normalize/producers/spread-arguments.d.ts +1 -1
- package/dist/semantics/normalize/producers/spread-arguments.js +1 -1
- package/dist/semantics/normalize/producers/tagged-template.d.ts +1 -1
- package/dist/semantics/normalize/producers/tagged-template.js +1 -1
- package/dist/semantics/normalize/producers/tuple-spread.d.ts +1 -1
- package/dist/semantics/normalize/producers/tuple-spread.js +1 -1
- package/dist/semantics/normalize/property-key-domain.d.ts +8 -1
- package/dist/semantics/normalize/property-key-domain.js +74 -47
- package/dist/semantics/normalize/reachability.d.ts +1 -1
- package/dist/semantics/normalize/reachability.js +3 -2
- package/dist/semantics/normalize/reassigned-bindings.d.ts +1 -1
- package/dist/semantics/normalize/record-home-arms.d.ts +1 -1
- package/dist/semantics/normalize/record-home-arms.js +1 -1
- package/dist/semantics/normalize/record-link-families.d.ts +1 -1
- package/dist/semantics/normalize/record-link-families.js +1 -1
- package/dist/semantics/normalize/record-stand-in-arms.d.ts +1 -1
- package/dist/semantics/normalize/record-stand-in-arms.js +1 -1
- package/dist/semantics/normalize/record-storage-families.d.ts +1 -1
- package/dist/semantics/normalize/record-storage-families.js +1 -1
- package/dist/semantics/normalize/return-bindings.d.ts +1 -1
- package/dist/semantics/normalize/return-bindings.js +1 -1
- package/dist/semantics/normalize/return-paths.d.ts +1 -1
- package/dist/semantics/normalize/return-paths.js +1 -1
- package/dist/semantics/normalize/round-tables.d.ts +21 -0
- package/dist/semantics/normalize/round-tables.js +59 -0
- package/dist/semantics/normalize/script-global-redefinition.d.ts +1 -1
- package/dist/semantics/normalize/script-global-redefinition.js +1 -1
- package/dist/semantics/normalize/shared-array-storage.d.ts +1 -1
- package/dist/semantics/normalize/shared-array-storage.js +1 -1
- package/dist/semantics/normalize/sloppy-absence.d.ts +1 -1
- package/dist/semantics/normalize/sloppy-absence.js +1 -1
- package/dist/semantics/normalize/source-native-iterable.d.ts +2 -2
- package/dist/semantics/normalize/source-native-iterable.js +4 -2
- package/dist/semantics/normalize/source-object-prototype-absence.d.ts +1 -1
- package/dist/semantics/normalize/source-object-prototype-absence.js +1 -1
- package/dist/semantics/normalize/specialization.d.ts +1 -1
- package/dist/semantics/normalize/specialization.js +1 -1
- package/dist/semantics/normalize/specialized-source-frames.d.ts +1 -1
- package/dist/semantics/normalize/specialized-source-frames.js +12 -4
- package/dist/semantics/normalize/structural-any-binding-consumer.d.ts +1 -1
- package/dist/semantics/normalize/structural-any-binding-consumer.js +1 -1
- package/dist/semantics/normalize/structural-array-element.d.ts +1 -1
- package/dist/semantics/normalize/structural-array-element.js +1 -1
- package/dist/semantics/normalize/structural-array-read.d.ts +1 -1
- package/dist/semantics/normalize/structural-array-read.js +1 -1
- package/dist/semantics/normalize/structural-callable.d.ts +1 -1
- package/dist/semantics/normalize/structural-callable.js +1 -1
- package/dist/semantics/normalize/structural-creation-order.d.ts +1 -1
- package/dist/semantics/normalize/structural-creation-order.js +1 -1
- package/dist/semantics/normalize/structural-declarations.d.ts +1 -1
- package/dist/semantics/normalize/structural-declarations.js +1 -1
- package/dist/semantics/normalize/structural-declared-body.d.ts +1 -1
- package/dist/semantics/normalize/structural-declared-body.js +1 -1
- package/dist/semantics/normalize/structural-generics.d.ts +1 -1
- package/dist/semantics/normalize/structural-generics.js +1 -1
- package/dist/semantics/normalize/structural-indexed-access.d.ts +1 -1
- package/dist/semantics/normalize/structural-indexed-access.js +1 -1
- package/dist/semantics/normalize/structural-instantiated-member.d.ts +1 -1
- package/dist/semantics/normalize/structural-instantiated-member.js +199 -68
- package/dist/semantics/normalize/structural-joins.d.ts +1 -1
- package/dist/semantics/normalize/structural-layout-relevance.d.ts +1 -1
- package/dist/semantics/normalize/structural-layout-relevance.js +1 -1
- package/dist/semantics/normalize/structural-layout-type.d.ts +1 -1
- package/dist/semantics/normalize/structural-layout-type.js +14 -2
- package/dist/semantics/normalize/structural-leaves.d.ts +1 -1
- package/dist/semantics/normalize/structural-leaves.js +1 -1
- package/dist/semantics/normalize/structural-local-union.d.ts +1 -1
- package/dist/semantics/normalize/structural-local-union.js +21 -16
- package/dist/semantics/normalize/structural-members.d.ts +1 -1
- package/dist/semantics/normalize/structural-members.js +1 -1
- package/dist/semantics/normalize/structural-mutable-field.d.ts +1 -2
- package/dist/semantics/normalize/structural-mutable-field.js +17 -4
- package/dist/semantics/normalize/structural-mutable-method.d.ts +1 -1
- package/dist/semantics/normalize/structural-mutable-method.js +1 -1
- package/dist/semantics/normalize/structural-parts.d.ts +1 -1
- package/dist/semantics/normalize/structural-parts.js +1 -1
- package/dist/semantics/normalize/structural-receiver.d.ts +1 -1
- package/dist/semantics/normalize/structural-receiver.js +1 -1
- package/dist/semantics/normalize/structural-rules.d.ts +4 -4
- package/dist/semantics/normalize/structural-rules.js +30 -12
- package/dist/semantics/normalize/structural-self-reference.d.ts +1 -1
- package/dist/semantics/normalize/structural-self-reference.js +1 -1
- package/dist/semantics/normalize/structural.d.ts +1 -1
- package/dist/semantics/normalize/structural.js +2467 -2239
- package/dist/semantics/normalize/suppressed-write-arms.d.ts +1 -1
- package/dist/semantics/normalize/suppressed-write-arms.js +1 -1
- package/dist/semantics/normalize/symbol-keyed-this-slots.d.ts +1 -1
- package/dist/semantics/normalize/symbol-keyed-this-slots.js +1 -1
- package/dist/semantics/normalize/unreduced-type-form.d.ts +1 -1
- package/dist/semantics/normalize/unreduced-type-form.js +1 -1
- package/dist/semantics/normalize/unresolvable-names.d.ts +1 -1
- package/dist/semantics/normalize/unresolvable-names.js +1 -1
- package/dist/semantics/normalize/unshared-array-result.d.ts +1 -1
- package/dist/semantics/normalize/unshared-array-result.js +1 -1
- package/dist/semantics/package-sources.d.ts +1 -1
- package/dist/semantics/package-sources.js +1 -1
- package/dist/semantics/program.d.ts +1 -1
- package/dist/semantics/program.js +11 -5
- package/dist/semantics/prototype-install-source-transform.js +1 -1
- package/dist/semantics/prototype-object-class-source-transform.js +1 -1
- package/dist/semantics/prototype-reparenting.d.ts +1 -1
- package/dist/semantics/prototype-reparenting.js +1 -1
- package/dist/semantics/shared-declaration-files.d.ts +1 -1
- package/dist/semantics/source-transform-exports.js +1 -1
- package/dist/semantics/stable-checker.d.ts +9 -1
- package/dist/semantics/stable-checker.js +21 -5
- package/dist/semantics/subclass-member-overlay-transform.js +46 -5
- package/dist/semantics/symbol-keyed-expando-source-transform.js +1 -1
- package/dist/semantics/this-constructor-source-transform.js +1 -1
- package/dist/semantics/typescript.d.ts +12 -0
- package/dist/semantics/typescript.js +12 -0
- package/dist/semantics/uncached-jsdoc-tags.d.ts +16 -0
- package/dist/semantics/uncached-jsdoc-tags.js +23 -0
- package/dist/semantics/unchecked-guard-argument-copies.d.ts +1 -1
- package/dist/semantics/unchecked-guard-argument-copies.js +1 -1
- package/dist/semantics/unchecked-write-member-declarations.d.ts +1 -1
- package/dist/semantics/unchecked-write-member-declarations.js +1 -1
- package/dist/semantics/uninstantiable-classes.d.ts +1 -1
- package/dist/semantics/uninstantiable-classes.js +1 -1
- package/dist/targets/cpp/conversions.js +137 -87
- package/dist/targets/cpp/emit-bindings.js +13 -0
- package/dist/targets/cpp/emit-context.d.ts +13 -0
- package/dist/targets/cpp/emit-context.js +9 -0
- package/dist/targets/cpp/emit-in.js +2 -1
- package/dist/targets/cpp/emit-iterator.d.ts +6 -5
- package/dist/targets/cpp/emit-iterator.js +23 -13
- package/dist/targets/cpp/emit-narrowing.d.ts +8 -0
- package/dist/targets/cpp/emit-narrowing.js +11 -1
- package/dist/targets/cpp/emit-properties.js +9 -0
- package/dist/targets/cpp/emit-record-view.d.ts +9 -0
- package/dist/targets/cpp/emit-record-view.js +12 -1
- package/dist/targets/cpp/emit.js +14 -2
- package/package.json +7 -1
- package/src/targets/cpp/runtime/gea_runtime.h +10 -2
package/dist/ir/certificate.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TargetRuntimeManifest } from '../preflight/obligations.js';
|
|
2
2
|
import type { SealedRepresentationPlan } from '../representation/plan.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type SemanticGraph } from '../semantics/model/graph.js';
|
|
4
4
|
import type { IrCertification } from './certify.js';
|
|
5
5
|
/**
|
|
6
6
|
* The whole-pipeline capability certificate.
|
package/dist/ir/certificate.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
|
+
import { SemanticEdgeTable } from '../semantics/model/edges.js';
|
|
3
|
+
import { PublishedResults } from '../semantics/model/graph.js';
|
|
2
4
|
const sha256 = (input) => createHash('sha256').update(input, 'utf8').digest('hex');
|
|
3
5
|
// The same digest as `sha256` over the concatenation, without ever holding
|
|
4
6
|
// the concatenation: the demanded-key list of a large program need not fit in
|
|
@@ -65,7 +67,16 @@ const digestOf = (value) => {
|
|
|
65
67
|
visit(element);
|
|
66
68
|
return write(']');
|
|
67
69
|
}
|
|
68
|
-
|
|
70
|
+
// The sealed graph's edge and result tables stand in for the array and
|
|
71
|
+
// the map they replaced, and digest as those: their own fields are a
|
|
72
|
+
// storage layout, and the edge table's grow as lookups memoize.
|
|
73
|
+
if (val instanceof SemanticEdgeTable) {
|
|
74
|
+
write(`A${val.length}[`);
|
|
75
|
+
for (const edge of val)
|
|
76
|
+
visit(edge);
|
|
77
|
+
return write(']');
|
|
78
|
+
}
|
|
79
|
+
if (val instanceof Map || val instanceof PublishedResults) {
|
|
69
80
|
write(`M${val.size}[`);
|
|
70
81
|
for (const [key, entry] of val) {
|
|
71
82
|
visit(key);
|
|
@@ -46,6 +46,22 @@ export declare const recordHasIteratorMethodField: (deriver: RepresentationDeriv
|
|
|
46
46
|
* cursor can walk -- see `preflight/runtime-helper-key.ts`'s own doc.
|
|
47
47
|
*/
|
|
48
48
|
export declare const isUniformTupleRecord: (representation: Representation) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* For a tuple whose positions do NOT share one carrier, the arm of the walk's
|
|
51
|
+
* element sum that carries each position, or `null` when any position has no
|
|
52
|
+
* single arm of its own.
|
|
53
|
+
*
|
|
54
|
+
* `[['GiB', 2 ** 30], ['MiB', 2 ** 20]] as const` is a tuple of two
|
|
55
|
+
* structurally identical records that are still two types, so no one cursor
|
|
56
|
+
* element type is every position's. The checker already says what a step
|
|
57
|
+
* yields: the union of the position types, which derives as a tagged union
|
|
58
|
+
* with an arm per distinct position carrier. Each position is then exactly
|
|
59
|
+
* one arm's value, and the cursor publishes that union, tagging each step
|
|
60
|
+
* with its position's arm -- the same value the program reads, never a
|
|
61
|
+
* conversion. A position matching no arm, or two, is refused rather than
|
|
62
|
+
* guessed.
|
|
63
|
+
*/
|
|
64
|
+
export declare const tuplePositionArmsOf: (representation: Representation, element: Representation | undefined) => readonly number[] | null;
|
|
49
65
|
/** Whether a sum's arms are all shared Arrays or Sets -- the only sums `emit-iterator.ts` walks natively. */
|
|
50
66
|
export declare const isSequenceSum: (representation: Representation) => boolean;
|
|
51
67
|
/**
|
|
@@ -54,7 +70,7 @@ export declare const isSequenceSum: (representation: Representation) => boolean;
|
|
|
54
70
|
* reasoning behind the `record(no-iterator-method)`/`record(tuple-values)`
|
|
55
71
|
* split.
|
|
56
72
|
*/
|
|
57
|
-
export declare const iteratorMethodCarrierKeyOf: (kind: string, representation: Representation | undefined, deriver: RepresentationDeriver) => string;
|
|
73
|
+
export declare const iteratorMethodCarrierKeyOf: (kind: string, representation: Representation | undefined, deriver: RepresentationDeriver, element?: Representation) => string;
|
|
58
74
|
/**
|
|
59
75
|
* An indexed record copied into a string-keyed dictionary: its declared fields
|
|
60
76
|
* unroll as a static record's do, and its string sidecar walks as a
|
|
@@ -124,6 +124,37 @@ export const isUniformTupleRecord = (representation) => {
|
|
|
124
124
|
const elementKey = representationKey(first.value);
|
|
125
125
|
return representation.fields.every((field, position) => field.key === String(position) && field.required && representationKey(field.value) === elementKey);
|
|
126
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* For a tuple whose positions do NOT share one carrier, the arm of the walk's
|
|
129
|
+
* element sum that carries each position, or `null` when any position has no
|
|
130
|
+
* single arm of its own.
|
|
131
|
+
*
|
|
132
|
+
* `[['GiB', 2 ** 30], ['MiB', 2 ** 20]] as const` is a tuple of two
|
|
133
|
+
* structurally identical records that are still two types, so no one cursor
|
|
134
|
+
* element type is every position's. The checker already says what a step
|
|
135
|
+
* yields: the union of the position types, which derives as a tagged union
|
|
136
|
+
* with an arm per distinct position carrier. Each position is then exactly
|
|
137
|
+
* one arm's value, and the cursor publishes that union, tagging each step
|
|
138
|
+
* with its position's arm -- the same value the program reads, never a
|
|
139
|
+
* conversion. A position matching no arm, or two, is refused rather than
|
|
140
|
+
* guessed.
|
|
141
|
+
*/
|
|
142
|
+
export const tuplePositionArmsOf = (representation, element) => {
|
|
143
|
+
if (representation.kind !== 'record' || representation.fields.length === 0 || element?.kind !== 'tagged-union')
|
|
144
|
+
return null;
|
|
145
|
+
const armKeys = element.arms.map((arm) => representationKey(arm.value));
|
|
146
|
+
const arms = [];
|
|
147
|
+
for (const [position, field] of representation.fields.entries()) {
|
|
148
|
+
if (field.key !== String(position) || !field.required)
|
|
149
|
+
return null;
|
|
150
|
+
const key = representationKey(field.value);
|
|
151
|
+
const matching = armKeys.flatMap((armKey, index) => (armKey === key ? [index] : []));
|
|
152
|
+
if (matching.length !== 1)
|
|
153
|
+
return null;
|
|
154
|
+
arms.push(matching[0]);
|
|
155
|
+
}
|
|
156
|
+
return arms;
|
|
157
|
+
};
|
|
127
158
|
/** Whether a sum's arms are all shared Arrays or Sets -- the only sums `emit-iterator.ts` walks natively. */
|
|
128
159
|
export const isSequenceSum = (representation) => representation.kind === 'tagged-union' &&
|
|
129
160
|
representation.arms.length > 0 &&
|
|
@@ -143,7 +174,7 @@ const optionalIterationSourceKeyOf = (kind, representation) => {
|
|
|
143
174
|
* reasoning behind the `record(no-iterator-method)`/`record(tuple-values)`
|
|
144
175
|
* split.
|
|
145
176
|
*/
|
|
146
|
-
export const iteratorMethodCarrierKeyOf = (kind, representation, deriver) => {
|
|
177
|
+
export const iteratorMethodCarrierKeyOf = (kind, representation, deriver, element) => {
|
|
147
178
|
const wrapped = optionalIterationSourceKeyOf(kind, representation);
|
|
148
179
|
if (wrapped !== null)
|
|
149
180
|
return wrapped;
|
|
@@ -160,7 +191,9 @@ export const iteratorMethodCarrierKeyOf = (kind, representation, deriver) => {
|
|
|
160
191
|
return kind;
|
|
161
192
|
if (kind === 'native-record-ref')
|
|
162
193
|
return 'native-record-ref(no-iterator-method)';
|
|
163
|
-
return isUniformTupleRecord(representation)
|
|
194
|
+
return isUniformTupleRecord(representation) || tuplePositionArmsOf(representation, element) !== null
|
|
195
|
+
? 'record(tuple-values)'
|
|
196
|
+
: 'record(no-iterator-method)';
|
|
164
197
|
};
|
|
165
198
|
/** Whether a `record`/`class-ref` is a shape `emitSpreadCopy` can copy without calling user code -- see `runtime-helper-key.ts`'s doc. */
|
|
166
199
|
const isCopyableSpreadRecord = (deriver, representation) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { producerEdges } from '../../semantics/model/edges.js';
|
|
1
2
|
import { operandOf } from '../../semantics/model/operands.js';
|
|
2
3
|
/** Only direct calls are implemented: an extracted builtin must not bind itself to the original function. */
|
|
3
4
|
export const isDirectFunctionSourceRead = (graph, operation) => {
|
|
@@ -11,7 +12,7 @@ export const isDirectFunctionSourceRead = (graph, operation) => {
|
|
|
11
12
|
if (!result)
|
|
12
13
|
return false;
|
|
13
14
|
let calls = 0;
|
|
14
|
-
for (const edge of graph.edges) {
|
|
15
|
+
for (const edge of producerEdges(graph.edges)) {
|
|
15
16
|
if (edge.kind !== 'value' || edge.result !== result.id)
|
|
16
17
|
continue;
|
|
17
18
|
const user = graph.operations.get(edge.to);
|
|
@@ -65,6 +65,12 @@ export declare const generatedSharedObjectCarrier: (representation: Representati
|
|
|
65
65
|
* key is only known at runtime. Classes deliberately stay out of this
|
|
66
66
|
* predicate: an arbitrary string can name an inherited program method, and
|
|
67
67
|
* that prototype question is not recoverable from the record sidecar.
|
|
68
|
+
*
|
|
69
|
+
* A NAMED record (`native-record-ref` with no host name) is the same generated
|
|
70
|
+
* struct behind the same handle, so `gea::nativeDynamicHasProperty` answers it
|
|
71
|
+
* identically: its own slots, its index, its expando, a live view's original,
|
|
72
|
+
* and the ordinary prototype. An interface narrowed out of `unknown` by a type
|
|
73
|
+
* guard and probed with `key in value` is that receiver.
|
|
68
74
|
*/
|
|
69
75
|
export declare const generatedSharedRecordCarrier: (representation: Representation) => boolean;
|
|
70
76
|
/** Any compiler-owned ordinary object carrier, including by-value records with no expando identity. */
|
|
@@ -77,8 +77,15 @@ export const generatedSharedObjectCarrier = (representation) => {
|
|
|
77
77
|
* key is only known at runtime. Classes deliberately stay out of this
|
|
78
78
|
* predicate: an arbitrary string can name an inherited program method, and
|
|
79
79
|
* that prototype question is not recoverable from the record sidecar.
|
|
80
|
+
*
|
|
81
|
+
* A NAMED record (`native-record-ref` with no host name) is the same generated
|
|
82
|
+
* struct behind the same handle, so `gea::nativeDynamicHasProperty` answers it
|
|
83
|
+
* identically: its own slots, its index, its expando, a live view's original,
|
|
84
|
+
* and the ordinary prototype. An interface narrowed out of `unknown` by a type
|
|
85
|
+
* guard and probed with `key in value` is that receiver.
|
|
80
86
|
*/
|
|
81
|
-
export const generatedSharedRecordCarrier = (representation) => (representation.kind === 'record' || representation.kind === 'record-with-index') && representation.ownership === 'shared-refcount'
|
|
87
|
+
export const generatedSharedRecordCarrier = (representation) => ((representation.kind === 'record' || representation.kind === 'record-with-index') && representation.ownership === 'shared-refcount') ||
|
|
88
|
+
(representation.kind === 'native-record-ref' && representation.native === null && representation.ownership === 'shared-refcount');
|
|
82
89
|
/** Any compiler-owned ordinary object carrier, including by-value records with no expando identity. */
|
|
83
90
|
export const generatedObjectCarrier = (representation) => representation.kind === 'record' ||
|
|
84
91
|
representation.kind === 'record-with-index' ||
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { withoutSpecialization } from '../../identity/ids.js';
|
|
2
|
+
import { producerEdges } from '../../semantics/model/edges.js';
|
|
2
3
|
import { operandOf } from '../../semantics/model/operands.js';
|
|
3
4
|
import { callableBuiltinResolution, callableMutationFactsOf, callableOriginsOf } from '../../semantics/callable-origins.js';
|
|
4
5
|
/**
|
|
@@ -248,7 +249,7 @@ export const isDirectCallableBuiltinRead = (graph, operation, member) => {
|
|
|
248
249
|
if (!result)
|
|
249
250
|
return false;
|
|
250
251
|
let calls = 0;
|
|
251
|
-
for (const edge of graph.edges) {
|
|
252
|
+
for (const edge of producerEdges(graph.edges)) {
|
|
252
253
|
if (edge.kind !== 'value' || edge.result !== result.id)
|
|
253
254
|
continue;
|
|
254
255
|
const user = graph.operations.get(edge.to);
|
|
@@ -90,9 +90,10 @@ const ownKindDemandsOf = (operation, ctx) => {
|
|
|
90
90
|
const semantic = ctx.semanticOperationOf(operation.lineage);
|
|
91
91
|
if (semantic?.family === 'protocol') {
|
|
92
92
|
const receiver = operation.receiver.representation;
|
|
93
|
+
const result = operation.result.representation;
|
|
93
94
|
const carrier = operation.protocol === 'enumerate'
|
|
94
95
|
? enumerateGetIteratorCarrierKeyOf(receiver.kind, receiver)
|
|
95
|
-
: iteratorMethodCarrierKeyOf(receiver.kind, receiver, ctx.deriver);
|
|
96
|
+
: iteratorMethodCarrierKeyOf(receiver.kind, receiver, ctx.deriver, result.kind === 'iterator' ? result.element : undefined);
|
|
96
97
|
return [helper(`protocol:${operation.protocol}:get-iterator:${carrier}`)];
|
|
97
98
|
}
|
|
98
99
|
// The array-pattern SOURCE step's own Set/string snapshot and dynamic
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DeclarationId, FunctionId, IrValueId } from '../identity/ids.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type Representation } from '../representation/model.js';
|
|
3
3
|
import type { ClassConstruction } from './instantiation.js';
|
|
4
|
-
import type
|
|
4
|
+
import { type IrBody } from './model.js';
|
|
5
5
|
import type { ReflectionDemand } from './reflection-demand.js';
|
|
6
6
|
/**
|
|
7
7
|
* Class fields the program writes only while constructing the object that
|
|
@@ -90,3 +90,36 @@ export declare const stableReceiversOf: (body: IrBody, receivers: ReadonlySet<Ir
|
|
|
90
90
|
export declare const stableFieldReadsOf: (body: IrBody, receivers: ReadonlySet<IrValueId>, fields: ConstructionOnlyFields, integrity: {
|
|
91
91
|
readonly restricts: (representation: Representation) => boolean;
|
|
92
92
|
}, dying: ReadonlySet<IrValueId>) => ReadonlySet<IrValueId>;
|
|
93
|
+
/**
|
|
94
|
+
* Cells that may name the stable field read they are initialized with,
|
|
95
|
+
* instead of holding a counted copy of it.
|
|
96
|
+
*
|
|
97
|
+
* `const left = node.left` stores the read into `left`'s cell, and the store
|
|
98
|
+
* is the retain the alias of the read itself (`stableFieldReadsOf`) was there
|
|
99
|
+
* to avoid: `count(node)` paid a retain and a release per child per node
|
|
100
|
+
* walked, a quarter of a binary-tree run. The field holds one value for the
|
|
101
|
+
* whole call, so when the cell does too, every read of the cell may spell the
|
|
102
|
+
* field.
|
|
103
|
+
*
|
|
104
|
+
* The cell holds one value when the body writes it exactly once, with that
|
|
105
|
+
* read, and that write comes before every read of the cell -- dominating it,
|
|
106
|
+
* and earlier in `blockOrder`, so the writer has decided before any reader
|
|
107
|
+
* renders. Nothing else may name the cell (`admits`: a cell another frame or a
|
|
108
|
+
* closure reaches is read by code this body does not render), and each read
|
|
109
|
+
* must want the field's own carrier. A body with exception or iterator-close
|
|
110
|
+
* regions keeps its cells: the dominator tree does not carry those edges. A
|
|
111
|
+
* suspending body keeps them too, for the reason `suspensionFreeReadsOf` gives.
|
|
112
|
+
*/
|
|
113
|
+
export declare const stableFieldCellsOf: (body: IrBody, stableReads: ReadonlySet<IrValueId>, admits: (declaration: DeclarationId) => boolean) => ReadonlySet<DeclarationId>;
|
|
114
|
+
/**
|
|
115
|
+
* `stableFieldReadsOf` and `stableFieldCellsOf` together. A read whose one use
|
|
116
|
+
* is the write into its cell is dying -- the write moves it in -- and so is no
|
|
117
|
+
* stable read on its own; it becomes one when that cell is admitted, because
|
|
118
|
+
* an admitted cell's write stores nothing and the move never happens.
|
|
119
|
+
*/
|
|
120
|
+
export declare const stableFieldReadsAndCellsOf: (body: IrBody, receivers: ReadonlySet<IrValueId>, fields: ConstructionOnlyFields, integrity: {
|
|
121
|
+
readonly restricts: (representation: Representation) => boolean;
|
|
122
|
+
}, dying: ReadonlySet<IrValueId>, admits: (declaration: DeclarationId) => boolean) => {
|
|
123
|
+
readonly reads: ReadonlySet<IrValueId>;
|
|
124
|
+
readonly cells: ReadonlySet<DeclarationId>;
|
|
125
|
+
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { representationKey } from '../representation/model.js';
|
|
1
2
|
import { stringConstantsOf } from './dead-values.js';
|
|
3
|
+
import { dominatorTreeOf } from './dominance.js';
|
|
4
|
+
import { allOperationsOf } from './model.js';
|
|
2
5
|
import { operandsOfIrOperation, resultOfIrOperation } from './queries.js';
|
|
3
6
|
const everyKey = Symbol('every key');
|
|
4
7
|
const unkeyableKinds = new Set(['dynamic', 'unresolved', 'native-handle', 'proxy-object', 'carrier']);
|
|
@@ -295,3 +298,100 @@ export const stableFieldReadsOf = (body, receivers, fields, integrity, dying) =>
|
|
|
295
298
|
}
|
|
296
299
|
return suspensionFreeReadsOf(body, candidates);
|
|
297
300
|
};
|
|
301
|
+
/**
|
|
302
|
+
* Cells that may name the stable field read they are initialized with,
|
|
303
|
+
* instead of holding a counted copy of it.
|
|
304
|
+
*
|
|
305
|
+
* `const left = node.left` stores the read into `left`'s cell, and the store
|
|
306
|
+
* is the retain the alias of the read itself (`stableFieldReadsOf`) was there
|
|
307
|
+
* to avoid: `count(node)` paid a retain and a release per child per node
|
|
308
|
+
* walked, a quarter of a binary-tree run. The field holds one value for the
|
|
309
|
+
* whole call, so when the cell does too, every read of the cell may spell the
|
|
310
|
+
* field.
|
|
311
|
+
*
|
|
312
|
+
* The cell holds one value when the body writes it exactly once, with that
|
|
313
|
+
* read, and that write comes before every read of the cell -- dominating it,
|
|
314
|
+
* and earlier in `blockOrder`, so the writer has decided before any reader
|
|
315
|
+
* renders. Nothing else may name the cell (`admits`: a cell another frame or a
|
|
316
|
+
* closure reaches is read by code this body does not render), and each read
|
|
317
|
+
* must want the field's own carrier. A body with exception or iterator-close
|
|
318
|
+
* regions keeps its cells: the dominator tree does not carry those edges. A
|
|
319
|
+
* suspending body keeps them too, for the reason `suspensionFreeReadsOf` gives.
|
|
320
|
+
*/
|
|
321
|
+
export const stableFieldCellsOf = (body, stableReads, admits) => {
|
|
322
|
+
if (stableReads.size === 0 || body.tryRegions.length > 0 || (body.iteratorCloseRegions?.length ?? 0) > 0)
|
|
323
|
+
return new Set();
|
|
324
|
+
const writes = new Map();
|
|
325
|
+
const reads = new Map();
|
|
326
|
+
const refused = new Set();
|
|
327
|
+
for (const [block, contents] of body.blocks) {
|
|
328
|
+
for (const [index, operation] of allOperationsOf(contents).entries()) {
|
|
329
|
+
if (operation.kind === 'await' || operation.kind === 'yield')
|
|
330
|
+
return new Set();
|
|
331
|
+
if (operation.kind === 'binding-write') {
|
|
332
|
+
const sites = writes.get(operation.declaration) ?? [];
|
|
333
|
+
sites.push({ block, index, value: operation.value.value, representation: operation.value.representation });
|
|
334
|
+
writes.set(operation.declaration, sites);
|
|
335
|
+
}
|
|
336
|
+
else if (operation.kind === 'binding-read') {
|
|
337
|
+
const sites = reads.get(operation.declaration) ?? [];
|
|
338
|
+
sites.push({ block, index, representation: operation.result.representation });
|
|
339
|
+
reads.set(operation.declaration, sites);
|
|
340
|
+
}
|
|
341
|
+
else if ('declaration' in operation && typeof operation.declaration === 'string') {
|
|
342
|
+
refused.add(operation.declaration);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const order = new Map(body.blockOrder.map((block, position) => [block, position]));
|
|
347
|
+
const dominance = dominatorTreeOf(body);
|
|
348
|
+
const cells = new Set();
|
|
349
|
+
for (const [declaration, sites] of writes) {
|
|
350
|
+
const write = sites[0];
|
|
351
|
+
if (sites.length !== 1 || write === undefined || refused.has(declaration) || !stableReads.has(write.value))
|
|
352
|
+
continue;
|
|
353
|
+
if (!admits(declaration))
|
|
354
|
+
continue;
|
|
355
|
+
const key = representationKey(write.representation);
|
|
356
|
+
const writeOrder = order.get(write.block);
|
|
357
|
+
if (writeOrder === undefined)
|
|
358
|
+
continue;
|
|
359
|
+
const before = (read) => {
|
|
360
|
+
if (read.block === write.block)
|
|
361
|
+
return write.index < read.index;
|
|
362
|
+
const readOrder = order.get(read.block);
|
|
363
|
+
return readOrder !== undefined && writeOrder < readOrder && dominance.dominates(write.block, read.block);
|
|
364
|
+
};
|
|
365
|
+
if ((reads.get(declaration) ?? []).every((read) => before(read) && representationKey(read.representation) === key))
|
|
366
|
+
cells.add(declaration);
|
|
367
|
+
}
|
|
368
|
+
return cells;
|
|
369
|
+
};
|
|
370
|
+
/**
|
|
371
|
+
* `stableFieldReadsOf` and `stableFieldCellsOf` together. A read whose one use
|
|
372
|
+
* is the write into its cell is dying -- the write moves it in -- and so is no
|
|
373
|
+
* stable read on its own; it becomes one when that cell is admitted, because
|
|
374
|
+
* an admitted cell's write stores nothing and the move never happens.
|
|
375
|
+
*/
|
|
376
|
+
export const stableFieldReadsAndCellsOf = (body, receivers, fields, integrity, dying, admits) => {
|
|
377
|
+
const reads = stableFieldReadsOf(body, receivers, fields, integrity, dying);
|
|
378
|
+
const uses = new Map();
|
|
379
|
+
const written = new Map();
|
|
380
|
+
for (const block of body.blocks.values())
|
|
381
|
+
for (const operation of allOperationsOf(block)) {
|
|
382
|
+
for (const operand of operandsOfIrOperation(operation))
|
|
383
|
+
uses.set(operand.value, (uses.get(operand.value) ?? 0) + 1);
|
|
384
|
+
if (operation.kind === 'binding-write')
|
|
385
|
+
written.set(operation.value.value, operation.declaration);
|
|
386
|
+
}
|
|
387
|
+
const intoCell = (value) => written.has(value) && uses.get(value) === 1;
|
|
388
|
+
const candidates = stableFieldReadsOf(body, receivers, fields, integrity, new Set([...dying].filter((value) => !intoCell(value))));
|
|
389
|
+
const cells = stableFieldCellsOf(body, candidates, admits);
|
|
390
|
+
const all = new Set(reads);
|
|
391
|
+
for (const value of candidates) {
|
|
392
|
+
const declaration = written.get(value);
|
|
393
|
+
if (declaration !== undefined && intoCell(value) && cells.has(declaration))
|
|
394
|
+
all.add(value);
|
|
395
|
+
}
|
|
396
|
+
return { reads: all, cells };
|
|
397
|
+
};
|
|
@@ -12,7 +12,7 @@ export interface EmissionRepresentationReason {
|
|
|
12
12
|
readonly owner: string;
|
|
13
13
|
readonly detail: string;
|
|
14
14
|
}
|
|
15
|
-
/** One carrier in the readonly closure, with
|
|
15
|
+
/** One carrier in the readonly closure, with the first reason of each kind that retained it. */
|
|
16
16
|
export interface EmissionRepresentationEntry {
|
|
17
17
|
readonly representation: Representation;
|
|
18
18
|
readonly reasons: readonly EmissionRepresentationReason[];
|
|
@@ -46,7 +46,7 @@ export interface EmissionRepresentationPublication {
|
|
|
46
46
|
readonly roots: readonly EmissionRepresentationEntry[];
|
|
47
47
|
/** Closure entries keyed by representationKey plus recursive role where needed, including root reasons. */
|
|
48
48
|
readonly closure: ReadonlyMap<string, EmissionRepresentationEntry>;
|
|
49
|
-
/**
|
|
49
|
+
/** The first reason of each kind a carrier was retained for, keyed by the closure key. */
|
|
50
50
|
readonly reasons: ReadonlyMap<string, readonly EmissionRepresentationReason[]>;
|
|
51
51
|
/** Final class declarations reached from retained carriers or retained member bodies. */
|
|
52
52
|
readonly retainedClasses: ReadonlySet<DeclarationId>;
|
|
@@ -44,7 +44,11 @@ export const publishEmissionRepresentationsOf = (input) => {
|
|
|
44
44
|
const citedConversionIds = new Set();
|
|
45
45
|
const missingConversions = new Set();
|
|
46
46
|
const missingDefinitions = new Set();
|
|
47
|
-
|
|
47
|
+
// One reason of each kind per carrier, the first found: provenance for a
|
|
48
|
+
// reader asking why a carrier is retained. Keeping every reason kept one
|
|
49
|
+
// per operation, body and conversion that named the carrier -- 1.1 million
|
|
50
|
+
// on a large app, alive to the end of the compile for no consumer.
|
|
51
|
+
const reasonKeyOf = (reason) => reason.kind;
|
|
48
52
|
const addReason = (table, representation, reason) => {
|
|
49
53
|
const key = closureKeyOf(representation);
|
|
50
54
|
const existing = table.get(key);
|
|
@@ -52,7 +56,8 @@ export const publishEmissionRepresentationsOf = (input) => {
|
|
|
52
56
|
table.set(key, { representation, reasons: new Map([[reasonKeyOf(reason), reason]]) });
|
|
53
57
|
return;
|
|
54
58
|
}
|
|
55
|
-
existing.reasons.
|
|
59
|
+
if (!existing.reasons.has(reasonKeyOf(reason)))
|
|
60
|
+
existing.reasons.set(reasonKeyOf(reason), reason);
|
|
56
61
|
};
|
|
57
62
|
const enqueue = (representation, reason, root = false) => {
|
|
58
63
|
addReason(root ? rootEntries : entries, representation, reason);
|
|
@@ -372,7 +377,8 @@ export const publishEmissionRepresentationsOf = (input) => {
|
|
|
372
377
|
}
|
|
373
378
|
const unique = new Map();
|
|
374
379
|
for (const reason of [...(nested?.reasons.values() ?? []), ...(direct?.reasons.values() ?? [])])
|
|
375
|
-
unique.
|
|
380
|
+
if (!unique.has(reasonKeyOf(reason)))
|
|
381
|
+
unique.set(reasonKeyOf(reason), reason);
|
|
376
382
|
closure.set(key, { representation: nested?.representation ?? direct.representation, reasons: Object.freeze([...unique.values()]) });
|
|
377
383
|
}
|
|
378
384
|
const reasons = new Map();
|
|
@@ -12,7 +12,9 @@ export declare const nativeGenericSelectorMatches: (source: Representation, targ
|
|
|
12
12
|
* the selected specialization and every actual physical frame.
|
|
13
13
|
* @semanticCategory generic-primitive
|
|
14
14
|
*/
|
|
15
|
-
export declare const nativeGenericCallEntriesOf: (operation: CallOperation, origins:
|
|
15
|
+
export declare const nativeGenericCallEntriesOf: (operation: CallOperation, origins: Iterable<FunctionId> & {
|
|
16
|
+
readonly size: number;
|
|
17
|
+
}, bodyOf: (id: FunctionId) => IrBody | null | undefined, conversions?: Pick<ConversionCensus, "nodeById">) => readonly {
|
|
16
18
|
readonly functionId: FunctionId;
|
|
17
19
|
readonly arguments: readonly IrOperand[];
|
|
18
20
|
}[] | null;
|
|
@@ -56,6 +56,34 @@ const rewrite = (bodies, operation) => new Map([...bodies].map(([id, body]) => [
|
|
|
56
56
|
]))
|
|
57
57
|
}
|
|
58
58
|
]));
|
|
59
|
+
/**
|
|
60
|
+
* `rewrite` for a generation that lives only as long as one solve: a block
|
|
61
|
+
* none of whose operations changed is the input's own block, and a body none
|
|
62
|
+
* of whose blocks changed is the input's own body. A whole fresh copy of the
|
|
63
|
+
* program beside the input, which the caller still holds, was the largest
|
|
64
|
+
* thing alive at the solve over it.
|
|
65
|
+
*/
|
|
66
|
+
const rewriteSharing = (bodies, operation) => {
|
|
67
|
+
const result = new Map();
|
|
68
|
+
for (const [id, body] of bodies) {
|
|
69
|
+
let blocks = null;
|
|
70
|
+
for (const [blockId, block] of body.blocks) {
|
|
71
|
+
let operations = null;
|
|
72
|
+
for (let at = 0; at < block.operations.length; at++) {
|
|
73
|
+
const value = block.operations[at];
|
|
74
|
+
const next = operation(value);
|
|
75
|
+
if (next !== value)
|
|
76
|
+
(operations ??= block.operations.slice())[at] = next;
|
|
77
|
+
}
|
|
78
|
+
if (operations === null)
|
|
79
|
+
continue;
|
|
80
|
+
blocks ??= new Map(body.blocks);
|
|
81
|
+
blocks.set(blockId, { ...block, operations });
|
|
82
|
+
}
|
|
83
|
+
result.set(id, blocks === null ? body : { ...body, blocks });
|
|
84
|
+
}
|
|
85
|
+
return result;
|
|
86
|
+
};
|
|
59
87
|
/** Close receiver irrelevance before shaking decides which operands require runtime values. */
|
|
60
88
|
export const publishLogicalReceivers = (bodies, placements, classes, conversions, deriver, hosts) => {
|
|
61
89
|
const keyTexts = new Map();
|
|
@@ -64,7 +92,7 @@ export const publishLogicalReceivers = (bodies, placements, classes, conversions
|
|
|
64
92
|
for (const operation of block.operations)
|
|
65
93
|
if (operation.kind === 'constant' && operation.literal === 'string')
|
|
66
94
|
keyTexts.set(operation.result.id, operation.text);
|
|
67
|
-
const marked =
|
|
95
|
+
const marked = rewriteSharing(bodies, (operation) => {
|
|
68
96
|
if (operation.kind !== 'get')
|
|
69
97
|
return operation;
|
|
70
98
|
if (hostReadIgnoresLogicalReceiver(operation, hosts, keyTexts.get(operation.key.value) ?? null))
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { edgesOfKind } from '../semantics/model/edges.js';
|
|
1
2
|
import { IrLoweringBlockedError } from './lower-graph.js';
|
|
2
3
|
/**
|
|
3
4
|
* Where a `break` or `continue` lands.
|
|
@@ -14,12 +15,16 @@ import { IrLoweringBlockedError } from './lower-graph.js';
|
|
|
14
15
|
* the try region, which the emitter reroutes through the clause (the scope
|
|
15
16
|
* guard, or the exit dispatch of a finally that suspends).
|
|
16
17
|
*/
|
|
17
|
-
const transferEdgeOf = (graph, from, completion) =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const transferEdgeOf = (graph, from, completion) => {
|
|
19
|
+
for (const candidate of edgesOfKind(graph.edges, 'completion')) {
|
|
20
|
+
if (candidate.from !== from || candidate.completion !== completion)
|
|
21
|
+
continue;
|
|
22
|
+
const target = graph.operations.get(candidate.to);
|
|
23
|
+
if (!(target?.family === 'boundary' && target.boundary === 'finally-region'))
|
|
24
|
+
return candidate;
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
};
|
|
23
28
|
/** The operation a `break`/`continue` transfers to, as the graph states it. */
|
|
24
29
|
export const completionTargetOf = (graph, from, completion) => transferEdgeOf(graph, from, completion)?.to ?? null;
|
|
25
30
|
export const findCompletionTargetBlock = (graph, blockStarts, from, completion) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { operationOfResult } from '../identity/ids.js';
|
|
2
2
|
import { carriesUndefined, representationKey } from '../representation/model.js';
|
|
3
|
+
import { edgesOfKind } from '../semantics/model/edges.js';
|
|
3
4
|
import { operandOf } from '../semantics/model/operands.js';
|
|
4
5
|
import { IrLoweringBlockedError } from './lower-graph.js';
|
|
5
6
|
import { mergeIncoming } from './lower-narrow.js';
|
|
@@ -49,8 +50,8 @@ import { convertTo, namedOperand, reactiveFieldReadOf, recordLayoutOf, registerR
|
|
|
49
50
|
* allocation.
|
|
50
51
|
*/
|
|
51
52
|
const chainSuccessorOf = (graph, id) => {
|
|
52
|
-
for (const edge of graph.edges) {
|
|
53
|
-
if (edge.
|
|
53
|
+
for (const edge of edgesOfKind(graph.edges, 'evaluation')) {
|
|
54
|
+
if (edge.from === id)
|
|
54
55
|
return edge.to;
|
|
55
56
|
}
|
|
56
57
|
return null;
|
|
@@ -9,5 +9,10 @@ import { type GetOperation, type IrBody } from './model.js';
|
|
|
9
9
|
export declare const nativeHostMethodReadProofsOf: (body: IrBody, rendering: CalleeRenderingInput | undefined, hosts?: HostMemberTable) => ReadonlyMap<GetOperation, AuthenticatedNativeHostMethodRead>;
|
|
10
10
|
/** Publish before callable, field-presence or reflection flow first runs;
|
|
11
11
|
* every subsequent rewrite recomputes rather than inherits this receipt.
|
|
12
|
+
*
|
|
13
|
+
* A Get that carries no receipt and earns none is kept as it is, and so is a
|
|
14
|
+
* block or body with nothing republished: a whole fresh copy of the program
|
|
15
|
+
* beside the input, which every caller still holds, sat under the callable
|
|
16
|
+
* flow solved over it.
|
|
12
17
|
*/
|
|
13
18
|
export declare const publishNativeHostMethodReads: (bodies: ReadonlyMap<PhysicalBodyId, IrBody>, rendering: CalleeRenderingInput | undefined, hosts?: HostMemberTable) => ReadonlyMap<PhysicalBodyId, IrBody>;
|
|
@@ -28,26 +28,35 @@ export const nativeHostMethodReadProofsOf = (body, rendering, hosts) => {
|
|
|
28
28
|
};
|
|
29
29
|
/** Publish before callable, field-presence or reflection flow first runs;
|
|
30
30
|
* every subsequent rewrite recomputes rather than inherits this receipt.
|
|
31
|
+
*
|
|
32
|
+
* A Get that carries no receipt and earns none is kept as it is, and so is a
|
|
33
|
+
* block or body with nothing republished: a whole fresh copy of the program
|
|
34
|
+
* beside the input, which every caller still holds, sat under the callable
|
|
35
|
+
* flow solved over it.
|
|
31
36
|
*/
|
|
32
|
-
export const publishNativeHostMethodReads = (bodies, rendering, hosts) =>
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
export const publishNativeHostMethodReads = (bodies, rendering, hosts) => {
|
|
38
|
+
const result = new Map();
|
|
39
|
+
for (const [id, body] of bodies) {
|
|
40
|
+
const proofs = nativeHostMethodReadProofsOf(body, rendering, hosts);
|
|
41
|
+
let blocks = null;
|
|
42
|
+
for (const [blockId, block] of body.blocks) {
|
|
43
|
+
let operations = null;
|
|
44
|
+
for (let at = 0; at < block.operations.length; at++) {
|
|
45
|
+
const operation = block.operations[at];
|
|
46
|
+
if (operation.kind !== 'get')
|
|
47
|
+
continue;
|
|
48
|
+
const proof = proofs.get(operation);
|
|
49
|
+
if (proof === undefined && !Object.prototype.hasOwnProperty.call(operation, 'nativeHostMethodRead'))
|
|
50
|
+
continue;
|
|
51
|
+
const { nativeHostMethodRead: _previous, ...current } = operation;
|
|
52
|
+
(operations ??= block.operations.slice())[at] = proof === undefined ? current : { ...current, nativeHostMethodRead: proof.receipt };
|
|
53
|
+
}
|
|
54
|
+
if (operations === null)
|
|
55
|
+
continue;
|
|
56
|
+
blocks ??= new Map(body.blocks);
|
|
57
|
+
blocks.set(blockId, { ...block, operations });
|
|
51
58
|
}
|
|
52
|
-
|
|
53
|
-
}
|
|
59
|
+
result.set(id, blocks === null ? body : { ...body, blocks });
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
@@ -482,7 +482,10 @@ const conversionNodeOf = (input, conversions) => input.nativeCallableEntry
|
|
|
482
482
|
: input.role === 'call-argument' || input.role === 'construct-argument'
|
|
483
483
|
? conversions.callArgumentFor(input.source, input.target)
|
|
484
484
|
: conversions.nodeFor(input.source, input.target);
|
|
485
|
-
|
|
485
|
+
// Most operations convert nothing; one shared empty list instead of one per
|
|
486
|
+
// operation, which on a large app was 900 thousand arrays held to the end.
|
|
487
|
+
const noOperationConversions = Object.freeze([]);
|
|
488
|
+
export const operationConversionsOf = (inputs, conversions) => inputs.length === 0 ? noOperationConversions : inputs.map((input) => ({ ...input, conversion: conversionNodeOf(input, conversions).id }));
|
|
486
489
|
export const operationConversionsMatch = (expected, actual, conversions) => expected.length === actual.length &&
|
|
487
490
|
expected.every((input, index) => {
|
|
488
491
|
const value = actual[index];
|
|
@@ -126,7 +126,18 @@ export const methodValueRecipesMatch = (expected, actual, conversions) => expect
|
|
|
126
126
|
/** Publish after all body rewrites, so the certificate and the printer name the same adaptations. */
|
|
127
127
|
export const publishConversionRecipes = (input) => {
|
|
128
128
|
const nativeBodies = publishNativeHostMethodReads(input.bodies, input.calleeRendering, input.hosts.members);
|
|
129
|
-
|
|
129
|
+
// Solved before the first body is published, when any call will ask for it:
|
|
130
|
+
// asked lazily, the solve ran beside the half-built output generation, the
|
|
131
|
+
// largest thing alive in this pass.
|
|
132
|
+
const asksCallableFlow = [...nativeBodies.values()].some((body) => [...body.blocks.values()].some((block) => allOperationsOf(block).some((operation) => {
|
|
133
|
+
if (operation.kind !== 'call')
|
|
134
|
+
return false;
|
|
135
|
+
const receiver = genericNativeLogicalReceiverOf(operation);
|
|
136
|
+
return receiver !== null && !nativeLogicalReceiverProtocolSupported(nativeLogicalReceiverProtocolOf(receiver.representation));
|
|
137
|
+
})));
|
|
138
|
+
let callableFlow = asksCallableFlow
|
|
139
|
+
? nativeCallableFlowOf([...nativeBodies.values()], input.placements, input.classes, input.conversions, undefined, input.deriver)
|
|
140
|
+
: undefined;
|
|
130
141
|
const virtualFrames = settledVirtualCallFramesOf(input.bodies.values(), input.classes, input.conversions);
|
|
131
142
|
const hostMethodAliases = buildHostMethodAliasIndex([...input.bodies.values()], input.placements, input.hosts);
|
|
132
143
|
const bodies = new Map();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { normalCompletion } from '../../semantics/model/operands.js';
|
|
3
3
|
import { createClassLifecycleProducer } from '../../semantics/normalize/producers/class-lifecycle.js';
|
|
4
4
|
import { mintOperationId, mintResult, operand } from '../../semantics/normalize/producers/mint.js';
|