@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/compiler.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { mergeNativeIterableProviders } from './plugins/native-iterable-providers.js';
|
|
2
2
|
import { nodeOfOperation, operationOfResult } from './identity/ids.js';
|
|
3
3
|
import { readFileSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { writeHeapSnapshot } from 'v8';
|
|
4
6
|
import { projectAbis } from './projection/abi.js';
|
|
5
7
|
import { publishConversionRecipes } from './ir/publish-conversion-recipes.js';
|
|
6
8
|
import { discardUnreadCallResults } from './ir/dead-values.js';
|
|
@@ -72,6 +74,8 @@ import { createCppTargetManifest, withCppIrOperandHelpers } from './targets/cpp/
|
|
|
72
74
|
import { coreHostConstants, coreHostFunctions, coreHostMembers } from './targets/cpp/host/host-members.js';
|
|
73
75
|
import { coreGlobalClasses, coreGlobalFunctions, coreGlobalSingletons, coreNativeTypes } from './targets/cpp/host/core-globals.js';
|
|
74
76
|
import { createCppConversionRegistry } from './targets/cpp/conversions.js';
|
|
77
|
+
import { forgetRecordRecastAnswers } from './targets/cpp/emit-narrowing.js';
|
|
78
|
+
import { forgetRecordViewPlans } from './targets/cpp/emit-record-view.js';
|
|
75
79
|
import { recordLayoutPolicyOf } from './projection/fields.js';
|
|
76
80
|
import { nativeClassFieldUsesOf, projectNativeClassStorage } from './projection/class-storage.js';
|
|
77
81
|
import { finalizeNativeFieldOwnership } from './ir/native-field-owner.js';
|
|
@@ -217,9 +221,26 @@ export const compile = (request) => {
|
|
|
217
221
|
const stage = (name) => {
|
|
218
222
|
if (stageStartedAt) {
|
|
219
223
|
const now = performance.now();
|
|
220
|
-
|
|
224
|
+
// Heap beside time: a compile that runs out of memory names the stage
|
|
225
|
+
// that grew, which a time column alone never could.
|
|
226
|
+
// `GEA_STAGE_TIMING=gc` (with `node --expose-gc`) collects first, so the
|
|
227
|
+
// heap column is what the stage RETAINS rather than what it left behind.
|
|
228
|
+
const collect = globalThis.gc;
|
|
229
|
+
if (process.env['GEA_STAGE_TIMING'] === 'gc' && collect)
|
|
230
|
+
collect();
|
|
231
|
+
const { heapUsed, rss } = process.memoryUsage();
|
|
232
|
+
const gb = (bytes) => (bytes / 1073741824).toFixed(2);
|
|
233
|
+
process.stderr.write(`[STAGE] ${name.padEnd(16)} ${(now - stageStartedAt.at).toFixed(0)}ms heap ${gb(heapUsed)}GB rss ${gb(rss)}GB\n`);
|
|
221
234
|
stageStartedAt.at = now;
|
|
222
235
|
}
|
|
236
|
+
// `GEA_HEAP_SNAPSHOT_AFTER=<name>` writes a V8 heap snapshot (into
|
|
237
|
+
// `GEA_HEAP_SNAPSHOT_DIR`, default the working directory) once that stage
|
|
238
|
+
// finishes: what a stage RETAINS, and through which references, is a
|
|
239
|
+
// question only the retainer graph answers.
|
|
240
|
+
if (process.env['GEA_HEAP_SNAPSHOT_AFTER'] === name) {
|
|
241
|
+
const directory = process.env['GEA_HEAP_SNAPSHOT_DIR'] ?? process.cwd();
|
|
242
|
+
process.stderr.write(`[STAGE] heap snapshot ${writeHeapSnapshot(join(directory, `after-${name}.heapsnapshot`))}\n`);
|
|
243
|
+
}
|
|
223
244
|
if (stopAfterStage === name)
|
|
224
245
|
process.exit(0);
|
|
225
246
|
};
|
|
@@ -748,10 +769,78 @@ export const compile = (request) => {
|
|
|
748
769
|
}
|
|
749
770
|
})());
|
|
750
771
|
const conversionCensus = createConversionNodes({ registry: conversionRegistry, nodes: conversions.nodes });
|
|
772
|
+
// A build stops here once no translation unit can come out of it
|
|
773
|
+
// (`CompilationRequest.stopWhenUnemittable`): a sweep that is not clean
|
|
774
|
+
// mints no certificate, and a blocked body leaves the program incomplete,
|
|
775
|
+
// so every later stage -- minutes and most of the heap on a large program --
|
|
776
|
+
// could only add rows to a report the build already fails on.
|
|
777
|
+
const unemittable = (loweringBlockers) => {
|
|
778
|
+
stage('stopped');
|
|
779
|
+
return {
|
|
780
|
+
dynamicFallback: {
|
|
781
|
+
enabled: request.dynamicFallback ?? false,
|
|
782
|
+
valueCount: [...representations.plan.selected.values()].filter((value) => value.kind === 'dynamic' && value.reason === 'opt-in-fallback').length
|
|
783
|
+
},
|
|
784
|
+
locationOfNode: frontend.locationOfNode,
|
|
785
|
+
locationOfDeclaration: frontend.locationOfDeclaration,
|
|
786
|
+
textOfNode: frontend.textOfNode,
|
|
787
|
+
graph: frontend.graph,
|
|
788
|
+
sourceFileNames: frontend.sourceFileNames,
|
|
789
|
+
sourcePreparations: frontend.sourcePreparations,
|
|
790
|
+
representations,
|
|
791
|
+
manifest,
|
|
792
|
+
preflight,
|
|
793
|
+
certificate: null,
|
|
794
|
+
diagnostics,
|
|
795
|
+
uninstalledFamilies: frontend.uninstalledFamilies,
|
|
796
|
+
censusAccounting: frontend.censusAccounting,
|
|
797
|
+
cellFacts: frontend.cellFacts,
|
|
798
|
+
conversionNodes: conversions.nodes,
|
|
799
|
+
conversionCensus,
|
|
800
|
+
source: null,
|
|
801
|
+
units: [],
|
|
802
|
+
loweringBlockers,
|
|
803
|
+
certification: null,
|
|
804
|
+
refusals: refusalsOf(frontend.censusRefusals, abis.blocked, loweringBlockers, [], []),
|
|
805
|
+
slotDrift: [],
|
|
806
|
+
printerDrift: [],
|
|
807
|
+
abiBlockers: abis.blocked,
|
|
808
|
+
emissionRefusals: [],
|
|
809
|
+
artifacts: plugins.flatMap((plugin) => (plugin.writeArtifacts ? [plugin.writeArtifacts] : [])),
|
|
810
|
+
generatedSupportIncludes: [...new Set(plugins.flatMap((plugin) => plugin.capabilities.generatedSupportIncludes))].sort(),
|
|
811
|
+
projection: {
|
|
812
|
+
abis: abis.abis,
|
|
813
|
+
constructs: abis.constructs,
|
|
814
|
+
callableOrigins: abis.callableOrigins,
|
|
815
|
+
classes,
|
|
816
|
+
placements,
|
|
817
|
+
slotHooks: plugins.flatMap((plugin) => (plugin.slotOf ? [plugin.slotOf] : []))
|
|
818
|
+
},
|
|
819
|
+
emissionRepresentations: null,
|
|
820
|
+
reflection: null,
|
|
821
|
+
irBodies: null,
|
|
822
|
+
physicalClasses: null
|
|
823
|
+
};
|
|
824
|
+
};
|
|
825
|
+
if (request.stopWhenUnemittable && !diagnostics.clean)
|
|
826
|
+
return unemittable([]);
|
|
751
827
|
// Lowering runs on the plan's verdict alone. An uncertified program lowers
|
|
752
828
|
// too, so its refusals are rows beside preflight's rather than a stage that
|
|
753
829
|
// never ran; only emission waits for the certificate (see the header).
|
|
754
|
-
|
|
830
|
+
// Every pass from here to certification rebuilds the bodies it is handed, so
|
|
831
|
+
// each generation is a whole copy of the program's IR. `compile` runs in one
|
|
832
|
+
// interpreted frame, which keeps every local it names until it returns, so a
|
|
833
|
+
// generation held by a `const` lived through every later stage: nine copies
|
|
834
|
+
// at certification on a large program. Each generation is therefore a `let`,
|
|
835
|
+
// dropped once the next one is built, and the long-lived results (`lowered`,
|
|
836
|
+
// `shaken`) keep only their facts, not their bodies.
|
|
837
|
+
// Every step that consumes a generation runs through `inFrame`, reading the
|
|
838
|
+
// generation from this frame's context instead of taking it as an argument
|
|
839
|
+
// here: argument and literal registers of `compile`'s own frame outlive the
|
|
840
|
+
// call they were made for, and one of them kept the pre-shake generation
|
|
841
|
+
// alive through certification -- the compile's heap floor.
|
|
842
|
+
const inFrame = (step) => step();
|
|
843
|
+
let loweredProgram = diagnostics.planClean
|
|
755
844
|
? lowerToIr({
|
|
756
845
|
graph: frontend.graph,
|
|
757
846
|
plan: representations.plan,
|
|
@@ -768,12 +857,17 @@ export const compile = (request) => {
|
|
|
768
857
|
plugins
|
|
769
858
|
})
|
|
770
859
|
: null;
|
|
860
|
+
const lowered = loweredProgram && { blocked: loweredProgram.blocked, slotDrift: loweredProgram.slotDrift };
|
|
861
|
+
forgetRecordViewPlans();
|
|
862
|
+
forgetRecordRecastAnswers();
|
|
771
863
|
stage('lowering');
|
|
772
864
|
// A partially lowered program renders a partially correct file, which is
|
|
773
865
|
// worse than rendering none: the missing half is invisible in the output.
|
|
774
866
|
// So text is produced only when every body lowered, and the blockers travel
|
|
775
867
|
// back either way so the caller can say which ones did not.
|
|
776
868
|
const complete = lowered !== null && lowered.blocked.length === 0;
|
|
869
|
+
if (request.stopWhenUnemittable && !complete)
|
|
870
|
+
return unemittable(lowered?.blocked ?? []);
|
|
777
871
|
// A generator whose formals need real work (a default, or a destructured
|
|
778
872
|
// pattern) was lowered as one body with a marker `ir/lower.ts` left on it
|
|
779
873
|
// (`IrBody.generatorPrologueBoundary`); this carves that one body into the
|
|
@@ -782,9 +876,11 @@ export const compile = (request) => {
|
|
|
782
876
|
// consumers of the body list, so the shaker and the emitter agree on which
|
|
783
877
|
// bodies -- and which placements, since a bridged cell mints its own -- the
|
|
784
878
|
// program actually has.
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
const splitPlacements = split?.placements ?? placements;
|
|
879
|
+
let split = complete && loweredProgram ? inFrame(() => splitGeneratorBodies(loweredProgram.bodies, placements)) : null;
|
|
880
|
+
let splitBodies = inFrame(() => split?.bodies ?? loweredProgram?.bodies ?? new Map());
|
|
881
|
+
const splitPlacements = inFrame(() => split?.placements ?? placements);
|
|
882
|
+
loweredProgram = null;
|
|
883
|
+
split = null;
|
|
788
884
|
// Pruning is per body, and a body lowering blocked on is absent rather than
|
|
789
885
|
// half built, so an incomplete program is pruned too. Gating it on
|
|
790
886
|
// `complete` certified the proven-dead arms of every OTHER body whenever one
|
|
@@ -793,32 +889,30 @@ export const compile = (request) => {
|
|
|
793
889
|
// while an unrelated file's lowering was blocked, and vanished whenever it
|
|
794
890
|
// was not.
|
|
795
891
|
stage('generator-split');
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
892
|
+
let provenPruned = inFrame(() => lowered ? pruneProvenBranches(splitBodies, frontend.graph, lowered.slotDrift) : { bodies: splitBodies, slotDrift: [] });
|
|
893
|
+
splitBodies = null;
|
|
894
|
+
const prunedSlotDrift = inFrame(() => provenPruned.slotDrift);
|
|
799
895
|
// Run after the set rewrite so a body it left alone is still judged on its own;
|
|
800
896
|
// the copy elision needs the placements to prove its cell is frame-local.
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
bodies: publishNativeCallablePrivateSlots({
|
|
805
|
-
bodies: elideReadOnlySpreadCopies(rewriteLiteralSetMembership(threadShortCircuitJoins(provenPruned.bodies)), splitPlacements, representations.deriver),
|
|
806
|
-
placements: splitPlacements,
|
|
807
|
-
conversions: conversionCensus,
|
|
808
|
-
deriver: representations.deriver,
|
|
809
|
-
classes,
|
|
810
|
-
graph: frontend.graph
|
|
811
|
-
}),
|
|
897
|
+
let prunedBodies = inFrame(() => publishLogicalReceivers(publishNativeHostMethodReads(publishNativeCallableDataSlots({
|
|
898
|
+
bodies: publishNativeCallablePrivateSlots({
|
|
899
|
+
bodies: elideReadOnlySpreadCopies(rewriteLiteralSetMembership(threadShortCircuitJoins(provenPruned.bodies)), splitPlacements, representations.deriver),
|
|
812
900
|
placements: splitPlacements,
|
|
813
901
|
conversions: conversionCensus,
|
|
814
902
|
deriver: representations.deriver,
|
|
815
903
|
classes,
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
904
|
+
graph: frontend.graph
|
|
905
|
+
}),
|
|
906
|
+
placements: splitPlacements,
|
|
907
|
+
conversions: conversionCensus,
|
|
908
|
+
deriver: representations.deriver,
|
|
909
|
+
classes,
|
|
910
|
+
calleeRendering: slotsForClasses(classes).input,
|
|
911
|
+
graph: frontend.graph,
|
|
912
|
+
nativeCallableData: representations.nativeCallableData,
|
|
913
|
+
programConversions: null
|
|
914
|
+
}), slotsForClasses(classes).input, hosts.members), splitPlacements, classes, conversionCensus, representations.deriver, hosts));
|
|
915
|
+
provenPruned = null;
|
|
822
916
|
stage('prune');
|
|
823
917
|
// What the entry can reach, computed once over the whole lowered program.
|
|
824
918
|
//
|
|
@@ -829,9 +923,9 @@ export const compile = (request) => {
|
|
|
829
923
|
// thunks all read the body list, and two of them disagreeing about it is a
|
|
830
924
|
// symbol declared and never defined. See `ir/shake.ts` for the rules and for
|
|
831
925
|
// why the cut is after lowering rather than before it.
|
|
832
|
-
|
|
833
|
-
? shakeProgram({
|
|
834
|
-
bodies:
|
|
926
|
+
let shakeResult = complete && lowered
|
|
927
|
+
? inFrame(() => shakeProgram({
|
|
928
|
+
bodies: prunedBodies,
|
|
835
929
|
placements: splitPlacements,
|
|
836
930
|
classes,
|
|
837
931
|
conversions: conversionCensus,
|
|
@@ -851,8 +945,14 @@ export const compile = (request) => {
|
|
|
851
945
|
const node = conversionCensus.nativeMethodFor(source, target) ?? conversionCensus.nodeFor(source, target);
|
|
852
946
|
return [...recipeClosureOf([node], conversionCensus.nodeById).values()].every((recipe) => conversionCensus.nodeById(recipe.id) === recipe && isMaterializable(recipe.capability));
|
|
853
947
|
}
|
|
854
|
-
})
|
|
948
|
+
}))
|
|
855
949
|
: null;
|
|
950
|
+
// An incomplete program has no shaken list, so it certifies the pruned one.
|
|
951
|
+
if (shakeResult)
|
|
952
|
+
prunedBodies = null;
|
|
953
|
+
let shakenBodies = inFrame(() => shakeResult?.bodies ?? null);
|
|
954
|
+
const shaken = inFrame(() => shakeResult && { ...shakeResult, bodies: null });
|
|
955
|
+
shakeResult = null;
|
|
856
956
|
stage('shake');
|
|
857
957
|
// Which cells a closure captures, and whether a captured cell is boxed
|
|
858
958
|
// (a program fact, so it belongs to the IR), computed once here from the
|
|
@@ -862,9 +962,14 @@ export const compile = (request) => {
|
|
|
862
962
|
// `targets/cpp/captures.ts` used to compute from this same, already-shaken
|
|
863
963
|
// list at render time. `renderTranslationUnit` reads the published fact
|
|
864
964
|
// off each body instead of re-deriving it from a fresh walk.
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
965
|
+
//
|
|
966
|
+
// The shaken generation is spent once its capture facts are published:
|
|
967
|
+
// every later reader took `dispatchedBodies ?? shakenBodies`, and the first
|
|
968
|
+
// is set whenever the second is, so holding it kept a whole generation of
|
|
969
|
+
// the program's IR alive through every call/reflection round.
|
|
970
|
+
const captureFactsOf = () => publishCaptureFacts(shakenBodies, splitPlacements, recordAccessorBodiesOf([...representations.plan.selected.values()], representations.deriver));
|
|
971
|
+
let captureFacts = shakenBodies ? captureFactsOf() : null;
|
|
972
|
+
shakenBodies = null;
|
|
868
973
|
// `CallOperation.target` (a fact moved out of the target): which
|
|
869
974
|
// FunctionId a call's callee resolves to statically, so the target reads a
|
|
870
975
|
// fact instead of re-deriving it from a whole-unit capture index at render
|
|
@@ -894,119 +999,155 @@ export const compile = (request) => {
|
|
|
894
999
|
// Method provenance follows the exact adapter entries a Get will execute.
|
|
895
1000
|
// Publish those recipes before settling dispatch, then publish again after
|
|
896
1001
|
// the final rewrites so certification authenticates the operations printed.
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
classes: operationClasses,
|
|
916
|
-
calleeRendering: slotsForClasses(operationClasses).input,
|
|
917
|
-
graph: frontend.graph,
|
|
918
|
-
nativeCallableData: representations.nativeCallableData,
|
|
919
|
-
programConversions: nativeProgramConversions ?? null
|
|
920
|
-
}),
|
|
921
|
-
placements: splitPlacements,
|
|
922
|
-
conversions: conversionCensus,
|
|
923
|
-
deriver: representations.deriver,
|
|
924
|
-
graph: frontend.graph
|
|
925
|
-
}),
|
|
926
|
-
graph: frontend.graph,
|
|
927
|
-
deriver: representations.deriver,
|
|
928
|
-
conversions: conversionCensus,
|
|
929
|
-
placements: splitPlacements,
|
|
930
|
-
selected: representations.plan.selected,
|
|
931
|
-
calleeRendering: slotsForClasses(operationClasses).input
|
|
932
|
-
}),
|
|
933
|
-
placements: splitPlacements,
|
|
934
|
-
classes: operationClasses,
|
|
935
|
-
conversions: conversionCensus,
|
|
936
|
-
deriver: representations.deriver,
|
|
937
|
-
calleeRendering: slotsForClasses(operationClasses).input
|
|
938
|
-
}),
|
|
939
|
-
placements: splitPlacements,
|
|
940
|
-
classes: operationClasses,
|
|
941
|
-
conversions: conversionCensus,
|
|
942
|
-
deriver: representations.deriver,
|
|
943
|
-
...(nativeProgramConversions ? { programConversions: nativeProgramConversions } : {})
|
|
944
|
-
}),
|
|
1002
|
+
// Each pass below rebuilds every body, so the chain is a sequence of
|
|
1003
|
+
// assignments rather than one nested expression: nested, every intermediate
|
|
1004
|
+
// generation stays in an argument or object-literal register of this frame
|
|
1005
|
+
// until the outermost call returns -- nine copies of the program's IR alive
|
|
1006
|
+
// at once, inside a round that is already the compile's peak.
|
|
1007
|
+
//
|
|
1008
|
+
// Handed a taker rather than the generation itself, and run as one frame
|
|
1009
|
+
// from the conversion recipes on: an argument stays in the caller's
|
|
1010
|
+
// register until that frame returns, so the generation a caller handed in,
|
|
1011
|
+
// or held between two of these steps, lived through every pass after it.
|
|
1012
|
+
const publishNativeOperationFacts = (take, operationClasses) => {
|
|
1013
|
+
const calleeRendering = slotsForClasses(operationClasses).input;
|
|
1014
|
+
let bodies = discardUnreadCallResults(take());
|
|
1015
|
+
bodies = publishConversionRecipes({
|
|
1016
|
+
calleeRendering,
|
|
1017
|
+
wellKnownSymbols: frontend.wellKnownSymbols,
|
|
1018
|
+
bodies,
|
|
1019
|
+
placements: splitPlacements,
|
|
945
1020
|
classes: operationClasses,
|
|
1021
|
+
abis: abis.abis,
|
|
1022
|
+
deriver: representations.deriver,
|
|
1023
|
+
conversions: conversionCensus,
|
|
1024
|
+
hosts
|
|
1025
|
+
});
|
|
1026
|
+
bodies = publishNativeCallablePrivateSlots({
|
|
1027
|
+
bodies,
|
|
1028
|
+
placements: splitPlacements,
|
|
1029
|
+
conversions: conversionCensus,
|
|
946
1030
|
deriver: representations.deriver,
|
|
1031
|
+
classes: operationClasses,
|
|
1032
|
+
graph: frontend.graph
|
|
1033
|
+
});
|
|
1034
|
+
bodies = publishNativeCallableDataSlots({
|
|
1035
|
+
bodies,
|
|
1036
|
+
placements: splitPlacements,
|
|
947
1037
|
conversions: conversionCensus,
|
|
1038
|
+
deriver: representations.deriver,
|
|
1039
|
+
classes: operationClasses,
|
|
1040
|
+
calleeRendering: slotsForClasses(operationClasses).input,
|
|
948
1041
|
graph: frontend.graph,
|
|
1042
|
+
nativeCallableData: representations.nativeCallableData,
|
|
1043
|
+
programConversions: nativeProgramConversions ?? null
|
|
1044
|
+
});
|
|
1045
|
+
bodies = publishNativeObjectDataSlots({
|
|
1046
|
+
bodies,
|
|
1047
|
+
placements: splitPlacements,
|
|
1048
|
+
conversions: conversionCensus,
|
|
1049
|
+
deriver: representations.deriver,
|
|
1050
|
+
graph: frontend.graph
|
|
1051
|
+
});
|
|
1052
|
+
bodies = publishNativeOwnAssignments({
|
|
1053
|
+
bodies,
|
|
1054
|
+
graph: frontend.graph,
|
|
1055
|
+
deriver: representations.deriver,
|
|
1056
|
+
conversions: conversionCensus,
|
|
1057
|
+
placements: splitPlacements,
|
|
1058
|
+
selected: representations.plan.selected,
|
|
949
1059
|
calleeRendering: slotsForClasses(operationClasses).input
|
|
950
|
-
})
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
bodies
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1060
|
+
});
|
|
1061
|
+
bodies = publishNativeArrayDescriptorSnapshots({
|
|
1062
|
+
bodies,
|
|
1063
|
+
placements: splitPlacements,
|
|
1064
|
+
classes: operationClasses,
|
|
1065
|
+
conversions: conversionCensus,
|
|
1066
|
+
deriver: representations.deriver,
|
|
1067
|
+
calleeRendering: slotsForClasses(operationClasses).input
|
|
1068
|
+
});
|
|
1069
|
+
bodies = publishNativeFieldViewFacts({
|
|
1070
|
+
bodies,
|
|
1071
|
+
placements: splitPlacements,
|
|
1072
|
+
classes: operationClasses,
|
|
1073
|
+
conversions: conversionCensus,
|
|
1074
|
+
deriver: representations.deriver,
|
|
1075
|
+
...(nativeProgramConversions ? { programConversions: nativeProgramConversions } : {})
|
|
1076
|
+
});
|
|
1077
|
+
bodies = publishNativeDataDefinitions({
|
|
1078
|
+
bodies,
|
|
1079
|
+
classes: operationClasses,
|
|
1080
|
+
deriver: representations.deriver,
|
|
1081
|
+
conversions: conversionCensus,
|
|
1082
|
+
graph: frontend.graph,
|
|
1083
|
+
calleeRendering: slotsForClasses(operationClasses).input
|
|
1084
|
+
});
|
|
1085
|
+
bodies = publishNativeAccessorDefinitions({
|
|
1086
|
+
bodies,
|
|
1087
|
+
graph: frontend.graph,
|
|
1088
|
+
abis: abis.abis,
|
|
1089
|
+
conversions: conversionCensus,
|
|
1090
|
+
calleeRendering: slotsForClasses(operationClasses).input
|
|
1091
|
+
});
|
|
1092
|
+
return publishLogicalReceivers(bodies, splitPlacements, operationClasses, conversionCensus, representations.deriver, hosts);
|
|
1093
|
+
};
|
|
1094
|
+
let dispatchedBodies = captureFacts;
|
|
1095
|
+
captureFacts = null;
|
|
1096
|
+
const takeDispatched = () => {
|
|
1097
|
+
const taken = dispatchedBodies;
|
|
1098
|
+
dispatchedBodies = null;
|
|
1099
|
+
return taken;
|
|
1100
|
+
};
|
|
1101
|
+
// Every step of the call/reflection rounds below runs in a frame of its own
|
|
1102
|
+
// and reads the current generation from `dispatchedBodies` rather than
|
|
1103
|
+
// taking it as an argument: argument and literal registers of `compile`'s
|
|
1104
|
+
// own frame outlive the call they were made for, and each kept a generation
|
|
1105
|
+
// of the program's IR -- or an array or iterator over one -- alive through
|
|
1106
|
+
// every later round and on into certification.
|
|
1107
|
+
const dispatchRound = (exposure) => {
|
|
1108
|
+
const recipes = publishNativeOperationFacts(takeDispatched, shaken.classes);
|
|
1109
|
+
dispatchedBodies = fillCallDispatchTargets(recipes, splitPlacements, shaken.classes, (callable) => abis.abis.get(callable) ?? null, capturesNothingOf, dispatchVerdict, representations.deriver, conversionCensus, exposure);
|
|
1110
|
+
};
|
|
1111
|
+
if (dispatchedBodies && shaken && dispatchVerdict)
|
|
1112
|
+
dispatchRound(undefined);
|
|
970
1113
|
stage('call-dispatch');
|
|
971
1114
|
// Physical emission dependencies come from the final program. The sealed
|
|
972
1115
|
// plan stays intact as carrier authority and as the incomplete-shake fallback.
|
|
973
1116
|
const resolveClassRef = physicalClassInstanceResolverOf(shaken?.classes ?? classes, frontend.graph.structuralTypes, representations.deriver);
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
: undefined;
|
|
1117
|
+
const emissionRepresentationsOf = () => publishEmissionRepresentationsOf({
|
|
1118
|
+
bodies: dispatchedBodies,
|
|
1119
|
+
placements: splitPlacements,
|
|
1120
|
+
classes: shaken.classes,
|
|
1121
|
+
resolveClassRef,
|
|
1122
|
+
deriver: representations.deriver,
|
|
1123
|
+
conversions: conversionCensus,
|
|
1124
|
+
omitGlobals: shaken.unreferencedCells,
|
|
1125
|
+
complete: shaken.refused === null,
|
|
1126
|
+
fallbackRoots: [...representations.plan.selected.values()]
|
|
1127
|
+
});
|
|
1128
|
+
let emissionRepresentations = shaken ? emissionRepresentationsOf() : undefined;
|
|
987
1129
|
stage('emission-carriers');
|
|
988
1130
|
// Candidate native reads become executable only after the one reflection
|
|
989
1131
|
// census proves their layouts stay closed across the reachable program.
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
: undefined;
|
|
1132
|
+
const firstReflectionOf = () => reflectionExposureOf([...dispatchedBodies.values()], shaken.classes, representations.deriver, {
|
|
1133
|
+
representations: emissionRepresentations?.representations ?? [...representations.plan.selected.values()],
|
|
1134
|
+
wellKnownSymbols: frontend.wellKnownSymbols,
|
|
1135
|
+
physicalClasses: physicalClassLayoutsOf(shaken.classes, emissionRepresentations?.representations ?? [...representations.plan.selected.values()]).layouts,
|
|
1136
|
+
placements: splitPlacements,
|
|
1137
|
+
conversions: conversionCensus,
|
|
1138
|
+
adapterBoundaries,
|
|
1139
|
+
trace: request.includeIr === true,
|
|
1140
|
+
shakeComplete: shaken.refused === null && emissionRepresentations?.complete === true
|
|
1141
|
+
});
|
|
1142
|
+
let reflection = shaken ? firstReflectionOf() : undefined;
|
|
1002
1143
|
// Closed containers can transport callable records through their native
|
|
1003
1144
|
// fields. Newly authenticated calls can close further containers. Grow the
|
|
1004
1145
|
// same call/reflection censuses to a fixed point before ownership or emission
|
|
1005
1146
|
// consumes either publication; no printer derives this provenance.
|
|
1006
1147
|
if (shaken && dispatchedBodies && reflection && dispatchVerdict) {
|
|
1007
|
-
const closedFactsOf = (
|
|
1148
|
+
const closedFactsOf = () => {
|
|
1008
1149
|
let count = 0;
|
|
1009
|
-
for (const body of
|
|
1150
|
+
for (const body of dispatchedBodies.values())
|
|
1010
1151
|
for (const block of body.blocks.values())
|
|
1011
1152
|
for (const operation of block.operations)
|
|
1012
1153
|
if (operation.kind === 'get' || operation.kind === 'binding-read'
|
|
@@ -1015,55 +1156,48 @@ export const compile = (request) => {
|
|
|
1015
1156
|
count++;
|
|
1016
1157
|
return count;
|
|
1017
1158
|
};
|
|
1018
|
-
let count = closedFactsOf(
|
|
1159
|
+
let count = closedFactsOf();
|
|
1160
|
+
const programRecipesOf = (exposure) => publishProgramConversionRecipes({
|
|
1161
|
+
bodies: dispatchedBodies.values(),
|
|
1162
|
+
classes: shaken.classes,
|
|
1163
|
+
deriver: representations.deriver,
|
|
1164
|
+
conversions: conversionCensus,
|
|
1165
|
+
reflection: exposure,
|
|
1166
|
+
representations: emissionRepresentations?.representations ?? [...representations.plan.selected.values()]
|
|
1167
|
+
});
|
|
1168
|
+
const nextReflectionOf = (emission) => reflectionExposureOf([...dispatchedBodies.values()], shaken.classes, representations.deriver, {
|
|
1169
|
+
representations: emission.representations,
|
|
1170
|
+
wellKnownSymbols: frontend.wellKnownSymbols,
|
|
1171
|
+
physicalClasses: physicalClassLayoutsOf(shaken.classes, emission.representations).layouts,
|
|
1172
|
+
placements: splitPlacements,
|
|
1173
|
+
conversions: conversionCensus,
|
|
1174
|
+
programConversions: nativeProgramConversions,
|
|
1175
|
+
adapterBoundaries,
|
|
1176
|
+
trace: request.includeIr === true,
|
|
1177
|
+
shakeComplete: shaken.refused === null && emission.complete
|
|
1178
|
+
});
|
|
1019
1179
|
let programSignature = '';
|
|
1020
1180
|
for (;;) {
|
|
1021
|
-
nativeProgramConversions =
|
|
1022
|
-
bodies: dispatchedBodies.values(),
|
|
1023
|
-
classes: shaken.classes,
|
|
1024
|
-
deriver: representations.deriver,
|
|
1025
|
-
conversions: conversionCensus,
|
|
1026
|
-
reflection,
|
|
1027
|
-
representations: emissionRepresentations?.representations ?? [...representations.plan.selected.values()]
|
|
1028
|
-
});
|
|
1181
|
+
nativeProgramConversions = programRecipesOf(reflection);
|
|
1029
1182
|
const nextProgramSignature = JSON.stringify(nativeProgramConversions.map((recipe) => [programConversionKey(recipe), recipe.conversion.id]).sort());
|
|
1030
1183
|
const programChanged = nextProgramSignature !== programSignature;
|
|
1031
1184
|
programSignature = nextProgramSignature;
|
|
1032
|
-
|
|
1033
|
-
const nextCount = closedFactsOf(
|
|
1034
|
-
|
|
1185
|
+
dispatchRound(reflection);
|
|
1186
|
+
const nextCount = closedFactsOf();
|
|
1187
|
+
stage('reflection-round');
|
|
1035
1188
|
if (nextCount <= count && !programChanged)
|
|
1036
1189
|
break;
|
|
1037
1190
|
count = nextCount;
|
|
1038
|
-
emissionRepresentations =
|
|
1039
|
-
|
|
1040
|
-
placements: splitPlacements,
|
|
1041
|
-
classes: shaken.classes,
|
|
1042
|
-
resolveClassRef,
|
|
1043
|
-
deriver: representations.deriver,
|
|
1044
|
-
conversions: conversionCensus,
|
|
1045
|
-
omitGlobals: shaken.unreferencedCells,
|
|
1046
|
-
complete: shaken.refused === null,
|
|
1047
|
-
fallbackRoots: [...representations.plan.selected.values()]
|
|
1048
|
-
});
|
|
1049
|
-
reflection = reflectionExposureOf([...dispatchedBodies.values()], shaken.classes, representations.deriver, {
|
|
1050
|
-
representations: emissionRepresentations.representations,
|
|
1051
|
-
wellKnownSymbols: frontend.wellKnownSymbols,
|
|
1052
|
-
physicalClasses: physicalClassLayoutsOf(shaken.classes, emissionRepresentations.representations).layouts,
|
|
1053
|
-
placements: splitPlacements,
|
|
1054
|
-
conversions: conversionCensus,
|
|
1055
|
-
programConversions: nativeProgramConversions,
|
|
1056
|
-
adapterBoundaries,
|
|
1057
|
-
trace: request.includeIr === true,
|
|
1058
|
-
shakeComplete: shaken.refused === null && emissionRepresentations.complete
|
|
1059
|
-
});
|
|
1191
|
+
emissionRepresentations = emissionRepresentationsOf();
|
|
1192
|
+
reflection = nextReflectionOf(emissionRepresentations);
|
|
1060
1193
|
}
|
|
1061
1194
|
}
|
|
1062
|
-
|
|
1063
|
-
? finalizeTypedComputedReads(confirmUnboxedMethodBinds(dispatchedBodies
|
|
1195
|
+
let finalizedReads = shaken && reflection
|
|
1196
|
+
? inFrame(() => finalizeTypedComputedReads(confirmUnboxedMethodBinds(dispatchedBodies, reflection, shaken.classes), reflection))
|
|
1064
1197
|
: null;
|
|
1065
|
-
|
|
1066
|
-
|
|
1198
|
+
dispatchedBodies = null;
|
|
1199
|
+
let fieldOwnership = shaken && reflection && finalizedReads
|
|
1200
|
+
? inFrame(() => finalizeNativeFieldOwnership(finalizedReads, shaken.classes, representations.deriver, conversionCensus, reflection, (reads) => nativeClassFieldUsesOf(frontend.graph, representations.plan, representations.deriver, classes, slotsForClasses(classes), reads)))
|
|
1067
1201
|
: null;
|
|
1068
1202
|
// Presence is the census's to prove, not the checker's to assert: a load out
|
|
1069
1203
|
// of an `optional` that no program fact proves present tests before it reads
|
|
@@ -1077,18 +1211,21 @@ export const compile = (request) => {
|
|
|
1077
1211
|
// Exact callable identities are available only after the call/reflection
|
|
1078
1212
|
// fixed point. A closed body's actual normal return can now prove an edge
|
|
1079
1213
|
// impossible without treating its declared return type as a runtime fact.
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
const
|
|
1087
|
-
|
|
1214
|
+
let normalResultPruned = fieldOwnership || finalizedReads
|
|
1215
|
+
? inFrame(() => pruneProvenBranches(fieldOwnership?.bodies ?? finalizedReads, frontend.graph, prunedSlotDrift, {
|
|
1216
|
+
conversions: conversionCensus,
|
|
1217
|
+
placements: splitPlacements
|
|
1218
|
+
}))
|
|
1219
|
+
: { bodies: null, slotDrift: prunedSlotDrift };
|
|
1220
|
+
const normalResultSlotDrift = inFrame(() => normalResultPruned.slotDrift);
|
|
1221
|
+
let finalizedBodies = inFrame(() => (normalResultPruned.bodies ? withPresenceChecks(normalResultPruned.bodies, readsUnchecked) : null));
|
|
1222
|
+
normalResultPruned = null;
|
|
1223
|
+
finalizedReads = null;
|
|
1224
|
+
const executableClasses = inFrame(() => fieldOwnership?.classes ?? shaken?.classes ?? classes);
|
|
1088
1225
|
if (shaken && fieldOwnership && fieldOwnership.classes !== shaken.classes) {
|
|
1089
1226
|
// Relocation preserves every lowered field carrier, but changes which
|
|
1090
1227
|
// native layouts and dispatch identities the emitted program requires.
|
|
1091
|
-
emissionRepresentations = publishEmissionRepresentationsOf({
|
|
1228
|
+
emissionRepresentations = inFrame(() => publishEmissionRepresentationsOf({
|
|
1092
1229
|
bodies: fieldOwnership.bodies,
|
|
1093
1230
|
placements: splitPlacements,
|
|
1094
1231
|
classes: executableClasses,
|
|
@@ -1098,17 +1235,19 @@ export const compile = (request) => {
|
|
|
1098
1235
|
omitGlobals: shaken.unreferencedCells,
|
|
1099
1236
|
complete: shaken.refused === null,
|
|
1100
1237
|
fallbackRoots: [...representations.plan.selected.values()]
|
|
1101
|
-
});
|
|
1238
|
+
}));
|
|
1102
1239
|
}
|
|
1240
|
+
fieldOwnership = null;
|
|
1103
1241
|
const physicalClasses = shaken && emissionRepresentations ? physicalClassLayoutsOf(executableClasses, emissionRepresentations.representations) : undefined;
|
|
1104
1242
|
if (reflection && physicalClasses)
|
|
1105
1243
|
reflection = closePhysicalClassReflection(reflection, physicalClasses.layouts);
|
|
1106
1244
|
// A union read's class arm that provably lacks the key reads `undefined`;
|
|
1107
1245
|
// only the CLOSED exposure can say its class never gained a dynamic protocol.
|
|
1108
|
-
|
|
1246
|
+
let absentArmBodies = inFrame(() => finalizedBodies && reflection ? finalizeAbsentClassArms(finalizedBodies, reflection, executableClasses) : finalizedBodies);
|
|
1247
|
+
finalizedBodies = null;
|
|
1109
1248
|
// Last, so the call targets it follows into a callee are the final ones.
|
|
1110
|
-
|
|
1111
|
-
? shareReadOnlyEmptyRecords(absentArmBodies, {
|
|
1249
|
+
let sharedEmptyBodies = absentArmBodies
|
|
1250
|
+
? inFrame(() => shareReadOnlyEmptyRecords(absentArmBodies, {
|
|
1112
1251
|
placements: splitPlacements,
|
|
1113
1252
|
declaresField: (shapeId, key) => {
|
|
1114
1253
|
const layout = recordLayoutOfShapeId(representations.deriver, shapeId);
|
|
@@ -1119,11 +1258,13 @@ export const compile = (request) => {
|
|
|
1119
1258
|
return false;
|
|
1120
1259
|
return representation.ownership === 'shared-refcount' && plainRecordFieldsOf(representation, representations.deriver) !== null;
|
|
1121
1260
|
}
|
|
1122
|
-
})
|
|
1261
|
+
}))
|
|
1123
1262
|
: absentArmBodies;
|
|
1263
|
+
absentArmBodies = null;
|
|
1124
1264
|
// Before the recipes and certification that read the final operation list:
|
|
1125
1265
|
// a selection an `instanceof` no longer reads (`call-dispatch.ts`) goes.
|
|
1126
|
-
|
|
1266
|
+
let emittedBodies = inFrame(() => sharedEmptyBodies ? dropUnreadPureConversions(sharedEmptyBodies, conversionCensus) : sharedEmptyBodies);
|
|
1267
|
+
sharedEmptyBodies = null;
|
|
1127
1268
|
stage('reflection');
|
|
1128
1269
|
// Certification is a walk of the IR lowering actually built
|
|
1129
1270
|
// (one question, one census): every capability the printer
|
|
@@ -1139,56 +1280,55 @@ export const compile = (request) => {
|
|
|
1139
1280
|
// incomplete program has no shaken list at all, so it certifies the bodies
|
|
1140
1281
|
// lowering did build: its refusals are the point of running at all, and
|
|
1141
1282
|
// dropping them would hide why it did not lower.
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
:
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
const
|
|
1167
|
-
|
|
1283
|
+
let unsealedBodies = inFrame(() => emittedBodies ?? (lowered ? prunedBodies : null));
|
|
1284
|
+
emittedBodies = null;
|
|
1285
|
+
prunedBodies = null;
|
|
1286
|
+
// Each step from here to certification is called through a closure that
|
|
1287
|
+
// reads its generation from this frame's context: an argument object or
|
|
1288
|
+
// iterator built in this frame stays in one of its registers until the
|
|
1289
|
+
// frame returns, and kept every spent generation alive through the
|
|
1290
|
+
// certification walk -- the compile's heap floor.
|
|
1291
|
+
const programRecipesOver = (bodies) => publishProgramConversionRecipes({
|
|
1292
|
+
bodies: bodies(),
|
|
1293
|
+
classes: executableClasses,
|
|
1294
|
+
deriver: representations.deriver,
|
|
1295
|
+
conversions: conversionCensus,
|
|
1296
|
+
representations: emissionRepresentations?.representations ?? [...representations.plan.selected.values()],
|
|
1297
|
+
...(reflection ? { reflection } : {})
|
|
1298
|
+
});
|
|
1299
|
+
nativeProgramConversions = unsealedBodies ? programRecipesOver(() => unsealedBodies.values()) : undefined;
|
|
1300
|
+
const takeUnsealed = () => {
|
|
1301
|
+
const taken = unsealedBodies;
|
|
1302
|
+
unsealedBodies = null;
|
|
1303
|
+
return taken;
|
|
1304
|
+
};
|
|
1305
|
+
let operationBodies = unsealedBodies ? publishNativeOperationFacts(takeUnsealed, executableClasses) : null;
|
|
1306
|
+
unsealedBodies = null;
|
|
1307
|
+
const finalRecipesOf = () => {
|
|
1308
|
+
const taken = operationBodies;
|
|
1309
|
+
operationBodies = null;
|
|
1310
|
+
return publishConversionRecipes({
|
|
1168
1311
|
calleeRendering: slotsForClasses(executableClasses).input,
|
|
1169
1312
|
wellKnownSymbols: frontend.wellKnownSymbols,
|
|
1170
|
-
bodies:
|
|
1313
|
+
bodies: taken,
|
|
1171
1314
|
placements: splitPlacements,
|
|
1172
1315
|
classes: executableClasses,
|
|
1173
1316
|
abis: abis.abis,
|
|
1174
1317
|
deriver: representations.deriver,
|
|
1175
1318
|
conversions: conversionCensus,
|
|
1176
1319
|
hosts
|
|
1177
|
-
})
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
...(reflection ? { reflection } : {})
|
|
1190
|
-
})
|
|
1191
|
-
: [];
|
|
1320
|
+
});
|
|
1321
|
+
};
|
|
1322
|
+
let finalRecipeBodies = operationBodies ? finalRecipesOf() : null;
|
|
1323
|
+
operationBodies = null;
|
|
1324
|
+
const denseLoopPlannedOf = () => {
|
|
1325
|
+
const taken = finalRecipeBodies;
|
|
1326
|
+
finalRecipeBodies = null;
|
|
1327
|
+
return new Map([...taken].map(([id, body]) => [id, publishDenseLoopPlan(body, splitPlacements, conversionCensus)]));
|
|
1328
|
+
};
|
|
1329
|
+
const certifiedBodies = finalRecipeBodies ? denseLoopPlannedOf() : null;
|
|
1330
|
+
finalRecipeBodies = null;
|
|
1331
|
+
const programConversionRecipes = certifiedBodies ? programRecipesOver(() => certifiedBodies.values()) : [];
|
|
1192
1332
|
const parallelRegionEntries = new Set(plugins.flatMap((plugin) => [...(plugin.capabilities.parallelRegionEntries ?? [])]));
|
|
1193
1333
|
const certificationManifest = certifiedBodies ? withCppIrOperandHelpers(manifest, certifiedBodies.values()) : manifest;
|
|
1194
1334
|
const certification = lowered && certifiedBodies
|
|
@@ -1199,7 +1339,7 @@ export const compile = (request) => {
|
|
|
1199
1339
|
programConversionRecipes,
|
|
1200
1340
|
representations: emissionRepresentations?.representations ?? [...representations.plan.selected.values()],
|
|
1201
1341
|
placements: splitPlacements,
|
|
1202
|
-
slotDrift:
|
|
1342
|
+
slotDrift: normalResultSlotDrift,
|
|
1203
1343
|
blocked: lowered.blocked,
|
|
1204
1344
|
manifest: certificationManifest,
|
|
1205
1345
|
conversions: conversionCensus,
|
|
@@ -1323,7 +1463,7 @@ export const compile = (request) => {
|
|
|
1323
1463
|
loweringBlockers: lowered?.blocked ?? [],
|
|
1324
1464
|
certification,
|
|
1325
1465
|
refusals: refusalsOf(frontend.censusRefusals, abis.blocked, lowered?.blocked ?? [], certification?.refusals ?? [], rendered?.refused ?? []),
|
|
1326
|
-
slotDrift:
|
|
1466
|
+
slotDrift: normalResultSlotDrift,
|
|
1327
1467
|
printerDrift: rendered?.printerDrift ?? [],
|
|
1328
1468
|
abiBlockers: abis.blocked,
|
|
1329
1469
|
emissionRefusals: rendered?.refused ?? [],
|