@geastack/compiler 1.0.26 → 1.0.29
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-coverage.js +2 -2
- package/dist/cli-emit.js +36 -12
- package/dist/compiler.d.ts +11 -9
- package/dist/compiler.js +264 -43
- package/dist/conversion/algebra.d.ts +84 -4
- package/dist/conversion/algebra.js +39 -0
- package/dist/conversion/array-view.d.ts +63 -0
- package/dist/conversion/array-view.js +186 -0
- package/dist/conversion/build.d.ts +8 -8
- package/dist/conversion/build.js +56 -50
- package/dist/conversion/certified-iterator-object-view.d.ts +13 -0
- package/dist/conversion/certified-iterator-object-view.js +31 -0
- package/dist/conversion/certified-iterator-protocols.d.ts +23 -0
- package/dist/conversion/certified-iterator-protocols.js +50 -0
- package/dist/conversion/checked-native-field-read.d.ts +7 -0
- package/dist/conversion/checked-native-field-read.js +36 -0
- package/dist/conversion/constructor-identity-family.d.ts +6 -6
- package/dist/conversion/constructor-identity-family.js +3 -3
- package/dist/conversion/derive.js +11 -8
- package/dist/conversion/dictionary-view.d.ts +114 -0
- package/dist/conversion/dictionary-view.js +275 -0
- package/dist/conversion/document-record-view.d.ts +89 -0
- package/dist/conversion/document-record-view.js +269 -0
- package/dist/conversion/dynamic-result-carriers.d.ts +6 -0
- package/dist/conversion/dynamic-result-carriers.js +43 -0
- package/dist/conversion/dynamic-wrapper.d.ts +52 -0
- package/dist/conversion/dynamic-wrapper.js +82 -0
- package/dist/conversion/impossible-field-read.d.ts +9 -0
- package/dist/conversion/impossible-field-read.js +28 -0
- package/dist/conversion/iterable-object-view.d.ts +1 -1
- package/dist/conversion/iterator-object-view.d.ts +2 -2
- package/dist/conversion/native-absence.d.ts +4 -0
- package/dist/conversion/native-absence.js +4 -0
- package/dist/conversion/native-buffer-method.d.ts +16 -0
- package/dist/conversion/native-buffer-method.js +37 -0
- package/dist/conversion/native-callable-adapter.d.ts +13 -0
- package/dist/conversion/native-callable-adapter.js +73 -0
- package/dist/conversion/native-descriptor-snapshot.d.ts +30 -0
- package/dist/conversion/native-descriptor-snapshot.js +75 -0
- package/dist/conversion/native-entry-writer.d.ts +21 -0
- package/dist/conversion/native-entry-writer.js +32 -0
- package/dist/conversion/native-field-view.d.ts +42 -0
- package/dist/conversion/native-field-view.js +145 -0
- package/dist/conversion/native-logical-receiver.d.ts +11 -0
- package/dist/conversion/native-logical-receiver.js +19 -0
- package/dist/conversion/native-method.d.ts +43 -0
- package/dist/conversion/native-method.js +56 -0
- package/dist/conversion/native-object-sample.d.ts +30 -0
- package/dist/conversion/native-object-sample.js +37 -0
- package/dist/conversion/native-payload-transport.d.ts +1 -1
- package/dist/conversion/native-payload-transport.js +1 -1
- package/dist/conversion/native-record-products.d.ts +15 -0
- package/dist/conversion/native-record-products.js +73 -0
- package/dist/conversion/native-selection.d.ts +18 -1
- package/dist/conversion/native-selection.js +117 -4
- package/dist/conversion/native-sum.d.ts +27 -0
- package/dist/conversion/native-sum.js +74 -9
- package/dist/conversion/native-view-origins.d.ts +12 -0
- package/dist/conversion/native-view-origins.js +97 -0
- package/dist/conversion/nodes.d.ts +75 -7
- package/dist/conversion/nodes.js +694 -19
- package/dist/conversion/number-storage.d.ts +8 -0
- package/dist/conversion/number-storage.js +8 -0
- package/dist/conversion/operand-view.js +10 -1
- package/dist/conversion/promise-adoption.d.ts +15 -0
- package/dist/conversion/promise-adoption.js +29 -0
- package/dist/conversion/protocol-iterator.d.ts +3 -3
- package/dist/conversion/recipe-closure.d.ts +14 -0
- package/dist/conversion/recipe-closure.js +135 -0
- package/dist/conversion/record-view.d.ts +51 -26
- package/dist/conversion/record-view.js +160 -97
- package/dist/conversion/registry.d.ts +18 -2
- package/dist/conversion/sibling-class.d.ts +4 -0
- package/dist/conversion/sibling-class.js +7 -0
- package/dist/conversion/structural-plan.d.ts +87 -0
- package/dist/conversion/structural-plan.js +480 -0
- package/dist/ir/absent-class-arm.d.ts +1 -1
- package/dist/ir/absent-class-arm.js +1 -1
- package/dist/ir/async-result-conventions.d.ts +15 -0
- package/dist/ir/async-result-conventions.js +140 -0
- package/dist/ir/borrowed-call-arguments.d.ts +3 -3
- package/dist/ir/borrowed-call-arguments.js +9 -9
- package/dist/ir/build.d.ts +20 -29
- package/dist/ir/build.js +116 -19
- package/dist/ir/call-dispatch.js +153 -40
- package/dist/ir/call-entry.d.ts +14 -3
- package/dist/ir/call-entry.js +63 -5
- package/dist/ir/callable-class-flow.d.ts +48 -3
- package/dist/ir/callable-class-flow.js +1509 -81
- package/dist/ir/callable-flow-candidates.d.ts +25 -0
- package/dist/ir/callable-flow-candidates.js +135 -0
- package/dist/ir/callable-identity-demand.d.ts +2 -2
- package/dist/ir/callable-identity-demand.js +33 -1
- package/dist/ir/callable-member-candidates.d.ts +1 -1
- package/dist/ir/callable-member-candidates.js +2 -2
- package/dist/ir/callable-records.js +1 -0
- package/dist/ir/callable-site-escape.js +3 -4
- package/dist/ir/captures.js +1 -1
- package/dist/ir/certificate.d.ts +1 -0
- package/dist/ir/certificate.js +2 -1
- package/dist/ir/certify/carrier-keys.d.ts +2 -2
- package/dist/ir/certify/carrier-keys.js +4 -4
- package/dist/ir/certify/has-property-key.d.ts +3 -3
- package/dist/ir/certify/has-property-key.js +3 -3
- package/dist/ir/certify/parallel-region.d.ts +26 -0
- package/dist/ir/certify/parallel-region.js +1331 -0
- package/dist/ir/certify/property-access-keys.d.ts +11 -11
- package/dist/ir/certify/property-access-keys.js +11 -11
- package/dist/ir/certify/property-access.js +7 -9
- package/dist/ir/certify.d.ts +66 -3
- package/dist/ir/certify.js +1197 -36
- package/dist/ir/class-allocation-domain.d.ts +9 -0
- package/dist/ir/class-allocation-domain.js +111 -0
- package/dist/ir/class-evaluation.d.ts +2 -3
- package/dist/ir/class-evaluation.js +2 -3
- package/dist/ir/class-static-fields.d.ts +12 -1
- package/dist/ir/class-static-fields.js +25 -0
- package/dist/ir/closed-normal-results.d.ts +18 -0
- package/dist/ir/closed-normal-results.js +208 -0
- package/dist/ir/construct-entry.js +1 -0
- package/dist/ir/construction-only-fields.d.ts +20 -1
- package/dist/ir/construction-only-fields.js +95 -9
- package/dist/ir/convert-carriers.d.ts +7 -0
- package/dist/ir/convert-carriers.js +12 -0
- package/dist/ir/coroutine-bodies.d.ts +74 -0
- package/dist/ir/coroutine-bodies.js +93 -0
- package/dist/ir/dead-logical-merge.d.ts +7 -0
- package/dist/ir/dead-logical-merge.js +84 -0
- package/dist/ir/dead-values.d.ts +7 -5
- package/dist/ir/dead-values.js +34 -5
- package/dist/ir/deferral.d.ts +3 -1
- package/dist/ir/deferral.js +19 -6
- package/dist/ir/dense-loops.d.ts +96 -7
- package/dist/ir/dense-loops.js +333 -17
- package/dist/ir/descriptor-own-protocol.d.ts +12 -0
- package/dist/ir/descriptor-own-protocol.js +35 -0
- package/dist/ir/dynamic-constructor-conversions.d.ts +17 -0
- package/dist/ir/dynamic-constructor-conversions.js +52 -0
- package/dist/ir/emission-representations.js +44 -2
- package/dist/ir/facts.d.ts +14 -2
- package/dist/ir/facts.js +23 -9
- package/dist/ir/fixed-data-definition-attributes.d.ts +10 -0
- package/dist/ir/fixed-data-definition-attributes.js +200 -0
- package/dist/ir/fixed-data-definition.d.ts +23 -5
- package/dist/ir/fixed-data-definition.js +80 -2
- package/dist/ir/function-reflection-demand.d.ts +11 -0
- package/dist/ir/function-reflection-demand.js +71 -0
- package/dist/ir/generic-call-entry.d.ts +18 -0
- package/dist/ir/generic-call-entry.js +94 -0
- package/dist/ir/hoist.d.ts +16 -3
- package/dist/ir/hoist.js +121 -8
- package/dist/ir/host-method-aliases.d.ts +15 -0
- package/dist/ir/host-method-aliases.js +61 -0
- package/dist/ir/host-namespace-reads.d.ts +24 -0
- package/dist/ir/host-namespace-reads.js +151 -0
- package/dist/ir/host-promise-conversions.d.ts +5 -0
- package/dist/ir/host-promise-conversions.js +61 -0
- package/dist/ir/host-template-conversions.d.ts +34 -0
- package/dist/ir/host-template-conversions.js +357 -0
- package/dist/ir/instance-reparenting.d.ts +3 -4
- package/dist/ir/instantiation.d.ts +1 -1
- package/dist/ir/instantiation.js +1 -1
- package/dist/ir/integer-storage.d.ts +19 -9
- package/dist/ir/integer-storage.js +158 -44
- package/dist/ir/integers.d.ts +34 -7
- package/dist/ir/integers.js +240 -7
- package/dist/ir/integrity-restrictions.d.ts +4 -4
- package/dist/ir/integrity-restrictions.js +7 -4
- package/dist/ir/internal-operation-conversions.d.ts +7 -0
- package/dist/ir/internal-operation-conversions.js +195 -0
- package/dist/ir/intrinsic-call-facts.d.ts +40 -0
- package/dist/ir/intrinsic-call-facts.js +176 -0
- package/dist/ir/key-order-observation.d.ts +1 -1
- package/dist/ir/lazy-splits.d.ts +20 -0
- package/dist/ir/lazy-splits.js +58 -0
- package/dist/ir/literal-set-membership.d.ts +2 -2
- package/dist/ir/literal-set-membership.js +2 -2
- package/dist/ir/logical-receivers.d.ts +15 -0
- package/dist/ir/logical-receivers.js +98 -0
- package/dist/ir/lower-allocation.js +16 -13
- package/dist/ir/lower-destructuring.js +7 -6
- package/dist/ir/lower-graph.d.ts +4 -4
- package/dist/ir/lower-graph.js +2 -2
- package/dist/ir/lower-invocation.d.ts +2 -2
- package/dist/ir/lower-invocation.js +99 -57
- package/dist/ir/lower-narrow.js +35 -13
- package/dist/ir/lower-operands.d.ts +40 -11
- package/dist/ir/lower-operands.js +206 -87
- package/dist/ir/lower-property.js +31 -8
- package/dist/ir/lower.js +9 -9
- package/dist/ir/merge-conversions.d.ts +18 -0
- package/dist/ir/merge-conversions.js +106 -0
- package/dist/ir/model.d.ts +138 -28
- package/dist/ir/native-accessor-definition.d.ts +104 -0
- package/dist/ir/native-accessor-definition.js +735 -0
- package/dist/ir/native-array-descriptor-snapshot.d.ts +45 -0
- package/dist/ir/native-array-descriptor-snapshot.js +380 -0
- package/dist/ir/native-array-insertion.d.ts +16 -0
- package/dist/ir/native-array-insertion.js +42 -0
- package/dist/ir/native-callable-argument.d.ts +38 -0
- package/dist/ir/native-callable-argument.js +128 -0
- package/dist/ir/native-callable-data-flow.d.ts +9 -0
- package/dist/ir/native-callable-data-flow.js +59 -0
- package/dist/ir/native-callable-data-owner.d.ts +45 -0
- package/dist/ir/native-callable-data-owner.js +755 -0
- package/dist/ir/native-callable-data-reads.d.ts +45 -0
- package/dist/ir/native-callable-data-reads.js +282 -0
- package/dist/ir/native-callable-data-slots.d.ts +78 -0
- package/dist/ir/native-callable-data-slots.js +403 -0
- package/dist/ir/native-callable-data-write.d.ts +58 -0
- package/dist/ir/native-callable-data-write.js +254 -0
- package/dist/ir/native-callable-integrity.d.ts +23 -0
- package/dist/ir/native-callable-integrity.js +77 -0
- package/dist/ir/native-callable-own-property.d.ts +42 -0
- package/dist/ir/native-callable-own-property.js +505 -0
- package/dist/ir/native-callable-prototype.d.ts +38 -0
- package/dist/ir/native-callable-prototype.js +307 -0
- package/dist/ir/native-callable-readonly-set.d.ts +25 -0
- package/dist/ir/native-callable-readonly-set.js +238 -0
- package/dist/ir/native-class-accessor.d.ts +3 -3
- package/dist/ir/native-class-accessor.js +3 -3
- package/dist/ir/native-class-construction.js +2 -2
- package/dist/ir/native-constructor-reads.d.ts +15 -0
- package/dist/ir/native-constructor-reads.js +156 -0
- package/dist/ir/native-constructor-static.d.ts +18 -0
- package/dist/ir/native-constructor-static.js +61 -0
- package/dist/ir/native-data-definition.d.ts +43 -0
- package/dist/ir/native-data-definition.js +222 -0
- package/dist/ir/native-document-array-entries.d.ts +15 -0
- package/dist/ir/native-document-array-entries.js +37 -0
- package/dist/ir/native-document-entries.d.ts +21 -0
- package/dist/ir/native-document-entries.js +74 -0
- package/dist/ir/native-entry-field-views.d.ts +18 -0
- package/dist/ir/native-entry-field-views.js +62 -0
- package/dist/ir/native-field-view-domains.d.ts +43 -0
- package/dist/ir/native-field-view-domains.js +300 -0
- package/dist/ir/native-field-view-facts.d.ts +97 -0
- package/dist/ir/native-field-view-facts.js +341 -0
- package/dist/ir/native-fixed-layout.js +1 -1
- package/dist/ir/native-host-construction.d.ts +4 -6
- package/dist/ir/native-host-construction.js +4 -6
- package/dist/ir/native-host-method-reads.d.ts +13 -0
- package/dist/ir/native-host-method-reads.js +53 -0
- package/dist/ir/native-iterator-field-views.d.ts +15 -0
- package/dist/ir/native-iterator-field-views.js +39 -0
- package/dist/ir/native-iterator-receivers.d.ts +8 -0
- package/dist/ir/native-iterator-receivers.js +59 -0
- package/dist/ir/native-logical-receiver-body.d.ts +8 -0
- package/dist/ir/native-logical-receiver-body.js +23 -0
- package/dist/ir/native-method-frames.d.ts +18 -0
- package/dist/ir/native-method-frames.js +127 -0
- package/dist/ir/native-method-read-source.d.ts +16 -0
- package/dist/ir/native-method-read-source.js +61 -0
- package/dist/ir/native-object-data-slots.d.ts +60 -0
- package/dist/ir/native-object-data-slots.js +493 -0
- package/dist/ir/native-object-sample.d.ts +32 -0
- package/dist/ir/native-object-sample.js +113 -0
- package/dist/ir/native-own-assignment.d.ts +123 -0
- package/dist/ir/native-own-assignment.js +529 -0
- package/dist/ir/native-property-coercibility.d.ts +3 -0
- package/dist/ir/native-property-coercibility.js +10 -0
- package/dist/ir/native-property-key-texts.d.ts +11 -0
- package/dist/ir/native-property-key-texts.js +41 -0
- package/dist/ir/native-property-presence-effects.d.ts +11 -0
- package/dist/ir/native-property-presence-effects.js +19 -0
- package/dist/ir/native-property-presence.d.ts +27 -0
- package/dist/ir/native-property-presence.js +275 -0
- package/dist/ir/native-prototype-calls.d.ts +19 -0
- package/dist/ir/native-prototype-calls.js +53 -0
- package/dist/ir/native-prototype-conversions.d.ts +5 -0
- package/dist/ir/native-prototype-conversions.js +46 -0
- package/dist/ir/native-prototype-presence-demand.d.ts +9 -0
- package/dist/ir/native-prototype-presence-demand.js +58 -0
- package/dist/ir/native-record-index.d.ts +1 -1
- package/dist/ir/native-union-method-targets.d.ts +8 -0
- package/dist/ir/native-union-method-targets.js +69 -0
- package/dist/ir/no-normal-call-completion.d.ts +15 -0
- package/dist/ir/no-normal-call-completion.js +184 -0
- package/dist/ir/non-normal-receiver.d.ts +39 -0
- package/dist/ir/non-normal-receiver.js +253 -0
- package/dist/ir/operation-conversions.d.ts +29 -0
- package/dist/ir/operation-conversions.js +484 -0
- package/dist/ir/operation-index.d.ts +1 -1
- package/dist/ir/presence-proof.d.ts +1 -1
- package/dist/ir/presence-proof.js +1 -0
- package/dist/ir/program-conversions.d.ts +48 -0
- package/dist/ir/program-conversions.js +221 -0
- package/dist/ir/program-facts.d.ts +4 -1
- package/dist/ir/program-facts.js +9 -7
- package/dist/ir/promise-reaction-conversions.d.ts +6 -0
- package/dist/ir/promise-reaction-conversions.js +92 -0
- package/dist/ir/property-read-conversions.d.ts +10 -0
- package/dist/ir/property-read-conversions.js +124 -0
- package/dist/ir/proven-branches.d.ts +2 -1
- package/dist/ir/proven-branches.js +97 -10
- package/dist/ir/publish-conversion-recipes.d.ts +27 -0
- package/dist/ir/publish-conversion-recipes.js +246 -0
- package/dist/ir/publish-native-field-view-facts.d.ts +17 -0
- package/dist/ir/publish-native-field-view-facts.js +119 -0
- package/dist/ir/queries.js +42 -4
- package/dist/ir/read-only-dictionary.d.ts +38 -0
- package/dist/ir/read-only-dictionary.js +281 -0
- package/dist/ir/reflection-demand.d.ts +2 -0
- package/dist/ir/reflection-demand.js +600 -44
- package/dist/ir/shake.d.ts +3 -0
- package/dist/ir/shake.js +24 -14
- package/dist/ir/shared-empty-records.js +1 -1
- package/dist/ir/short-circuit-threading.d.ts +23 -0
- package/dist/ir/short-circuit-threading.js +133 -0
- package/dist/ir/spread-conversions.d.ts +27 -0
- package/dist/ir/spread-conversions.js +134 -0
- package/dist/ir/spread-copy-elision.d.ts +2 -2
- package/dist/ir/spread-copy-elision.js +7 -4
- package/dist/ir/string-layout-reuse.d.ts +9 -8
- package/dist/ir/string-layout-reuse.js +8 -16
- package/dist/ir/string-length-reuse.d.ts +20 -4
- package/dist/ir/string-length-reuse.js +57 -13
- package/dist/ir/transfer.d.ts +5 -5
- package/dist/ir/transfer.js +53 -31
- package/dist/ir/typed-property-access.d.ts +2 -0
- package/dist/ir/typed-property-access.js +21 -8
- package/dist/ir/virtual-call-frames.d.ts +7 -0
- package/dist/ir/virtual-call-frames.js +8 -0
- package/dist/native-signatures.d.ts +45 -0
- package/dist/native-signatures.js +368 -0
- package/dist/plugins/gea/host.d.ts +6 -1
- package/dist/plugins/gea/host.js +30 -1
- package/dist/plugins/gea/lower.js +9 -3
- package/dist/plugins/gea/members.js +1 -1
- package/dist/plugins/gea/plugin.js +2 -1
- package/dist/plugins/gea/prelude.d.ts +1 -1
- package/dist/plugins/gea/prelude.js +1 -1
- package/dist/plugins/gea/reactive-slots.js +6 -6
- package/dist/plugins/gea/render-bridge.js +5 -6
- package/dist/plugins/gea/user-agent-styles.js +1 -1
- package/dist/plugins/installed.d.ts +2 -2
- package/dist/plugins/installed.js +2 -2
- package/dist/plugins/load.js +1 -1
- package/dist/plugins/model.d.ts +21 -36
- package/dist/plugins/webgl/host.d.ts +23 -23
- package/dist/plugins/webgl/host.js +25 -26
- package/dist/plugins/webgl/plugin.d.ts +16 -19
- package/dist/plugins/webgl/plugin.js +16 -23
- package/dist/project-preparation.js +12 -14
- package/dist/projection/abi.js +13 -10
- package/dist/projection/bindings.d.ts +8 -0
- package/dist/projection/bindings.js +36 -5
- package/dist/projection/callee.d.ts +17 -15
- package/dist/projection/callee.js +108 -81
- package/dist/projection/class-property-presence.d.ts +1 -1
- package/dist/projection/class-property-presence.js +1 -1
- package/dist/projection/classes.d.ts +2 -0
- package/dist/projection/classes.js +4 -1
- package/dist/projection/dispatch.d.ts +19 -3
- package/dist/projection/dispatch.js +39 -16
- package/dist/projection/fields.d.ts +14 -2
- package/dist/projection/fields.js +100 -38
- package/dist/projection/function-source.d.ts +5 -0
- package/dist/projection/function-source.js +15 -0
- package/dist/projection/immediate-callees.d.ts +12 -0
- package/dist/projection/immediate-callees.js +36 -0
- package/dist/projection/index-protocols.d.ts +12 -0
- package/dist/projection/index-protocols.js +39 -0
- package/dist/projection/instance-test.d.ts +8 -0
- package/dist/projection/instance-test.js +3 -1
- package/dist/projection/method-values.d.ts +7 -0
- package/dist/projection/method-values.js +29 -0
- package/dist/projection/native-accessor-access.d.ts +26 -0
- package/dist/projection/native-accessor-access.js +18 -0
- package/dist/projection/native-callable-data.d.ts +24 -0
- package/dist/projection/native-callable-data.js +101 -0
- package/dist/projection/native-expando.d.ts +3 -0
- package/dist/projection/native-expando.js +13 -0
- package/dist/projection/native-object-data.d.ts +47 -0
- package/dist/projection/native-object-data.js +203 -0
- package/dist/projection/native-prototype-methods.d.ts +22 -0
- package/dist/projection/native-prototype-methods.js +161 -0
- package/dist/projection/regexp-fields.d.ts +35 -0
- package/dist/projection/regexp-fields.js +80 -0
- package/dist/projection/slots.d.ts +5 -1
- package/dist/projection/slots.js +89 -10
- package/dist/representation/derive.d.ts +5 -7
- package/dist/representation/derive.js +78 -78
- package/dist/representation/difference.js +1 -1
- package/dist/representation/host-abi.d.ts +2 -2
- package/dist/representation/host-abi.js +4 -5
- package/dist/representation/host-templates.d.ts +6 -2
- package/dist/representation/host-templates.js +8 -2
- package/dist/representation/intersection.d.ts +3 -3
- package/dist/representation/intersection.js +3 -3
- package/dist/representation/merge.js +1 -1
- package/dist/representation/model.d.ts +27 -22
- package/dist/representation/model.js +35 -22
- package/dist/representation/native-callable-data-storage.d.ts +85 -0
- package/dist/representation/native-callable-data-storage.js +398 -0
- package/dist/representation/native-data-properties.d.ts +14 -0
- package/dist/representation/native-data-properties.js +52 -0
- package/dist/representation/native-logical-receiver.d.ts +36 -0
- package/dist/representation/native-logical-receiver.js +92 -0
- package/dist/representation/object-shape.d.ts +1 -1
- package/dist/representation/object-shape.js +1 -1
- package/dist/representation/optional.js +2 -2
- package/dist/representation/physical-carrier.d.ts +25 -0
- package/dist/representation/physical-carrier.js +153 -0
- package/dist/representation/policies.d.ts +16 -10
- package/dist/representation/policies.js +5 -1
- package/dist/representation/primitives.js +3 -0
- package/dist/representation/promise-resolution.d.ts +19 -0
- package/dist/representation/promise-resolution.js +50 -0
- package/dist/representation/prototype-domains.d.ts +43 -0
- package/dist/representation/prototype-domains.js +226 -0
- package/dist/representation/proxy-carriers.d.ts +3 -3
- package/dist/representation/proxy-carriers.js +2 -3
- package/dist/representation/publish.d.ts +4 -0
- package/dist/representation/publish.js +73 -42
- package/dist/representation/record-fields.d.ts +2 -2
- package/dist/representation/record-fields.js +2 -2
- package/dist/representation/static-field-cells.d.ts +1 -1
- package/dist/representation/structural-method-abi.d.ts +6 -0
- package/dist/representation/structural-method-abi.js +13 -0
- package/dist/representation/unassigned-binding-cells.d.ts +3 -3
- package/dist/representation/union.js +19 -4
- package/dist/representation/unwritten-record-members.d.ts +6 -6
- package/dist/representation/unwritten-record-members.js +1 -1
- package/dist/representation/value-records.js +77 -5
- package/dist/representation/verify.js +1 -1
- package/dist/representation/well-known-symbols.d.ts +3 -0
- package/dist/representation/well-known-symbols.js +11 -0
- package/dist/semantics/alias-this-field-declaration-transform.js +3 -3
- package/dist/semantics/ambient-type-realization-transform.d.ts +19 -20
- package/dist/semantics/ambient-type-realization-transform.js +20 -12
- package/dist/semantics/ambient.d.ts +13 -13
- package/dist/semantics/ambient.js +12 -12
- package/dist/semantics/borrowed-builtin-call-bind-source-transform.d.ts +5 -0
- package/dist/semantics/borrowed-builtin-call-bind-source-transform.js +110 -52
- package/dist/semantics/borrowed-method-receiver-copy-source-transform.d.ts +4 -4
- package/dist/semantics/borrowed-method-receiver-copy-source-transform.js +4 -4
- package/dist/semantics/call-invalidated-narrowing.js +2 -2
- package/dist/semantics/callable-origins.d.ts +49 -1
- package/dist/semantics/callable-origins.js +148 -32
- package/dist/semantics/callable-own-data-slots.d.ts +122 -0
- package/dist/semantics/callable-own-data-slots.js +421 -0
- package/dist/semantics/class-alias.d.ts +4 -4
- package/dist/semantics/class-alias.js +4 -4
- package/dist/semantics/class-heritage.d.ts +8 -7
- package/dist/semantics/class-heritage.js +8 -7
- package/dist/semantics/commonjs-wrapper.js +5 -2
- package/dist/semantics/constructor-function-class-source-transform.js +2 -3
- package/dist/semantics/constructor-slot-subclasses.d.ts +1 -1
- package/dist/semantics/constructor-slot-subclasses.js +5 -5
- package/dist/semantics/declaration-overlay-transform.d.ts +9 -12
- package/dist/semantics/declaration-overlay-transform.js +138 -141
- package/dist/semantics/declared-integers.d.ts +24 -0
- package/dist/semantics/declared-integers.js +34 -0
- package/dist/semantics/define-property-source-transform.js +21 -8
- package/dist/semantics/dynamic-fallback.d.ts +1 -1
- package/dist/semantics/dynamic-fallback.js +1 -1
- package/dist/semantics/frontend.d.ts +12 -16
- package/dist/semantics/frontend.js +187 -75
- package/dist/semantics/host-methods.d.ts +3 -3
- package/dist/semantics/host-methods.js +1 -1
- package/dist/semantics/host-protocols.d.ts +3 -3
- package/dist/semantics/host-protocols.js +26 -26
- package/dist/semantics/interface-families.d.ts +2 -2
- package/dist/semantics/interface-families.js +46 -47
- package/dist/semantics/interface-implementors.d.ts +12 -15
- package/dist/semantics/interface-implementors.js +12 -15
- package/dist/semantics/jsdoc-namepath-transform.js +7 -7
- package/dist/semantics/model/operands.d.ts +18 -3
- package/dist/semantics/model/operands.js +41 -0
- package/dist/semantics/model/operations.d.ts +82 -1
- package/dist/semantics/model/selected-signature.d.ts +24 -3
- package/dist/semantics/model/structural-type-table.js +24 -6
- package/dist/semantics/model/structural-types.d.ts +10 -8
- package/dist/semantics/model/structural-types.js +7 -5
- package/dist/semantics/module-resolution.js +3 -2
- package/dist/semantics/native-callable-readonly-set.d.ts +17 -0
- package/dist/semantics/native-callable-readonly-set.js +1 -0
- package/dist/semantics/native-function-signatures.d.ts +14 -0
- package/dist/semantics/native-function-signatures.js +96 -0
- package/dist/semantics/native-object-data-slots.d.ts +72 -0
- package/dist/semantics/native-object-data-slots.js +679 -0
- package/dist/semantics/native-own-assignment.d.ts +62 -0
- package/dist/semantics/native-own-assignment.js +1 -0
- package/dist/semantics/normalize/absent-globals.d.ts +8 -8
- package/dist/semantics/normalize/absent-globals.js +5 -5
- package/dist/semantics/normalize/arguments-objects.d.ts +3 -1
- package/dist/semantics/normalize/arguments-objects.js +1 -1
- package/dist/semantics/normalize/asserted-argument-arms.d.ts +7 -7
- package/dist/semantics/normalize/asserted-arm-absence.d.ts +1 -2
- package/dist/semantics/normalize/asserted-arm-absence.js +1 -2
- package/dist/semantics/normalize/binding-fixpoint.js +3 -3
- package/dist/semantics/normalize/bivariant-slot-parameter.d.ts +2 -2
- package/dist/semantics/normalize/bivariant-slot-parameter.js +6 -6
- package/dist/semantics/normalize/callable-data-write.d.ts +46 -0
- package/dist/semantics/normalize/callable-data-write.js +182 -0
- package/dist/semantics/normalize/census.js +5 -5
- 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 +11 -13
- package/dist/semantics/normalize/collection-bindings.js +60 -33
- package/dist/semantics/normalize/commonjs-module-record.d.ts +7 -4
- package/dist/semantics/normalize/commonjs-module-record.js +93 -4
- package/dist/semantics/normalize/contribution.js +4 -4
- package/dist/semantics/normalize/dead-method-copies.d.ts +5 -5
- package/dist/semantics/normalize/dead-typeof-guards.d.ts +2 -2
- package/dist/semantics/normalize/dead-typeof-guards.js +6 -6
- package/dist/semantics/normalize/deferred-intrinsic-protocols.d.ts +22 -13
- package/dist/semantics/normalize/deferred-intrinsic-protocols.js +85 -13
- package/dist/semantics/normalize/derived-expression-type.d.ts +129 -91
- package/dist/semantics/normalize/derived-expression-type.js +419 -192
- package/dist/semantics/normalize/field-bindings.d.ts +4 -4
- package/dist/semantics/normalize/field-bindings.js +334 -67
- package/dist/semantics/normalize/flow/array-element-continuation.d.ts +2 -2
- package/dist/semantics/normalize/flow/array-element-continuation.js +35 -18
- package/dist/semantics/normalize/flow/callable-array-origins.d.ts +1 -1
- package/dist/semantics/normalize/flow/callable-array-origins.js +3 -3
- package/dist/semantics/normalize/flow/callable-completions.d.ts +2 -2
- package/dist/semantics/normalize/flow/callable-completions.js +2 -2
- package/dist/semantics/normalize/flow/callable-reach.d.ts +19 -6
- package/dist/semantics/normalize/flow/callable-reach.js +722 -289
- package/dist/semantics/normalize/flow/class-family-member-read.js +24 -29
- package/dist/semantics/normalize/flow/collection-value-continuation.d.ts +2 -2
- package/dist/semantics/normalize/flow/collection-value-continuation.js +2 -2
- package/dist/semantics/normalize/flow/component-solver.d.ts +19 -16
- package/dist/semantics/normalize/flow/component-solver.js +138 -69
- package/dist/semantics/normalize/flow/computed-key-set.d.ts +6 -7
- package/dist/semantics/normalize/flow/computed-key-set.js +20 -1
- package/dist/semantics/normalize/flow/export-importers.js +4 -4
- package/dist/semantics/normalize/flow/host-text-sink.d.ts +3 -2
- package/dist/semantics/normalize/flow/host-text-sink.js +4 -3
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.js +3 -2
- package/dist/semantics/normalize/flow/intrinsic-data-definition.d.ts +2 -2
- package/dist/semantics/normalize/flow/intrinsic-data-definition.js +3 -3
- package/dist/semantics/normalize/flow/invocation-facts.d.ts +3 -2
- package/dist/semantics/normalize/flow/invocation-facts.js +3 -3
- package/dist/semantics/normalize/flow/member-call-forwarding.d.ts +12 -6
- package/dist/semantics/normalize/flow/member-call-forwarding.js +94 -21
- package/dist/semantics/normalize/flow/model.d.ts +5 -5
- package/dist/semantics/normalize/flow/model.js +11 -11
- package/dist/semantics/normalize/flow/node-path-token.js +3 -3
- package/dist/semantics/normalize/flow/origin-authority.d.ts +3 -3
- package/dist/semantics/normalize/flow/owned-class-receivers.js +8 -7
- package/dist/semantics/normalize/flow/parameter-values.js +6 -6
- package/dist/semantics/normalize/flow/proof-hypotheses.d.ts +30 -4
- package/dist/semantics/normalize/flow/proof-hypotheses.js +56 -5
- package/dist/semantics/normalize/flow/proof-memo-settlement.d.ts +21 -0
- package/dist/semantics/normalize/flow/proof-memo-settlement.js +32 -0
- 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 +4 -4
- package/dist/semantics/normalize/flow/seeded-origins.js +4 -4
- package/dist/semantics/normalize/flow/source-accessor-descriptor.d.ts +22 -0
- package/dist/semantics/normalize/flow/source-accessor-descriptor.js +210 -0
- package/dist/semantics/normalize/flow/source-callable-own-data.d.ts +33 -0
- package/dist/semantics/normalize/flow/source-callable-own-data.js +238 -0
- package/dist/semantics/normalize/flow/source-callable-readonly-set.d.ts +26 -0
- package/dist/semantics/normalize/flow/source-callable-readonly-set.js +337 -0
- package/dist/semantics/normalize/flow/source-class-data.d.ts +7 -7
- package/dist/semantics/normalize/flow/source-class-data.js +25 -26
- package/dist/semantics/normalize/flow/source-class-static-data.d.ts +2 -2
- package/dist/semantics/normalize/flow/source-class-static-data.js +2 -2
- package/dist/semantics/normalize/flow/source-commonjs-exports.d.ts +15 -0
- package/dist/semantics/normalize/flow/source-commonjs-exports.js +7 -0
- package/dist/semantics/normalize/flow/source-descriptor-protocol.d.ts +20 -0
- package/dist/semantics/normalize/flow/source-descriptor-protocol.js +75 -0
- package/dist/semantics/normalize/flow/source-executing-parameter-values.d.ts +8 -0
- package/dist/semantics/normalize/flow/source-executing-parameter-values.js +93 -0
- package/dist/semantics/normalize/flow/source-global-binding.d.ts +13 -0
- package/dist/semantics/normalize/flow/source-global-binding.js +42 -0
- package/dist/semantics/normalize/flow/source-intrinsic-member-data.d.ts +27 -0
- package/dist/semantics/normalize/flow/source-intrinsic-member-data.js +178 -0
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.js +31 -11
- package/dist/semantics/normalize/flow/source-invocation-receiver.d.ts +7 -3
- package/dist/semantics/normalize/flow/source-invocation-receiver.js +30 -2
- package/dist/semantics/normalize/flow/source-native-class-alias.d.ts +7 -0
- package/dist/semantics/normalize/flow/source-native-class-alias.js +91 -0
- package/dist/semantics/normalize/flow/source-normal-predecessor.d.ts +10 -0
- package/dist/semantics/normalize/flow/source-normal-predecessor.js +90 -0
- package/dist/semantics/normalize/flow/source-property-key.d.ts +3 -0
- package/dist/semantics/normalize/flow/source-property-key.js +7 -0
- package/dist/semantics/normalize/flow/source-read-protocol.d.ts +20 -0
- package/dist/semantics/normalize/flow/source-read-protocol.js +108 -0
- package/dist/semantics/normalize/flow/source-record-data.js +31 -30
- package/dist/semantics/normalize/flow/source-value-session.d.ts +106 -3
- package/dist/semantics/normalize/flow/source-value-session.js +1172 -218
- package/dist/semantics/normalize/flow/standard-prototype-method-source.d.ts +16 -0
- package/dist/semantics/normalize/flow/standard-prototype-method-source.js +64 -0
- package/dist/semantics/normalize/flow/targets.d.ts +13 -14
- package/dist/semantics/normalize/flow/targets.js +20 -23
- package/dist/semantics/normalize/flow/value-flow.d.ts +2 -4
- package/dist/semantics/normalize/flow/value-flow.js +4 -13
- package/dist/semantics/normalize/flow/value-provenance.d.ts +23 -3
- package/dist/semantics/normalize/flow/value-provenance.js +44 -4
- package/dist/semantics/normalize/fresh-dictionary-storage.d.ts +32 -0
- package/dist/semantics/normalize/fresh-dictionary-storage.js +530 -0
- package/dist/semantics/normalize/fresh-indexed-storage.d.ts +43 -0
- package/dist/semantics/normalize/fresh-indexed-storage.js +88 -0
- package/dist/semantics/normalize/fresh-ordinary-object.d.ts +8 -0
- package/dist/semantics/normalize/fresh-ordinary-object.js +27 -0
- package/dist/semantics/normalize/gating.js +2 -2
- package/dist/semantics/normalize/global-host-mutations.js +770 -261
- 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 +2 -2
- package/dist/semantics/normalize/host-mutation-computed-keys.js +8 -0
- package/dist/semantics/normalize/host-mutation-key-reader.d.ts +6 -11
- package/dist/semantics/normalize/host-mutation-key-reader.js +11 -28
- package/dist/semantics/normalize/host-mutation-keys.d.ts +11 -7
- package/dist/semantics/normalize/host-mutation-keys.js +26 -15
- package/dist/semantics/normalize/identities.js +20 -17
- package/dist/semantics/normalize/implicit-arguments-tuple.d.ts +8 -3
- package/dist/semantics/normalize/implicit-arguments-tuple.js +21 -4
- package/dist/semantics/normalize/installed-global-properties.d.ts +17 -0
- package/dist/semantics/normalize/installed-global-properties.js +214 -0
- package/dist/semantics/normalize/instantiation.js +6 -6
- package/dist/semantics/normalize/intrinsic-accessor-getter.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-property-call.d.ts +6 -1
- package/dist/semantics/normalize/intrinsic-property-call.js +19 -0
- package/dist/semantics/normalize/intrinsic-prototype.d.ts +7 -0
- package/dist/semantics/normalize/intrinsic-prototype.js +10 -0
- package/dist/semantics/normalize/intrinsic-return-identity.d.ts +5 -0
- package/dist/semantics/normalize/intrinsic-return-identity.js +29 -0
- package/dist/semantics/normalize/jsdoc-type-names.js +59 -63
- package/dist/semantics/normalize/keyof.js +3 -3
- package/dist/semantics/normalize/local-bindings.d.ts +4 -4
- package/dist/semantics/normalize/local-bindings.js +60 -61
- package/dist/semantics/normalize/logical-object-truthiness.d.ts +8 -0
- package/dist/semantics/normalize/logical-object-truthiness.js +20 -0
- package/dist/semantics/normalize/merged-declaration.d.ts +3 -3
- package/dist/semantics/normalize/merged-declaration.js +3 -3
- package/dist/semantics/normalize/never-override-result.d.ts +2 -3
- package/dist/semantics/normalize/never-override-result.js +2 -3
- package/dist/semantics/normalize/null-blind-parameter.d.ts +2 -2
- package/dist/semantics/normalize/null-blind-parameter.js +2 -2
- package/dist/semantics/normalize/object-bag-bindings.d.ts +19 -19
- package/dist/semantics/normalize/object-bag-bindings.js +334 -141
- package/dist/semantics/normalize/omitted-stated-parameter.d.ts +8 -8
- package/dist/semantics/normalize/omitted-stated-parameter.js +8 -9
- package/dist/semantics/normalize/override-field-arms.d.ts +3 -3
- package/dist/semantics/normalize/override-field-arms.js +15 -16
- package/dist/semantics/normalize/parameter-bindings.d.ts +13 -12
- package/dist/semantics/normalize/parameter-bindings.js +173 -139
- package/dist/semantics/normalize/parameter-slot.d.ts +9 -10
- package/dist/semantics/normalize/parameter-slot.js +16 -17
- package/dist/semantics/normalize/physical-overload-result.d.ts +8 -8
- package/dist/semantics/normalize/physical-overload-result.js +10 -10
- package/dist/semantics/normalize/producer-context.d.ts +27 -12
- package/dist/semantics/normalize/producers/allocations.js +5 -1
- package/dist/semantics/normalize/producers/bindings.js +8 -7
- package/dist/semantics/normalize/producers/class-lifecycle.js +52 -7
- package/dist/semantics/normalize/producers/computations.js +27 -3
- package/dist/semantics/normalize/producers/control.js +5 -5
- package/dist/semantics/normalize/producers/declaration-lifecycle.js +4 -4
- package/dist/semantics/normalize/producers/destructuring.js +10 -5
- package/dist/semantics/normalize/producers/erasure.d.ts +9 -0
- package/dist/semantics/normalize/producers/erasure.js +22 -0
- package/dist/semantics/normalize/producers/invocations.d.ts +1 -1
- package/dist/semantics/normalize/producers/invocations.js +200 -55
- package/dist/semantics/normalize/producers/logical-merge-type.d.ts +2 -2
- package/dist/semantics/normalize/producers/logical-merge-type.js +12 -12
- package/dist/semantics/normalize/producers/native-callable-readonly-set.d.ts +6 -0
- package/dist/semantics/normalize/producers/native-callable-readonly-set.js +24 -0
- package/dist/semantics/normalize/producers/native-own-assignment.d.ts +14 -0
- package/dist/semantics/normalize/producers/native-own-assignment.js +153 -0
- package/dist/semantics/normalize/producers/properties.js +153 -20
- package/dist/semantics/normalize/producers/protocol.js +4 -4
- package/dist/semantics/normalize/producers/references.js +21 -19
- package/dist/semantics/normalize/producers/shared.d.ts +1 -1
- package/dist/semantics/normalize/producers/shared.js +59 -58
- package/dist/semantics/normalize/producers/spread-arguments.js +7 -3
- package/dist/semantics/normalize/producers/tuple-spread.d.ts +2 -2
- package/dist/semantics/normalize/producers/tuple-spread.js +5 -5
- package/dist/semantics/normalize/property-key-domain.d.ts +6 -6
- package/dist/semantics/normalize/property-key-domain.js +7 -7
- package/dist/semantics/normalize/reachability.d.ts +6 -7
- package/dist/semantics/normalize/reachability.js +60 -62
- package/dist/semantics/normalize/record-home-arms.js +2 -3
- 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 +4 -5
- package/dist/semantics/normalize/return-bindings.d.ts +19 -9
- package/dist/semantics/normalize/return-bindings.js +49 -41
- 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 +4 -5
- package/dist/semantics/normalize/shared-array-storage.js +7 -8
- package/dist/semantics/normalize/sloppy-absence.d.ts +6 -3
- package/dist/semantics/normalize/sloppy-absence.js +7 -3
- package/dist/semantics/normalize/source-object-prototype-absence.d.ts +7 -0
- package/dist/semantics/normalize/source-object-prototype-absence.js +19 -0
- package/dist/semantics/normalize/specialization.d.ts +10 -10
- package/dist/semantics/normalize/specialization.js +107 -112
- package/dist/semantics/normalize/specialized-source-frames.d.ts +11 -0
- package/dist/semantics/normalize/specialized-source-frames.js +41 -0
- package/dist/semantics/normalize/structural-array-element.d.ts +5 -5
- package/dist/semantics/normalize/structural-array-element.js +40 -39
- package/dist/semantics/normalize/structural-array-read.js +3 -3
- package/dist/semantics/normalize/structural-callable.d.ts +15 -1
- package/dist/semantics/normalize/structural-callable.js +35 -3
- package/dist/semantics/normalize/structural-creation-order.d.ts +2 -2
- package/dist/semantics/normalize/structural-declarations.d.ts +22 -21
- package/dist/semantics/normalize/structural-declarations.js +42 -42
- package/dist/semantics/normalize/structural-declared-body.js +10 -11
- package/dist/semantics/normalize/structural-indexed-access.js +2 -2
- package/dist/semantics/normalize/structural-instantiated-member.d.ts +9 -10
- package/dist/semantics/normalize/structural-instantiated-member.js +43 -30
- package/dist/semantics/normalize/structural-joins.d.ts +4 -16
- package/dist/semantics/normalize/structural-joins.js +5 -65
- package/dist/semantics/normalize/structural-layout-relevance.d.ts +5 -5
- package/dist/semantics/normalize/structural-layout-relevance.js +22 -23
- package/dist/semantics/normalize/structural-layout-type.d.ts +1 -1
- package/dist/semantics/normalize/structural-layout-type.js +140 -107
- package/dist/semantics/normalize/structural-local-union.d.ts +1 -1
- package/dist/semantics/normalize/structural-local-union.js +38 -12
- package/dist/semantics/normalize/structural-mutable-field.d.ts +9 -0
- package/dist/semantics/normalize/structural-mutable-field.js +152 -0
- package/dist/semantics/normalize/structural-parts.d.ts +6 -0
- package/dist/semantics/normalize/structural-parts.js +35 -32
- package/dist/semantics/normalize/structural-receiver.d.ts +3 -3
- package/dist/semantics/normalize/structural-receiver.js +12 -13
- package/dist/semantics/normalize/structural-self-reference.d.ts +12 -11
- package/dist/semantics/normalize/structural-self-reference.js +24 -25
- package/dist/semantics/normalize/structural.d.ts +13 -3
- package/dist/semantics/normalize/structural.js +400 -201
- package/dist/semantics/normalize/suppressed-write-arms.d.ts +10 -11
- package/dist/semantics/normalize/symbol-keyed-this-slots.d.ts +6 -6
- package/dist/semantics/normalize/symbol-keyed-this-slots.js +4 -4
- package/dist/semantics/normalize/unresolvable-names.d.ts +2 -3
- package/dist/semantics/normalize/unresolvable-names.js +2 -2
- package/dist/semantics/normalize/unshared-array-result.d.ts +4 -4
- package/dist/semantics/normalize/unshared-array-result.js +4 -4
- package/dist/semantics/package-sources.js +2 -3
- package/dist/semantics/program.d.ts +10 -13
- package/dist/semantics/program.js +80 -26
- package/dist/semantics/property-key.d.ts +9 -0
- package/dist/semantics/property-key.js +25 -0
- package/dist/semantics/prototype-object-class-source-transform.js +2 -2
- 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 +6 -1
- package/dist/semantics/shared-declaration-files.js +2 -2
- package/dist/semantics/source-transform-protocol.d.ts +26 -0
- package/dist/semantics/source-transform-protocol.js +1 -0
- package/dist/semantics/stable-checker.js +9 -13
- package/dist/semantics/subclass-member-overlay-transform.d.ts +2 -2
- package/dist/semantics/subclass-member-overlay-transform.js +89 -88
- package/dist/semantics/this-constructor-source-transform.js +2 -2
- package/dist/semantics/unchecked-guard-argument-copies.d.ts +3 -3
- package/dist/semantics/unchecked-write-member-declarations.d.ts +9 -11
- package/dist/semantics/unchecked-write-member-declarations.js +11 -13
- package/dist/semantics/uninstantiable-classes.d.ts +1 -1
- package/dist/semantics/uninstantiable-classes.js +1 -1
- package/dist/targets/cpp/balanced-units.d.ts +1 -1
- package/dist/targets/cpp/balanced-units.js +1 -1
- package/dist/targets/cpp/borrowed-arm-projections.d.ts +2 -3
- package/dist/targets/cpp/borrowed-arm-projections.js +2 -3
- package/dist/targets/cpp/borrowed-call-entry.js +3 -3
- package/dist/targets/cpp/captures.d.ts +2 -2
- package/dist/targets/cpp/captures.js +4 -4
- package/dist/targets/cpp/char-code-buffers.d.ts +1 -1
- package/dist/targets/cpp/char-code-buffers.js +4 -1
- package/dist/targets/cpp/class-layout.d.ts +7 -17
- package/dist/targets/cpp/class-layout.js +6 -13
- package/dist/targets/cpp/class-properties/computed-method-value.d.ts +1 -1
- package/dist/targets/cpp/class-properties/computed-method-value.js +5 -27
- package/dist/targets/cpp/class-properties/emit-class-properties.d.ts +49 -59
- package/dist/targets/cpp/class-properties/emit-class-properties.js +68 -232
- package/dist/targets/cpp/class-properties/native-method-read.d.ts +5 -0
- package/dist/targets/cpp/class-properties/native-method-read.js +60 -0
- package/dist/targets/cpp/class-properties/native-prototype.d.ts +3 -1
- package/dist/targets/cpp/class-properties/native-prototype.js +5 -6
- package/dist/targets/cpp/class-ref-transport.d.ts +1 -11
- package/dist/targets/cpp/class-ref-transport.js +1 -9
- package/dist/targets/cpp/conversions.js +613 -252
- package/dist/targets/cpp/coroutine-bodies.d.ts +1 -97
- package/dist/targets/cpp/coroutine-bodies.js +1 -187
- package/dist/targets/cpp/document.js +1 -1
- package/dist/targets/cpp/emit-allocation.d.ts +0 -38
- package/dist/targets/cpp/emit-allocation.js +63 -88
- package/dist/targets/cpp/emit-array-view.d.ts +7 -0
- package/dist/targets/cpp/emit-array-view.js +47 -0
- package/dist/targets/cpp/emit-arrays.d.ts +9 -52
- package/dist/targets/cpp/emit-arrays.js +177 -113
- package/dist/targets/cpp/emit-binding-reference.d.ts +10 -0
- package/dist/targets/cpp/emit-binding-reference.js +19 -1
- package/dist/targets/cpp/emit-bindings.js +19 -24
- package/dist/targets/cpp/emit-buffers.d.ts +8 -4
- package/dist/targets/cpp/emit-buffers.js +88 -47
- package/dist/targets/cpp/emit-callable-view.d.ts +6 -0
- package/dist/targets/cpp/emit-callable-view.js +133 -0
- package/dist/targets/cpp/emit-callable.d.ts +11 -1
- package/dist/targets/cpp/emit-callable.js +225 -266
- package/dist/targets/cpp/emit-carrier-members.d.ts +2 -2
- package/dist/targets/cpp/emit-carrier-members.js +42 -35
- package/dist/targets/cpp/emit-certified-conversion.d.ts +7 -0
- package/dist/targets/cpp/emit-certified-conversion.js +27 -0
- package/dist/targets/cpp/emit-context.d.ts +123 -64
- package/dist/targets/cpp/emit-context.js +147 -44
- package/dist/targets/cpp/emit-descriptor-snapshot.d.ts +10 -0
- package/dist/targets/cpp/emit-descriptor-snapshot.js +60 -0
- package/dist/targets/cpp/emit-dictionary-view.d.ts +6 -0
- package/dist/targets/cpp/emit-dictionary-view.js +102 -0
- package/dist/targets/cpp/emit-document-record-view.d.ts +3 -0
- package/dist/targets/cpp/emit-document-record-view.js +104 -0
- package/dist/targets/cpp/emit-dynamic-properties.d.ts +42 -17
- package/dist/targets/cpp/emit-dynamic-properties.js +118 -72
- package/dist/targets/cpp/emit-equality.d.ts +2 -1
- package/dist/targets/cpp/emit-equality.js +65 -45
- package/dist/targets/cpp/emit-exceptions.js +1 -1
- package/dist/targets/cpp/emit-in.js +22 -11
- package/dist/targets/cpp/emit-instanceof.js +15 -14
- package/dist/targets/cpp/emit-integers.d.ts +40 -3
- package/dist/targets/cpp/emit-integers.js +76 -5
- package/dist/targets/cpp/emit-iterable-object-view.d.ts +2 -0
- package/dist/targets/cpp/emit-iterable-object-view.js +15 -11
- package/dist/targets/cpp/emit-iterator-object-view.d.ts +2 -0
- package/dist/targets/cpp/emit-iterator-object-view.js +24 -16
- package/dist/targets/cpp/emit-iterator.d.ts +2 -0
- package/dist/targets/cpp/emit-iterator.js +115 -43
- package/dist/targets/cpp/emit-json.js +6 -6
- package/dist/targets/cpp/emit-jsx.js +2 -2
- package/dist/targets/cpp/emit-live-field-view.d.ts +26 -0
- package/dist/targets/cpp/emit-live-field-view.js +50 -0
- package/dist/targets/cpp/emit-narrowing.d.ts +60 -139
- package/dist/targets/cpp/emit-narrowing.js +694 -624
- package/dist/targets/cpp/emit-native-accessor-definition.d.ts +10 -0
- package/dist/targets/cpp/emit-native-accessor-definition.js +94 -0
- package/dist/targets/cpp/emit-native-callable-data.d.ts +23 -0
- package/dist/targets/cpp/emit-native-callable-data.js +117 -0
- package/dist/targets/cpp/emit-native-document-entry.d.ts +4 -0
- package/dist/targets/cpp/emit-native-document-entry.js +52 -0
- package/dist/targets/cpp/emit-native-field-view.d.ts +26 -0
- package/dist/targets/cpp/emit-native-field-view.js +217 -0
- package/dist/targets/cpp/emit-native-method.d.ts +16 -0
- package/dist/targets/cpp/emit-native-method.js +90 -0
- package/dist/targets/cpp/emit-native-object-data.d.ts +7 -0
- package/dist/targets/cpp/emit-native-object-data.js +66 -0
- package/dist/targets/cpp/emit-native-object-sample.d.ts +8 -0
- package/dist/targets/cpp/emit-native-object-sample.js +34 -0
- package/dist/targets/cpp/emit-native-own-assignment.d.ts +7 -0
- package/dist/targets/cpp/emit-native-own-assignment.js +119 -0
- package/dist/targets/cpp/emit-native-selection.d.ts +2 -2
- package/dist/targets/cpp/emit-native-selection.js +14 -5
- package/dist/targets/cpp/emit-number-storage.d.ts +2 -0
- package/dist/targets/cpp/emit-number-storage.js +1 -0
- package/dist/targets/cpp/emit-presence.d.ts +3 -4
- package/dist/targets/cpp/emit-presence.js +43 -21
- package/dist/targets/cpp/emit-properties.js +224 -111
- package/dist/targets/cpp/emit-protocol-iterator.d.ts +2 -0
- package/dist/targets/cpp/emit-protocol-iterator.js +45 -23
- package/dist/targets/cpp/emit-record-view.d.ts +5 -10
- package/dist/targets/cpp/emit-record-view.js +223 -269
- package/dist/targets/cpp/emit-return.js +33 -8
- package/dist/targets/cpp/emit-scopes.d.ts +2 -2
- package/dist/targets/cpp/emit-sum-widening.js +13 -5
- package/dist/targets/cpp/emit-tonumber.d.ts +1 -1
- package/dist/targets/cpp/emit-tonumber.js +3 -3
- package/dist/targets/cpp/emit-tostring.d.ts +20 -2
- package/dist/targets/cpp/emit-tostring.js +131 -28
- package/dist/targets/cpp/emit-typeof.d.ts +4 -0
- package/dist/targets/cpp/emit-typeof.js +29 -1
- package/dist/targets/cpp/emit-union-properties.d.ts +6 -23
- package/dist/targets/cpp/emit-union-properties.js +127 -235
- package/dist/targets/cpp/emit.d.ts +4 -1
- package/dist/targets/cpp/emit.js +336 -119
- package/dist/targets/cpp/error-types.d.ts +1 -3
- package/dist/targets/cpp/error-types.js +1 -2
- package/dist/targets/cpp/evaluated-once.d.ts +4 -4
- package/dist/targets/cpp/evaluated-once.js +5 -5
- package/dist/targets/cpp/function-source-reads.d.ts +2 -15
- package/dist/targets/cpp/function-source-reads.js +3 -38
- package/dist/targets/cpp/host/core-globals.d.ts +5 -0
- package/dist/targets/cpp/host/core-globals.js +10 -0
- package/dist/targets/cpp/host/emit-host-arity.js +1 -1
- package/dist/targets/cpp/host/emit-host-invoke.js +73 -23
- package/dist/targets/cpp/host/emit-host-object.d.ts +2 -1
- package/dist/targets/cpp/host/emit-host-object.js +328 -145
- package/dist/targets/cpp/host/emit-host-properties.js +4 -6
- package/dist/targets/cpp/host/emit-host-reflect.js +29 -5
- package/dist/targets/cpp/host/emit-host-value.d.ts +1 -1
- package/dist/targets/cpp/host/emit-host-value.js +2 -2
- package/dist/targets/cpp/host/host-members.d.ts +11 -0
- package/dist/targets/cpp/host/host-members.js +27 -5
- package/dist/targets/cpp/host/host-method-aliases.d.ts +1 -30
- package/dist/targets/cpp/host/host-method-aliases.js +1 -76
- package/dist/targets/cpp/host/native-protocols.js +1 -1
- package/dist/targets/cpp/host/object-protocol.d.ts +1 -1
- package/dist/targets/cpp/host/object-protocol.js +24 -24
- package/dist/targets/cpp/host-namespace-reads.d.ts +1 -83
- package/dist/targets/cpp/host-namespace-reads.js +1 -113
- package/dist/targets/cpp/manifest/capabilities.js +33 -33
- package/dist/targets/cpp/manifest.d.ts +5 -0
- package/dist/targets/cpp/manifest.js +38 -14
- package/dist/targets/cpp/native-collection-base.js +7 -6
- package/dist/targets/cpp/native-debug-source.d.ts +15 -0
- package/dist/targets/cpp/native-debug-source.js +21 -0
- package/dist/targets/cpp/native-error-base.d.ts +1 -1
- package/dist/targets/cpp/native-error-base.js +1 -1
- package/dist/targets/cpp/native-narrowing-transport.d.ts +2 -0
- package/dist/targets/cpp/native-narrowing-transport.js +25 -5
- package/dist/targets/cpp/native-view-targets.d.ts +3 -0
- package/dist/targets/cpp/native-view-targets.js +5 -0
- package/dist/targets/cpp/prototype/emit-prototype-array.d.ts +3 -33
- package/dist/targets/cpp/prototype/emit-prototype-array.js +40 -22
- package/dist/targets/cpp/prototype/emit-prototype-date.d.ts +1 -58
- package/dist/targets/cpp/prototype/emit-prototype-date.js +14 -97
- package/dist/targets/cpp/prototype/emit-prototype-error.d.ts +20 -0
- package/dist/targets/cpp/prototype/emit-prototype-error.js +2 -2
- package/dist/targets/cpp/prototype/emit-prototype-invoke.d.ts +3 -27
- package/dist/targets/cpp/prototype/emit-prototype-invoke.js +60 -52
- package/dist/targets/cpp/prototype/emit-prototype-iterator.d.ts +1 -41
- package/dist/targets/cpp/prototype/emit-prototype-iterator.js +4 -43
- package/dist/targets/cpp/prototype/emit-prototype-promise.d.ts +2 -13
- package/dist/targets/cpp/prototype/emit-prototype-promise.js +10 -58
- package/dist/targets/cpp/prototype/emit-prototype-regexp.d.ts +4 -25
- package/dist/targets/cpp/prototype/emit-prototype-regexp.js +16 -81
- package/dist/targets/cpp/prototype/emit-prototype-string.d.ts +1 -1
- package/dist/targets/cpp/prototype/emit-prototype-string.js +17 -28
- package/dist/targets/cpp/prototype/prototype-method-reads.js +4 -80
- package/dist/targets/cpp/reactive-dependencies.d.ts +12 -6
- package/dist/targets/cpp/reactive-dependencies.js +62 -42
- package/dist/targets/cpp/reactive-origins.js +12 -0
- package/dist/targets/cpp/records.d.ts +133 -14
- package/dist/targets/cpp/records.js +345 -153
- package/dist/targets/cpp/regexp-types.d.ts +1 -26
- package/dist/targets/cpp/regexp-types.js +4 -29
- package/dist/targets/cpp/segment-scopes.d.ts +30 -0
- package/dist/targets/cpp/segment-scopes.js +294 -0
- package/dist/targets/cpp/translation-unit.d.ts +21 -2
- package/dist/targets/cpp/translation-unit.js +121 -276
- package/dist/targets/cpp/types.d.ts +8 -3
- package/dist/targets/cpp/types.js +30 -6
- package/dist/targets/cpp/virtual-callees.d.ts +18 -0
- package/dist/targets/cpp/virtual-callees.js +27 -0
- package/dist/targets/cpp/virtual-methods.d.ts +7 -7
- package/dist/targets/cpp/virtual-methods.js +213 -58
- package/package.json +8 -3
- package/src/targets/cpp/runtime/gea_dictionary_view.h +204 -0
- package/src/targets/cpp/runtime/gea_document_view.h +845 -0
- package/src/targets/cpp/runtime/gea_dynamic_proxy.h +66 -23
- package/src/targets/cpp/runtime/gea_eval.h +6 -6
- package/src/targets/cpp/runtime/gea_runtime.h +7550 -1166
- package/dist/targets/cpp/direct-call-receivers.d.ts +0 -37
- package/dist/targets/cpp/direct-call-receivers.js +0 -79
|
@@ -1,25 +1,35 @@
|
|
|
1
|
+
import { nativeLogicalReceiverProtocolOf, nativeLogicalReceiverProtocolSupported } from '../../representation/native-logical-receiver.js';
|
|
1
2
|
import { coercionText } from './emit-coercion.js';
|
|
2
3
|
import { classRefTransportKind, constructorFamilyUpcastMembers, constructorUpcastMember, nativeRecordBaseTransportKind } from './class-ref-transport.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { callablePayloadPlan, callableViewPlan, certifiedRecordViewPlan, recordToArrayPlan } from '../../conversion/structural-plan.js';
|
|
5
|
+
import { recipeClosureOf } from '../../conversion/recipe-closure.js';
|
|
6
|
+
import { nativeFieldViewPlanIsLive } from '../../conversion/native-field-view.js';
|
|
7
|
+
import { promiseAdoptionPlanOf } from '../../conversion/promise-adoption.js';
|
|
8
|
+
import { composedDictionaryViewPlan } from '../../conversion/dictionary-view.js';
|
|
9
|
+
import { nativeArrayViewBasePlanOf, nativeArrayViewSourceIsBoxed, nativeArrayViewWithObservation, nativeArrayViewWithOwnerObservation } from '../../conversion/array-view.js';
|
|
10
|
+
import { composedDocumentRecordViewPlanOf } from '../../conversion/document-record-view.js';
|
|
11
|
+
import { certifiedIteratorObjectViewPlan } from '../../conversion/certified-iterator-object-view.js';
|
|
12
|
+
import { chainFieldProtocolUnused, chainPayloadNeedsSourceGuard, nativeSumNarrowingTransports } from './native-narrowing-transport.js';
|
|
13
|
+
import { classRefDomainsOverlap, classifierDomainsOverlap, conversionNeedsPriorSourceGuard, conversionRequiresSourceGuard, transfersNativeStorage } from '../../conversion/algebra.js';
|
|
6
14
|
import { emptyConversionRegistry, narrowingReachesTarget, narrowsToDescendantClassUnion } from '../../conversion/build.js';
|
|
7
15
|
import { defaultRecordLayoutPolicy } from '../../representation/policies.js';
|
|
8
16
|
import { abiKey, arrayExtensionKey, representationKey, carriesUndefined, containsUnresolved, isOpenDocument } from '../../representation/model.js';
|
|
9
|
-
import { isSpellable, callableObjectAbi, resultAdapterTransportOf, adaptsConstructorIntoDispatch, boxDiscriminantsOfArm, conversionRecipeOf, boxedAssertionText, classDocumentViewText, dropsAllParametersIntoResultArm, dropsUnboundParameters, dynamicTagFor, promisePayloadConvertible, rebasesRestOverLeadingParameters,
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { nativeSelectionRecipeOf, nativeTotalSelectionRecipeOf } from '../../conversion/native-selection.js';
|
|
17
|
+
import { isSpellable, callableObjectAbi, resultAdapterTransportOf, adaptsConstructorIntoDispatch, boxDiscriminantsOfArm, conversionRecipeOf, boxedAssertionText, classDocumentViewText, documentViewable, dropsAllParametersIntoResultArm, dropsUnboundParameters, dynamicTagFor, promisePayloadConvertible, rebasesRestOverLeadingParameters, CONSTRUCTOR_STATIC_VIEW, constructorStaticViewAdmitted, DYNAMIC_DICTIONARY_TO_NAMED_RECORD, dynamicDictionaryToNamedRecordAdmitted, indexedRecordCastableToDictionary, indexedRecordDictionaryArmOf, indexedRecordViewOf, INDEXED_RECORD_INTO_DICTIONARY_ARM, INDEXED_RECORD_TO_DICTIONARY, recordCastableToDictionary, recordRecastCrossesDynamic, recordsRecastable, sameArrayUpToExtension, sumIntoPayloadText, widensResultIntoArm, resultAdaptedCallableText, tryCandidateText, VIEW_ADAPTED_CALLABLE, CHECKED_ARM_NARROWING, checkedArmNarrowingText } from './emit-narrowing.js';
|
|
18
|
+
import { NATIVE_SUM_CLASSIFIER, NATIVE_SUM_MATERIALIZER, nativeSumPlan, nativeSumPreservesPayload } from '../../conversion/native-sum.js';
|
|
19
|
+
import { NATIVE_REFERENCE_ABSENCE, nativeReferenceAbsenceOf } from '../../conversion/native-absence.js';
|
|
20
|
+
import { nativeSelectionGuardContractOf, nativeSelectionPreservesPayload, nativeSelectionRecipeOf, nativeSubsetSelectionRecipeOf, nativeTotalSelectionRecipeOf } from '../../conversion/native-selection.js';
|
|
13
21
|
import { nativeClassReferenceIdentityOf } from '../../conversion/native-class-reference.js';
|
|
14
|
-
import {
|
|
22
|
+
import { certifiedIterableObjectViewPlan, certifiedProtocolIteratorPlan } from '../../conversion/certified-iterator-protocols.js';
|
|
23
|
+
import { isRecordViewTarget, ownedRecordMaterializationPlan, recordViewDispatchesArms, recordViewResidualReflection, recordViewUsesOnlyDirectFields } from '../../conversion/record-view.js';
|
|
15
24
|
import { cppStringObjectNativeType } from './regexp-types.js';
|
|
16
|
-
import {
|
|
25
|
+
import { viewPlanFor } from './emit-record-view.js';
|
|
17
26
|
import { FAMILY_MEMBER_VIEW_MATERIALIZER } from '../../conversion/nodes.js';
|
|
18
27
|
import { PROTOCOL_ITERATOR, protocolIteratorPlanFor } from './emit-protocol-iterator.js';
|
|
19
28
|
import { ITERABLE_OBJECT_VIEW, iterableObjectViewPlanFor } from './emit-iterable-object-view.js';
|
|
20
29
|
import { ITERATOR_OBJECT_VIEW, iteratorObjectViewPlanFor } from './emit-iterator-object-view.js';
|
|
21
30
|
import { CONSTRUCTOR_DISPATCH_FAMILY, CONSTRUCTOR_IDENTITY_FAMILY } from './emit-constructor-identity-family.js';
|
|
22
31
|
import { proxyArmWithoutHome } from '../../representation/proxy-carriers.js';
|
|
32
|
+
import { samePhysicalCarrier } from '../../representation/physical-carrier.js';
|
|
23
33
|
import { constructorDispatchFamilyPlan, constructorIdentityFamilyPlan } from '../../conversion/constructor-identity-family.js';
|
|
24
34
|
/** Called only after the native converting-constructor predicate has selected this pair. */
|
|
25
35
|
const nativeClassPresence = (value) => {
|
|
@@ -37,17 +47,18 @@ const nativeCallableTransport = (source, target) => {
|
|
|
37
47
|
: { nativeFieldProtocol: 'unused', callableAdapter: { from, to }, callableIdentityTransport: 'preserved' };
|
|
38
48
|
};
|
|
39
49
|
const nativeSumConversion = (source, target) => {
|
|
40
|
-
|
|
50
|
+
const plan = nativeSumPlan(source, target);
|
|
51
|
+
if (plan === null)
|
|
41
52
|
return null;
|
|
42
53
|
const domain = `sum-widen:${representationKey(source)}->${representationKey(target)}`;
|
|
43
54
|
return {
|
|
44
|
-
classifier: { id:
|
|
55
|
+
classifier: { id: NATIVE_SUM_CLASSIFIER, domain },
|
|
45
56
|
materializer: {
|
|
46
|
-
id:
|
|
57
|
+
id: NATIVE_SUM_MATERIALIZER,
|
|
47
58
|
domain,
|
|
48
59
|
allocates: false,
|
|
49
60
|
nativeFieldProtocol: 'unused',
|
|
50
|
-
nativePayloadTransport: 'preserved',
|
|
61
|
+
...(nativeSumPreservesPayload(plan) ? { nativePayloadTransport: 'preserved' } : {}),
|
|
51
62
|
...nativeClassReferenceIdentityOf(source, target)
|
|
52
63
|
}
|
|
53
64
|
};
|
|
@@ -60,9 +71,11 @@ const nativeSelectionConversion = (source, target, nativeSelection) => {
|
|
|
60
71
|
id: 'gea::native-sum::select',
|
|
61
72
|
domain,
|
|
62
73
|
allocates: false,
|
|
74
|
+
armSelection: 'native-sum',
|
|
63
75
|
nativeFieldProtocol: 'unused',
|
|
64
|
-
nativePayloadTransport: 'preserved',
|
|
76
|
+
...(nativeSelectionPreservesPayload(nativeSelection) ? { nativePayloadTransport: 'preserved' } : {}),
|
|
65
77
|
nativeSelection,
|
|
78
|
+
...nativeSelectionGuardContractOf(nativeSelection),
|
|
66
79
|
...nativeClassReferenceIdentityOf(source, target)
|
|
67
80
|
}
|
|
68
81
|
};
|
|
@@ -140,13 +153,13 @@ const nativeSelectionConversion = (source, target, nativeSelection) => {
|
|
|
140
153
|
* carriers, exactly as `emit-narrowing.ts`'s `widenedStoreText` recurses when
|
|
141
154
|
* it RENDERS the store. Asked as one predicate rather than restated per
|
|
142
155
|
* branch, because the branch that restated it read only one level and refused
|
|
143
|
-
* `tagged-union(record | optional(callable))`:
|
|
144
|
-
* carrier for its
|
|
156
|
+
* `tagged-union(record | optional(callable))`: a middleware-composition
|
|
157
|
+
* function builds that carrier for its handler, and the render was ready for it.
|
|
145
158
|
*/
|
|
146
159
|
const boxable = (representation) => {
|
|
147
160
|
// Already a box. `dynamicTagFor` answers `null` for it -- a box holds
|
|
148
161
|
// whichever tag its value carries, not one fixed tag -- and reading that as
|
|
149
|
-
// "cannot be boxed" refused
|
|
162
|
+
// "cannot be boxed" refused a composed handler typed
|
|
150
163
|
// `tagged-union(dynamic | optional(callable))`, whose first arm is one.
|
|
151
164
|
if (representation.kind === 'dynamic')
|
|
152
165
|
return true;
|
|
@@ -158,7 +171,7 @@ const boxable = (representation) => {
|
|
|
158
171
|
};
|
|
159
172
|
const exactTagRead = (tag) => ({
|
|
160
173
|
classifier: { id: 'gea::Value::tag', domain: `tag:${tag}` },
|
|
161
|
-
materializer: { id: 'gea::detail::unboxValue', domain: `tag:${tag}`, allocates: false }
|
|
174
|
+
materializer: { id: 'gea::detail::unboxValue', domain: `tag:${tag}`, allocates: false, wrapperKind: 'unbox-tag', boxTag: tag }
|
|
162
175
|
});
|
|
163
176
|
/**
|
|
164
177
|
* A derived class-ref stored into a base class-ref cell.
|
|
@@ -182,8 +195,8 @@ const upcastsToBase = (source, target) => classRefTransportKind(source, target)
|
|
|
182
195
|
* The exact mirror: a BASE class-ref read at one of its descendants, which is
|
|
183
196
|
* what `instanceof` narrows and what `upcastsToBase` above cannot express.
|
|
184
197
|
*
|
|
185
|
-
* `
|
|
186
|
-
*
|
|
198
|
+
* `node.visit( part => { if ( part instanceof Derived ) part.flag = true } )`
|
|
199
|
+
* is the shape, and it is the one `instanceof` exists for -- the
|
|
187
200
|
* handle is declared at the base and the guard proves the object is a
|
|
188
201
|
* descendant. Nothing had ever PROPOSED the pair (`conversion/build.ts`'s
|
|
189
202
|
* class-ref loop asked only `widening`), so the reads past the guard carried
|
|
@@ -200,8 +213,8 @@ const downcastsToDerived = (source, target) => classRefTransportKind(source, tar
|
|
|
200
213
|
/** Exactly one class arm inside `target` accepts `source` by inheritance. */
|
|
201
214
|
const hasSingleClassUpcastHome = (source, target) => {
|
|
202
215
|
// A class extending the intrinsic `Error` reaches an `Error` arm by the same
|
|
203
|
-
// pointer upcast a bare `Error` slot takes:
|
|
204
|
-
//
|
|
216
|
+
// pointer upcast a bare `Error` slot takes: a program hands its own error
|
|
217
|
+
// subclass to an `(err?: Error | null)` callback.
|
|
205
218
|
if (upcastsToBase(source, target) || (target.kind !== source.kind && nativeRecordBaseTransportKind(source, target) === 'upcast'))
|
|
206
219
|
return true;
|
|
207
220
|
if (target.kind === 'optional')
|
|
@@ -237,7 +250,7 @@ const genericFunctionSetPair = (source, target) => {
|
|
|
237
250
|
const domain = `generic-function-set:${representationKey(source)}->${representationKey(target)}`;
|
|
238
251
|
return {
|
|
239
252
|
classifier: { id: 'generic-function-set::index', domain },
|
|
240
|
-
materializer: { id: 'generic-function-set::remap', domain, allocates: false }
|
|
253
|
+
materializer: { id: 'generic-function-set::remap', domain, allocates: false, nativeFieldProtocol: 'unused' }
|
|
241
254
|
};
|
|
242
255
|
};
|
|
243
256
|
/**
|
|
@@ -335,7 +348,11 @@ const cppTaggedUnionArmClassifier = (arm) => {
|
|
|
335
348
|
if (discriminants === null || discriminants.length === 0)
|
|
336
349
|
return null;
|
|
337
350
|
if (arm.runtimeDiscriminator.kind === 'record-literal') {
|
|
338
|
-
return {
|
|
351
|
+
return {
|
|
352
|
+
id: 'gea::detail::dynamicRecordDiscriminator',
|
|
353
|
+
domain: `record-literal:${JSON.stringify(arm.runtimeDiscriminator)}`,
|
|
354
|
+
recordDiscriminator: arm.runtimeDiscriminator
|
|
355
|
+
};
|
|
339
356
|
}
|
|
340
357
|
if (arm.runtimeDiscriminator.kind === 'callable-tag') {
|
|
341
358
|
return {
|
|
@@ -443,26 +460,77 @@ const dynamicCarrierSupported = (representation, seen = new Set()) => {
|
|
|
443
460
|
return false;
|
|
444
461
|
}
|
|
445
462
|
};
|
|
446
|
-
const dynamicCallableAbiSupported = (abi, seen = new Set()) => {
|
|
463
|
+
const dynamicCallableAbiSupported = (abi, seen = new Set(), argument = dynamicCarrierSupported) => {
|
|
447
464
|
if (abi.receiver !== null && !dynamicCarrierSupported(abi.receiver, seen))
|
|
448
465
|
return false;
|
|
449
466
|
if (abi.result.kind !== 'void' && !dynamicCarrierSupported(abi.result, seen))
|
|
450
467
|
return false;
|
|
451
|
-
if (!abi.parameters.every((parameter) =>
|
|
468
|
+
if (!abi.parameters.every((parameter) => argument(parameter.value, seen)))
|
|
452
469
|
return false;
|
|
453
470
|
if (abi.restFrom === null)
|
|
454
471
|
return true;
|
|
455
472
|
const rest = abi.parameters[abi.restFrom]?.value;
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
dynamicCarrierSupported(rest.element, seen)
|
|
473
|
+
if (abi.restFrom !== abi.parameters.length - 1 || rest === undefined)
|
|
474
|
+
return false;
|
|
475
|
+
if (rest.kind === 'array-object')
|
|
476
|
+
return rest.ownership === 'shared-refcount' && dynamicCarrierSupported(rest.element, seen);
|
|
477
|
+
return dynamicRestTupleSupported(rest, seen);
|
|
460
478
|
};
|
|
479
|
+
/**
|
|
480
|
+
* A rest slot carried as a closed tuple record, not an Array: a function that
|
|
481
|
+
* forwards `arguments` to a fixed-arity call (a wrapper written as
|
|
482
|
+
* `function f() { target.f( ...arguments ) }`) lowers
|
|
483
|
+
* its argument list to a record whose own keys are the canonical indexes. The
|
|
484
|
+
* runtime's `DynamicRestArgument<Ref<T>>` spreads its present index keys in
|
|
485
|
+
* order and packs incoming arguments by index, through the record's own field
|
|
486
|
+
* table -- so the record must be nothing but those index slots.
|
|
487
|
+
*/
|
|
488
|
+
const dynamicRestTupleSupported = (rest, seen) => rest.kind === 'record' &&
|
|
489
|
+
rest.ownership === 'shared-refcount' &&
|
|
490
|
+
rest.accessors.length === 0 &&
|
|
491
|
+
rest.fields.every((field, index) => field.key === String(index) && dynamicCarrierSupported(field.value, seen));
|
|
492
|
+
/**
|
|
493
|
+
* What a checked adapter over a dynamic function does with an argument: it
|
|
494
|
+
* only boxes it OUT (`adapt` in gea_runtime.h); only the result is read back
|
|
495
|
+
* in. A union argument therefore needs every arm boxable, which is exactly
|
|
496
|
+
* `DynamicCallableCarrier<TaggedUnion>::supported` -- not the disjoint arm
|
|
497
|
+
* classifiers that reading one back from a Value needs. A property-bag
|
|
498
|
+
* `update(object, key, value)` takes `value` as the union of everything the
|
|
499
|
+
* bag holds -- itself a union nested inside the absences -- whose class arms
|
|
500
|
+
* share a family, beside typed string-keyed tables.
|
|
501
|
+
*/
|
|
502
|
+
const dynamicArgumentCarrierSupported = (representation, seen) => representation.kind === 'tagged-union'
|
|
503
|
+
? representation.arms.every((arm) => dynamicArgumentCarrierSupported(arm.value, seen))
|
|
504
|
+
: // A typed `Record<string, V>` table boxes out as itself
|
|
505
|
+
// (`DynamicCarrier<Ref<T>>::out`); only reading one back in needs the
|
|
506
|
+
// entry-checking view a bare frame position has no recipe for.
|
|
507
|
+
(representation.kind === 'dictionary' && representation.ownership === 'shared-refcount') ||
|
|
508
|
+
dynamicCarrierSupported(representation, seen);
|
|
461
509
|
const dynamicCallablePair = (target) => {
|
|
462
510
|
const domain = `dynamic-callable:${representationKey(target)}`;
|
|
463
511
|
return {
|
|
464
512
|
classifier: { id: 'gea::Value::tag', domain },
|
|
465
|
-
materializer: {
|
|
513
|
+
materializer: {
|
|
514
|
+
id: 'gea::detail::DynamicCarrier::in',
|
|
515
|
+
domain,
|
|
516
|
+
allocates: true,
|
|
517
|
+
callableIdentityTransport: 'preserved',
|
|
518
|
+
wrapperKind: 'dynamic-carrier-in'
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
};
|
|
522
|
+
// A reader's physical receiver uses its separately sealed native factory.
|
|
523
|
+
// Positional/result Optional carriers retain the ordinary dynamic-frame
|
|
524
|
+
// restrictions; the factory alone supplies null/undefined receiver policy.
|
|
525
|
+
const dynamicCallableReadAbiSupported = (abi) => dynamicCallableAbiSupported({ ...abi, receiver: null }, new Set(), dynamicArgumentCarrierSupported) &&
|
|
526
|
+
(abi.receiver === null || nativeLogicalReceiverProtocolSupported(nativeLogicalReceiverProtocolOf(abi.receiver)));
|
|
527
|
+
/** Record/array construction immediately performs every cited payload conversion. */
|
|
528
|
+
const sourceGuardsOf = (nodes, resolve) => {
|
|
529
|
+
if (!nodes.some((node) => conversionRequiresSourceGuard(node.capability, resolve)))
|
|
530
|
+
return {};
|
|
531
|
+
return {
|
|
532
|
+
requiresSourceGuard: true,
|
|
533
|
+
...(!nodes.some((node) => conversionNeedsPriorSourceGuard(node.capability, resolve)) ? { executesSourceGuard: true } : {})
|
|
466
534
|
};
|
|
467
535
|
};
|
|
468
536
|
/**
|
|
@@ -472,17 +540,17 @@ const dynamicCallablePair = (target) => {
|
|
|
472
540
|
* Nothing in the program proves that arm dead: an interface-typed slot holds
|
|
473
541
|
* whatever object the program put there (`semantics/interface-implementors.ts`),
|
|
474
542
|
* and a class this cannot view as the record is still a value the slot can be
|
|
475
|
-
* handed --
|
|
476
|
-
*
|
|
477
|
-
*
|
|
543
|
+
* handed -- `const x: SomeInterface | null = Ctor ? new Ctor() : createOther()`,
|
|
544
|
+
* where the other class carries class-typed fields and a promise the view
|
|
545
|
+
* cannot rebuild. Selecting the record arm
|
|
478
546
|
* there read the class instance's bytes as the record and crashed at launch,
|
|
479
547
|
* certified. A record arm beside the exact one is the opposite case: a record
|
|
480
548
|
* the view cannot rebuild as the target is not assignable to it either, so the
|
|
481
549
|
* checker's own narrowing is what put the pair here, and the selection stands.
|
|
482
550
|
*
|
|
483
|
-
* Asked by every table that could answer the pair -- `narrowing
|
|
484
|
-
* `staticRecipe` -- so the census refuses it outright
|
|
485
|
-
* declining and the next selecting.
|
|
551
|
+
* Asked by every table that could answer the pair -- `narrowing`,
|
|
552
|
+
* `structuralRecipe` and `staticRecipe` -- so the census refuses it outright
|
|
553
|
+
* rather than one table declining and the next selecting.
|
|
486
554
|
*/
|
|
487
555
|
const classArmWithoutHome = (layouts, source, target) => {
|
|
488
556
|
const union = source.kind === 'optional' ? source.payload : source;
|
|
@@ -500,7 +568,10 @@ export const createCppConversionRegistry = (layouts = defaultRecordLayoutPolicy)
|
|
|
500
568
|
// A sum narrowing's contract is composed from the contracts this same
|
|
501
569
|
// registry states for its leaf pairs (`native-narrowing-transport.ts`), so
|
|
502
570
|
// the tables are handed a view of the finished registry.
|
|
503
|
-
const registry = cppConversionTables(layouts, (source, target) => nativeSumNarrowingTransports(registry, source, target) ? { nativeFieldProtocol: 'unused', nativePayloadTransport: 'preserved' } : {}, (source, payload) => (
|
|
571
|
+
const registry = cppConversionTables(layouts, (source, target) => nativeSumNarrowingTransports(registry, source, target) ? { nativeFieldProtocol: 'unused', nativePayloadTransport: 'preserved' } : {}, (source, payload) => ({
|
|
572
|
+
...(chainFieldProtocolUnused(registry, source, payload) ? { nativeFieldProtocol: 'unused' } : {}),
|
|
573
|
+
...(chainPayloadNeedsSourceGuard(registry, source, payload) ? { requiresSourceGuard: true } : {})
|
|
574
|
+
}));
|
|
504
575
|
return registry;
|
|
505
576
|
};
|
|
506
577
|
/**
|
|
@@ -577,22 +648,56 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
577
648
|
*
|
|
578
649
|
* Install only the ABI presently proved end to end: a receiver-less,
|
|
579
650
|
* fixed-arity numeric comparator whose arguments are themselves dynamic
|
|
580
|
-
* values
|
|
651
|
+
* values -- the shape of a public `Function | null` sort hook. Broadening the
|
|
581
652
|
* predicate requires matching `DynamicCarrier<T>::supported` for every new
|
|
582
653
|
* parameter/result carrier; guessing there would move an honest preflight
|
|
583
654
|
* refusal into a C++ template failure.
|
|
584
655
|
*/
|
|
585
656
|
functionValueDispatchMaterializer: (abi) => {
|
|
586
657
|
const target = { kind: 'function-value-dispatch', abi };
|
|
587
|
-
return
|
|
658
|
+
return dynamicCallableReadAbiSupported(abi) ? dynamicCallablePair(target) : null;
|
|
659
|
+
},
|
|
660
|
+
/**
|
|
661
|
+
* `DynamicCarrier<ConstructorObject<R(A...)>>::readWith`: an exact payload
|
|
662
|
+
* is the constructor itself; any other box is constructed through
|
|
663
|
+
* `Value::construct`, which throws the language's `TypeError` for a value
|
|
664
|
+
* with no `[[Construct]]`, and the object it returns is read by the
|
|
665
|
+
* census's own reader (`constructedResult`, nodes.ts). Only a frame with
|
|
666
|
+
* no receiver and no rest slot is a construct frame `readWith` adapts, and
|
|
667
|
+
* each argument only boxes out, as the callable adapter's do.
|
|
668
|
+
*/
|
|
669
|
+
constructorValueDispatchMaterializer: (abi) => {
|
|
670
|
+
if (abi.receiver !== null || abi.restFrom !== null || abi.argumentsFrame !== undefined || abi.overloadJoined)
|
|
671
|
+
return null;
|
|
672
|
+
if (abi.result.kind === 'void' || !abi.parameters.every((parameter) => dynamicArgumentCarrierSupported(parameter.value, new Set())))
|
|
673
|
+
return null;
|
|
674
|
+
const domain = `dynamic-constructor:${representationKey({ kind: 'constructor-value-dispatch', abi })}`;
|
|
675
|
+
return {
|
|
676
|
+
classifier: { id: 'gea::Value::tag', domain },
|
|
677
|
+
// An adapted read shares one environment per Function object, which is
|
|
678
|
+
// a constructor's identity, so every read hands back the same one.
|
|
679
|
+
materializer: {
|
|
680
|
+
id: 'gea::detail::DynamicCarrier::readWith',
|
|
681
|
+
domain,
|
|
682
|
+
allocates: true,
|
|
683
|
+
callableIdentityTransport: 'preserved',
|
|
684
|
+
wrapperKind: 'dynamic-constructor-in'
|
|
685
|
+
}
|
|
686
|
+
};
|
|
588
687
|
},
|
|
589
688
|
functionMaterializer: (functionId, abi) => {
|
|
590
|
-
if (!
|
|
689
|
+
if (!dynamicCallableReadAbiSupported(abi))
|
|
591
690
|
return null;
|
|
592
691
|
const domain = `dynamic-callable-identity:${functionId}:${representationKey({ kind: 'function', functionId, abi })}`;
|
|
593
692
|
return {
|
|
594
693
|
classifier: { id: 'gea::Value::callableDeclarationIdentity', domain },
|
|
595
|
-
materializer: {
|
|
694
|
+
materializer: {
|
|
695
|
+
id: 'gea::detail::DynamicCarrier::in',
|
|
696
|
+
domain,
|
|
697
|
+
allocates: true,
|
|
698
|
+
callableIdentityTransport: 'preserved',
|
|
699
|
+
wrapperKind: 'dynamic-carrier-in'
|
|
700
|
+
}
|
|
596
701
|
};
|
|
597
702
|
},
|
|
598
703
|
/**
|
|
@@ -613,8 +718,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
613
718
|
*
|
|
614
719
|
* The cost of its absence was not one conversion: `deriveTaggedUnion`
|
|
615
720
|
* derives one arm at a time and a single `never` arm makes the whole sum
|
|
616
|
-
* `never`, so EVERY nullable tagged-union read out of a box was refused
|
|
617
|
-
* 15 of the three.js app's 74 unmet obligations, all on this one arm.
|
|
721
|
+
* `never`, so EVERY nullable tagged-union read out of a box was refused.
|
|
618
722
|
*/
|
|
619
723
|
nullMaterializer: () => ({
|
|
620
724
|
classifier: { id: 'gea::Value::tag', domain: 'tag:Null' },
|
|
@@ -697,7 +801,13 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
697
801
|
const domain = `class-family:${declaration}:${ownership}`;
|
|
698
802
|
return {
|
|
699
803
|
classifier: { id: 'gea::Value::classIdentity', domain },
|
|
700
|
-
materializer: {
|
|
804
|
+
materializer: {
|
|
805
|
+
id: 'gea::detail::unboxClassRef',
|
|
806
|
+
domain,
|
|
807
|
+
allocates: false,
|
|
808
|
+
nativeFieldProtocol: 'unused',
|
|
809
|
+
nativePayloadTransport: 'preserved'
|
|
810
|
+
}
|
|
701
811
|
};
|
|
702
812
|
},
|
|
703
813
|
// The compiler's own opaque host carrier is `NativeHandle<protocol>`: its
|
|
@@ -713,7 +823,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
713
823
|
const domain = `opaque-native-handle:${protocol}@${version}`;
|
|
714
824
|
return {
|
|
715
825
|
classifier: { id: 'gea::Value::payloadType', domain },
|
|
716
|
-
materializer: { id: 'gea::detail::unboxValue', domain, allocates: false }
|
|
826
|
+
materializer: { id: 'gea::detail::unboxValue', domain, allocates: false, wrapperKind: 'unbox-payload' }
|
|
717
827
|
};
|
|
718
828
|
},
|
|
719
829
|
// Compiler-owned records have a closed field census, so a dynamic object can
|
|
@@ -771,13 +881,18 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
771
881
|
* type, and `owned` spells a bare `Foo` whose copy-constructibility is
|
|
772
882
|
* unchecked.
|
|
773
883
|
*
|
|
774
|
-
*
|
|
775
|
-
*
|
|
776
|
-
*
|
|
777
|
-
*
|
|
884
|
+
* An accessor-bearing record cannot be reconstructed as a product: doing
|
|
885
|
+
* so would discard its accessor environments or run user code during a
|
|
886
|
+
* classifier. Its one admissible read is this authenticated payload
|
|
887
|
+
* recovery, retaining the exact object and its getters. Plain records
|
|
888
|
+
* keep their product entry; native records, classes and arrays keep their
|
|
889
|
+
* existing dedicated entries.
|
|
778
890
|
*/
|
|
779
891
|
boxedIdentityMaterializer: (target) => {
|
|
780
|
-
const eligible = (target.kind === 'dictionary' ||
|
|
892
|
+
const eligible = (target.kind === 'dictionary' ||
|
|
893
|
+
target.kind === 'record-with-index' ||
|
|
894
|
+
target.kind === 'typed-array' ||
|
|
895
|
+
(target.kind === 'record' && target.accessors.length > 0)) &&
|
|
781
896
|
target.ownership === 'shared-refcount';
|
|
782
897
|
if (!eligible && target.kind !== 'array-buffer' && target.kind !== 'shared-array-buffer' && target.kind !== 'data-view')
|
|
783
898
|
return null;
|
|
@@ -786,7 +901,26 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
786
901
|
const domain = `boxed-identity:${representationKey(target)}`;
|
|
787
902
|
return {
|
|
788
903
|
classifier: { id: 'gea::Value::payloadType', domain },
|
|
789
|
-
materializer: {
|
|
904
|
+
materializer: {
|
|
905
|
+
id: 'gea::detail::unboxValue',
|
|
906
|
+
domain,
|
|
907
|
+
allocates: false,
|
|
908
|
+
wrapperKind: 'unbox-payload',
|
|
909
|
+
...((target.kind === 'typed-array' ||
|
|
910
|
+
target.kind === 'array-buffer' ||
|
|
911
|
+
target.kind === 'shared-array-buffer' ||
|
|
912
|
+
target.kind === 'data-view') &&
|
|
913
|
+
target.ownership === 'shared-refcount'
|
|
914
|
+
? { nativeFieldProtocol: 'unused', nativePayloadTransport: 'preserved' }
|
|
915
|
+
: {}),
|
|
916
|
+
...(target.kind === 'record' && target.accessors.length > 0
|
|
917
|
+
? {
|
|
918
|
+
nativeAccessorPayload: 'preserved',
|
|
919
|
+
nativeFieldProtocol: 'unused',
|
|
920
|
+
nativePayloadTransport: 'preserved'
|
|
921
|
+
}
|
|
922
|
+
: {})
|
|
923
|
+
}
|
|
790
924
|
};
|
|
791
925
|
},
|
|
792
926
|
dynamicPromiseAdoptionMaterializer: (target) => {
|
|
@@ -795,7 +929,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
795
929
|
const domain = `dynamic-promise-adoption:${representationKey(target)}`;
|
|
796
930
|
return {
|
|
797
931
|
classifier: { id: 'gea::detail::adoptBoxedPromise', domain },
|
|
798
|
-
materializer: { id: 'gea::detail::promiseFromDynamic', domain, allocates: true }
|
|
932
|
+
materializer: { id: 'gea::detail::promiseFromDynamic', domain, allocates: true, wrapperKind: 'promise-from-dynamic' }
|
|
799
933
|
};
|
|
800
934
|
},
|
|
801
935
|
dynamicMapViewMaterializer: (target) => {
|
|
@@ -817,7 +951,15 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
817
951
|
const domain = `record-payload:${shapeId}:${ownership}`;
|
|
818
952
|
return {
|
|
819
953
|
classifier: { id: 'gea::Value::payloadType', domain },
|
|
820
|
-
materializer: {
|
|
954
|
+
materializer: {
|
|
955
|
+
id: 'gea::detail::unboxValue',
|
|
956
|
+
domain,
|
|
957
|
+
allocates: false,
|
|
958
|
+
wrapperKind: 'unbox-payload',
|
|
959
|
+
nativeFieldProtocol: 'unused',
|
|
960
|
+
nativePayloadTransport: 'preserved',
|
|
961
|
+
...((layouts.accessorsForShape(shapeId)?.length ?? 0) > 0 ? { nativeAccessorPayload: 'preserved' } : {})
|
|
962
|
+
}
|
|
821
963
|
};
|
|
822
964
|
},
|
|
823
965
|
/**
|
|
@@ -876,6 +1018,10 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
876
1018
|
// checker-only semantic type into a fake runtime domain.
|
|
877
1019
|
taggedUnionArmClassifier: cppTaggedUnionArmClassifier,
|
|
878
1020
|
narrowing: (source, target) => {
|
|
1021
|
+
// An open Document accepts every native object arm. Its live alias
|
|
1022
|
+
// recipe must run before an exact-tag subset drops those objects.
|
|
1023
|
+
if (isOpenDocument(target) && documentViewable(source))
|
|
1024
|
+
return null;
|
|
879
1025
|
// Presence loads and native class casts below inspect tags/allocation
|
|
880
1026
|
// identity, never a property's reflection protocol. State that on the
|
|
881
1027
|
// installed materializer, where the implementation is known; the IR
|
|
@@ -936,6 +1082,17 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
936
1082
|
}
|
|
937
1083
|
};
|
|
938
1084
|
}
|
|
1085
|
+
// The same absent read of a cell whose own carrier encodes absence: a
|
|
1086
|
+
// shared class reference IS `C | null` (a null `shared_ptr`), so `let x:
|
|
1087
|
+
// C | null = null` read where the guard proved it holds nothing -- the
|
|
1088
|
+
// flow type is `null` -- answers the constant, exactly as the optional
|
|
1089
|
+
// pair above does.
|
|
1090
|
+
if (source.kind === 'class-ref' && source.ownership === 'shared-refcount' && target.kind === 'null') {
|
|
1091
|
+
return {
|
|
1092
|
+
classifier: { id: 'gea::Optional::has_value', domain: 'absent-class-ref:null' },
|
|
1093
|
+
materializer: { id: 'gea::constant', domain: 'absent-class-ref:null', allocates: false, nativeFieldProtocol: 'unused' }
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
939
1096
|
// A structural value read as an instance of a class nothing can
|
|
940
1097
|
// instantiate. No such instance exists, so a guard that narrowed to it --
|
|
941
1098
|
// `incoming instanceof Http2ServerRequest` -- never passes, and the
|
|
@@ -951,13 +1108,19 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
951
1108
|
const domain = `uninstantiable-class:${representationKey(target)}`;
|
|
952
1109
|
return {
|
|
953
1110
|
classifier: { id: 'gea::host::neverInstance', domain },
|
|
954
|
-
materializer: {
|
|
1111
|
+
materializer: {
|
|
1112
|
+
id: 'gea::host::unreachableValue',
|
|
1113
|
+
domain,
|
|
1114
|
+
allocates: false,
|
|
1115
|
+
nativeFieldProtocol: 'unused',
|
|
1116
|
+
normalCompletion: 'never'
|
|
1117
|
+
}
|
|
955
1118
|
};
|
|
956
1119
|
}
|
|
957
1120
|
// A shared structural view read as a class, under the `instanceof` that
|
|
958
1121
|
// proved it was built from one: the view remembers its origin
|
|
959
|
-
// (`gea::record::viewOrigin`) and
|
|
960
|
-
// class
|
|
1122
|
+
// (`gea::record::viewOrigin`) and authenticates that native allocation's
|
|
1123
|
+
// class layout. An optional view is the same read of its
|
|
961
1124
|
// payload, which the test proved present.
|
|
962
1125
|
// An open `any` document may view an instance too (`classDocumentViewText`).
|
|
963
1126
|
const sharedView = (value) => ((value.kind === 'record' || value.kind === 'record-with-index' || (value.kind === 'native-record-ref' && value.native === null)) &&
|
|
@@ -969,7 +1132,14 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
969
1132
|
const domain = `view-origin:${representationKey(target)}`;
|
|
970
1133
|
return {
|
|
971
1134
|
classifier: { id: 'gea::record::viewOriginIs', domain },
|
|
972
|
-
materializer: {
|
|
1135
|
+
materializer: {
|
|
1136
|
+
id: 'gea::record::viewOrigin',
|
|
1137
|
+
domain,
|
|
1138
|
+
allocates: false,
|
|
1139
|
+
nativeFieldProtocol: 'unused',
|
|
1140
|
+
requiresSourceGuard: true,
|
|
1141
|
+
executesSourceGuard: true
|
|
1142
|
+
}
|
|
973
1143
|
};
|
|
974
1144
|
}
|
|
975
1145
|
// A base class-ref read at a descendant -- see `downcastsToDerived` above.
|
|
@@ -983,14 +1153,15 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
983
1153
|
id: 'gea::host::downcastClassRef',
|
|
984
1154
|
domain: `class-descendant:${representationKey(target)}`,
|
|
985
1155
|
allocates: false,
|
|
1156
|
+
requiresSourceGuard: true,
|
|
986
1157
|
nativeFieldProtocol: 'unused',
|
|
987
1158
|
nativePayloadTransport: 'preserved',
|
|
988
1159
|
...nativeClassReferenceIdentityOf(source, target)
|
|
989
1160
|
}
|
|
990
1161
|
};
|
|
991
1162
|
}
|
|
992
|
-
// The same handle read at a UNION of descendants -- `object instanceof
|
|
993
|
-
// || object instanceof
|
|
1163
|
+
// The same handle read at a UNION of descendants -- `object instanceof A
|
|
1164
|
+
// || object instanceof B || object instanceof C`. The physical
|
|
994
1165
|
// carrier stays one `Ref<Base>`; allocation identity is the discriminant,
|
|
995
1166
|
// so the classifier is the same family test and the materializer the same
|
|
996
1167
|
// checked downcast, applied per arm by `emit-narrowing.ts`'s
|
|
@@ -1003,6 +1174,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1003
1174
|
id: 'gea::host::downcastClassRef',
|
|
1004
1175
|
domain: `class-descendant-union:${representationKey(target)}`,
|
|
1005
1176
|
allocates: false,
|
|
1177
|
+
requiresSourceGuard: true,
|
|
1006
1178
|
nativeFieldProtocol: 'unused',
|
|
1007
1179
|
// Each arm is `ofArm<I>(downcastClassRef<D>(held))`: one pointee,
|
|
1008
1180
|
// injected into the target union (and its optional, if any).
|
|
@@ -1029,9 +1201,10 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1029
1201
|
id: 'gea::host::downcastClassRef',
|
|
1030
1202
|
domain: `class-descendant-sum:${representationKey(target)}`,
|
|
1031
1203
|
allocates: false,
|
|
1204
|
+
requiresSourceGuard: true,
|
|
1032
1205
|
// Presence and sum selection over native class handles never reads
|
|
1033
1206
|
// field values. Mixed sums retain their general converting protocol.
|
|
1034
|
-
// A mixed sum (`Error |
|
|
1207
|
+
// A mixed sum (`Error | CustomError` narrowed by `instanceof`) composes
|
|
1035
1208
|
// its leaves' contracts, as the exact-arm narrowing below does.
|
|
1036
1209
|
...(nativeClassPresence(source)
|
|
1037
1210
|
? { nativeFieldProtocol: 'unused', ...nativeClassReferenceIdentityOf(source, target) }
|
|
@@ -1086,6 +1259,9 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1086
1259
|
downcastsToDerived(candidate.value, arm.value)));
|
|
1087
1260
|
if (!installed)
|
|
1088
1261
|
return null;
|
|
1262
|
+
const selection = nativeSubsetSelectionRecipeOf(source, target);
|
|
1263
|
+
if (selection)
|
|
1264
|
+
return nativeSelectionConversion(source, target, selection);
|
|
1089
1265
|
return {
|
|
1090
1266
|
classifier: { id: 'gea::TaggedUnion::is', domain: `live-arm-subset:${targetKey}` },
|
|
1091
1267
|
materializer: {
|
|
@@ -1098,6 +1274,18 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1098
1274
|
}
|
|
1099
1275
|
};
|
|
1100
1276
|
}
|
|
1277
|
+
// The same admitted tag selection can load one exact opaque record arm.
|
|
1278
|
+
// It rejects every omitted tag; composing a possible structural rebuild
|
|
1279
|
+
// from those tags would lose the selected allocation's storage identity.
|
|
1280
|
+
// Only a structural target can be reached by a rebuild of another arm; a
|
|
1281
|
+
// guard-proven load of any other arm keeps the unchecked `get<k>()`
|
|
1282
|
+
// below, and an `as` assertion takes `assertedUnionFor`'s checked
|
|
1283
|
+
// projection instead.
|
|
1284
|
+
const exactSelection = isRecordViewTarget(selected) || selected.kind === 'record-with-index' || selected.kind === 'dictionary'
|
|
1285
|
+
? nativeSubsetSelectionRecipeOf(source, target)
|
|
1286
|
+
: null;
|
|
1287
|
+
if (exactSelection)
|
|
1288
|
+
return nativeSelectionConversion(source, target, exactSelection);
|
|
1101
1289
|
// A target OPTIONAL whose payload is one of the union's arms, where the
|
|
1102
1290
|
// union carries no bare absent arm at all -- absence living inside another
|
|
1103
1291
|
// arm's own optional. `emit-narrowing.ts`'s `narrowedLoadText` renders the
|
|
@@ -1109,13 +1297,14 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1109
1297
|
id: 'gea::TaggedUnion::get',
|
|
1110
1298
|
domain: `live-arm-optional:${targetKey}`,
|
|
1111
1299
|
allocates: false,
|
|
1300
|
+
armSelection: 'guarded-load',
|
|
1112
1301
|
...nativeNarrowing(source, target)
|
|
1113
1302
|
}
|
|
1114
1303
|
};
|
|
1115
1304
|
}
|
|
1116
1305
|
if (!union.arms.some((arm) => representationKey(arm.value) === targetKey)) {
|
|
1117
1306
|
// An arm the target lives INSIDE, not one that equals it. A narrowing
|
|
1118
|
-
// does not stop at the top level:
|
|
1307
|
+
// does not stop at the top level: a `?(string|number|boolean)`
|
|
1119
1308
|
// field is `undefined | null | (string|number|boolean)`, and a guard past
|
|
1120
1309
|
// the two absences lands on one of the inner arms -- two steps, and this
|
|
1121
1310
|
// test saw only one. `narrowingReachesTarget` (`conversion/build.ts`) is
|
|
@@ -1131,13 +1320,20 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1131
1320
|
id: 'gea::TaggedUnion::get',
|
|
1132
1321
|
domain: `live-arm-nested:${targetKey}`,
|
|
1133
1322
|
allocates: false,
|
|
1323
|
+
armSelection: 'guarded-load',
|
|
1134
1324
|
...nativeNarrowing(source, target)
|
|
1135
1325
|
}
|
|
1136
1326
|
};
|
|
1137
1327
|
}
|
|
1138
1328
|
return {
|
|
1139
1329
|
classifier: { id: 'gea::TaggedUnion::is', domain: `live-arm:${targetKey}` },
|
|
1140
|
-
materializer: {
|
|
1330
|
+
materializer: {
|
|
1331
|
+
id: 'gea::TaggedUnion::get',
|
|
1332
|
+
domain: `live-arm:${targetKey}`,
|
|
1333
|
+
allocates: false,
|
|
1334
|
+
armSelection: 'guarded-load',
|
|
1335
|
+
...nativeNarrowing(source, target)
|
|
1336
|
+
}
|
|
1141
1337
|
};
|
|
1142
1338
|
},
|
|
1143
1339
|
// The mirror of `narrowing`: a plain value taking the place of the tagged
|
|
@@ -1152,6 +1348,19 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1152
1348
|
widening: (source, target) => {
|
|
1153
1349
|
if (!isSpellable(target))
|
|
1154
1350
|
return null;
|
|
1351
|
+
const nativeAbsence = nativeReferenceAbsenceOf(source, target);
|
|
1352
|
+
if (nativeAbsence !== null)
|
|
1353
|
+
return {
|
|
1354
|
+
classifier: { id: NATIVE_REFERENCE_ABSENCE, domain: `absence:${nativeAbsence}` },
|
|
1355
|
+
materializer: {
|
|
1356
|
+
id: NATIVE_REFERENCE_ABSENCE,
|
|
1357
|
+
domain: `absence:${nativeAbsence}`,
|
|
1358
|
+
allocates: false,
|
|
1359
|
+
nativeFieldProtocol: 'unused',
|
|
1360
|
+
nativePayloadTransport: 'preserved',
|
|
1361
|
+
...nativeClassReferenceIdentityOf(source, target)
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1155
1364
|
const nativeSum = nativeSumConversion(source, target);
|
|
1156
1365
|
if (nativeSum)
|
|
1157
1366
|
return nativeSum;
|
|
@@ -1178,7 +1387,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1178
1387
|
if (source.kind === 'dynamic' &&
|
|
1179
1388
|
source.reason === 'untyped-callable' &&
|
|
1180
1389
|
target.kind === 'function-value-dispatch' &&
|
|
1181
|
-
|
|
1390
|
+
dynamicCallableReadAbiSupported(target.abi)) {
|
|
1182
1391
|
return dynamicCallablePair(target);
|
|
1183
1392
|
}
|
|
1184
1393
|
// A callable declaring a type-matching PREFIX of the target's own
|
|
@@ -1390,6 +1599,10 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1390
1599
|
id: 'gea::Value::box',
|
|
1391
1600
|
domain: `box:${tag}`,
|
|
1392
1601
|
allocates: !absent,
|
|
1602
|
+
...(['scalar', 'string', 'symbol', 'null', 'undefined'].includes(source.kind)
|
|
1603
|
+
? { primitiveIdentityTransport: 'preserved' }
|
|
1604
|
+
: {}),
|
|
1605
|
+
...(callableObjectAbi(source) === null ? {} : { callableIdentityTransport: 'preserved' }),
|
|
1393
1606
|
...(absent ? { nativeFieldProtocol: 'unused' } : {})
|
|
1394
1607
|
}
|
|
1395
1608
|
};
|
|
@@ -1411,6 +1624,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1411
1624
|
domain: `absence:${target.absence}`,
|
|
1412
1625
|
allocates: false,
|
|
1413
1626
|
nativeFieldProtocol: 'unused',
|
|
1627
|
+
nativePayloadTransport: 'preserved',
|
|
1414
1628
|
...nativeClassReferenceIdentityOf(source, target)
|
|
1415
1629
|
}
|
|
1416
1630
|
};
|
|
@@ -1484,6 +1698,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1484
1698
|
domain: `payload:${sourceKey}`,
|
|
1485
1699
|
allocates: false,
|
|
1486
1700
|
nativeFieldProtocol: 'unused',
|
|
1701
|
+
nativePayloadTransport: 'preserved',
|
|
1487
1702
|
...nativeClassReferenceIdentityOf(source, target)
|
|
1488
1703
|
}
|
|
1489
1704
|
};
|
|
@@ -1492,8 +1707,8 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1492
1707
|
// `gea::CallableObject` converting constructors above. Every one of those
|
|
1493
1708
|
// was installed only for a BARE callable target, so
|
|
1494
1709
|
// `((gl, v) => void)` returned where `((gl, v, textures) => void) |
|
|
1495
|
-
// undefined` is expected --
|
|
1496
|
-
// exactly that shape -- refused for a pair whose two halves this backend
|
|
1710
|
+
// undefined` is expected -- a setter-selecting function with many returns
|
|
1711
|
+
// of exactly that shape -- refused for a pair whose two halves this backend
|
|
1497
1712
|
// performs individually. The same four authorities are asked here, one
|
|
1498
1713
|
// optional layer down, so the graph and the emitter cannot disagree about
|
|
1499
1714
|
// which pairs the runtime accepts.
|
|
@@ -1595,9 +1810,9 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1595
1810
|
};
|
|
1596
1811
|
}
|
|
1597
1812
|
// A hand-written iterator object read as the cursor its declared type
|
|
1598
|
-
// names --
|
|
1599
|
-
// `
|
|
1600
|
-
//
|
|
1813
|
+
// names -- an object literal whose `[Symbol.asyncIterator]()` does
|
|
1814
|
+
// `return this` (`conversion/protocol-iterator.ts`), held by a field
|
|
1815
|
+
// declared `AsyncGenerator<T> | null`.
|
|
1601
1816
|
const cursor = target.kind === 'optional' ? target.payload : target;
|
|
1602
1817
|
if ((cursor.kind === 'iterator' || cursor.kind === 'async-generator') && protocolIteratorPlanFor(layouts, source, cursor) !== null) {
|
|
1603
1818
|
const domain = `protocol-iterator:${representationKey(source)}->${representationKey(target)}`;
|
|
@@ -1607,8 +1822,8 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1607
1822
|
};
|
|
1608
1823
|
}
|
|
1609
1824
|
// The reverse: a native cursor read as the iterator OBJECT an interface
|
|
1610
|
-
// declares --
|
|
1611
|
-
//
|
|
1825
|
+
// declares -- a subclass's `keys(): IterableIterator<K> { return
|
|
1826
|
+
// super.keys() as IterableIterator<K> }`
|
|
1612
1827
|
// over a generator-backed `URLSearchParams.keys()`
|
|
1613
1828
|
// (`conversion/iterator-object-view.ts`).
|
|
1614
1829
|
// `x.constructor` stored where a constructor family is declared
|
|
@@ -1658,7 +1873,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1658
1873
|
}
|
|
1659
1874
|
// Built on demand, never up front: this function is asked about EVERY
|
|
1660
1875
|
// ordered pair of recastable carriers (`conversion/build.ts`), hundreds
|
|
1661
|
-
// of millions on
|
|
1876
|
+
// of millions on a large program, and almost every pair leaves
|
|
1662
1877
|
// through an early `null` without ever needing its key. Concatenating
|
|
1663
1878
|
// it first was one string allocation per pair and a collector busy
|
|
1664
1879
|
// reclaiming them -- the same cost `build.ts`'s own loop already paid once.
|
|
@@ -1672,7 +1887,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1672
1887
|
source.native !== null &&
|
|
1673
1888
|
source.native === target.native &&
|
|
1674
1889
|
source.ownership === target.ownership &&
|
|
1675
|
-
|
|
1890
|
+
samePhysicalCarrier(source, target)) {
|
|
1676
1891
|
return {
|
|
1677
1892
|
classifier: { id: 'gea::native-record::identity', domain: `native-identity:${source.native}:${source.ownership}` },
|
|
1678
1893
|
materializer: {
|
|
@@ -1703,10 +1918,10 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1703
1918
|
};
|
|
1704
1919
|
}
|
|
1705
1920
|
// The plain array and the array an interface extended with typed fields
|
|
1706
|
-
// (`
|
|
1921
|
+
// (`List<T> extends ReadonlyArray<T>`, `array-object.extension`) are
|
|
1707
1922
|
// ONE `gea::ArrayObject<E>`: the fields live in the object's own
|
|
1708
|
-
// extension sidecar, so `elements.slice() as
|
|
1709
|
-
// same object gaining fields on their first write, and a `
|
|
1923
|
+
// extension sidecar, so `elements.slice() as MutableList<T>` is the
|
|
1924
|
+
// same object gaining fields on their first write, and a `List<T>`
|
|
1710
1925
|
// handed to a `readonly T[]` parameter is that object read as the array
|
|
1711
1926
|
// it is. Same element, same ownership, and only the extension differs;
|
|
1712
1927
|
// the identity spelling `convertedValueText` already renders for two
|
|
@@ -1718,13 +1933,20 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1718
1933
|
arrayExtensionKey(source.extension) !== arrayExtensionKey(target.extension)) {
|
|
1719
1934
|
return {
|
|
1720
1935
|
classifier: { id: 'gea::ArrayObject::identity', domain: `array-extension:${pairKey()}` },
|
|
1721
|
-
|
|
1936
|
+
// The extension is a typed native sidecar struct, never the field
|
|
1937
|
+
// protocol: the elements and the fields cross unchanged.
|
|
1938
|
+
materializer: {
|
|
1939
|
+
id: 'gea::ArrayObject::identity',
|
|
1940
|
+
domain: `array-extension:${pairKey()}`,
|
|
1941
|
+
allocates: false,
|
|
1942
|
+
nativeFieldProtocol: 'unused',
|
|
1943
|
+
nativePayloadTransport: 'preserved'
|
|
1944
|
+
}
|
|
1722
1945
|
};
|
|
1723
1946
|
}
|
|
1724
|
-
// `never[]` into `E[]`: THE empty array of `E`, by identity.
|
|
1725
|
-
// `emptyArray: never[]` is a sentinel
|
|
1726
|
-
// (
|
|
1727
|
-
// progress; `=== emptyArray` detects it), so a fresh `[]` is a silently
|
|
1947
|
+
// `never[]` into `E[]`: THE empty array of `E`, by identity. A shared
|
|
1948
|
+
// `emptyArray: never[]` is a sentinel a program can compare by identity
|
|
1949
|
+
// (storing it marks a state; `=== emptyArray` detects it), so a fresh `[]` is a silently
|
|
1728
1950
|
// wrong answer and a boxed one a refusal; `gea::emptyArraySentinel<E>()`
|
|
1729
1951
|
// is one object per element type, so every `never[]` that reaches an
|
|
1730
1952
|
// `E[]` slot is the same one and compares equal to itself. The carrier
|
|
@@ -1751,10 +1973,9 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1751
1973
|
// can still reach is a mutable reference, so a fresh array silently drops
|
|
1752
1974
|
// every later write through the other name and loses identity outright.
|
|
1753
1975
|
// `gea::ArrayObject::recastElements` did exactly that at a call argument
|
|
1754
|
-
//
|
|
1755
|
-
//
|
|
1756
|
-
//
|
|
1757
|
-
// rectangle. A compile refusal is the correct outcome here, and the fix
|
|
1976
|
+
// where two helpers pushed their values into the COPY, so every key the
|
|
1977
|
+
// caller built from the array came out identical and every cache lookup
|
|
1978
|
+
// keyed on it collided -- silently wrong output. A compile refusal is the correct outcome here, and the fix
|
|
1758
1979
|
// for a disagreement is to make the two authorities agree -- which is
|
|
1759
1980
|
// where `structural-array-element.ts`'s `unstatedNeverArray` parameter
|
|
1760
1981
|
// form and `structural.ts`'s `refusedArrayParameterTypeAt` now put it.
|
|
@@ -1840,11 +2061,11 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1840
2061
|
// the view remembers boxed is read back only by `instanceof` and
|
|
1841
2062
|
// by the `gea::record::viewOrigin` narrowing to the class, never by
|
|
1842
2063
|
// program code that could write through it. Without it
|
|
1843
|
-
// the reflection census read
|
|
1844
|
-
//
|
|
2064
|
+
// the reflection census read an `emitter as unknown as
|
|
2065
|
+
// SomeMethodsInterface` cast as an unknown boundary, promoted every
|
|
1845
2066
|
// emitter subclass and everything their fields reach to full
|
|
1846
|
-
// reflection, and refused each `this.method.bind(this)` in
|
|
1847
|
-
// as `call-abi:bind-shadowable`.
|
|
2067
|
+
// reflection, and refused each `this.method.bind(this)` in those
|
|
2068
|
+
// subclasses as `call-abi:bind-shadowable`.
|
|
1848
2069
|
const plan = conversionRecipeOf(source, target)?.renders === true ? null : viewPlanFor(layouts, source, target);
|
|
1849
2070
|
return {
|
|
1850
2071
|
classifier: { id: 'gea::record::classStructuralView', domain: `class-view:${pairKey()}` },
|
|
@@ -1865,8 +2086,8 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1865
2086
|
// `emit-narrowing.ts`'s `convertedValueText` renders it; installed here so
|
|
1866
2087
|
// the merge that needs it is certified rather than emitted uncertified.
|
|
1867
2088
|
// The same for an open record whose every declared field is optional:
|
|
1868
|
-
//
|
|
1869
|
-
//
|
|
2089
|
+
// `f(filter: Filter<T> = {})` defaults an all-optional parameter to the
|
|
2090
|
+
// empty literal, and the value-initialized struct IS that
|
|
1870
2091
|
// object -- every presence bit off, an empty index sidecar.
|
|
1871
2092
|
if (source.kind === 'record' &&
|
|
1872
2093
|
source.fields.length === 0 &&
|
|
@@ -1879,7 +2100,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1879
2100
|
}
|
|
1880
2101
|
if (source.kind === 'record-with-index' && target.kind === 'native-record-ref' && target.native === null) {
|
|
1881
2102
|
const targetFields = layouts.forShape(target.shapeId);
|
|
1882
|
-
const targetIndexes = layouts.indexesForShape
|
|
2103
|
+
const targetIndexes = layouts.indexesForShape(target.shapeId);
|
|
1883
2104
|
const sourceFields = {
|
|
1884
2105
|
kind: 'record',
|
|
1885
2106
|
shapeId: source.shapeId,
|
|
@@ -1911,8 +2132,9 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1911
2132
|
// A closed named interface may receive an open record at runtime even
|
|
1912
2133
|
// though the interface itself declares no index signature. TypeScript's
|
|
1913
2134
|
// structural assignment permits that value, and JavaScript keeps the
|
|
1914
|
-
// extra own properties:
|
|
1915
|
-
//
|
|
2135
|
+
// extra own properties: `Object.assign(o, this.fields)` returned as a
|
|
2136
|
+
// closed interface still carries user fields that must enumerate and
|
|
2137
|
+
// serialize.
|
|
1916
2138
|
//
|
|
1917
2139
|
// The target does not need an inline index member. Every shared native
|
|
1918
2140
|
// record already has the identity-keyed expando table implemented by
|
|
@@ -1938,10 +2160,10 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1938
2160
|
};
|
|
1939
2161
|
}
|
|
1940
2162
|
}
|
|
1941
|
-
// A class viewed as a record of its own properties:
|
|
1942
|
-
// `
|
|
1943
|
-
// `{
|
|
1944
|
-
//
|
|
2163
|
+
// A class viewed as a record of its own properties: a helper takes the
|
|
2164
|
+
// class itself as `{ tags?: Set<symbol> }` and writes a static, and an
|
|
2165
|
+
// instance method reads `(this.constructor as { tags?: Set<symbol> }).tags`.
|
|
2166
|
+
// The view is
|
|
1945
2167
|
// the class evaluation's own record for the shape, so a write through one
|
|
1946
2168
|
// view is every later view's read (`gea::constructorStaticView`).
|
|
1947
2169
|
if (constructorStaticViewAdmitted(source, target, target.kind === 'native-record-ref' ? layouts.forShape(target.shapeId) : null)) {
|
|
@@ -1950,23 +2172,16 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1950
2172
|
materializer: { id: CONSTRUCTOR_STATIC_VIEW, domain: `constructor-view:${pairKey()}`, allocates: true }
|
|
1951
2173
|
};
|
|
1952
2174
|
}
|
|
1953
|
-
//
|
|
1954
|
-
//
|
|
1955
|
-
// `ErrorDescription`. The same checked rebuild `dictionary-to-record`
|
|
1956
|
-
// performs for an anonymous record, over the layout the name resolves to;
|
|
1957
|
-
// a string index sidecar of `any` keeps every key the fields do not name.
|
|
1958
|
-
// `emit-narrowing.ts`'s `documentAdoptionText` renders it, and the
|
|
1959
|
-
// Document then views the record rather than leaving a copy beside it.
|
|
1960
|
-
// `DbOptions` in mongodb's `new Db(client, name, options?)` is the
|
|
1961
|
-
// optional case: `filterOptions` returns a Document.
|
|
2175
|
+
// The provisional layout pair is sealed into exact deferred field routes
|
|
2176
|
+
// by structuralRecipe; no shared document migration is rendered here.
|
|
1962
2177
|
const named = target.kind === 'optional' ? target.payload : target;
|
|
1963
|
-
// Lifted through an optional of the same absence:
|
|
1964
|
-
//
|
|
1965
|
-
// `
|
|
2178
|
+
// Lifted through an optional of the same absence: `items.find((o:
|
|
2179
|
+
// Document) => o.flag)` answers `Document | undefined` where a named
|
|
2180
|
+
// `Item | undefined` is carried.
|
|
1966
2181
|
const document = source.kind === 'optional' && target.kind === 'optional' && source.absence === target.absence ? source.payload : source;
|
|
1967
2182
|
if (document.kind === 'dictionary' &&
|
|
1968
2183
|
named.kind === 'native-record-ref' &&
|
|
1969
|
-
dynamicDictionaryToNamedRecordAdmitted(document, named, layouts.forShape(named.shapeId), layouts.indexesForShape
|
|
2184
|
+
dynamicDictionaryToNamedRecordAdmitted(document, named, layouts.forShape(named.shapeId), layouts.indexesForShape(named.shapeId))) {
|
|
1970
2185
|
return {
|
|
1971
2186
|
classifier: { id: DYNAMIC_DICTIONARY_TO_NAMED_RECORD, domain: `dictionary-record:${pairKey()}` },
|
|
1972
2187
|
materializer: { id: DYNAMIC_DICTIONARY_TO_NAMED_RECORD, domain: `dictionary-record:${pairKey()}`, allocates: true }
|
|
@@ -1994,8 +2209,8 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
1994
2209
|
}
|
|
1995
2210
|
// The arm the value belongs in, written as a DIFFERENT shape id than the
|
|
1996
2211
|
// arm declares. A tuple literal returned into a union of tuple types is
|
|
1997
|
-
// the case --
|
|
1998
|
-
// `Result<T> = [[T,
|
|
2212
|
+
// the case -- a method writes `[items]` against
|
|
2213
|
+
// `Result<T> = [[T, A][]] | [[T, B][], C]` --
|
|
1999
2214
|
// and an exact-key search cannot see it, because the literal's own shape
|
|
2000
2215
|
// id is minted at the literal and the arm's at the declaration. It is
|
|
2001
2216
|
// still the same shape: `recordsRecastable` is the one authority on that,
|
|
@@ -2019,24 +2234,6 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
2019
2234
|
}
|
|
2020
2235
|
};
|
|
2021
2236
|
}
|
|
2022
|
-
// The same admission for a dictionary whose values widen into ONE
|
|
2023
|
-
// dictionary arm of the union -- the string dictionary `@hono/node-server`
|
|
2024
|
-
// merges into `[string, string][] | OutgoingHttpHeaders`. Only a SOLE
|
|
2025
|
-
// castable arm, for the same reason as the record rule: two would make
|
|
2026
|
-
// the choice of arm a guess. `emit-narrowing.ts`'s `widenedStoreText`
|
|
2027
|
-
// renders it through `recastedDictionaryText` at the arm it finds first,
|
|
2028
|
-
// which under this admission is the only one.
|
|
2029
|
-
if (source.kind === 'dictionary' && target.kind === 'tagged-union') {
|
|
2030
|
-
const recastable = target.arms
|
|
2031
|
-
.map((arm) => arm.value)
|
|
2032
|
-
.filter((arm) => arm.kind === 'dictionary' && dictionaryCastableToDictionary(source, arm));
|
|
2033
|
-
if (recastable.length !== 1)
|
|
2034
|
-
return null;
|
|
2035
|
-
return {
|
|
2036
|
-
classifier: { id: 'gea::TaggedUnion::ofArm', domain: `arm-recast:${pairKey()}` },
|
|
2037
|
-
materializer: { id: 'gea::TaggedUnion::ofArm', domain: `arm-recast:${pairKey()}`, allocates: true, nativeFieldProtocol: 'unused' }
|
|
2038
|
-
};
|
|
2039
|
-
}
|
|
2040
2237
|
if (source.kind === 'record' && target.kind === 'record') {
|
|
2041
2238
|
if (!recordsRecastable(source, target))
|
|
2042
2239
|
return null;
|
|
@@ -2065,10 +2262,10 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
2065
2262
|
// `emit-narrowing.ts`'s `recordCastableToDictionary` is the one authority
|
|
2066
2263
|
// for which pairs actually rebuild, asked here rather than restated.
|
|
2067
2264
|
// A named interface is the same closed field list, resolved through the
|
|
2068
|
-
// layout it names (`asRecord`):
|
|
2069
|
-
// to
|
|
2070
|
-
// A record that also carries an open string index --
|
|
2071
|
-
// `Filter<
|
|
2265
|
+
// layout it names (`asRecord`): a program builds a named interface value
|
|
2266
|
+
// and hands it to a parameter typed `Document`.
|
|
2267
|
+
// A record that also carries an open string index -- a mapped
|
|
2268
|
+
// `Filter<T>`, or a named interface whose layout declares one --
|
|
2072
2269
|
// poured into an open string dictionary, or into the ONE dictionary arm of
|
|
2073
2270
|
// a union (`Document | Document[]`): the named fields, then every
|
|
2074
2271
|
// enumerable index entry (`indexedRecordCastableToDictionary`). Ahead of
|
|
@@ -2104,31 +2301,12 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
2104
2301
|
materializer: { id: 'gea::record::recastToDictionary', domain: `recast:${pairKey()}`, allocates: true }
|
|
2105
2302
|
};
|
|
2106
2303
|
}
|
|
2107
|
-
//
|
|
2108
|
-
//
|
|
2109
|
-
//
|
|
2110
|
-
//
|
|
2111
|
-
if (source.kind === 'dictionary' && target.kind === 'dictionary')
|
|
2112
|
-
|
|
2113
|
-
return null;
|
|
2114
|
-
return {
|
|
2115
|
-
classifier: { id: 'gea::dictionary::recastValues', domain: `recast:${pairKey()}` },
|
|
2116
|
-
materializer: { id: 'gea::dictionary::recastValues', domain: `recast:${pairKey()}`, allocates: true }
|
|
2117
|
-
};
|
|
2118
|
-
}
|
|
2119
|
-
// A third recast at the same distance: a closed, contiguous-numeric-keyed
|
|
2120
|
-
// record -- an unannotated rest parameter's open-arity tuple view, from
|
|
2121
|
-
// `semantics/normalize/structural.ts`'s `restParameterArrayElementAt` --
|
|
2122
|
-
// poured into the array it physically is. `emit-narrowing.ts`'s
|
|
2123
|
-
// `recordCastableToArray` is the one authority for which pairs rebuild.
|
|
2124
|
-
if (source.kind === 'record' && target.kind === 'array-object') {
|
|
2125
|
-
if (!recordCastableToArray(source, target))
|
|
2126
|
-
return null;
|
|
2127
|
-
return {
|
|
2128
|
-
classifier: { id: 'gea::record::recastToArray', domain: `recast:${pairKey()}` },
|
|
2129
|
-
materializer: { id: 'gea::record::recastToArray', domain: `recast:${pairKey()}`, allocates: true }
|
|
2130
|
-
};
|
|
2131
|
-
}
|
|
2304
|
+
// Structural recipes publish live dictionary views with checked reads
|
|
2305
|
+
// and total writes. This widening table must not replace that shared
|
|
2306
|
+
// storage with an entry-by-entry copy. Exact identity and native-sum
|
|
2307
|
+
// transport are handled by their ordinary authorities.
|
|
2308
|
+
if (source.kind === 'dictionary' && target.kind === 'dictionary')
|
|
2309
|
+
return null;
|
|
2132
2310
|
// Two optionals over the IDENTICAL payload that disagree only on which
|
|
2133
2311
|
// falsy JS value spends the absence -- `string | null` widened into a
|
|
2134
2312
|
// `string | undefined` slot (`request.ts`'s `this.raw.headers.get(name) ??
|
|
@@ -2161,7 +2339,7 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
2161
2339
|
// The payload is a record recast one level in: `return toSearchResult(
|
|
2162
2340
|
// undefined)` where the copy at `T = undefined` returns `{ value:
|
|
2163
2341
|
// undefined } | undefined` into a slot declared `SearchResult<Resolved>`
|
|
2164
|
-
// (13 rows
|
|
2342
|
+
// (13 rows from one module). The bare pair is already
|
|
2165
2343
|
// admitted just below (`gea::record::recast`); the presence bit adds
|
|
2166
2344
|
// nothing to convert, only a branch to render, so the admission is the
|
|
2167
2345
|
// same question asked of the payloads. Same absence on both sides, as
|
|
@@ -2181,29 +2359,6 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
2181
2359
|
}
|
|
2182
2360
|
};
|
|
2183
2361
|
}
|
|
2184
|
-
// The payload is a dictionary reaching the one wider dictionary arm of
|
|
2185
|
-
// the target's union, still wrapped in its presence bit: `cache[2] ||
|
|
2186
|
-
// (... ? undefined : { 'content-type': ... })` merged as `optional(
|
|
2187
|
-
// dictionary(string, string))` into `optional([string, string][] |
|
|
2188
|
-
// OutgoingHttpHeaders)`. The bare pair is the arm-recast admission just
|
|
2189
|
-
// above; the presence bit adds only the branch `emit-narrowing.ts`'s
|
|
2190
|
-
// `optional-payload-convert` already renders around any converted
|
|
2191
|
-
// payload. Same absence on both sides, as for every optional pair here.
|
|
2192
|
-
const sourceDictionary = source.payload.kind === 'dictionary' ? source.payload : null;
|
|
2193
|
-
if (sourceDictionary !== null &&
|
|
2194
|
-
target.payload.kind === 'tagged-union' &&
|
|
2195
|
-
source.absence === target.absence &&
|
|
2196
|
-
target.payload.arms.filter((arm) => arm.value.kind === 'dictionary' && dictionaryCastableToDictionary(sourceDictionary, arm.value)).length === 1) {
|
|
2197
|
-
return {
|
|
2198
|
-
classifier: { id: 'gea::Optional::has_value', domain: `recast:${pairKey()}` },
|
|
2199
|
-
materializer: {
|
|
2200
|
-
id: 'gea::Optional::recastPayloadArm',
|
|
2201
|
-
domain: `recast:${pairKey()}`,
|
|
2202
|
-
allocates: true,
|
|
2203
|
-
nativeFieldProtocol: 'unused'
|
|
2204
|
-
}
|
|
2205
|
-
};
|
|
2206
|
-
}
|
|
2207
2362
|
// The payload itself is a union recast one level in -- `optional(string |
|
|
2208
2363
|
// boolean, undefined)` merged against `optional(boolean | string,
|
|
2209
2364
|
// undefined)`, the two branches of a control-flow merge each arriving
|
|
@@ -2235,9 +2390,9 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
2235
2390
|
}
|
|
2236
2391
|
// A sum every arm of which reaches ONE payload, wrapped in the presence
|
|
2237
2392
|
// bit: `fn === undefined ? node : fn(node, ...)` returned as `T |
|
|
2238
|
-
// undefined` from
|
|
2393
|
+
// undefined` from a generic visitor `visit<T>` -- `tagged-union(
|
|
2239
2394
|
// native-record-ref | dynamic)` into `optional(native-record-ref)`, 74
|
|
2240
|
-
// rows from one site
|
|
2395
|
+
// rows from one site, one per instantiation. The
|
|
2241
2396
|
// typed arm is the payload and the dynamic arm is the checked unbox, and
|
|
2242
2397
|
// `emit-narrowing.ts`'s `sumIntoPayloadText` is asked here so the pair is
|
|
2243
2398
|
// admitted on exactly the render that will spell it.
|
|
@@ -2285,27 +2440,265 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
2285
2440
|
domain: `coercion:${operation}:${representationKey(source)}`,
|
|
2286
2441
|
allocates: operation === 'ToString'
|
|
2287
2442
|
},
|
|
2288
|
-
|
|
2443
|
+
nativeArrayViewRecipe: (source, target, lookup, read, resolve) => {
|
|
2444
|
+
const base = nativeArrayViewBasePlanOf(source, target, lookup, read, resolve);
|
|
2445
|
+
if (base === null)
|
|
2446
|
+
return null;
|
|
2447
|
+
const observationTarget = { kind: 'dynamic', reason: 'declared-any-never-narrowed' };
|
|
2448
|
+
const observed = nativeArrayViewWithObservation(base, lookup(base.storage.element, observationTarget), resolve);
|
|
2449
|
+
const plan = observed !== null && source.kind === 'array-object' && observed.write.kind === 'conversion'
|
|
2450
|
+
? nativeArrayViewWithOwnerObservation(observed, lookup(observed.storage, observationTarget), resolve)
|
|
2451
|
+
: observed;
|
|
2452
|
+
if (plan === null)
|
|
2453
|
+
return null;
|
|
2454
|
+
// An open Document is checked as the object it views, exactly as a box is.
|
|
2455
|
+
const boxed = nativeArrayViewSourceIsBoxed(source);
|
|
2456
|
+
const domain = boxed
|
|
2457
|
+
? `any-of:array-payload:${representationKey(plan.storage)}|array-payload:${representationKey(plan.target)}`
|
|
2458
|
+
: `native-array-view:${representationKey(source)}->${representationKey(target)}`;
|
|
2459
|
+
return {
|
|
2460
|
+
classifier: { id: boxed ? 'gea::detail::nativeArrayViewAccepts' : 'gea::ArrayObject::identity', domain },
|
|
2461
|
+
materializer: {
|
|
2462
|
+
id: boxed ? 'gea::detail::checkedNativeArrayView' : 'gea::makeNativeArrayView',
|
|
2463
|
+
domain,
|
|
2464
|
+
allocates: true,
|
|
2465
|
+
nativeFieldProtocol: 'unused',
|
|
2466
|
+
nativePayloadTransport: 'preserved',
|
|
2467
|
+
...(boxed ? { requiresSourceGuard: true, executesSourceGuard: true } : {}),
|
|
2468
|
+
nativeArrayView: plan,
|
|
2469
|
+
dependencies: plan.dependencies
|
|
2470
|
+
}
|
|
2471
|
+
};
|
|
2472
|
+
},
|
|
2473
|
+
dictionaryReadRecipe: (conversion) => {
|
|
2474
|
+
const { source, target, capability } = conversion;
|
|
2475
|
+
if (capability.kind === 'atom' || capability.kind === 'static') {
|
|
2476
|
+
if (capability.materializer.documentRecordView !== undefined || capability.materializer.nativeArrayView !== undefined)
|
|
2477
|
+
return null;
|
|
2478
|
+
const selection = capability.materializer.nativeSelection;
|
|
2479
|
+
if (selection !== undefined)
|
|
2480
|
+
return {
|
|
2481
|
+
id: 'view:checked-dictionary-entry',
|
|
2482
|
+
domain: 'static:checked-dictionary-entry',
|
|
2483
|
+
allocates: false,
|
|
2484
|
+
requiresSourceGuard: true,
|
|
2485
|
+
executesSourceGuard: true,
|
|
2486
|
+
dictionaryRead: { kind: 'native-selection', conversion, selection },
|
|
2487
|
+
dependencies: [conversion]
|
|
2488
|
+
};
|
|
2489
|
+
}
|
|
2490
|
+
if (source.kind !== 'dynamic' || target.kind === 'dynamic')
|
|
2491
|
+
return null;
|
|
2492
|
+
if (target.kind === 'null' || target.kind === 'undefined')
|
|
2493
|
+
return {
|
|
2494
|
+
id: 'view:checked-dictionary-entry',
|
|
2495
|
+
domain: 'static:checked-dictionary-entry',
|
|
2496
|
+
allocates: false,
|
|
2497
|
+
requiresSourceGuard: true,
|
|
2498
|
+
executesSourceGuard: true,
|
|
2499
|
+
dictionaryRead: { kind: 'dynamic-absence', conversion, absence: target.kind },
|
|
2500
|
+
dependencies: [conversion]
|
|
2501
|
+
};
|
|
2502
|
+
if (target.kind === 'class-ref' && target.ownership === 'shared-refcount')
|
|
2503
|
+
return {
|
|
2504
|
+
id: 'view:checked-dictionary-entry',
|
|
2505
|
+
domain: 'static:checked-dictionary-entry',
|
|
2506
|
+
allocates: false,
|
|
2507
|
+
requiresSourceGuard: true,
|
|
2508
|
+
executesSourceGuard: true,
|
|
2509
|
+
dictionaryRead: { kind: 'dynamic-class', conversion, target },
|
|
2510
|
+
dependencies: [conversion]
|
|
2511
|
+
};
|
|
2512
|
+
// A construct-frame entry reads through its own adapter too: the exact
|
|
2513
|
+
// payload check below would refuse a constructor boxed at another frame.
|
|
2514
|
+
if (callableObjectAbi(target) !== null || target.kind === 'constructor-value-dispatch')
|
|
2515
|
+
return {
|
|
2516
|
+
id: 'view:checked-dictionary-entry',
|
|
2517
|
+
domain: 'static:checked-dictionary-entry',
|
|
2518
|
+
// The adapter may build a native frame around the same function.
|
|
2519
|
+
allocates: 'materializer' in capability && capability.materializer.allocates,
|
|
2520
|
+
requiresSourceGuard: true,
|
|
2521
|
+
executesSourceGuard: true,
|
|
2522
|
+
dictionaryRead: { kind: 'dynamic-callable', conversion },
|
|
2523
|
+
dependencies: [conversion]
|
|
2524
|
+
};
|
|
2525
|
+
const tag = dynamicTagFor(target);
|
|
2526
|
+
if (tag === null || target.kind === 'optional' || target.kind === 'record' || target.kind === 'record-with-index')
|
|
2527
|
+
return null;
|
|
2528
|
+
return {
|
|
2529
|
+
id: 'view:checked-dictionary-entry',
|
|
2530
|
+
domain: 'static:checked-dictionary-entry',
|
|
2531
|
+
allocates: false,
|
|
2532
|
+
requiresSourceGuard: true,
|
|
2533
|
+
executesSourceGuard: true,
|
|
2534
|
+
dictionaryRead: { kind: 'dynamic-payload', conversion, target, tag },
|
|
2535
|
+
dependencies: [conversion]
|
|
2536
|
+
};
|
|
2537
|
+
},
|
|
2538
|
+
readOnlyDictionaryRecipe: (source, target, lookup, resolve, read) => {
|
|
2539
|
+
const plan = composedDictionaryViewPlan(source, target, 'read-only', lookup, resolve, read);
|
|
2540
|
+
return plan === null
|
|
2541
|
+
? null
|
|
2542
|
+
: {
|
|
2543
|
+
id: 'view:read-only-dictionary',
|
|
2544
|
+
domain: 'static:read-only-dictionary',
|
|
2545
|
+
allocates: true,
|
|
2546
|
+
readOnlyDictionary: plan,
|
|
2547
|
+
dependencies: plan.dependencies
|
|
2548
|
+
};
|
|
2549
|
+
},
|
|
2550
|
+
structuralRecipe: (source, target, lookup, members, nativeMethod, resolve, dictionaryRead, classDowncast) => {
|
|
2289
2551
|
if (!isSpellable(source) || !isSpellable(target))
|
|
2290
2552
|
return null;
|
|
2291
2553
|
if (classArmWithoutHome(layouts, source, target))
|
|
2292
2554
|
return null;
|
|
2293
2555
|
if (proxyArmWithoutHome(source, target))
|
|
2294
2556
|
return null;
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
//
|
|
2301
|
-
|
|
2302
|
-
|
|
2557
|
+
const accepted = (from, into) => {
|
|
2558
|
+
const node = lookup(from, into);
|
|
2559
|
+
return node.capability.kind === 'never' ? null : node;
|
|
2560
|
+
};
|
|
2561
|
+
const nativeDependencies = (nodes) => [...recipeClosureOf(nodes, resolve).values()].every((node) => transfersNativeStorage(node.capability));
|
|
2562
|
+
// `writeDocumentNativeEntry` stores through `nativeDocumentSetNative`,
|
|
2563
|
+
// which checks an Array owner's element lane before an index store.
|
|
2564
|
+
const documentRecordView = composedDocumentRecordViewPlanOf(source, target, layouts, accepted, dictionaryRead ?? accepted, resolve, {
|
|
2565
|
+
laneChecked: true
|
|
2566
|
+
});
|
|
2567
|
+
if (documentRecordView !== null)
|
|
2568
|
+
return {
|
|
2569
|
+
id: 'view:document-record',
|
|
2570
|
+
domain: 'static:document-record',
|
|
2571
|
+
allocates: true,
|
|
2572
|
+
documentRecordView,
|
|
2573
|
+
nativeFieldViewProtocol: 'live',
|
|
2574
|
+
dependencies: documentRecordView.dependencies
|
|
2575
|
+
};
|
|
2576
|
+
const dictionaryView = composedDictionaryViewPlan(source, target, 'mutable', accepted, resolve, dictionaryRead);
|
|
2577
|
+
if (dictionaryView !== null)
|
|
2303
2578
|
return {
|
|
2304
|
-
id: 'view:
|
|
2305
|
-
domain: 'static:
|
|
2579
|
+
id: 'view:mutable-dictionary',
|
|
2580
|
+
domain: 'static:mutable-dictionary',
|
|
2306
2581
|
allocates: true,
|
|
2307
|
-
|
|
2582
|
+
dictionaryView,
|
|
2583
|
+
dependencies: dictionaryView.dependencies
|
|
2308
2584
|
};
|
|
2585
|
+
const callablePayload = callablePayloadPlan(source, target, accepted, resolve);
|
|
2586
|
+
if (callablePayload !== null)
|
|
2587
|
+
return {
|
|
2588
|
+
id: 'view:callable-payload',
|
|
2589
|
+
domain: 'static:callable-payload',
|
|
2590
|
+
allocates: true,
|
|
2591
|
+
callablePayload,
|
|
2592
|
+
dependencies: [callablePayload.payload],
|
|
2593
|
+
...(nativeDependencies([callablePayload.payload]) ? { nativeFieldProtocol: 'unused' } : {}),
|
|
2594
|
+
...(callablePayload.mode === 'unwrap' ? { requiresSourceGuard: true, executesSourceGuard: true } : {})
|
|
2595
|
+
};
|
|
2596
|
+
if (source.kind === 'record' && target.kind === 'array-object') {
|
|
2597
|
+
const plan = recordToArrayPlan(source, target, accepted);
|
|
2598
|
+
return plan === null
|
|
2599
|
+
? null
|
|
2600
|
+
: {
|
|
2601
|
+
id: 'gea::record::recastToArray',
|
|
2602
|
+
domain: `recast:${representationKey(source)}->${representationKey(target)}`,
|
|
2603
|
+
allocates: true,
|
|
2604
|
+
recordToArray: plan,
|
|
2605
|
+
...sourceGuardsOf(plan.fields.map((field) => field.conversion), resolve)
|
|
2606
|
+
};
|
|
2607
|
+
}
|
|
2608
|
+
if (source.kind === 'promise' && target.kind === 'promise') {
|
|
2609
|
+
const plan = promiseAdoptionPlanOf(source, target, lookup, resolve);
|
|
2610
|
+
return plan === null
|
|
2611
|
+
? null
|
|
2612
|
+
: {
|
|
2613
|
+
id: 'gea::Promise::adopt-converted',
|
|
2614
|
+
domain: `promise-state-adoption:${representationKey(source)}->${representationKey(target)}`,
|
|
2615
|
+
allocates: true,
|
|
2616
|
+
promiseAdoption: plan,
|
|
2617
|
+
...(plan.kind === 'payload-transfer' ? { dependencies: [plan.conversion] } : {})
|
|
2618
|
+
};
|
|
2619
|
+
}
|
|
2620
|
+
const protocol = certifiedProtocolIteratorPlan(layouts, source, target, accepted, resolve);
|
|
2621
|
+
if (protocol !== null)
|
|
2622
|
+
return {
|
|
2623
|
+
id: PROTOCOL_ITERATOR,
|
|
2624
|
+
domain: `protocol-iterator:${representationKey(source)}->${representationKey(target)}`,
|
|
2625
|
+
allocates: true,
|
|
2626
|
+
protocolIterator: protocol,
|
|
2627
|
+
dependencies: [...protocol.leaves.values()]
|
|
2628
|
+
};
|
|
2629
|
+
if (source.kind === 'array-object' || source.kind === 'keyed-collection') {
|
|
2630
|
+
const plan = certifiedIterableObjectViewPlan(layouts, source, target, accepted, resolve);
|
|
2631
|
+
if (plan !== null)
|
|
2632
|
+
return {
|
|
2633
|
+
id: ITERABLE_OBJECT_VIEW,
|
|
2634
|
+
domain: `iterable-object-view:${representationKey(source)}->${representationKey(target)}`,
|
|
2635
|
+
allocates: true,
|
|
2636
|
+
iterableObjectView: plan,
|
|
2637
|
+
dependencies: [...plan.leaves.values()]
|
|
2638
|
+
};
|
|
2639
|
+
}
|
|
2640
|
+
if (source.kind === 'iterator' || source.kind === 'async-generator') {
|
|
2641
|
+
const plan = certifiedIteratorObjectViewPlan(layouts, source, target, accepted, resolve);
|
|
2642
|
+
if (plan !== null)
|
|
2643
|
+
return {
|
|
2644
|
+
id: ITERATOR_OBJECT_VIEW,
|
|
2645
|
+
domain: `iterator-object-view:${representationKey(source)}->${representationKey(target)}`,
|
|
2646
|
+
allocates: true,
|
|
2647
|
+
iteratorObjectView: plan,
|
|
2648
|
+
dependencies: [...plan.leaves.values()]
|
|
2649
|
+
};
|
|
2650
|
+
}
|
|
2651
|
+
const sourceCallable = callableObjectAbi(source);
|
|
2652
|
+
const targetCallable = callableObjectAbi(target);
|
|
2653
|
+
if (sourceCallable !== null && targetCallable !== null) {
|
|
2654
|
+
const plan = callableViewPlan(source, target, accepted, resolve, classDowncast);
|
|
2655
|
+
if (plan !== null) {
|
|
2656
|
+
const dependencies = [
|
|
2657
|
+
...(plan.logicalReceiver?.materializers ?? []),
|
|
2658
|
+
...(plan.receiver === null ? [] : [plan.receiver]),
|
|
2659
|
+
...plan.parameters,
|
|
2660
|
+
...(plan.omittedArguments ?? []),
|
|
2661
|
+
...(plan.restPacking?.elements ?? []),
|
|
2662
|
+
...(plan.restUnpacking?.elements.flatMap((element) => element.absent === null ? [element.present] : [element.present, element.absent]) ?? []),
|
|
2663
|
+
...(plan.result === null ? [] : [plan.result])
|
|
2664
|
+
];
|
|
2665
|
+
return {
|
|
2666
|
+
id: VIEW_ADAPTED_CALLABLE,
|
|
2667
|
+
domain: 'static:adapted-callable',
|
|
2668
|
+
allocates: true,
|
|
2669
|
+
callableView: plan,
|
|
2670
|
+
dependencies,
|
|
2671
|
+
// adaptSourceWithReceiver shares the original Function identity.
|
|
2672
|
+
// Executable native frames are a separate claim, authenticated by
|
|
2673
|
+
// every sealed leaf rather than inherited from a provisional atom.
|
|
2674
|
+
callableIdentityTransport: 'preserved',
|
|
2675
|
+
...(nativeDependencies(dependencies)
|
|
2676
|
+
? { nativeFieldProtocol: 'unused', callableAdapter: { from: sourceCallable, to: targetCallable } }
|
|
2677
|
+
: {})
|
|
2678
|
+
};
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
const plan = certifiedRecordViewPlan(layouts, source, target, accepted, members, nativeMethod, resolve);
|
|
2682
|
+
return plan === null
|
|
2683
|
+
? null
|
|
2684
|
+
: {
|
|
2685
|
+
id: members === undefined ? 'view:structural-record' : FAMILY_MEMBER_VIEW_MATERIALIZER,
|
|
2686
|
+
domain: members === undefined ? 'static:structural-record-view' : 'static:family-member-record-view',
|
|
2687
|
+
allocates: true,
|
|
2688
|
+
recordView: plan,
|
|
2689
|
+
...(nativeFieldViewPlanIsLive(plan) ? { nativeFieldViewProtocol: 'live' } : {}),
|
|
2690
|
+
dependencies: [...plan.leaves.values()],
|
|
2691
|
+
...viewProtocolOf(plan.view),
|
|
2692
|
+
...sourceGuardsOf([...plan.leaves.values()], resolve)
|
|
2693
|
+
};
|
|
2694
|
+
},
|
|
2695
|
+
staticRecipe: (source, target) => {
|
|
2696
|
+
if (!isSpellable(source) || !isSpellable(target))
|
|
2697
|
+
return null;
|
|
2698
|
+
if (classArmWithoutHome(layouts, source, target))
|
|
2699
|
+
return null;
|
|
2700
|
+
if (proxyArmWithoutHome(source, target))
|
|
2701
|
+
return null;
|
|
2309
2702
|
const recipe = conversionRecipeOf(source, target);
|
|
2310
2703
|
if (recipe !== null && recipe.renders) {
|
|
2311
2704
|
// `unreachable-value` spells either `unreachableValue<T>()` (a throw that
|
|
@@ -2318,38 +2711,26 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
2318
2711
|
// `optional-wrap-converted` spells `Optional<P>{P{inner}}` around the
|
|
2319
2712
|
// chain's own text for (source, payload), so it reads a field table
|
|
2320
2713
|
// exactly when that inner conversion does (`nativeWrappedPayload`).
|
|
2321
|
-
const native = recipe.id === 'unreachable-value'
|
|
2322
|
-
? { nativeFieldProtocol: 'unused', nativePayloadTransport: 'preserved' }
|
|
2323
|
-
: recipe.id === '
|
|
2324
|
-
?
|
|
2325
|
-
: recipe.id === '
|
|
2326
|
-
?
|
|
2327
|
-
:
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
// After the chain, as the printer asks (`emit.ts`'s `emitConvert`): a
|
|
2335
|
-
// record rebuilt as another shape it satisfies, decided by the plan the
|
|
2336
|
-
// printer renders from (`conversion/record-view.ts`). `viewPlanFor`
|
|
2337
|
-
// caches this build so the printer's later render of the same node
|
|
2338
|
-
// (`emit-record-view.ts`'s `structuralRecordViewText`) reads the plan
|
|
2339
|
-
// this existence check already built rather than rebuilding it.
|
|
2340
|
-
const view = viewPlanFor(layouts, source, target);
|
|
2341
|
-
if (view !== null) {
|
|
2342
|
-
const heldUnused = heldPairUnusedOf(nativeWrappedPayload);
|
|
2343
|
-
if (process.env.GEA_REFLECTION_DEBUG !== undefined) {
|
|
2344
|
-
const indirect = recordViewIndirectReads(view, heldUnused);
|
|
2345
|
-
if (indirect.length > 0)
|
|
2346
|
-
console.error(`[VIEW-INDIRECT] ${representationKey(source).slice(0, 100)} -> ${representationKey(target).slice(0, 100)} reads=${indirect.join(',').slice(0, 300)}`);
|
|
2347
|
-
}
|
|
2714
|
+
const native = recipe.id === 'unreachable-value'
|
|
2715
|
+
? { nativeFieldProtocol: 'unused', ...(source.kind === 'undefined' ? { nativePayloadTransport: 'preserved' } : {}) }
|
|
2716
|
+
: recipe.id === 'same-cpp-type'
|
|
2717
|
+
? { nativeFieldProtocol: 'unused', nativePayloadTransport: 'preserved' }
|
|
2718
|
+
: recipe.id === 'narrowed-load' && (source.kind === 'optional' || source.kind === 'tagged-union')
|
|
2719
|
+
? nativeNarrowing(source, target)
|
|
2720
|
+
: recipe.id === 'optional-wrap-converted' && target.kind === 'optional'
|
|
2721
|
+
? nativeWrappedPayload(source, target.payload)
|
|
2722
|
+
: // `optional-payload-convert` spells `has_value() ? T{P{convert(*x)}} : T{}`,
|
|
2723
|
+
// the same shape around the payload's own conversion.
|
|
2724
|
+
recipe.id === 'optional-payload-convert' && source.kind === 'optional' && target.kind === 'optional'
|
|
2725
|
+
? nativeWrappedPayload(source.payload, target.payload)
|
|
2726
|
+
: {};
|
|
2348
2727
|
return {
|
|
2349
|
-
id:
|
|
2350
|
-
domain:
|
|
2351
|
-
allocates:
|
|
2352
|
-
...
|
|
2728
|
+
id: `chain:${recipe.id}`,
|
|
2729
|
+
domain: `static:${recipe.id}`,
|
|
2730
|
+
allocates: allocatingRecipes.has(recipe.id),
|
|
2731
|
+
...(recipe.id === 'narrowed-load' ? { armSelection: 'guarded-load' } : {}),
|
|
2732
|
+
...native,
|
|
2733
|
+
...(recipe.id === 'unreachable-value' && source.kind === 'undefined' ? { normalCompletion: 'never' } : {})
|
|
2353
2734
|
};
|
|
2354
2735
|
}
|
|
2355
2736
|
// A callable whose parameter reaches the source's only through a record
|
|
@@ -2360,34 +2741,14 @@ const cppConversionTables = (layouts, nativeNarrowing, nativeWrappedPayload) =>
|
|
|
2360
2741
|
!containsUnresolved(source) &&
|
|
2361
2742
|
!containsUnresolved(target) &&
|
|
2362
2743
|
tryCandidateText(() => resultAdaptedCallableText(source, target, 'gea_conversion_probe', (from, to, text) => viewPlanFor(layouts, from, to) === null ? null : `gea_view(${text})`)) !== null)
|
|
2363
|
-
return { id: VIEW_ADAPTED_CALLABLE, domain: 'static:adapted-callable', allocates: true };
|
|
2744
|
+
return { id: VIEW_ADAPTED_CALLABLE, domain: 'static:adapted-callable', allocates: true, staticRecipeFallback: true };
|
|
2364
2745
|
// Some arms homed, some with no home anywhere (`CHECKED_ARM_NARROWING`).
|
|
2365
2746
|
if (checkedArmNarrowingText(source, target, 'gea_conversion_probe') !== null)
|
|
2366
|
-
return { id: CHECKED_ARM_NARROWING, domain: 'static:checked-arm-narrowing', allocates: false };
|
|
2747
|
+
return { id: CHECKED_ARM_NARROWING, domain: 'static:checked-arm-narrowing', allocates: false, staticRecipeFallback: true };
|
|
2367
2748
|
// The printer's own last resort behind the view (`structuralRecordViewText`).
|
|
2368
2749
|
if (boxedAssertionText(source, target, 'gea_conversion_probe') !== null)
|
|
2369
|
-
return { id: 'view:boxed-assertion', domain: 'static:boxed-assertion', allocates: true };
|
|
2750
|
+
return { id: 'view:boxed-assertion', domain: 'static:boxed-assertion', allocates: true, staticRecipeFallback: true };
|
|
2370
2751
|
return null;
|
|
2371
|
-
},
|
|
2372
|
-
// The same view, knowing which family members the site named; rendered by
|
|
2373
|
-
// `emit-record-view.ts`'s `familyMemberViewText` from the node's own
|
|
2374
|
-
// `familyMembers`. No boxed fallback: a pair this plan refuses stays refused.
|
|
2375
|
-
familyMemberView: (source, target, members) => {
|
|
2376
|
-
if (!isSpellable(source) || !isSpellable(target))
|
|
2377
|
-
return null;
|
|
2378
|
-
if (classArmWithoutHome(layouts, source, target))
|
|
2379
|
-
return null;
|
|
2380
|
-
if (proxyArmWithoutHome(source, target))
|
|
2381
|
-
return null;
|
|
2382
|
-
const view = familyMemberViewPlanFor(layouts, source, target, members);
|
|
2383
|
-
if (view === null)
|
|
2384
|
-
return null;
|
|
2385
|
-
return {
|
|
2386
|
-
id: FAMILY_MEMBER_VIEW_MATERIALIZER,
|
|
2387
|
-
domain: 'static:family-member-record-view',
|
|
2388
|
-
allocates: true,
|
|
2389
|
-
...viewProtocolOf(view)
|
|
2390
|
-
};
|
|
2391
2752
|
}
|
|
2392
2753
|
};
|
|
2393
2754
|
};
|