@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
|
@@ -113,6 +113,13 @@ const structuralUnionLoadText = (ctx, held, read, text) => {
|
|
|
113
113
|
* knows is wrong.
|
|
114
114
|
*/
|
|
115
115
|
export const emitBindingRead = (ctx, lines, operation) => {
|
|
116
|
+
// A cell that names a stable field (`EmitContext.stableFieldCells`). Const,
|
|
117
|
+
// so a consumer that moves from it copies instead of emptying the field.
|
|
118
|
+
const fieldCell = ctx.stableFieldCellTexts.get(operation.declaration);
|
|
119
|
+
if (fieldCell !== undefined) {
|
|
120
|
+
defineValueAlias(ctx, operation.result, `std::as_const(${fieldCell})`);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
116
123
|
// A char-code buffer is read by naming the string, never by copying it: a push appends to the cell itself.
|
|
117
124
|
if (ctx.charCodeBuffers.reads.has(operation.result.id)) {
|
|
118
125
|
defineValueAlias(ctx, operation.result, cellValueText(bindingReference(ctx, operation.declaration, 'a char-code buffer read')));
|
|
@@ -435,6 +442,12 @@ export const emitBindingWrite = (ctx, lines, operation) => {
|
|
|
435
442
|
// `gea_arg_0 = gea_arg_0` is the copy this exists to remove.
|
|
436
443
|
if (ctx.formalCells.has(operation.declaration))
|
|
437
444
|
return;
|
|
445
|
+
// The one write of a cell that names a stable field stores nothing: the
|
|
446
|
+
// field already holds the value for every read that follows.
|
|
447
|
+
if (ctx.stableFieldCells.has(operation.declaration) && ctx.aliasedStableFieldReads.has(operation.value.value)) {
|
|
448
|
+
ctx.stableFieldCellTexts.set(operation.declaration, operandText(ctx, operation.value));
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
438
451
|
// The one write that makes a cell a host-method alias stores nothing: the
|
|
439
452
|
// value is a host member with no C++ spelling of its own, and every read of
|
|
440
453
|
// the cell names that member directly (`emitBindingRead`).
|
|
@@ -709,6 +709,8 @@ export interface EmitBodyFacts {
|
|
|
709
709
|
readonly stableCellReads: ReadonlySet<IrValueId>;
|
|
710
710
|
/** See `EmitContext.stableFieldReads`. */
|
|
711
711
|
readonly stableFieldReads: ReadonlySet<IrValueId>;
|
|
712
|
+
/** See `EmitContext.stableFieldCells`. */
|
|
713
|
+
readonly stableFieldCells: ReadonlySet<DeclarationId>;
|
|
712
714
|
/** See `EmitContext.constructorOf`. */
|
|
713
715
|
readonly constructorOf: {
|
|
714
716
|
readonly layout: ClassLayout;
|
|
@@ -1540,6 +1542,17 @@ export interface EmitContext {
|
|
|
1540
1542
|
* so the read renders as the field itself rather than a counted copy.
|
|
1541
1543
|
*/
|
|
1542
1544
|
readonly stableFieldReads: ReadonlySet<IrValueId>;
|
|
1545
|
+
/**
|
|
1546
|
+
* Cells written once with a stable field read and read only after it
|
|
1547
|
+
* (`ir/construction-only-fields.ts`'s `stableFieldCellsOf`). When that read
|
|
1548
|
+
* did render as the field (`aliasedStableFieldReads`), the write stores
|
|
1549
|
+
* nothing and every read names the field (`stableFieldCellTexts`).
|
|
1550
|
+
*/
|
|
1551
|
+
readonly stableFieldCells: ReadonlySet<DeclarationId>;
|
|
1552
|
+
/** The stable field reads that rendered as the field itself. Filled as the body renders. */
|
|
1553
|
+
readonly aliasedStableFieldReads: Set<IrValueId>;
|
|
1554
|
+
/** The field text each admitted cell names, set by its one write before any read renders. */
|
|
1555
|
+
readonly stableFieldCellTexts: Map<DeclarationId, string>;
|
|
1543
1556
|
/** Dominating native length results, selected by the IR reuse proof. Settled the same way as `hoistedResults`. */
|
|
1544
1557
|
readonly reusedStringLengths: ReadonlyMap<IrValueId, IrOperand>;
|
|
1545
1558
|
/** Withheld values whose single reader is a call, and which therefore reach exactly one operand position -- see `emit.ts`'s `consumedByCall`. Settled the same way as `hoistedResults`. */
|
|
@@ -264,6 +264,9 @@ conversions = null, nativeSelections = undefined, callableIdentityDemand = obser
|
|
|
264
264
|
deferrable,
|
|
265
265
|
stableCellReads: bodyFacts.stableCellReads,
|
|
266
266
|
stableFieldReads: bodyFacts.stableFieldReads,
|
|
267
|
+
stableFieldCells: bodyFacts.stableFieldCells,
|
|
268
|
+
aliasedStableFieldReads: new Set(),
|
|
269
|
+
stableFieldCellTexts: new Map(),
|
|
267
270
|
reusedStringLengths,
|
|
268
271
|
callArgumentOnly,
|
|
269
272
|
classTableRoots: bodyFacts.classTableRoots,
|
|
@@ -1080,6 +1083,12 @@ const renderMutableEmitContextFields = new Set([
|
|
|
1080
1083
|
// The local that GetIterator names for its once-only Get(next). IteratorNext
|
|
1081
1084
|
// reads that name; method identity and frame remain the certified IR's facts.
|
|
1082
1085
|
'protocolNextMethods',
|
|
1086
|
+
// Text again, by the same test: WHICH cells may name their field is the
|
|
1087
|
+
// prepass's `stableFieldCells`. Whether the one write's value printed as the
|
|
1088
|
+
// field itself is decided where `emitGet` spells it, so the write records
|
|
1089
|
+
// that, and the field text its later reads print in place of the cell.
|
|
1090
|
+
'aliasedStableFieldReads',
|
|
1091
|
+
'stableFieldCellTexts',
|
|
1083
1092
|
// A wrapped dense window's subscript companion, minted and declared beside
|
|
1084
1093
|
// the read that needed it (`denseRemainderCompanion`). WHICH accesses a
|
|
1085
1094
|
// window admits is `admitDenseWindows`' prepass answer; this is only what
|
|
@@ -63,7 +63,8 @@ const generatedSharedObjectCarrier = (carrier) => {
|
|
|
63
63
|
return carrier.kind === 'native-record-ref' && carrier.native === null && carrier.ownership === 'shared-refcount';
|
|
64
64
|
};
|
|
65
65
|
/** A shared compiler-emitted record can answer a runtime string key without losing its native carrier. */
|
|
66
|
-
const generatedSharedRecordCarrier = (carrier) => (carrier.kind === 'record' || carrier.kind === 'record-with-index') && carrier.ownership === 'shared-refcount'
|
|
66
|
+
const generatedSharedRecordCarrier = (carrier) => ((carrier.kind === 'record' || carrier.kind === 'record-with-index') && carrier.ownership === 'shared-refcount') ||
|
|
67
|
+
(carrier.kind === 'native-record-ref' && carrier.native === null && carrier.ownership === 'shared-refcount');
|
|
67
68
|
/** Whether this carrier has ordinary Object.prototype semantics, independent of whether it can own expandos. */
|
|
68
69
|
const generatedObjectCarrier = (carrier) => carrier.kind === 'record' ||
|
|
69
70
|
carrier.kind === 'record-with-index' ||
|
|
@@ -83,11 +83,12 @@ export declare const dynamicIteratorHelperClaims: readonly string[];
|
|
|
83
83
|
* method is called, because the position count is a compile-time fact and
|
|
84
84
|
* `emitStaticTupleIterator` above unrolls it.
|
|
85
85
|
*
|
|
86
|
-
* `record(tuple-values)` is
|
|
87
|
-
*
|
|
88
|
-
* sibling of the deliberately unclaimed
|
|
89
|
-
* heterogeneous tuple keeps, which
|
|
90
|
-
*
|
|
86
|
+
* `record(tuple-values)` is the refinement of a positional "record" receiver
|
|
87
|
+
* whose positions all share one carrier, or whose element sum carries each
|
|
88
|
+
* position in an arm of its own -- the sibling of the deliberately unclaimed
|
|
89
|
+
* `record(no-iterator-method)` any other heterogeneous tuple keeps, which
|
|
90
|
+
* refuses at certification rather than reaching an emitter with one
|
|
91
|
+
* `gea::Iterator<E>` to build and two different `E`s.
|
|
91
92
|
*
|
|
92
93
|
* There is no `get-method` row: the producer takes this source down the native
|
|
93
94
|
* fast path (`producers/shared.ts`'s `hasNativeIterationCursor`), which mints
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { representationKey } from '../../representation/model.js';
|
|
2
2
|
import { nativeEnumerationPlanOf } from '../../ir/native-enumeration.js';
|
|
3
|
+
import { tuplePositionArmsOf } from '../../ir/certify/carrier-keys.js';
|
|
3
4
|
import { createCppEmitBlockedError, defineValue, operandText, paddedArguments, suspendsInPlace } from './emit-context.js';
|
|
4
5
|
import { receiverArgumentText } from './emit-callable.js';
|
|
5
6
|
import { nativeCallReceiverText } from './emit-native-method.js';
|
|
@@ -75,12 +76,13 @@ const emitStaticEnumerateIterator = (ctx, lines, operation, target) => {
|
|
|
75
76
|
* picking the wrong one would compile cleanly and yield `"0", "1", "2"` where
|
|
76
77
|
* the program asked for its elements.
|
|
77
78
|
*
|
|
78
|
-
* Every field must be positional
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
79
|
+
* Every field must be positional and required, and one cursor has one
|
|
80
|
+
* element type: either every position is carried identically, or the element
|
|
81
|
+
* is a sum with exactly one arm per position carrier (`tuplePositionArmsOf`),
|
|
82
|
+
* and each step is tagged with its position's arm. Certification keys the
|
|
83
|
+
* `record(tuple-values)` claim on the same two tests, so the checks here are
|
|
84
|
+
* fail-closed re-checks of that guarantee rather than a first opinion, the
|
|
85
|
+
* same posture every other source in this file takes.
|
|
84
86
|
*/
|
|
85
87
|
const emitStaticTupleIterator = (ctx, lines, operation, target, element) => {
|
|
86
88
|
if (target.kind !== 'record' || target.fields.length === 0)
|
|
@@ -90,7 +92,10 @@ const emitStaticTupleIterator = (ctx, lines, operation, target, element) => {
|
|
|
90
92
|
if (!positional)
|
|
91
93
|
return false;
|
|
92
94
|
const uniform = target.fields.every((field) => cppTypeOf(field.value) === elementType);
|
|
93
|
-
|
|
95
|
+
// A tuple whose positions differ steps through the element sum instead, each
|
|
96
|
+
// position tagged with the one arm `tuplePositionArmsOf` proved carries it.
|
|
97
|
+
const arms = uniform ? null : tuplePositionArmsOf(target, element);
|
|
98
|
+
if (!uniform && arms === null) {
|
|
94
99
|
throw createCppEmitBlockedError('runtime-helper:protocol:iterator:get-iterator:record(tuple-values)', `iterates a tuple whose positions do not share one carrier, so the single "${elementType}" element type its cursor would ` +
|
|
95
100
|
'have to publish is not the type of every position');
|
|
96
101
|
}
|
|
@@ -98,7 +103,11 @@ const emitStaticTupleIterator = (ctx, lines, operation, target, element) => {
|
|
|
98
103
|
const receiver = operandText(ctx, operation.receiver);
|
|
99
104
|
const name = defineValue(ctx, operation.result);
|
|
100
105
|
const cases = target.fields
|
|
101
|
-
.map((field, position) =>
|
|
106
|
+
.map((field, position) => {
|
|
107
|
+
const slot = `gea_receiver${accessor}${cppRecordFieldName(field.key)}`;
|
|
108
|
+
const arm = arms?.[position];
|
|
109
|
+
return `case ${position}: gea_out = ${arm === undefined ? slot : `${elementType}::ofArm<${arm}>(${slot})`}; return true;`;
|
|
110
|
+
})
|
|
102
111
|
.join(' ');
|
|
103
112
|
lines.push(`${name} = ${cppTypeOf(operation.result.representation)}(std::function<bool(std::size_t, ${elementType}&)>(` +
|
|
104
113
|
`[gea_receiver = ${receiver}](std::size_t gea_position, ${elementType}& gea_out) -> bool { ` +
|
|
@@ -1554,11 +1563,12 @@ export const dynamicIteratorHelperClaims = [
|
|
|
1554
1563
|
* method is called, because the position count is a compile-time fact and
|
|
1555
1564
|
* `emitStaticTupleIterator` above unrolls it.
|
|
1556
1565
|
*
|
|
1557
|
-
* `record(tuple-values)` is
|
|
1558
|
-
*
|
|
1559
|
-
* sibling of the deliberately unclaimed
|
|
1560
|
-
* heterogeneous tuple keeps, which
|
|
1561
|
-
*
|
|
1566
|
+
* `record(tuple-values)` is the refinement of a positional "record" receiver
|
|
1567
|
+
* whose positions all share one carrier, or whose element sum carries each
|
|
1568
|
+
* position in an arm of its own -- the sibling of the deliberately unclaimed
|
|
1569
|
+
* `record(no-iterator-method)` any other heterogeneous tuple keeps, which
|
|
1570
|
+
* refuses at certification rather than reaching an emitter with one
|
|
1571
|
+
* `gea::Iterator<E>` to build and two different `E`s.
|
|
1562
1572
|
*
|
|
1563
1573
|
* There is no `get-method` row: the producer takes this source down the native
|
|
1564
1574
|
* fast path (`producers/shared.ts`'s `hasNativeIterationCursor`), which mints
|
|
@@ -213,6 +213,14 @@ export declare const recastedUnionFromHomes: (source: Extract<Representation, {
|
|
|
213
213
|
}>, text: string, homes: readonly RecastUnionHome[]) => string | null;
|
|
214
214
|
/** Two array carriers of one element and ownership whose only difference is the extension an interface adds -- one C++ type. */
|
|
215
215
|
export declare const sameArrayUpToExtension: (left: Representation, right: Representation) => boolean;
|
|
216
|
+
/**
|
|
217
|
+
* Drops every remembered top-level answer. Called once lowering is done: the
|
|
218
|
+
* eager graph asks about every ordered pair of record carriers while it is
|
|
219
|
+
* built -- over a million answers on a large application, some 37 MB of
|
|
220
|
+
* nested tables -- and afterwards only the printer asks, for the pairs the
|
|
221
|
+
* graph kept, each of which it answers again from the same carriers.
|
|
222
|
+
*/
|
|
223
|
+
export declare const forgetRecordRecastAnswers: () => void;
|
|
216
224
|
export declare const recordsRecastable: (source: Representation, target: Representation) => boolean;
|
|
217
225
|
/**
|
|
218
226
|
* Whether an admitted record recast moves any field across the dynamic
|
|
@@ -1796,7 +1796,17 @@ const fieldIndexOf = (record) => {
|
|
|
1796
1796
|
/** The top-level pairs whose answer is being computed. */
|
|
1797
1797
|
const recordRecastPending = new WeakMap();
|
|
1798
1798
|
/** Top-level `recordsRecastable` answers, per (source, target) carrier pair. */
|
|
1799
|
-
|
|
1799
|
+
let recordRecastAnswers = new WeakMap();
|
|
1800
|
+
/**
|
|
1801
|
+
* Drops every remembered top-level answer. Called once lowering is done: the
|
|
1802
|
+
* eager graph asks about every ordered pair of record carriers while it is
|
|
1803
|
+
* built -- over a million answers on a large application, some 37 MB of
|
|
1804
|
+
* nested tables -- and afterwards only the printer asks, for the pairs the
|
|
1805
|
+
* graph kept, each of which it answers again from the same carriers.
|
|
1806
|
+
*/
|
|
1807
|
+
export const forgetRecordRecastAnswers = () => {
|
|
1808
|
+
recordRecastAnswers = new WeakMap();
|
|
1809
|
+
};
|
|
1800
1810
|
/**
|
|
1801
1811
|
* `seen` is the coinductive cycle guard: `null` at the top level, and the set
|
|
1802
1812
|
* of every pair on the current descent once a field's own carrier makes the
|
|
@@ -1025,6 +1025,7 @@ export const emitGet = (ctx, lines, operation) => {
|
|
|
1025
1025
|
operation.result.representation.kind !== 'scalar' &&
|
|
1026
1026
|
read === plainFieldReadText(ctx, operation, fieldName)) {
|
|
1027
1027
|
defineValueAlias(ctx, operation.result, read);
|
|
1028
|
+
ctx.aliasedStableFieldReads.add(operation.result.id);
|
|
1028
1029
|
return;
|
|
1029
1030
|
}
|
|
1030
1031
|
const name = defineValue(ctx, operation.result);
|
|
@@ -1204,6 +1205,14 @@ const fixedFieldPresenceText = (ctx, receiver, fieldName) => {
|
|
|
1204
1205
|
representation.kind !== 'native-record-ref' &&
|
|
1205
1206
|
representation.kind !== 'class-ref')
|
|
1206
1207
|
return null;
|
|
1208
|
+
// A required field's bit is a `static` that is always `true` when nothing in
|
|
1209
|
+
// the program can delete, freeze or redefine a field (`records.ts`, on
|
|
1210
|
+
// `ctx.fixedFieldStateConstant`), so testing it only turns a member load into
|
|
1211
|
+
// a fresh value, which a stable field read may not alias. The per-carrier
|
|
1212
|
+
// proof is not enough here: its bit is an instance member a decoder may
|
|
1213
|
+
// leave unset.
|
|
1214
|
+
if (field.required && ctx.fixedFieldStateConstant)
|
|
1215
|
+
return null;
|
|
1207
1216
|
return `${constructorViewReceiverText(ctx, receiver, fieldName, operandText(ctx, receiver))}${memberAccessOperator(representation.ownership)}${cppRecordFieldPresenceName(fieldName)}`;
|
|
1208
1217
|
};
|
|
1209
1218
|
/** A native slot is read through the exact conversion lowering certified. */
|
|
@@ -3,6 +3,15 @@ import type { Representation } from '../../representation/model.js';
|
|
|
3
3
|
import { type CertifiedRecordViewPlan } from '../../conversion/structural-plan.js';
|
|
4
4
|
import { type FamilyMemberKeys, type RecordViewPlan } from '../../conversion/record-view.js';
|
|
5
5
|
import { type ConversionSite } from './emit-narrowing.js';
|
|
6
|
+
/**
|
|
7
|
+
* Drops every remembered plan. Called once lowering is done: the eager
|
|
8
|
+
* conversion graph asks for tens of thousands of pairs while it is built and
|
|
9
|
+
* almost never the same pair twice (55,251 misses in 55,261 asks on a large
|
|
10
|
+
* application), and later stages ask for a handful. Keeping the table from
|
|
11
|
+
* there to the end of the compile held some 70 MB of plans and nested tables
|
|
12
|
+
* nothing read again; a later ask plans its pair afresh, the same pure answer.
|
|
13
|
+
*/
|
|
14
|
+
export declare const forgetRecordViewPlans: () => void;
|
|
6
15
|
export declare const viewPlanFor: (layouts: RecordLayoutPolicy, source: Representation, target: Representation) => RecordViewPlan | null;
|
|
7
16
|
export declare const familyMemberViewPlanFor: (layouts: RecordLayoutPolicy, source: Representation, target: Representation, members: FamilyMemberKeys) => RecordViewPlan | null;
|
|
8
17
|
/**
|
|
@@ -51,7 +51,18 @@ import { cppBodyName, cppRecordFieldName, cppRecordAccessorEnvironmentName, cppR
|
|
|
51
51
|
* different policy for the same pair, at the cost of one more miss, not a
|
|
52
52
|
* wrong answer.
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
let recordViewPlans = new WeakMap();
|
|
55
|
+
/**
|
|
56
|
+
* Drops every remembered plan. Called once lowering is done: the eager
|
|
57
|
+
* conversion graph asks for tens of thousands of pairs while it is built and
|
|
58
|
+
* almost never the same pair twice (55,251 misses in 55,261 asks on a large
|
|
59
|
+
* application), and later stages ask for a handful. Keeping the table from
|
|
60
|
+
* there to the end of the compile held some 70 MB of plans and nested tables
|
|
61
|
+
* nothing read again; a later ask plans its pair afresh, the same pure answer.
|
|
62
|
+
*/
|
|
63
|
+
export const forgetRecordViewPlans = () => {
|
|
64
|
+
recordViewPlans = new WeakMap();
|
|
65
|
+
};
|
|
55
66
|
export const viewPlanFor = (layouts, source, target) => {
|
|
56
67
|
let bySource = recordViewPlans.get(layouts);
|
|
57
68
|
if (bySource === undefined) {
|
package/dist/targets/cpp/emit.js
CHANGED
|
@@ -12,7 +12,7 @@ import { redundantPureConversionsOf } from '../../ir/pure-conversion-reuse.js';
|
|
|
12
12
|
import { owningConversionInputText } from './owning-conversion-input.js';
|
|
13
13
|
import { boxedValueText } from './emit-dynamic-properties.js';
|
|
14
14
|
import { stableCellReadsOf } from '../../ir/stable-cell-reads.js';
|
|
15
|
-
import { noConstructionOnlyFields,
|
|
15
|
+
import { noConstructionOnlyFields, stableFieldReadsAndCellsOf, stableReceiversOf } from '../../ir/construction-only-fields.js';
|
|
16
16
|
import { DyingArgumentSet, dyingTransferUsesOf, receiverRenamesOf, ownedDyingMergeInputsOf, ownedDyingValuesOf, ownedFormalInputsOf, transfersFormalConversion } from '../../ir/transfer.js';
|
|
17
17
|
import { classLayoutsConstructedBy, constructedBaseOf } from '../../projection/classes.js';
|
|
18
18
|
import { recordFieldsOfShape } from '../../projection/fields.js';
|
|
@@ -2538,6 +2538,17 @@ virtualDispatch = new Map(), narrowedStorage = { reads: new Map(), integral: new
|
|
|
2538
2538
|
// fields below, whose collectors genuinely do need one.
|
|
2539
2539
|
const functionSources = functionSourceReadsOf(origins.staticKeyTexts, body);
|
|
2540
2540
|
const directCalleeFacts = directCalleesOf(body, abiOfCallable);
|
|
2541
|
+
// Only a counted handle: a cell of any other carrier is read by renderers
|
|
2542
|
+
// (string appends, array and JSON fills) that name its storage directly.
|
|
2543
|
+
const { reads: stableFieldReads, cells: stableFieldCells } = stableFieldReadsAndCellsOf(body, stableReceiversOf(body, receiverValues, borrowedFormals, bindingWriteCounts, (declaration) => captures.isBoxed(declaration)), constructionOnlyFields, nativeIntegrityRestricted, bodyDyingArguments, (declaration) => {
|
|
2544
|
+
const placement = placements.get(declaration);
|
|
2545
|
+
if (placement?.storage.kind !== 'local' || placement.storage.owner !== body.sourceOwner)
|
|
2546
|
+
return false;
|
|
2547
|
+
if (captures.isBoxed(declaration) || captures.isCaptured(declaration))
|
|
2548
|
+
return false;
|
|
2549
|
+
const held = placement.representation;
|
|
2550
|
+
return held?.kind === 'class-ref' || (held?.kind === 'optional' && held.payload.kind === 'class-ref');
|
|
2551
|
+
});
|
|
2541
2552
|
const bodyFacts = {
|
|
2542
2553
|
generatorBody: body.generator === true,
|
|
2543
2554
|
asyncCoroutineBody: isAsyncCoroutineBody(body),
|
|
@@ -2545,7 +2556,8 @@ virtualDispatch = new Map(), narrowedStorage = { reads: new Map(), integral: new
|
|
|
2545
2556
|
receiverValues,
|
|
2546
2557
|
bindingWriteCounts,
|
|
2547
2558
|
stableCellReads: stableCellReadsOf(body, (declaration) => placements.get(declaration)?.storage.kind === 'local'),
|
|
2548
|
-
stableFieldReads
|
|
2559
|
+
stableFieldReads,
|
|
2560
|
+
stableFieldCells,
|
|
2549
2561
|
constructorOf,
|
|
2550
2562
|
ownedDyingValues,
|
|
2551
2563
|
transferDyingValues,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geastack/compiler",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"description": "The geastack TypeScript-to-C++ compiler: one semantic spine, no source-shaped authority, no boxing of statically typed values.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -31,6 +31,12 @@
|
|
|
31
31
|
"./dist/*": "./dist/*",
|
|
32
32
|
"./src/*": "./src/*"
|
|
33
33
|
},
|
|
34
|
+
"imports": {
|
|
35
|
+
"#typescript": {
|
|
36
|
+
"types": "typescript",
|
|
37
|
+
"default": "./dist/semantics/typescript.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
34
40
|
"files": [
|
|
35
41
|
"dist/**/*.js",
|
|
36
42
|
"dist/**/*.d.ts",
|
|
@@ -5030,10 +5030,18 @@ struct Ref : detail::RefStorage {
|
|
|
5030
5030
|
* construction installs and every later one only confirms. A parallel region
|
|
5031
5031
|
* can make two tasks the first at once, so the confirmation is an acquire
|
|
5032
5032
|
* load and the install happens once, under a lock.
|
|
5033
|
+
*
|
|
5034
|
+
* Only the confirmation is inline. With the lock in the same body it was a
|
|
5035
|
+
* call per construction -- 5% of a binary-tree build that confirmed the
|
|
5036
|
+
* same pointer 52 million times.
|
|
5033
5037
|
*/
|
|
5034
|
-
static void installShared(Ref& slot, T* object) {
|
|
5038
|
+
[[gnu::always_inline]] static void installShared(Ref& slot, T* object) {
|
|
5039
|
+
if (std::atomic_ref<void*>(slot.erased_).load(std::memory_order_acquire) == object) [[likely]] return;
|
|
5040
|
+
installSharedSlow(slot, object);
|
|
5041
|
+
}
|
|
5042
|
+
|
|
5043
|
+
[[gnu::noinline]] static void installSharedSlow(Ref& slot, T* object) {
|
|
5035
5044
|
std::atomic_ref<void*> cell(slot.erased_);
|
|
5036
|
-
if (cell.load(std::memory_order_acquire) == object) return;
|
|
5037
5045
|
static std::mutex mutex;
|
|
5038
5046
|
std::lock_guard<std::mutex> lock(mutex);
|
|
5039
5047
|
if (cell.load(std::memory_order_relaxed) == object) return;
|