@geastack/compiler 1.0.15
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/LICENSE +202 -0
- package/README.md +149 -0
- package/dist/cli-analyze.d.ts +1 -0
- package/dist/cli-analyze.js +61 -0
- package/dist/cli-coverage.d.ts +1 -0
- package/dist/cli-coverage.js +329 -0
- package/dist/cli-emit.d.ts +10 -0
- package/dist/cli-emit.js +398 -0
- package/dist/cli-module-graph.d.ts +18 -0
- package/dist/cli-module-graph.js +123 -0
- package/dist/cli-package-source.d.ts +5 -0
- package/dist/cli-package-source.js +116 -0
- package/dist/cli-project.d.ts +2 -0
- package/dist/cli-project.js +60 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +199 -0
- package/dist/compiler.d.ts +228 -0
- package/dist/compiler.js +1029 -0
- package/dist/conversion/algebra.d.ts +218 -0
- package/dist/conversion/algebra.js +155 -0
- package/dist/conversion/build.d.ts +67 -0
- package/dist/conversion/build.js +1378 -0
- package/dist/conversion/derive.d.ts +37 -0
- package/dist/conversion/derive.js +260 -0
- package/dist/conversion/graph-validation.d.ts +8 -0
- package/dist/conversion/graph-validation.js +97 -0
- package/dist/conversion/native-callable-adapter.d.ts +13 -0
- package/dist/conversion/native-callable-adapter.js +53 -0
- package/dist/conversion/native-class-reference.d.ts +12 -0
- package/dist/conversion/native-class-reference.js +39 -0
- package/dist/conversion/native-payload-transport.d.ts +25 -0
- package/dist/conversion/native-payload-transport.js +33 -0
- package/dist/conversion/native-selection.d.ts +49 -0
- package/dist/conversion/native-selection.js +135 -0
- package/dist/conversion/native-sum.d.ts +42 -0
- package/dist/conversion/native-sum.js +115 -0
- package/dist/conversion/nodes.d.ts +55 -0
- package/dist/conversion/nodes.js +91 -0
- package/dist/conversion/operand-view.d.ts +14 -0
- package/dist/conversion/operand-view.js +20 -0
- package/dist/conversion/record-view.d.ts +157 -0
- package/dist/conversion/record-view.js +273 -0
- package/dist/conversion/registry.d.ts +217 -0
- package/dist/conversion/registry.js +1 -0
- package/dist/diagnostics/model.d.ts +76 -0
- package/dist/diagnostics/model.js +60 -0
- package/dist/diagnostics/sweep.d.ts +31 -0
- package/dist/diagnostics/sweep.js +112 -0
- package/dist/identity/ids.d.ts +179 -0
- package/dist/identity/ids.js +212 -0
- package/dist/ir/absent-class-arm.d.ts +48 -0
- package/dist/ir/absent-class-arm.js +157 -0
- package/dist/ir/borrow-effects.d.ts +23 -0
- package/dist/ir/borrow-effects.js +151 -0
- package/dist/ir/borrowed-call-arguments.d.ts +40 -0
- package/dist/ir/borrowed-call-arguments.js +117 -0
- package/dist/ir/build.d.ts +168 -0
- package/dist/ir/build.js +459 -0
- package/dist/ir/call-dispatch.d.ts +38 -0
- package/dist/ir/call-dispatch.js +502 -0
- package/dist/ir/call-entry.d.ts +142 -0
- package/dist/ir/call-entry.js +386 -0
- package/dist/ir/callable-class-flow.d.ts +27 -0
- package/dist/ir/callable-class-flow.js +1386 -0
- package/dist/ir/callable-field-slots.d.ts +22 -0
- package/dist/ir/callable-field-slots.js +166 -0
- package/dist/ir/callable-identity-demand.d.ts +52 -0
- package/dist/ir/callable-identity-demand.js +460 -0
- package/dist/ir/callable-member-candidates.d.ts +9 -0
- package/dist/ir/callable-member-candidates.js +39 -0
- package/dist/ir/callable-records.d.ts +21 -0
- package/dist/ir/callable-records.js +411 -0
- package/dist/ir/captures.d.ts +26 -0
- package/dist/ir/captures.js +335 -0
- package/dist/ir/certificate.d.ts +45 -0
- package/dist/ir/certificate.js +47 -0
- package/dist/ir/certify/carrier-keys.d.ts +73 -0
- package/dist/ir/certify/carrier-keys.js +221 -0
- package/dist/ir/certify/function-source.d.ts +4 -0
- package/dist/ir/certify/function-source.js +28 -0
- package/dist/ir/certify/has-property-key.d.ts +88 -0
- package/dist/ir/certify/has-property-key.js +116 -0
- package/dist/ir/certify/instanceof-key.d.ts +24 -0
- package/dist/ir/certify/instanceof-key.js +35 -0
- package/dist/ir/certify/property-access-keys.d.ts +172 -0
- package/dist/ir/certify/property-access-keys.js +291 -0
- package/dist/ir/certify/property-access.d.ts +3 -0
- package/dist/ir/certify/property-access.js +597 -0
- package/dist/ir/certify/runtime-helper.d.ts +3 -0
- package/dist/ir/certify/runtime-helper.js +326 -0
- package/dist/ir/certify/typeof-operand.d.ts +14 -0
- package/dist/ir/certify/typeof-operand.js +16 -0
- package/dist/ir/certify.d.ts +123 -0
- package/dist/ir/certify.js +481 -0
- package/dist/ir/class-evaluation.d.ts +26 -0
- package/dist/ir/class-evaluation.js +50 -0
- package/dist/ir/class-static-fields.d.ts +60 -0
- package/dist/ir/class-static-fields.js +108 -0
- package/dist/ir/construct-entry.d.ts +26 -0
- package/dist/ir/construct-entry.js +117 -0
- package/dist/ir/dead-values.d.ts +90 -0
- package/dist/ir/dead-values.js +184 -0
- package/dist/ir/deferral.d.ts +99 -0
- package/dist/ir/deferral.js +409 -0
- package/dist/ir/dense-loops.d.ts +230 -0
- package/dist/ir/dense-loops.js +697 -0
- package/dist/ir/dominance.d.ts +82 -0
- package/dist/ir/dominance.js +268 -0
- package/dist/ir/emission-representations.d.ts +71 -0
- package/dist/ir/emission-representations.js +350 -0
- package/dist/ir/facts.d.ts +218 -0
- package/dist/ir/facts.js +181 -0
- package/dist/ir/fixed-data-definition.d.ts +19 -0
- package/dist/ir/fixed-data-definition.js +49 -0
- package/dist/ir/generator-split.d.ts +38 -0
- package/dist/ir/generator-split.js +329 -0
- package/dist/ir/hoist.d.ts +55 -0
- package/dist/ir/hoist.js +375 -0
- package/dist/ir/instantiation.d.ts +61 -0
- package/dist/ir/instantiation.js +137 -0
- package/dist/ir/integer-storage.d.ts +170 -0
- package/dist/ir/integer-storage.js +822 -0
- package/dist/ir/integers.d.ts +161 -0
- package/dist/ir/integers.js +539 -0
- package/dist/ir/integrity-restrictions.d.ts +50 -0
- package/dist/ir/integrity-restrictions.js +118 -0
- package/dist/ir/local-iterators.d.ts +4 -0
- package/dist/ir/local-iterators.js +27 -0
- package/dist/ir/lower-allocation.d.ts +4 -0
- package/dist/ir/lower-allocation.js +325 -0
- package/dist/ir/lower-completion.d.ts +15 -0
- package/dist/ir/lower-completion.js +25 -0
- package/dist/ir/lower-destructuring.d.ts +5 -0
- package/dist/ir/lower-destructuring.js +693 -0
- package/dist/ir/lower-element.d.ts +29 -0
- package/dist/ir/lower-element.js +111 -0
- package/dist/ir/lower-exceptions.d.ts +47 -0
- package/dist/ir/lower-exceptions.js +92 -0
- package/dist/ir/lower-flow.d.ts +137 -0
- package/dist/ir/lower-flow.js +600 -0
- package/dist/ir/lower-graph.d.ts +218 -0
- package/dist/ir/lower-graph.js +687 -0
- package/dist/ir/lower-invocation.d.ts +4 -0
- package/dist/ir/lower-invocation.js +514 -0
- package/dist/ir/lower-narrow.d.ts +53 -0
- package/dist/ir/lower-narrow.js +320 -0
- package/dist/ir/lower-operands.d.ts +272 -0
- package/dist/ir/lower-operands.js +461 -0
- package/dist/ir/lower-property.d.ts +21 -0
- package/dist/ir/lower-property.js +132 -0
- package/dist/ir/lower-protocol.d.ts +11 -0
- package/dist/ir/lower-protocol.js +118 -0
- package/dist/ir/lower-short-circuit.d.ts +41 -0
- package/dist/ir/lower-short-circuit.js +63 -0
- package/dist/ir/lower.d.ts +82 -0
- package/dist/ir/lower.js +1346 -0
- package/dist/ir/model.d.ts +1474 -0
- package/dist/ir/model.js +6 -0
- package/dist/ir/native-absent-property.d.ts +3 -0
- package/dist/ir/native-absent-property.js +13 -0
- package/dist/ir/native-array-transport.d.ts +7 -0
- package/dist/ir/native-array-transport.js +46 -0
- package/dist/ir/native-callable-bind.d.ts +9 -0
- package/dist/ir/native-callable-bind.js +30 -0
- package/dist/ir/native-carrier-predicate.d.ts +34 -0
- package/dist/ir/native-carrier-predicate.js +49 -0
- package/dist/ir/native-class-accessor.d.ts +18 -0
- package/dist/ir/native-class-accessor.js +52 -0
- package/dist/ir/native-class-construction.d.ts +16 -0
- package/dist/ir/native-class-construction.js +71 -0
- package/dist/ir/native-class-initialization.d.ts +15 -0
- package/dist/ir/native-class-initialization.js +56 -0
- package/dist/ir/native-class-origins.d.ts +13 -0
- package/dist/ir/native-class-origins.js +237 -0
- package/dist/ir/native-dictionary-transport.d.ts +6 -0
- package/dist/ir/native-dictionary-transport.js +37 -0
- package/dist/ir/native-enumeration.d.ts +14 -0
- package/dist/ir/native-enumeration.js +26 -0
- package/dist/ir/native-equality.d.ts +10 -0
- package/dist/ir/native-equality.js +18 -0
- package/dist/ir/native-field-owner.d.ts +37 -0
- package/dist/ir/native-field-owner.js +183 -0
- package/dist/ir/native-fixed-layout.d.ts +41 -0
- package/dist/ir/native-fixed-layout.js +232 -0
- package/dist/ir/native-host-construction.d.ts +53 -0
- package/dist/ir/native-host-construction.js +62 -0
- package/dist/ir/native-key-query.d.ts +4 -0
- package/dist/ir/native-key-query.js +38 -0
- package/dist/ir/native-merge-transport.d.ts +25 -0
- package/dist/ir/native-merge-transport.js +71 -0
- package/dist/ir/native-record-index-transport.d.ts +11 -0
- package/dist/ir/native-record-index-transport.js +34 -0
- package/dist/ir/native-record-index.d.ts +12 -0
- package/dist/ir/native-record-index.js +27 -0
- package/dist/ir/native-reflect-field.d.ts +5 -0
- package/dist/ir/native-reflect-field.js +33 -0
- package/dist/ir/native-sequence-transport.d.ts +7 -0
- package/dist/ir/native-sequence-transport.js +53 -0
- package/dist/ir/numeric-intrinsics.d.ts +13 -0
- package/dist/ir/numeric-intrinsics.js +57 -0
- package/dist/ir/object-value-conversions.d.ts +20 -0
- package/dist/ir/object-value-conversions.js +50 -0
- package/dist/ir/physical-class-reflection.d.ts +9 -0
- package/dist/ir/physical-class-reflection.js +57 -0
- package/dist/ir/presence-proof.d.ts +42 -0
- package/dist/ir/presence-proof.js +490 -0
- package/dist/ir/program-facts.d.ts +106 -0
- package/dist/ir/program-facts.js +319 -0
- package/dist/ir/proven-branches.d.ts +16 -0
- package/dist/ir/proven-branches.js +219 -0
- package/dist/ir/queries.d.ts +41 -0
- package/dist/ir/queries.js +213 -0
- package/dist/ir/reflection-demand.d.ts +64 -0
- package/dist/ir/reflection-demand.js +1394 -0
- package/dist/ir/refusal.d.ts +43 -0
- package/dist/ir/refusal.js +28 -0
- package/dist/ir/shake.d.ts +37 -0
- package/dist/ir/shake.js +1078 -0
- package/dist/ir/static-callables.d.ts +11 -0
- package/dist/ir/static-callables.js +163 -0
- package/dist/ir/string-layout-reuse.d.ts +13 -0
- package/dist/ir/string-layout-reuse.js +39 -0
- package/dist/ir/string-length-reuse.d.ts +8 -0
- package/dist/ir/string-length-reuse.js +47 -0
- package/dist/ir/transfer.d.ts +78 -0
- package/dist/ir/transfer.js +270 -0
- package/dist/ir/type-query-results.d.ts +25 -0
- package/dist/ir/type-query-results.js +96 -0
- package/dist/ir/typed-property-access.d.ts +100 -0
- package/dist/ir/typed-property-access.js +161 -0
- package/dist/ir/verify.d.ts +19 -0
- package/dist/ir/verify.js +355 -0
- package/dist/plugins/apple/constructors.d.ts +112 -0
- package/dist/plugins/apple/constructors.js +217 -0
- package/dist/plugins/apple/host.d.ts +181 -0
- package/dist/plugins/apple/host.js +262 -0
- package/dist/plugins/apple/jsx.d.ts +2 -0
- package/dist/plugins/apple/jsx.js +293 -0
- package/dist/plugins/apple/members.d.ts +16 -0
- package/dist/plugins/apple/members.js +190 -0
- package/dist/plugins/apple/plugin.d.ts +2 -0
- package/dist/plugins/apple/plugin.js +156 -0
- package/dist/plugins/gea/component-classes.d.ts +25 -0
- package/dist/plugins/gea/component-classes.js +162 -0
- package/dist/plugins/gea/component-inline.d.ts +13 -0
- package/dist/plugins/gea/component-inline.js +532 -0
- package/dist/plugins/gea/constructors.d.ts +23 -0
- package/dist/plugins/gea/constructors.js +100 -0
- package/dist/plugins/gea/contract.d.ts +150 -0
- package/dist/plugins/gea/contract.js +195 -0
- package/dist/plugins/gea/element-ref.d.ts +31 -0
- package/dist/plugins/gea/element-ref.js +45 -0
- package/dist/plugins/gea/host.d.ts +520 -0
- package/dist/plugins/gea/host.js +762 -0
- package/dist/plugins/gea/lower.d.ts +6 -0
- package/dist/plugins/gea/lower.js +195 -0
- package/dist/plugins/gea/members.d.ts +22 -0
- package/dist/plugins/gea/members.js +221 -0
- package/dist/plugins/gea/plugin.d.ts +22 -0
- package/dist/plugins/gea/plugin.js +307 -0
- package/dist/plugins/gea/prelude.d.ts +78 -0
- package/dist/plugins/gea/prelude.js +153 -0
- package/dist/plugins/gea/producer.d.ts +5 -0
- package/dist/plugins/gea/producer.js +52 -0
- package/dist/plugins/gea/reactive-slots.d.ts +49 -0
- package/dist/plugins/gea/reactive-slots.js +578 -0
- package/dist/plugins/gea/render-bridge.d.ts +6 -0
- package/dist/plugins/gea/render-bridge.js +281 -0
- package/dist/plugins/gea/slots.d.ts +15 -0
- package/dist/plugins/gea/slots.js +36 -0
- package/dist/plugins/gea/template-analysis.d.ts +151 -0
- package/dist/plugins/gea/template-analysis.js +346 -0
- package/dist/plugins/gea/user-agent-styles.d.ts +9 -0
- package/dist/plugins/gea/user-agent-styles.js +94 -0
- package/dist/plugins/installed.d.ts +19 -0
- package/dist/plugins/installed.js +21 -0
- package/dist/plugins/load.d.ts +7 -0
- package/dist/plugins/load.js +207 -0
- package/dist/plugins/model.d.ts +735 -0
- package/dist/plugins/model.js +47 -0
- package/dist/plugins/webgl/host.d.ts +77 -0
- package/dist/plugins/webgl/host.js +162 -0
- package/dist/plugins/webgl/plugin.d.ts +40 -0
- package/dist/plugins/webgl/plugin.js +99 -0
- package/dist/preflight/obligations.d.ts +206 -0
- package/dist/preflight/obligations.js +36 -0
- package/dist/preflight/report.d.ts +20 -0
- package/dist/preflight/report.js +61 -0
- package/dist/preflight/run.d.ts +39 -0
- package/dist/preflight/run.js +403 -0
- package/dist/project-preparation.d.ts +33 -0
- package/dist/project-preparation.js +314 -0
- package/dist/projection/abi.d.ts +82 -0
- package/dist/projection/abi.js +349 -0
- package/dist/projection/apply-arguments.d.ts +12 -0
- package/dist/projection/apply-arguments.js +20 -0
- package/dist/projection/bindings.d.ts +250 -0
- package/dist/projection/bindings.js +340 -0
- package/dist/projection/callee.d.ts +196 -0
- package/dist/projection/callee.js +444 -0
- package/dist/projection/class-property-presence.d.ts +28 -0
- package/dist/projection/class-property-presence.js +58 -0
- package/dist/projection/class-prototype.d.ts +5 -0
- package/dist/projection/class-prototype.js +23 -0
- package/dist/projection/class-storage.d.ts +26 -0
- package/dist/projection/class-storage.js +236 -0
- package/dist/projection/classes.d.ts +283 -0
- package/dist/projection/classes.js +944 -0
- package/dist/projection/coercions.d.ts +20 -0
- package/dist/projection/coercions.js +33 -0
- package/dist/projection/dispatch.d.ts +167 -0
- package/dist/projection/dispatch.js +379 -0
- package/dist/projection/fields.d.ts +123 -0
- package/dist/projection/fields.js +383 -0
- package/dist/projection/instance-test.d.ts +78 -0
- package/dist/projection/instance-test.js +156 -0
- package/dist/projection/slots.d.ts +146 -0
- package/dist/projection/slots.js +663 -0
- package/dist/projection/synthesized-abi.d.ts +61 -0
- package/dist/projection/synthesized-abi.js +94 -0
- package/dist/representation/array-index.d.ts +14 -0
- package/dist/representation/array-index.js +17 -0
- package/dist/representation/callable-object.d.ts +3 -0
- package/dist/representation/callable-object.js +6 -0
- package/dist/representation/collections.d.ts +84 -0
- package/dist/representation/collections.js +139 -0
- package/dist/representation/derive.d.ts +159 -0
- package/dist/representation/derive.js +2546 -0
- package/dist/representation/difference.d.ts +30 -0
- package/dist/representation/difference.js +240 -0
- package/dist/representation/field-descriptor-policy.d.ts +19 -0
- package/dist/representation/field-descriptor-policy.js +39 -0
- package/dist/representation/function-constructor.d.ts +13 -0
- package/dist/representation/function-constructor.js +9 -0
- package/dist/representation/host-abi.d.ts +32 -0
- package/dist/representation/host-abi.js +97 -0
- package/dist/representation/host-templates.d.ts +67 -0
- package/dist/representation/host-templates.js +94 -0
- package/dist/representation/intersection.d.ts +84 -0
- package/dist/representation/intersection.js +149 -0
- package/dist/representation/literal-destination.d.ts +43 -0
- package/dist/representation/literal-destination.js +133 -0
- package/dist/representation/merge.d.ts +18 -0
- package/dist/representation/merge.js +83 -0
- package/dist/representation/model.d.ts +1160 -0
- package/dist/representation/model.js +1019 -0
- package/dist/representation/numeric-index.d.ts +13 -0
- package/dist/representation/numeric-index.js +29 -0
- package/dist/representation/object-shape.d.ts +109 -0
- package/dist/representation/object-shape.js +123 -0
- package/dist/representation/optional.d.ts +12 -0
- package/dist/representation/optional.js +87 -0
- package/dist/representation/plan.d.ts +60 -0
- package/dist/representation/plan.js +78 -0
- package/dist/representation/policies.d.ts +589 -0
- package/dist/representation/policies.js +107 -0
- package/dist/representation/primitive-domain.d.ts +1 -0
- package/dist/representation/primitive-domain.js +1 -0
- package/dist/representation/primitives.d.ts +44 -0
- package/dist/representation/primitives.js +78 -0
- package/dist/representation/publish.d.ts +49 -0
- package/dist/representation/publish.js +648 -0
- package/dist/representation/record-fields.d.ts +96 -0
- package/dist/representation/record-fields.js +116 -0
- package/dist/representation/template-object.d.ts +11 -0
- package/dist/representation/template-object.js +26 -0
- package/dist/representation/union.d.ts +30 -0
- package/dist/representation/union.js +324 -0
- package/dist/representation/value-records.d.ts +3 -0
- package/dist/representation/value-records.js +307 -0
- package/dist/representation/verify.d.ts +17 -0
- package/dist/representation/verify.js +221 -0
- package/dist/semantics/alias-this-field-declaration-transform.d.ts +4 -0
- package/dist/semantics/alias-this-field-declaration-transform.js +207 -0
- package/dist/semantics/ambient-type-realization-transform.d.ts +62 -0
- package/dist/semantics/ambient-type-realization-transform.js +168 -0
- package/dist/semantics/ambient.d.ts +24 -0
- package/dist/semantics/ambient.js +119 -0
- package/dist/semantics/borrowed-builtin-call-bind-source-transform.d.ts +4 -0
- package/dist/semantics/borrowed-builtin-call-bind-source-transform.js +341 -0
- package/dist/semantics/callable-origins.d.ts +46 -0
- package/dist/semantics/callable-origins.js +354 -0
- package/dist/semantics/class-alias.d.ts +7 -0
- package/dist/semantics/class-alias.js +37 -0
- package/dist/semantics/class-heritage.d.ts +34 -0
- package/dist/semantics/class-heritage.js +104 -0
- package/dist/semantics/commonjs-wrapper.d.ts +69 -0
- package/dist/semantics/commonjs-wrapper.js +231 -0
- package/dist/semantics/constructor-slot-subclasses.d.ts +28 -0
- package/dist/semantics/constructor-slot-subclasses.js +112 -0
- package/dist/semantics/declaration-overlay-transform.d.ts +35 -0
- package/dist/semantics/declaration-overlay-transform.js +2157 -0
- package/dist/semantics/define-property-source-transform.d.ts +4 -0
- package/dist/semantics/define-property-source-transform.js +437 -0
- package/dist/semantics/diagnostic-source-preparation.d.ts +24 -0
- package/dist/semantics/diagnostic-source-preparation.js +82 -0
- package/dist/semantics/documentation-ranges.d.ts +22 -0
- package/dist/semantics/documentation-ranges.js +36 -0
- package/dist/semantics/dynamic-fallback.d.ts +86 -0
- package/dist/semantics/dynamic-fallback.js +249 -0
- package/dist/semantics/frontend-timing.d.ts +6 -0
- package/dist/semantics/frontend-timing.js +35 -0
- package/dist/semantics/frontend.d.ts +504 -0
- package/dist/semantics/frontend.js +1157 -0
- package/dist/semantics/host-declaration-provenance.d.ts +11 -0
- package/dist/semantics/host-declaration-provenance.js +18 -0
- package/dist/semantics/host-methods.d.ts +24 -0
- package/dist/semantics/host-methods.js +74 -0
- package/dist/semantics/host-protocols.d.ts +429 -0
- package/dist/semantics/host-protocols.js +1501 -0
- package/dist/semantics/inherited-accessor.d.ts +7 -0
- package/dist/semantics/inherited-accessor.js +48 -0
- package/dist/semantics/interface-families.d.ts +70 -0
- package/dist/semantics/interface-families.js +180 -0
- package/dist/semantics/interface-implementors.d.ts +53 -0
- package/dist/semantics/interface-implementors.js +87 -0
- package/dist/semantics/jsdoc-namepath-transform.d.ts +4 -0
- package/dist/semantics/jsdoc-namepath-transform.js +85 -0
- package/dist/semantics/model/coverage.d.ts +68 -0
- package/dist/semantics/model/coverage.js +73 -0
- package/dist/semantics/model/edges.d.ts +103 -0
- package/dist/semantics/model/edges.js +20 -0
- package/dist/semantics/model/graph.d.ts +55 -0
- package/dist/semantics/model/graph.js +129 -0
- package/dist/semantics/model/operands.d.ts +159 -0
- package/dist/semantics/model/operands.js +26 -0
- package/dist/semantics/model/operations.d.ts +496 -0
- package/dist/semantics/model/operations.js +2 -0
- package/dist/semantics/model/primitive-domain.d.ts +26 -0
- package/dist/semantics/model/primitive-domain.js +38 -0
- package/dist/semantics/model/selected-signature.d.ts +261 -0
- package/dist/semantics/model/selected-signature.js +55 -0
- package/dist/semantics/model/structural-type-table.d.ts +93 -0
- package/dist/semantics/model/structural-type-table.js +237 -0
- package/dist/semantics/model/structural-types.d.ts +367 -0
- package/dist/semantics/model/structural-types.js +200 -0
- package/dist/semantics/module-resolution.d.ts +23 -0
- package/dist/semantics/module-resolution.js +227 -0
- package/dist/semantics/new-callee-class-tag-source-transform.d.ts +4 -0
- package/dist/semantics/new-callee-class-tag-source-transform.js +64 -0
- package/dist/semantics/node-project.d.ts +13 -0
- package/dist/semantics/node-project.js +107 -0
- package/dist/semantics/node-source-hooks.d.ts +1 -0
- package/dist/semantics/node-source-hooks.js +63 -0
- package/dist/semantics/normalize/absent-globals.d.ts +143 -0
- package/dist/semantics/normalize/absent-globals.js +191 -0
- package/dist/semantics/normalize/arguments-objects.d.ts +43 -0
- package/dist/semantics/normalize/arguments-objects.js +60 -0
- package/dist/semantics/normalize/asserted-arm-absence.d.ts +28 -0
- package/dist/semantics/normalize/asserted-arm-absence.js +61 -0
- package/dist/semantics/normalize/assignment-patterns.d.ts +70 -0
- package/dist/semantics/normalize/assignment-patterns.js +147 -0
- package/dist/semantics/normalize/bag-absence.d.ts +8 -0
- package/dist/semantics/normalize/bag-absence.js +42 -0
- package/dist/semantics/normalize/binding-fixpoint.d.ts +36 -0
- package/dist/semantics/normalize/binding-fixpoint.js +140 -0
- package/dist/semantics/normalize/callback-parameter-contracts.d.ts +16 -0
- package/dist/semantics/normalize/callback-parameter-contracts.js +91 -0
- package/dist/semantics/normalize/cells/agreement.d.ts +46 -0
- package/dist/semantics/normalize/cells/agreement.js +34 -0
- package/dist/semantics/normalize/cells/candidates.d.ts +17 -0
- package/dist/semantics/normalize/cells/candidates.js +35 -0
- package/dist/semantics/normalize/cells/facts.d.ts +19 -0
- package/dist/semantics/normalize/cells/facts.js +90 -0
- package/dist/semantics/normalize/cells/index.d.ts +10 -0
- package/dist/semantics/normalize/cells/index.js +6 -0
- package/dist/semantics/normalize/cells/model.d.ts +98 -0
- package/dist/semantics/normalize/cells/model.js +2 -0
- package/dist/semantics/normalize/cells/policies/bag.d.ts +44 -0
- package/dist/semantics/normalize/cells/policies/bag.js +114 -0
- package/dist/semantics/normalize/cells/policies/collection.d.ts +42 -0
- package/dist/semantics/normalize/cells/policies/collection.js +218 -0
- package/dist/semantics/normalize/cells/policies/field.d.ts +28 -0
- package/dist/semantics/normalize/cells/policies/field.js +40 -0
- package/dist/semantics/normalize/cells/policies/index.d.ts +49 -0
- package/dist/semantics/normalize/cells/policies/index.js +58 -0
- package/dist/semantics/normalize/cells/policies/local.d.ts +18 -0
- package/dist/semantics/normalize/cells/policies/local.js +37 -0
- package/dist/semantics/normalize/cells/policies/parameter.d.ts +28 -0
- package/dist/semantics/normalize/cells/policies/parameter.js +39 -0
- package/dist/semantics/normalize/cells/policies/return.d.ts +26 -0
- package/dist/semantics/normalize/cells/policies/return.js +45 -0
- package/dist/semantics/normalize/cells/policies/shared.d.ts +33 -0
- package/dist/semantics/normalize/cells/policies/shared.js +45 -0
- package/dist/semantics/normalize/cells/policy.d.ts +72 -0
- package/dist/semantics/normalize/cells/policy.js +18 -0
- package/dist/semantics/normalize/cells/registry.d.ts +14 -0
- package/dist/semantics/normalize/cells/registry.js +17 -0
- package/dist/semantics/normalize/census-refusal.d.ts +62 -0
- package/dist/semantics/normalize/census-refusal.js +27 -0
- package/dist/semantics/normalize/census.d.ts +109 -0
- package/dist/semantics/normalize/census.js +667 -0
- package/dist/semantics/normalize/collection-bindings.d.ts +278 -0
- package/dist/semantics/normalize/collection-bindings.js +677 -0
- package/dist/semantics/normalize/commonjs-module-record.d.ts +21 -0
- package/dist/semantics/normalize/commonjs-module-record.js +289 -0
- package/dist/semantics/normalize/commonjs-require.d.ts +13 -0
- package/dist/semantics/normalize/commonjs-require.js +1527 -0
- package/dist/semantics/normalize/contribution.d.ts +63 -0
- package/dist/semantics/normalize/contribution.js +172 -0
- package/dist/semantics/normalize/dead-typeof-guards.d.ts +64 -0
- package/dist/semantics/normalize/dead-typeof-guards.js +152 -0
- package/dist/semantics/normalize/deferred-intrinsic-protocols.d.ts +57 -0
- package/dist/semantics/normalize/deferred-intrinsic-protocols.js +109 -0
- package/dist/semantics/normalize/derived-expression-type.d.ts +1070 -0
- package/dist/semantics/normalize/derived-expression-type.js +3463 -0
- package/dist/semantics/normalize/evaluation-order.d.ts +16 -0
- package/dist/semantics/normalize/evaluation-order.js +37 -0
- package/dist/semantics/normalize/field-bindings.d.ts +167 -0
- package/dist/semantics/normalize/field-bindings.js +1125 -0
- package/dist/semantics/normalize/flow/array-element-continuation.d.ts +27 -0
- package/dist/semantics/normalize/flow/array-element-continuation.js +1452 -0
- package/dist/semantics/normalize/flow/callable-array-origins.d.ts +42 -0
- package/dist/semantics/normalize/flow/callable-array-origins.js +318 -0
- package/dist/semantics/normalize/flow/callable-completions.d.ts +45 -0
- package/dist/semantics/normalize/flow/callable-completions.js +82 -0
- package/dist/semantics/normalize/flow/callable-reach.d.ts +237 -0
- package/dist/semantics/normalize/flow/callable-reach.js +7174 -0
- package/dist/semantics/normalize/flow/class-family-member-read.d.ts +16 -0
- package/dist/semantics/normalize/flow/class-family-member-read.js +992 -0
- package/dist/semantics/normalize/flow/collection-value-continuation.d.ts +21 -0
- package/dist/semantics/normalize/flow/collection-value-continuation.js +192 -0
- package/dist/semantics/normalize/flow/component-solver.d.ts +199 -0
- package/dist/semantics/normalize/flow/component-solver.js +587 -0
- package/dist/semantics/normalize/flow/computed-key-set.d.ts +84 -0
- package/dist/semantics/normalize/flow/computed-key-set.js +660 -0
- package/dist/semantics/normalize/flow/export-importers.d.ts +24 -0
- package/dist/semantics/normalize/flow/export-importers.js +269 -0
- package/dist/semantics/normalize/flow/host-text-sink.d.ts +25 -0
- package/dist/semantics/normalize/flow/host-text-sink.js +87 -0
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.d.ts +84 -0
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.js +180 -0
- package/dist/semantics/normalize/flow/intrinsic-data-definition.d.ts +35 -0
- package/dist/semantics/normalize/flow/intrinsic-data-definition.js +140 -0
- package/dist/semantics/normalize/flow/invocation-facts.d.ts +98 -0
- package/dist/semantics/normalize/flow/invocation-facts.js +257 -0
- package/dist/semantics/normalize/flow/member-call-forwarding.d.ts +122 -0
- package/dist/semantics/normalize/flow/member-call-forwarding.js +835 -0
- package/dist/semantics/normalize/flow/model.d.ts +357 -0
- package/dist/semantics/normalize/flow/model.js +177 -0
- package/dist/semantics/normalize/flow/native-collection-protocol.d.ts +24 -0
- package/dist/semantics/normalize/flow/native-collection-protocol.js +252 -0
- package/dist/semantics/normalize/flow/node-path-token.d.ts +3 -0
- package/dist/semantics/normalize/flow/node-path-token.js +53 -0
- package/dist/semantics/normalize/flow/object-binding-continuation.d.ts +11 -0
- package/dist/semantics/normalize/flow/object-binding-continuation.js +42 -0
- package/dist/semantics/normalize/flow/origin-authority.d.ts +56 -0
- package/dist/semantics/normalize/flow/origin-authority.js +2 -0
- package/dist/semantics/normalize/flow/owned-class-receivers.d.ts +35 -0
- package/dist/semantics/normalize/flow/owned-class-receivers.js +191 -0
- package/dist/semantics/normalize/flow/parameter-values.d.ts +27 -0
- package/dist/semantics/normalize/flow/parameter-values.js +251 -0
- package/dist/semantics/normalize/flow/proof-hypotheses.d.ts +66 -0
- package/dist/semantics/normalize/flow/proof-hypotheses.js +162 -0
- package/dist/semantics/normalize/flow/record-alias-closure.d.ts +27 -0
- package/dist/semantics/normalize/flow/record-alias-closure.js +298 -0
- package/dist/semantics/normalize/flow/seeded-origins.d.ts +43 -0
- package/dist/semantics/normalize/flow/seeded-origins.js +54 -0
- package/dist/semantics/normalize/flow/source-class-data.d.ts +132 -0
- package/dist/semantics/normalize/flow/source-class-data.js +838 -0
- package/dist/semantics/normalize/flow/source-class-instanceof.d.ts +13 -0
- package/dist/semantics/normalize/flow/source-class-instanceof.js +37 -0
- package/dist/semantics/normalize/flow/source-class-static-data.d.ts +16 -0
- package/dist/semantics/normalize/flow/source-class-static-data.js +47 -0
- package/dist/semantics/normalize/flow/source-construction-frames.d.ts +12 -0
- package/dist/semantics/normalize/flow/source-construction-frames.js +118 -0
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.d.ts +34 -0
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.js +78 -0
- package/dist/semantics/normalize/flow/source-invocation-receiver.d.ts +37 -0
- package/dist/semantics/normalize/flow/source-invocation-receiver.js +95 -0
- package/dist/semantics/normalize/flow/source-prototype-method-identity.d.ts +23 -0
- package/dist/semantics/normalize/flow/source-prototype-method-identity.js +81 -0
- package/dist/semantics/normalize/flow/source-record-data.d.ts +29 -0
- package/dist/semantics/normalize/flow/source-record-data.js +626 -0
- package/dist/semantics/normalize/flow/source-value-session.d.ts +77 -0
- package/dist/semantics/normalize/flow/source-value-session.js +3089 -0
- package/dist/semantics/normalize/flow/targets.d.ts +118 -0
- package/dist/semantics/normalize/flow/targets.js +405 -0
- package/dist/semantics/normalize/flow/value-flow.d.ts +36 -0
- package/dist/semantics/normalize/flow/value-flow.js +823 -0
- package/dist/semantics/normalize/flow/value-provenance.d.ts +31 -0
- package/dist/semantics/normalize/flow/value-provenance.js +112 -0
- package/dist/semantics/normalize/gating.d.ts +51 -0
- package/dist/semantics/normalize/gating.js +560 -0
- package/dist/semantics/normalize/generic-function-choice.d.ts +31 -0
- package/dist/semantics/normalize/generic-function-choice.js +115 -0
- package/dist/semantics/normalize/global-host-mutations.d.ts +51 -0
- package/dist/semantics/normalize/global-host-mutations.js +5989 -0
- package/dist/semantics/normalize/host-effect-contracts.d.ts +77 -0
- package/dist/semantics/normalize/host-effect-contracts.js +143 -0
- package/dist/semantics/normalize/host-mutation-computed-keys.d.ts +38 -0
- package/dist/semantics/normalize/host-mutation-computed-keys.js +26 -0
- package/dist/semantics/normalize/host-mutation-key-reader.d.ts +66 -0
- package/dist/semantics/normalize/host-mutation-key-reader.js +192 -0
- package/dist/semantics/normalize/host-mutation-keys.d.ts +114 -0
- package/dist/semantics/normalize/host-mutation-keys.js +183 -0
- package/dist/semantics/normalize/identities.d.ts +172 -0
- package/dist/semantics/normalize/identities.js +426 -0
- package/dist/semantics/normalize/implicit-arguments-tuple.d.ts +97 -0
- package/dist/semantics/normalize/implicit-arguments-tuple.js +197 -0
- package/dist/semantics/normalize/implicit-arguments.d.ts +11 -0
- package/dist/semantics/normalize/implicit-arguments.js +39 -0
- package/dist/semantics/normalize/instantiation.d.ts +73 -0
- package/dist/semantics/normalize/instantiation.js +399 -0
- package/dist/semantics/normalize/intrinsic-property-call.d.ts +18 -0
- package/dist/semantics/normalize/intrinsic-property-call.js +69 -0
- package/dist/semantics/normalize/intrinsic-prototype.d.ts +41 -0
- package/dist/semantics/normalize/intrinsic-prototype.js +87 -0
- package/dist/semantics/normalize/intrinsic-static-member.d.ts +14 -0
- package/dist/semantics/normalize/intrinsic-static-member.js +23 -0
- package/dist/semantics/normalize/jsdoc-type-names.d.ts +32 -0
- package/dist/semantics/normalize/jsdoc-type-names.js +512 -0
- package/dist/semantics/normalize/keyof.d.ts +32 -0
- package/dist/semantics/normalize/keyof.js +110 -0
- package/dist/semantics/normalize/local-bindings.d.ts +176 -0
- package/dist/semantics/normalize/local-bindings.js +1826 -0
- package/dist/semantics/normalize/logical-result-type.d.ts +16 -0
- package/dist/semantics/normalize/logical-result-type.js +102 -0
- package/dist/semantics/normalize/namespace-paths.d.ts +57 -0
- package/dist/semantics/normalize/namespace-paths.js +108 -0
- package/dist/semantics/normalize/normalize.d.ts +57 -0
- package/dist/semantics/normalize/normalize.js +68 -0
- package/dist/semantics/normalize/object-bag-bindings.d.ts +305 -0
- package/dist/semantics/normalize/object-bag-bindings.js +1290 -0
- package/dist/semantics/normalize/omitted-stated-parameter.d.ts +53 -0
- package/dist/semantics/normalize/omitted-stated-parameter.js +59 -0
- package/dist/semantics/normalize/open-type-form.d.ts +10 -0
- package/dist/semantics/normalize/open-type-form.js +32 -0
- package/dist/semantics/normalize/parameter-bindings.d.ts +361 -0
- package/dist/semantics/normalize/parameter-bindings.js +3339 -0
- package/dist/semantics/normalize/parameter-slot.d.ts +264 -0
- package/dist/semantics/normalize/parameter-slot.js +491 -0
- package/dist/semantics/normalize/physical-overload-result.d.ts +77 -0
- package/dist/semantics/normalize/physical-overload-result.js +99 -0
- package/dist/semantics/normalize/primitive-property-absence.d.ts +12 -0
- package/dist/semantics/normalize/primitive-property-absence.js +60 -0
- package/dist/semantics/normalize/producer-context.d.ts +376 -0
- package/dist/semantics/normalize/producer-context.js +1 -0
- package/dist/semantics/normalize/producers/allocations.d.ts +3 -0
- package/dist/semantics/normalize/producers/allocations.js +863 -0
- package/dist/semantics/normalize/producers/binding-kind.d.ts +37 -0
- package/dist/semantics/normalize/producers/binding-kind.js +36 -0
- package/dist/semantics/normalize/producers/bindings.d.ts +85 -0
- package/dist/semantics/normalize/producers/bindings.js +710 -0
- package/dist/semantics/normalize/producers/boundary.d.ts +34 -0
- package/dist/semantics/normalize/producers/boundary.js +123 -0
- package/dist/semantics/normalize/producers/class-lifecycle.d.ts +3 -0
- package/dist/semantics/normalize/producers/class-lifecycle.js +902 -0
- package/dist/semantics/normalize/producers/computations.d.ts +3 -0
- package/dist/semantics/normalize/producers/computations.js +613 -0
- package/dist/semantics/normalize/producers/control-loops.d.ts +30 -0
- package/dist/semantics/normalize/producers/control-loops.js +91 -0
- package/dist/semantics/normalize/producers/control.d.ts +30 -0
- package/dist/semantics/normalize/producers/control.js +923 -0
- package/dist/semantics/normalize/producers/declaration-lifecycle.d.ts +3 -0
- package/dist/semantics/normalize/producers/declaration-lifecycle.js +390 -0
- package/dist/semantics/normalize/producers/destructuring.d.ts +45 -0
- package/dist/semantics/normalize/producers/destructuring.js +1180 -0
- package/dist/semantics/normalize/producers/dynamic-language.d.ts +3 -0
- package/dist/semantics/normalize/producers/dynamic-language.js +70 -0
- package/dist/semantics/normalize/producers/erasure.d.ts +51 -0
- package/dist/semantics/normalize/producers/erasure.js +90 -0
- package/dist/semantics/normalize/producers/installed.d.ts +3 -0
- package/dist/semantics/normalize/producers/installed.js +55 -0
- package/dist/semantics/normalize/producers/invocations.d.ts +35 -0
- package/dist/semantics/normalize/producers/invocations.js +1796 -0
- package/dist/semantics/normalize/producers/iteration-yield.d.ts +59 -0
- package/dist/semantics/normalize/producers/iteration-yield.js +235 -0
- package/dist/semantics/normalize/producers/jsx.d.ts +3 -0
- package/dist/semantics/normalize/producers/jsx.js +360 -0
- package/dist/semantics/normalize/producers/mint.d.ts +39 -0
- package/dist/semantics/normalize/producers/mint.js +44 -0
- package/dist/semantics/normalize/producers/nullish.d.ts +16 -0
- package/dist/semantics/normalize/producers/nullish.js +27 -0
- package/dist/semantics/normalize/producers/object-assignment.d.ts +8 -0
- package/dist/semantics/normalize/producers/object-assignment.js +204 -0
- package/dist/semantics/normalize/producers/object-tag.d.ts +9 -0
- package/dist/semantics/normalize/producers/object-tag.js +119 -0
- package/dist/semantics/normalize/producers/optional-chain.d.ts +44 -0
- package/dist/semantics/normalize/producers/optional-chain.js +75 -0
- package/dist/semantics/normalize/producers/properties.d.ts +21 -0
- package/dist/semantics/normalize/producers/properties.js +1053 -0
- package/dist/semantics/normalize/producers/protocol.d.ts +67 -0
- package/dist/semantics/normalize/producers/protocol.js +695 -0
- package/dist/semantics/normalize/producers/references.d.ts +53 -0
- package/dist/semantics/normalize/producers/references.js +1027 -0
- package/dist/semantics/normalize/producers/shared.d.ts +561 -0
- package/dist/semantics/normalize/producers/shared.js +1683 -0
- package/dist/semantics/normalize/producers/spread-arguments.d.ts +72 -0
- package/dist/semantics/normalize/producers/spread-arguments.js +375 -0
- package/dist/semantics/normalize/producers/tagged-template.d.ts +5 -0
- package/dist/semantics/normalize/producers/tagged-template.js +307 -0
- package/dist/semantics/normalize/producers/tuple-spread.d.ts +189 -0
- package/dist/semantics/normalize/producers/tuple-spread.js +279 -0
- package/dist/semantics/normalize/property-key-domain.d.ts +36 -0
- package/dist/semantics/normalize/property-key-domain.js +150 -0
- package/dist/semantics/normalize/reachability.d.ts +189 -0
- package/dist/semantics/normalize/reachability.js +1057 -0
- package/dist/semantics/normalize/reassigned-bindings.d.ts +13 -0
- package/dist/semantics/normalize/reassigned-bindings.js +41 -0
- package/dist/semantics/normalize/record-storage-families.d.ts +11 -0
- package/dist/semantics/normalize/record-storage-families.js +109 -0
- package/dist/semantics/normalize/return-bindings.d.ts +260 -0
- package/dist/semantics/normalize/return-bindings.js +1311 -0
- package/dist/semantics/normalize/return-paths.d.ts +2 -0
- package/dist/semantics/normalize/return-paths.js +28 -0
- package/dist/semantics/normalize/script-global-redefinition.d.ts +44 -0
- package/dist/semantics/normalize/script-global-redefinition.js +75 -0
- package/dist/semantics/normalize/specialization.d.ts +201 -0
- package/dist/semantics/normalize/specialization.js +1824 -0
- package/dist/semantics/normalize/structural-array-element.d.ts +176 -0
- package/dist/semantics/normalize/structural-array-element.js +700 -0
- package/dist/semantics/normalize/structural-array-read.d.ts +13 -0
- package/dist/semantics/normalize/structural-array-read.js +124 -0
- package/dist/semantics/normalize/structural-callable.d.ts +12 -0
- package/dist/semantics/normalize/structural-callable.js +82 -0
- package/dist/semantics/normalize/structural-creation-order.d.ts +32 -0
- package/dist/semantics/normalize/structural-creation-order.js +111 -0
- package/dist/semantics/normalize/structural-declarations.d.ts +395 -0
- package/dist/semantics/normalize/structural-declarations.js +968 -0
- package/dist/semantics/normalize/structural-declared-body.d.ts +25 -0
- package/dist/semantics/normalize/structural-declared-body.js +147 -0
- package/dist/semantics/normalize/structural-generics.d.ts +56 -0
- package/dist/semantics/normalize/structural-generics.js +120 -0
- package/dist/semantics/normalize/structural-indexed-access.d.ts +11 -0
- package/dist/semantics/normalize/structural-indexed-access.js +126 -0
- package/dist/semantics/normalize/structural-instantiated-member.d.ts +64 -0
- package/dist/semantics/normalize/structural-instantiated-member.js +407 -0
- package/dist/semantics/normalize/structural-joins.d.ts +44 -0
- package/dist/semantics/normalize/structural-joins.js +143 -0
- package/dist/semantics/normalize/structural-layout-relevance.d.ts +29 -0
- package/dist/semantics/normalize/structural-layout-relevance.js +391 -0
- package/dist/semantics/normalize/structural-layout-type.d.ts +11 -0
- package/dist/semantics/normalize/structural-layout-type.js +1468 -0
- package/dist/semantics/normalize/structural-leaves.d.ts +49 -0
- package/dist/semantics/normalize/structural-leaves.js +125 -0
- package/dist/semantics/normalize/structural-local-union.d.ts +13 -0
- package/dist/semantics/normalize/structural-local-union.js +133 -0
- package/dist/semantics/normalize/structural-members.d.ts +26 -0
- package/dist/semantics/normalize/structural-members.js +84 -0
- package/dist/semantics/normalize/structural-mutable-method.d.ts +15 -0
- package/dist/semantics/normalize/structural-mutable-method.js +109 -0
- package/dist/semantics/normalize/structural-parts.d.ts +131 -0
- package/dist/semantics/normalize/structural-parts.js +737 -0
- package/dist/semantics/normalize/structural-receiver.d.ts +66 -0
- package/dist/semantics/normalize/structural-receiver.js +551 -0
- package/dist/semantics/normalize/structural-rules.d.ts +112 -0
- package/dist/semantics/normalize/structural-rules.js +93 -0
- package/dist/semantics/normalize/structural-self-reference.d.ts +150 -0
- package/dist/semantics/normalize/structural-self-reference.js +494 -0
- package/dist/semantics/normalize/structural.d.ts +202 -0
- package/dist/semantics/normalize/structural.js +4218 -0
- package/dist/semantics/normalize/unreduced-type-form.d.ts +41 -0
- package/dist/semantics/normalize/unreduced-type-form.js +53 -0
- package/dist/semantics/normalize/unresolvable-names.d.ts +56 -0
- package/dist/semantics/normalize/unresolvable-names.js +140 -0
- package/dist/semantics/package-sources.d.ts +16 -0
- package/dist/semantics/package-sources.js +365 -0
- package/dist/semantics/program.d.ts +151 -0
- package/dist/semantics/program.js +667 -0
- package/dist/semantics/prototype-install-source-transform.d.ts +4 -0
- package/dist/semantics/prototype-install-source-transform.js +341 -0
- package/dist/semantics/prototype-object-class-source-transform.d.ts +4 -0
- package/dist/semantics/prototype-object-class-source-transform.js +525 -0
- package/dist/semantics/prototype-reparenting.d.ts +50 -0
- package/dist/semantics/prototype-reparenting.js +317 -0
- package/dist/semantics/stable-checker.d.ts +10 -0
- package/dist/semantics/stable-checker.js +148 -0
- package/dist/semantics/subclass-member-overlay-transform.d.ts +35 -0
- package/dist/semantics/subclass-member-overlay-transform.js +1418 -0
- package/dist/semantics/symbol-keyed-expando-source-transform.d.ts +4 -0
- package/dist/semantics/symbol-keyed-expando-source-transform.js +66 -0
- package/dist/semantics/this-constructor-source-transform.d.ts +4 -0
- package/dist/semantics/this-constructor-source-transform.js +122 -0
- package/dist/semantics/uninstantiable-classes.d.ts +22 -0
- package/dist/semantics/uninstantiable-classes.js +75 -0
- package/dist/targets/cpp/balanced-units.d.ts +3 -0
- package/dist/targets/cpp/balanced-units.js +58 -0
- package/dist/targets/cpp/borrowed-call-entry.d.ts +30 -0
- package/dist/targets/cpp/borrowed-call-entry.js +68 -0
- package/dist/targets/cpp/captures.d.ts +68 -0
- package/dist/targets/cpp/captures.js +269 -0
- package/dist/targets/cpp/class-layout.d.ts +313 -0
- package/dist/targets/cpp/class-layout.js +483 -0
- package/dist/targets/cpp/class-properties/computed-method-value.d.ts +25 -0
- package/dist/targets/cpp/class-properties/computed-method-value.js +22 -0
- package/dist/targets/cpp/class-properties/emit-class-properties.d.ts +216 -0
- package/dist/targets/cpp/class-properties/emit-class-properties.js +917 -0
- package/dist/targets/cpp/class-properties/native-prototype.d.ts +11 -0
- package/dist/targets/cpp/class-properties/native-prototype.js +101 -0
- package/dist/targets/cpp/class-ref-transport.d.ts +12 -0
- package/dist/targets/cpp/class-ref-transport.js +32 -0
- package/dist/targets/cpp/conversions.d.ts +3 -0
- package/dist/targets/cpp/conversions.js +2027 -0
- package/dist/targets/cpp/deferral-safety.d.ts +82 -0
- package/dist/targets/cpp/deferral-safety.js +86 -0
- package/dist/targets/cpp/direct-call-receivers.d.ts +37 -0
- package/dist/targets/cpp/direct-call-receivers.js +79 -0
- package/dist/targets/cpp/document.d.ts +74 -0
- package/dist/targets/cpp/document.js +106 -0
- package/dist/targets/cpp/emit-allocation.d.ts +60 -0
- package/dist/targets/cpp/emit-allocation.js +573 -0
- package/dist/targets/cpp/emit-arrays.d.ts +119 -0
- package/dist/targets/cpp/emit-arrays.js +1047 -0
- package/dist/targets/cpp/emit-binding-reference.d.ts +17 -0
- package/dist/targets/cpp/emit-binding-reference.js +120 -0
- package/dist/targets/cpp/emit-bindings.d.ts +158 -0
- package/dist/targets/cpp/emit-bindings.js +769 -0
- package/dist/targets/cpp/emit-buffers.d.ts +156 -0
- package/dist/targets/cpp/emit-buffers.js +573 -0
- package/dist/targets/cpp/emit-callable.d.ts +230 -0
- package/dist/targets/cpp/emit-callable.js +2154 -0
- package/dist/targets/cpp/emit-carrier-members.d.ts +406 -0
- package/dist/targets/cpp/emit-carrier-members.js +1224 -0
- package/dist/targets/cpp/emit-coercion.d.ts +26 -0
- package/dist/targets/cpp/emit-coercion.js +39 -0
- package/dist/targets/cpp/emit-context.d.ts +1882 -0
- package/dist/targets/cpp/emit-context.js +904 -0
- package/dist/targets/cpp/emit-dynamic-properties.d.ts +174 -0
- package/dist/targets/cpp/emit-dynamic-properties.js +1249 -0
- package/dist/targets/cpp/emit-equality.d.ts +39 -0
- package/dist/targets/cpp/emit-equality.js +472 -0
- package/dist/targets/cpp/emit-exceptions.d.ts +104 -0
- package/dist/targets/cpp/emit-exceptions.js +513 -0
- package/dist/targets/cpp/emit-field-owner.d.ts +4 -0
- package/dist/targets/cpp/emit-field-owner.js +27 -0
- package/dist/targets/cpp/emit-in.d.ts +31 -0
- package/dist/targets/cpp/emit-in.js +426 -0
- package/dist/targets/cpp/emit-instanceof.d.ts +19 -0
- package/dist/targets/cpp/emit-instanceof.js +601 -0
- package/dist/targets/cpp/emit-integers.d.ts +68 -0
- package/dist/targets/cpp/emit-integers.js +184 -0
- package/dist/targets/cpp/emit-iterator.d.ts +100 -0
- package/dist/targets/cpp/emit-iterator.js +1137 -0
- package/dist/targets/cpp/emit-json.d.ts +73 -0
- package/dist/targets/cpp/emit-json.js +823 -0
- package/dist/targets/cpp/emit-jsx.d.ts +74 -0
- package/dist/targets/cpp/emit-jsx.js +806 -0
- package/dist/targets/cpp/emit-mixed-binary.d.ts +51 -0
- package/dist/targets/cpp/emit-mixed-binary.js +60 -0
- package/dist/targets/cpp/emit-namespaces.d.ts +101 -0
- package/dist/targets/cpp/emit-namespaces.js +133 -0
- package/dist/targets/cpp/emit-narrowing.d.ts +738 -0
- package/dist/targets/cpp/emit-narrowing.js +3967 -0
- package/dist/targets/cpp/emit-native-equality.d.ts +3 -0
- package/dist/targets/cpp/emit-native-equality.js +14 -0
- package/dist/targets/cpp/emit-native-selection.d.ts +5 -0
- package/dist/targets/cpp/emit-native-selection.js +37 -0
- package/dist/targets/cpp/emit-object-tag.d.ts +4 -0
- package/dist/targets/cpp/emit-object-tag.js +108 -0
- package/dist/targets/cpp/emit-owned-record.d.ts +2 -0
- package/dist/targets/cpp/emit-owned-record.js +15 -0
- package/dist/targets/cpp/emit-presence.d.ts +78 -0
- package/dist/targets/cpp/emit-presence.js +376 -0
- package/dist/targets/cpp/emit-properties.d.ts +105 -0
- package/dist/targets/cpp/emit-properties.js +1640 -0
- package/dist/targets/cpp/emit-record-view.d.ts +20 -0
- package/dist/targets/cpp/emit-record-view.js +354 -0
- package/dist/targets/cpp/emit-return.d.ts +5 -0
- package/dist/targets/cpp/emit-return.js +237 -0
- package/dist/targets/cpp/emit-sum-widening.d.ts +10 -0
- package/dist/targets/cpp/emit-sum-widening.js +69 -0
- package/dist/targets/cpp/emit-tonumber.d.ts +38 -0
- package/dist/targets/cpp/emit-tonumber.js +177 -0
- package/dist/targets/cpp/emit-tostring.d.ts +92 -0
- package/dist/targets/cpp/emit-tostring.js +556 -0
- package/dist/targets/cpp/emit-typeof.d.ts +49 -0
- package/dist/targets/cpp/emit-typeof.js +317 -0
- package/dist/targets/cpp/emit-union-properties.d.ts +181 -0
- package/dist/targets/cpp/emit-union-properties.js +1281 -0
- package/dist/targets/cpp/emit.d.ts +45 -0
- package/dist/targets/cpp/emit.js +2225 -0
- package/dist/targets/cpp/error-types.d.ts +4 -0
- package/dist/targets/cpp/error-types.js +11 -0
- package/dist/targets/cpp/function-source-reads.d.ts +72 -0
- package/dist/targets/cpp/function-source-reads.js +148 -0
- package/dist/targets/cpp/host/atomics.d.ts +25 -0
- package/dist/targets/cpp/host/atomics.js +63 -0
- package/dist/targets/cpp/host/core-globals.d.ts +108 -0
- package/dist/targets/cpp/host/core-globals.js +158 -0
- package/dist/targets/cpp/host/dynamic-argument-members.d.ts +42 -0
- package/dist/targets/cpp/host/dynamic-argument-members.js +61 -0
- package/dist/targets/cpp/host/emit-host-arity.d.ts +139 -0
- package/dist/targets/cpp/host/emit-host-arity.js +232 -0
- package/dist/targets/cpp/host/emit-host-invoke.d.ts +91 -0
- package/dist/targets/cpp/host/emit-host-invoke.js +1105 -0
- package/dist/targets/cpp/host/emit-host-object.d.ts +55 -0
- package/dist/targets/cpp/host/emit-host-object.js +2206 -0
- package/dist/targets/cpp/host/emit-host-properties.d.ts +69 -0
- package/dist/targets/cpp/host/emit-host-properties.js +533 -0
- package/dist/targets/cpp/host/emit-host-reflect.d.ts +4 -0
- package/dist/targets/cpp/host/emit-host-reflect.js +180 -0
- package/dist/targets/cpp/host/emit-host-value.d.ts +120 -0
- package/dist/targets/cpp/host/emit-host-value.js +392 -0
- package/dist/targets/cpp/host/host-members.d.ts +505 -0
- package/dist/targets/cpp/host/host-members.js +819 -0
- package/dist/targets/cpp/host/host-method-aliases.d.ts +30 -0
- package/dist/targets/cpp/host/host-method-aliases.js +76 -0
- package/dist/targets/cpp/host/native-protocols.d.ts +47 -0
- package/dist/targets/cpp/host/native-protocols.js +183 -0
- package/dist/targets/cpp/host/object-protocol.d.ts +351 -0
- package/dist/targets/cpp/host/object-protocol.js +671 -0
- package/dist/targets/cpp/host-namespace-reads.d.ts +83 -0
- package/dist/targets/cpp/host-namespace-reads.js +113 -0
- package/dist/targets/cpp/manifest/capabilities.d.ts +39 -0
- package/dist/targets/cpp/manifest/capabilities.js +1484 -0
- package/dist/targets/cpp/manifest.d.ts +23 -0
- package/dist/targets/cpp/manifest.js +113 -0
- package/dist/targets/cpp/native-error-base.d.ts +38 -0
- package/dist/targets/cpp/native-error-base.js +74 -0
- package/dist/targets/cpp/native-narrowing-transport.d.ts +12 -0
- package/dist/targets/cpp/native-narrowing-transport.js +151 -0
- package/dist/targets/cpp/native-selection-helpers.d.ts +11 -0
- package/dist/targets/cpp/native-selection-helpers.js +46 -0
- package/dist/targets/cpp/native-symbol-keys.d.ts +8 -0
- package/dist/targets/cpp/native-symbol-keys.js +34 -0
- package/dist/targets/cpp/ownership.d.ts +43 -0
- package/dist/targets/cpp/ownership.js +38 -0
- package/dist/targets/cpp/owning-conversion-input.d.ts +14 -0
- package/dist/targets/cpp/owning-conversion-input.js +12 -0
- package/dist/targets/cpp/property-read-claims.d.ts +62 -0
- package/dist/targets/cpp/property-read-claims.js +23 -0
- package/dist/targets/cpp/property-store-claims.d.ts +62 -0
- package/dist/targets/cpp/property-store-claims.js +26 -0
- package/dist/targets/cpp/prototype/emit-prototype-array.d.ts +111 -0
- package/dist/targets/cpp/prototype/emit-prototype-array.js +602 -0
- package/dist/targets/cpp/prototype/emit-prototype-date.d.ts +133 -0
- package/dist/targets/cpp/prototype/emit-prototype-date.js +515 -0
- package/dist/targets/cpp/prototype/emit-prototype-error.d.ts +13 -0
- package/dist/targets/cpp/prototype/emit-prototype-error.js +54 -0
- package/dist/targets/cpp/prototype/emit-prototype-invoke.d.ts +34 -0
- package/dist/targets/cpp/prototype/emit-prototype-invoke.js +1003 -0
- package/dist/targets/cpp/prototype/emit-prototype-iterator.d.ts +47 -0
- package/dist/targets/cpp/prototype/emit-prototype-iterator.js +250 -0
- package/dist/targets/cpp/prototype/emit-prototype-promise.d.ts +46 -0
- package/dist/targets/cpp/prototype/emit-prototype-promise.js +143 -0
- package/dist/targets/cpp/prototype/emit-prototype-regexp.d.ts +335 -0
- package/dist/targets/cpp/prototype/emit-prototype-regexp.js +853 -0
- package/dist/targets/cpp/prototype/emit-prototype-string.d.ts +42 -0
- package/dist/targets/cpp/prototype/emit-prototype-string.js +252 -0
- package/dist/targets/cpp/prototype/prototype-method-reads.d.ts +25 -0
- package/dist/targets/cpp/prototype/prototype-method-reads.js +182 -0
- package/dist/targets/cpp/reactive-dependencies.d.ts +140 -0
- package/dist/targets/cpp/reactive-dependencies.js +432 -0
- package/dist/targets/cpp/reactive-origins.d.ts +44 -0
- package/dist/targets/cpp/reactive-origins.js +82 -0
- package/dist/targets/cpp/records.d.ts +277 -0
- package/dist/targets/cpp/records.js +2427 -0
- package/dist/targets/cpp/recursive-containers.d.ts +43 -0
- package/dist/targets/cpp/recursive-containers.js +144 -0
- package/dist/targets/cpp/regexp-types.d.ts +56 -0
- package/dist/targets/cpp/regexp-types.js +59 -0
- package/dist/targets/cpp/substrate.d.ts +125 -0
- package/dist/targets/cpp/substrate.js +12 -0
- package/dist/targets/cpp/translation-unit.d.ts +219 -0
- package/dist/targets/cpp/translation-unit.js +2063 -0
- package/dist/targets/cpp/types.d.ts +280 -0
- package/dist/targets/cpp/types.js +1135 -0
- package/dist/targets/cpp/virtual-methods.d.ts +95 -0
- package/dist/targets/cpp/virtual-methods.js +264 -0
- package/package.json +95 -0
- package/src/targets/cpp/runtime/gea_dynamic_proxy.h +824 -0
- package/src/targets/cpp/runtime/gea_eval.h +1376 -0
- package/src/targets/cpp/runtime/gea_native_class_prototype.h +44 -0
- package/src/targets/cpp/runtime/gea_runtime.h +29222 -0
- package/src/targets/cpp/runtime/gea_runtime_builtins.cpp +55 -0
|
@@ -0,0 +1,1474 @@
|
|
|
1
|
+
import type { DeclarationId, FunctionId, IrValueId, OperationId, PhysicalBodyId, RegionId, SemanticResultId } from '../identity/ids.js';
|
|
2
|
+
import type { CallableAbi, Representation } from '../representation/model.js';
|
|
3
|
+
import type { ConstantLiteral } from '../semantics/model/operands.js';
|
|
4
|
+
import type { HostMethodBinding } from '../semantics/host-methods.js';
|
|
5
|
+
import type { SemanticTargetProof } from '../semantics/model/operations.js';
|
|
6
|
+
import type { VirtualMemberRole } from '../projection/dispatch.js';
|
|
7
|
+
import type { NativeEqualityRecipe } from './native-equality.js';
|
|
8
|
+
import type { FixedDataDefinitionRecipe } from './fixed-data-definition.js';
|
|
9
|
+
import type { TypedComputedReadRecipe, TypedComputedWriteRecipe } from './typed-property-access.js';
|
|
10
|
+
/**
|
|
11
|
+
* The typed IR: verified SSA values and a closed operation union.
|
|
12
|
+
*
|
|
13
|
+
* Every operation here is one of the object-substrate internal methods, a
|
|
14
|
+
* callable/CFG/value primitive, an allocation of one of the runtime carriers,
|
|
15
|
+
* a conversion-use application, or an iterator-protocol step. Nothing here may
|
|
16
|
+
* be named after a framework, fixture, or optimization -- `proxy-wrap`,
|
|
17
|
+
* `direct-map`, `fresh-array`, and similar source-shaped names are exactly the
|
|
18
|
+
* defect the object substrate exists to prevent (architecture.md, "Non-
|
|
19
|
+
* negotiable runtime object substrate").
|
|
20
|
+
*
|
|
21
|
+
* Property syntax lowers through the object internal methods only: `get`,
|
|
22
|
+
* `set`, `delete`, `has-property`, `own-property-keys`, `define-own-property`.
|
|
23
|
+
* There is no second, source-shaped route from a property expression to a
|
|
24
|
+
* runtime operation.
|
|
25
|
+
*/
|
|
26
|
+
declare const irBlockBrand: unique symbol;
|
|
27
|
+
/** A basic block inside one physical body. Never an identity outside that body. */
|
|
28
|
+
export type IrBlockId = string & {
|
|
29
|
+
readonly [irBlockBrand]: 'IrBlockId';
|
|
30
|
+
};
|
|
31
|
+
export declare const irBlockId: (owner: PhysicalBodyId, ordinal: number) => IrBlockId;
|
|
32
|
+
/**
|
|
33
|
+
* The authenticated conversion-use identity a `convert` operation applies.
|
|
34
|
+
*
|
|
35
|
+
* Minted and owned by the `conversion/` capability algebra, not by typed IR.
|
|
36
|
+
* Left as a plain string, like `ConversionNodeId` in `conversion/algebra.ts`,
|
|
37
|
+
* because typed IR only cites it -- it never mints or interprets one.
|
|
38
|
+
*/
|
|
39
|
+
export type ConversionUseId = string;
|
|
40
|
+
/**
|
|
41
|
+
* One value an operation consumes, paired with the carrier the consuming
|
|
42
|
+
* operation expects it to have.
|
|
43
|
+
*
|
|
44
|
+
* The pairing looks redundant with the definition the id points to, but it is
|
|
45
|
+
* the same deliberate redundancy `SemanticOperand.type` uses against the
|
|
46
|
+
* structural-type table: the consumer states its expectation so verification
|
|
47
|
+
* can catch the case where a producer's published carrier and a consumer's
|
|
48
|
+
* assumed carrier have quietly diverged, instead of trusting that they always
|
|
49
|
+
* agree.
|
|
50
|
+
*/
|
|
51
|
+
export interface IrOperand {
|
|
52
|
+
readonly value: IrValueId;
|
|
53
|
+
readonly representation: Representation;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* How the target hands an operand's value to the site consuming it: `move`
|
|
57
|
+
* empties the source storage (the value's last use anywhere in the unit, or
|
|
58
|
+
* the last use of a physically owned SSA temporary), `retain` leaves it
|
|
59
|
+
* (copy or borrow, decided elsewhere by carrier ownership -- see
|
|
60
|
+
* `ir/transfer.ts`). There is no third "borrow" arm here because this fact
|
|
61
|
+
* only ever proves one thing, a last use; an ABI's own ownership tier is a
|
|
62
|
+
* different question (`representation/model.ts`'s `AbiParameter.passing`).
|
|
63
|
+
*
|
|
64
|
+
* Per-operand in name, not in storage: `ir/transfer.ts`'s whole-program
|
|
65
|
+
* analysis runs after every body is built, so it publishes value-keyed facts
|
|
66
|
+
* (`TransferFacts`) rather than mutating already-built `IrOperand`s in place.
|
|
67
|
+
* A value the analysis can flag is read from exactly one structural site by
|
|
68
|
+
* construction (the dying tests below all require a single use), so keying
|
|
69
|
+
* by `IrValueId` is equivalent to keying by the one operand that names it.
|
|
70
|
+
*/
|
|
71
|
+
export type ValueTransfer = 'move' | 'retain';
|
|
72
|
+
/** One value an operation defines. Never a second declaration of a carrier already selected upstream. */
|
|
73
|
+
export interface IrResult {
|
|
74
|
+
readonly id: IrValueId;
|
|
75
|
+
readonly representation: Representation;
|
|
76
|
+
}
|
|
77
|
+
/** Fields every operation carries, regardless of kind. */
|
|
78
|
+
export interface IrOperationBase {
|
|
79
|
+
/**
|
|
80
|
+
* The published semantic result this operation lowers.
|
|
81
|
+
*
|
|
82
|
+
* Per "one operation, one authoritative result", this is a citation, not a
|
|
83
|
+
* proof: the operation does not re-derive or duplicate anything the
|
|
84
|
+
* semantic/representation layers already decided.
|
|
85
|
+
*
|
|
86
|
+
* Every ordinary operation carries this citation even when it discards its
|
|
87
|
+
* runtime value. Only synthesized jump/return terminators widen lineage to
|
|
88
|
+
* null in their own interfaces; adding an operation cannot accidentally make
|
|
89
|
+
* missing provenance a valid input to the builder.
|
|
90
|
+
*/
|
|
91
|
+
readonly lineage: SemanticResultId;
|
|
92
|
+
}
|
|
93
|
+
export interface GetOperation extends IrOperationBase {
|
|
94
|
+
readonly hostMethod?: HostMethodBinding;
|
|
95
|
+
readonly kind: 'get';
|
|
96
|
+
/** Semantic proof that normal completion is the undefined value. */
|
|
97
|
+
readonly normalResult?: 'undefined';
|
|
98
|
+
readonly receiver: IrOperand;
|
|
99
|
+
readonly key: IrOperand;
|
|
100
|
+
readonly result: IrResult;
|
|
101
|
+
/**
|
|
102
|
+
* `true` when this read names a class field an installed plugin declared a
|
|
103
|
+
* reactive cell -- `PluginCapabilities.reactiveClassFields`, merged once per
|
|
104
|
+
* lowering run (`ir/lower.ts`) and consulted at the one point a property
|
|
105
|
+
* read is built (`lower-property.ts`, `lower-destructuring.ts`'s object
|
|
106
|
+
* pattern step).
|
|
107
|
+
*
|
|
108
|
+
* Stated here, on the operation, instead of re-asked at render time: the
|
|
109
|
+
* target's own answer to the same question (`targets/cpp/records.ts`'s
|
|
110
|
+
* `celled`/`revisions`) is not published until STRUCT RENDERING runs, which
|
|
111
|
+
* is after this read has already been built, so a printer that "asks
|
|
112
|
+
* again" is really asking a table that does not exist yet for the body
|
|
113
|
+
* currently rendering and is forced to substitute a whole-program
|
|
114
|
+
* over-approximation instead (`emit.ts`'s deferral policy used to flatten
|
|
115
|
+
* every struct's celled keys into one bare name set, so a plain field
|
|
116
|
+
* merely SHARING a name with some other class's reactive field anywhere in
|
|
117
|
+
* the program was refused deferral too). This fact is a plan-time
|
|
118
|
+
* question -- which field a plugin marked reactive -- and belongs beside
|
|
119
|
+
* the read that resolved it, not behind a second, later-arriving table.
|
|
120
|
+
*
|
|
121
|
+
* Deliberately NOT the cell-vs-companion-revision distinction
|
|
122
|
+
* (`records.ts`'s `representationCanCell`): that is a C++ carrier decision
|
|
123
|
+
* made during struct rendering, still asked from `celled`/`revisions`
|
|
124
|
+
* wherever it matters (`class-properties/emit-class-properties.ts`,
|
|
125
|
+
* `reactive-dependencies.ts`). This marker only answers "did the plugin
|
|
126
|
+
* name this field reactive", which is enough to settle every consumer that
|
|
127
|
+
* was asking exactly that and nothing more.
|
|
128
|
+
*/
|
|
129
|
+
readonly reactive?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* The census's answer for a `prototype` read off a callable carrier
|
|
132
|
+
* (`semantics/callable-origins.ts`'s `callableOwnPrototypeAt`): `true` where
|
|
133
|
+
* the declaration ran `MakeConstructor`, `false` where it provably did not,
|
|
134
|
+
* and ABSENT where the census proved neither -- which is why this is present
|
|
135
|
+
* at `false` rather than stripped. Its presence is the printer's proof that
|
|
136
|
+
* this read is the one certification admitted.
|
|
137
|
+
*
|
|
138
|
+
* Stated here for the same reason `reactive` above is: the CARRIER cannot
|
|
139
|
+
* answer it. `function-and-constructor` materializes its prototype from
|
|
140
|
+
* inside the runtime read because being constructable is proof enough there,
|
|
141
|
+
* while a `function-value-dispatch` receiver has no such proof in its
|
|
142
|
+
* carrier -- the fact belongs to the DECLARATION, and this is where the one
|
|
143
|
+
* layer that could ask hands it to the one layer that spells it.
|
|
144
|
+
*/
|
|
145
|
+
readonly callableOwnPrototype?: boolean;
|
|
146
|
+
/** A sealed finite-key fixed-field read, when lowering published one. */
|
|
147
|
+
readonly typedComputedRead?: TypedComputedReadRecipe;
|
|
148
|
+
/**
|
|
149
|
+
* Class arms of this read's union receiver that provably answer `undefined`
|
|
150
|
+
* for its key (`reflection-demand.ts`'s `finalizeAbsentClassArms`): no class
|
|
151
|
+
* on the arm's chain or below it declares the key, it is no
|
|
152
|
+
* `Object.prototype` member, and the closed reflection census left the
|
|
153
|
+
* class without a dynamic protocol -- so nothing in the program can give
|
|
154
|
+
* one of its instances that own property. The printer renders these arms
|
|
155
|
+
* as the result's `undefined` instead of an expando lookup.
|
|
156
|
+
*/
|
|
157
|
+
readonly absentClassArms?: readonly DeclarationId[];
|
|
158
|
+
/** A field read whose synthetic ancestor slot was relocated to its real owners. */
|
|
159
|
+
readonly nativeFieldOwnerRead?: import('./native-field-owner.js').NativeFieldOwnerRead;
|
|
160
|
+
/** Callable identity proved from an unmodified compiler-owned record allocation. */
|
|
161
|
+
readonly closedCallable?: CallCalleeIdentity;
|
|
162
|
+
/**
|
|
163
|
+
* The computed key's proven finite name set, copied from
|
|
164
|
+
* `PropertyOperation.provenKeyTexts` while the semantic graph is still open
|
|
165
|
+
* -- by emission the key is an opaque `std::string` and the question can no
|
|
166
|
+
* longer be asked. `reflection-demand.ts` is the one reader: at a computed
|
|
167
|
+
* key it cannot resolve to a constant, this lets it demand each proven
|
|
168
|
+
* field by name (`promoteNamedField`, fanned across the receiver's whole
|
|
169
|
+
* class family) instead of the whole reachable carrier graph
|
|
170
|
+
* (`promoteFull`). Absent for a static key and absent whenever the proof
|
|
171
|
+
* refused or failed to survive the sealed host-mutation census's own
|
|
172
|
+
* obligations -- an upper bound never assumed beyond what was proven.
|
|
173
|
+
*/
|
|
174
|
+
readonly provenKeyTexts?: readonly string[];
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* `[[Set]]` returns a success boolean that ordinary (non-strict) assignment
|
|
178
|
+
* discards. `result` is therefore optional: a producer that has nowhere to
|
|
179
|
+
* route the boolean is not forced to invent an SSA value nobody reads.
|
|
180
|
+
*/
|
|
181
|
+
export interface SetOperation extends IrOperationBase {
|
|
182
|
+
readonly kind: 'set';
|
|
183
|
+
/** Preserved from the source Reference Record; false `[[Set]]` throws only in strict code. */
|
|
184
|
+
readonly strict: boolean;
|
|
185
|
+
readonly receiver: IrOperand;
|
|
186
|
+
readonly key: IrOperand;
|
|
187
|
+
readonly value: IrOperand;
|
|
188
|
+
readonly result: IrResult | null;
|
|
189
|
+
/**
|
|
190
|
+
* Present when the key's semantic type was a finite set of string literals
|
|
191
|
+
* that all name declared fields of the receiver. Sealed during lowering,
|
|
192
|
+
* where the semantic graph is still open; by emission time the key is a
|
|
193
|
+
* `std::string` and the question can no longer be asked.
|
|
194
|
+
*/
|
|
195
|
+
readonly typedComputedWrite?: TypedComputedWriteRecipe;
|
|
196
|
+
/** See `GetOperation.provenKeyTexts` -- the same fact, copied for a `[[Set]]`'s own computed key. */
|
|
197
|
+
readonly provenKeyTexts?: readonly string[];
|
|
198
|
+
}
|
|
199
|
+
export interface DeleteOperation extends IrOperationBase {
|
|
200
|
+
readonly kind: 'delete';
|
|
201
|
+
/** Preserved from the source Reference Record; false [[Delete]] throws only in strict code. */
|
|
202
|
+
readonly strict: boolean;
|
|
203
|
+
readonly receiver: IrOperand;
|
|
204
|
+
readonly key: IrOperand;
|
|
205
|
+
readonly result: IrResult | null;
|
|
206
|
+
}
|
|
207
|
+
export interface HasPropertyOperation extends IrOperationBase {
|
|
208
|
+
readonly kind: 'has-property';
|
|
209
|
+
readonly receiver: IrOperand;
|
|
210
|
+
readonly key: IrOperand;
|
|
211
|
+
readonly result: IrResult;
|
|
212
|
+
}
|
|
213
|
+
export interface OwnPropertyKeysOperation extends IrOperationBase {
|
|
214
|
+
readonly kind: 'own-property-keys';
|
|
215
|
+
readonly receiver: IrOperand;
|
|
216
|
+
readonly result: IrResult;
|
|
217
|
+
}
|
|
218
|
+
/** The attributes `[[DefineOwnProperty]]` installs. A data descriptor; the value itself is a separate operand. */
|
|
219
|
+
export interface IrPropertyAttributes {
|
|
220
|
+
readonly writable: boolean;
|
|
221
|
+
readonly enumerable: boolean;
|
|
222
|
+
readonly configurable: boolean;
|
|
223
|
+
}
|
|
224
|
+
export interface DefineOwnPropertyOperation extends IrOperationBase {
|
|
225
|
+
readonly kind: 'define-own-property';
|
|
226
|
+
readonly receiver: IrOperand;
|
|
227
|
+
readonly key: IrOperand;
|
|
228
|
+
readonly value: IrOperand;
|
|
229
|
+
readonly attributes: IrPropertyAttributes;
|
|
230
|
+
readonly result: IrResult | null;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Object spread's `CopyDataProperties` (ECMA-262 7.3.25) when the source's
|
|
234
|
+
* own-property set is not known until this operation runs -- `producers/
|
|
235
|
+
* protocol.ts`'s `contributeObjectSpread`, lowered by `lower-protocol.ts`.
|
|
236
|
+
*
|
|
237
|
+
* Not a `define-own-property` with a dynamic key: that operation is exactly
|
|
238
|
+
* ONE key, known before it runs (`operation.key`), and this copy's whole
|
|
239
|
+
* reason to exist is that the keys are not known until the emitted C++
|
|
240
|
+
* actually walks the source -- `targets/cpp/emit-allocation.ts` is where that
|
|
241
|
+
* walk (and, for a source with statically-keyed arms, the per-arm field
|
|
242
|
+
* unroll) is rendered. It publishes no result: `CopyDataProperties` is not a
|
|
243
|
+
* value a JS consumer ever reads, and `receiver`/`source` are the only two
|
|
244
|
+
* operands the copy needs.
|
|
245
|
+
*/
|
|
246
|
+
export interface SpreadCopyOperation extends IrOperationBase {
|
|
247
|
+
readonly kind: 'spread-copy';
|
|
248
|
+
readonly receiver: IrOperand;
|
|
249
|
+
readonly source: IrOperand;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* `receiver` is `null` exactly when the callee's ABI declares no receiver
|
|
253
|
+
* (`CallableAbi.receiver === null`), mirroring that field instead of forcing
|
|
254
|
+
* every free-function call to carry a manufactured `undefined` operand.
|
|
255
|
+
*
|
|
256
|
+
* `result` is optional because a callable ABI whose result is `void` is "not
|
|
257
|
+
* a value carrier at all" (`representation/model.ts`): there is nothing to
|
|
258
|
+
* mint an SSA id for.
|
|
259
|
+
*/
|
|
260
|
+
export interface CallOperation extends IrOperationBase {
|
|
261
|
+
readonly kind: 'call';
|
|
262
|
+
/** Closed body entry, including evaluated arguments that do not enter its fixed frame. */
|
|
263
|
+
readonly closedFrame?: {
|
|
264
|
+
readonly abi: CallableAbi;
|
|
265
|
+
readonly receivedArguments: number;
|
|
266
|
+
readonly result: 'exact' | 'ignored' | 'undefined';
|
|
267
|
+
};
|
|
268
|
+
readonly callee: IrOperand;
|
|
269
|
+
readonly receiver: IrOperand | null;
|
|
270
|
+
readonly arguments: readonly IrOperand[];
|
|
271
|
+
readonly result: IrResult | null;
|
|
272
|
+
/** A retained ModuleRecord exposed through a host's dynamic builtin lookup. */
|
|
273
|
+
readonly builtinModuleLookup?: {
|
|
274
|
+
readonly target: RegionId;
|
|
275
|
+
readonly builtinModule: string;
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* `true` exactly when `arguments` holds ONE operand that is itself the
|
|
279
|
+
* whole, already-materialized element sequence of a spread argument
|
|
280
|
+
* (`console.log(...values)`) reaching a receiver with no physical calling
|
|
281
|
+
* convention to range-copy into -- `ir/lower-invocation.ts`'s own comment
|
|
282
|
+
* on the guard this lifts for exactly that shape. Indistinguishable from an
|
|
283
|
+
* ordinary single array-typed argument (`console.log(values)`) by
|
|
284
|
+
* `arguments` alone, which is why this exists: only `emit-host-invoke.ts`'s
|
|
285
|
+
* `variadic` arity reads it, to render a runtime join over the array's
|
|
286
|
+
* elements instead of ToString-ing the array itself as one value. Absent
|
|
287
|
+
* everywhere else, so no other consumer of `arguments` is affected.
|
|
288
|
+
*/
|
|
289
|
+
readonly argumentsAreSpread?: boolean;
|
|
290
|
+
/** Authenticated host property with a borrowed numeric rest sequence, instead of an escaping rest array. */
|
|
291
|
+
readonly numericRestHostCall?: {
|
|
292
|
+
readonly protocol: string;
|
|
293
|
+
readonly member: string;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* For a callee carried as a `generic-function-set`: the body to run for
|
|
297
|
+
* each member the tag can name, by the member's declaration id. The set's
|
|
298
|
+
* members are the tag's index space; this says which instantiated copy
|
|
299
|
+
* each index dispatches to at THIS call, since a generic function has a
|
|
300
|
+
* different copy at every call that instantiates it differently.
|
|
301
|
+
*/
|
|
302
|
+
readonly family?: readonly {
|
|
303
|
+
readonly member: DeclarationId;
|
|
304
|
+
readonly functionId: FunctionId;
|
|
305
|
+
}[];
|
|
306
|
+
/**
|
|
307
|
+
* Which of the three ways this call can bypass the callee's own
|
|
308
|
+
* `CallableObject` invoke pointer, or `unresolved` for the ordinary
|
|
309
|
+
* indirect call every callee carrier already supports.
|
|
310
|
+
*
|
|
311
|
+
* Absent (rather than `unresolved`) exactly when nothing has filled it
|
|
312
|
+
* yet: `ir/call-dispatch.ts`'s `fillCallDispatchTargets` is a post-shake
|
|
313
|
+
* rewrite over every `call` operation (the `ir/generator-split.ts` body-
|
|
314
|
+
* rewrite pattern, applied to operations instead of bodies), run in
|
|
315
|
+
* `compiler.ts` after `shakeProgram` and `ir/captures.ts`'s
|
|
316
|
+
* `publishCaptureFacts` -- never during lowering. All three facts this
|
|
317
|
+
* field can name test whether the callee's underlying body captures
|
|
318
|
+
* anything (the sealed `CallOperation.target` fact), and that answer -- `IrBody.facts.capturedDeclarations`/
|
|
319
|
+
* `.capturedReceiver` -- does not exist until a body has been shaken and
|
|
320
|
+
* published, both of which happen after every `call` operation in the
|
|
321
|
+
* program has already been built.
|
|
322
|
+
*
|
|
323
|
+
* `targets/cpp/virtual-methods.ts` used to be the only place that decided
|
|
324
|
+
* the `virtual` half of this (whether a family is actually dispatchable,
|
|
325
|
+
* not just overridden); that verdict is `projection/dispatch.ts`'s
|
|
326
|
+
* `virtualDispatchVerdictOf` now, so a target reads this field instead of
|
|
327
|
+
* re-deriving the same test from a whole-unit capture index built at
|
|
328
|
+
* render time.
|
|
329
|
+
*/
|
|
330
|
+
readonly target?: CallDispatchTarget;
|
|
331
|
+
/**
|
|
332
|
+
* The compiler-owned body identity of this call's callee, when the same
|
|
333
|
+
* producer/member resolution used by `target` proved it without requiring
|
|
334
|
+
* capture-free physical devirtualization. This is deliberately separate
|
|
335
|
+
* from `target`: a capturing closure still calls through its ordinary
|
|
336
|
+
* `CallableObject` path, while reflection census may use the authenticated
|
|
337
|
+
* body identity to match the call ABI. Absent means the callee is open,
|
|
338
|
+
* dynamic, computed, or otherwise not closed.
|
|
339
|
+
*/
|
|
340
|
+
readonly closedCallee?: CallCalleeIdentity;
|
|
341
|
+
/** Authenticated own-key intrinsic, retained only for a projected intrinsic-template call. */
|
|
342
|
+
readonly intrinsicOwnKeys?: true;
|
|
343
|
+
/** Authenticated Reflect operation: a native ABI still observes this property protocol. */
|
|
344
|
+
readonly intrinsicReflection?: 'get' | 'set' | 'has' | 'deleteProperty' | 'getOwnPropertyDescriptor';
|
|
345
|
+
/**
|
|
346
|
+
* Authenticated `Array.isArray` -- ECMA-262 23.1.2.2, whose whole answer is
|
|
347
|
+
* the argument's own carrier. Read by `ir/native-carrier-predicate.ts`; the
|
|
348
|
+
* printer spells the call from the host member table, exactly as it does for
|
|
349
|
+
* `intrinsicOwnKeys`.
|
|
350
|
+
*/
|
|
351
|
+
readonly intrinsicCarrierPredicate?: true;
|
|
352
|
+
/**
|
|
353
|
+
* The host template the printer spells this call from, when it is one this IR
|
|
354
|
+
* states a frame for (`ir/lower-invocation.ts`'s `hostTemplateOf`):
|
|
355
|
+
* `Object.assign` (`emit-host-object.ts`'s `assignText`), `Array.isArray`
|
|
356
|
+
* (`emit-host-invoke.ts`'s `isArrayText`) and `%TypedArray%.prototype.set`
|
|
357
|
+
* (`emit-buffers.ts`'s `typedArrayCallText`). Such a call never enters the
|
|
358
|
+
* callee's declared convention, so the reflection census asks the template's
|
|
359
|
+
* own frame (`ir/call-entry.ts`'s `hostTemplateFrameOf`) instead of that ABI.
|
|
360
|
+
*/
|
|
361
|
+
readonly hostTemplate?: import('../representation/host-templates.js').HostTemplate;
|
|
362
|
+
/** A native fixed-slot descriptor update; no unknown callable boundary. */
|
|
363
|
+
readonly fixedDataDefinition?: FixedDataDefinitionRecipe;
|
|
364
|
+
readonly objectValueConversions?: readonly import('./object-value-conversions.js').ObjectValueConversion[];
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* A closed set of compiler-owned bodies a call can enter. This fact names
|
|
368
|
+
* semantic callee identity only; it never licenses the physical direct or
|
|
369
|
+
* virtual dispatch path represented by `CallOperation.target`.
|
|
370
|
+
*/
|
|
371
|
+
export type CallCalleeIdentity = ({
|
|
372
|
+
readonly kind: 'exact';
|
|
373
|
+
readonly functionId: FunctionId;
|
|
374
|
+
} | {
|
|
375
|
+
readonly kind: 'closed-family';
|
|
376
|
+
readonly functionIds: readonly FunctionId[];
|
|
377
|
+
}) & {
|
|
378
|
+
/** Dispatch census proved every implementation's adapter uses no native field protocol. */
|
|
379
|
+
readonly nativeEntryAbi?: CallableAbi;
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* The one census answer behind `CallOperation.target`: which FunctionId (if
|
|
383
|
+
* any) a call's callee resolves to statically, without reading the
|
|
384
|
+
* callee value's own `CallableObject` invoke pointer.
|
|
385
|
+
*
|
|
386
|
+
* `direct` and `union-arm` both require the resolved body to capture
|
|
387
|
+
* nothing -- a member function (`virtual`'s C++ shape) and a bare function
|
|
388
|
+
* pointer (`direct`'s) have no environment slot to carry one -- so all three
|
|
389
|
+
* non-`unresolved` variants are, at bottom, the same capture-freedom test
|
|
390
|
+
* asked of a different callee shape: a closure allocated or read straight
|
|
391
|
+
* off a cell (`direct`), an instance method whose family some subclass
|
|
392
|
+
* overrides (`virtual`), or a method read off a receiver that is itself a
|
|
393
|
+
* union of classes (`union-arm`, one target per class arm the union can
|
|
394
|
+
* hold).
|
|
395
|
+
*/
|
|
396
|
+
export type CallDispatchTarget = {
|
|
397
|
+
readonly kind: 'direct';
|
|
398
|
+
readonly functionId: FunctionId;
|
|
399
|
+
} | {
|
|
400
|
+
readonly kind: 'virtual';
|
|
401
|
+
readonly owner: DeclarationId;
|
|
402
|
+
readonly key: string;
|
|
403
|
+
readonly role: VirtualMemberRole;
|
|
404
|
+
} | {
|
|
405
|
+
readonly kind: 'union-arm';
|
|
406
|
+
readonly arms: readonly CallUnionArmTarget[];
|
|
407
|
+
} | {
|
|
408
|
+
readonly kind: 'unresolved';
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* One arm of a `union-arm` dispatch target: the class a nested tagged-union's
|
|
412
|
+
* arm names, and the body its own (non-overridden, capture-free) method
|
|
413
|
+
* resolves to. `path` is the index sequence through however many
|
|
414
|
+
* `tagged-union` levels the receiver nests, outermost first -- the same
|
|
415
|
+
* indices `targets/cpp/emit-union-properties.ts`'s `armAt`/`armIs` take, so
|
|
416
|
+
* the target names an arm the printer can still find without re-walking the
|
|
417
|
+
* receiver's shape to rediscover it.
|
|
418
|
+
*/
|
|
419
|
+
export interface CallUnionArmTarget {
|
|
420
|
+
readonly path: readonly number[];
|
|
421
|
+
readonly declaration: DeclarationId;
|
|
422
|
+
readonly functionId: FunctionId;
|
|
423
|
+
}
|
|
424
|
+
/** A statically resolved CommonJS module-record lookup. */
|
|
425
|
+
export interface CommonJsRequireOperation extends IrOperationBase {
|
|
426
|
+
readonly kind: 'commonjs-require';
|
|
427
|
+
readonly owner: RegionId;
|
|
428
|
+
readonly target: RegionId;
|
|
429
|
+
/** Canonical host builtin name, or null for an ordinary resolved module. */
|
|
430
|
+
readonly builtinModule: string | null;
|
|
431
|
+
readonly result: IrResult;
|
|
432
|
+
}
|
|
433
|
+
/** A lexical CommonJS wrapper parameter read. */
|
|
434
|
+
export interface CommonJsBindingOperation extends IrOperationBase {
|
|
435
|
+
readonly kind: 'commonjs-binding';
|
|
436
|
+
readonly global: 'require' | 'exports' | 'module';
|
|
437
|
+
readonly owner: RegionId;
|
|
438
|
+
readonly result: IrResult;
|
|
439
|
+
}
|
|
440
|
+
/** A write to one real lexical CommonJS wrapper binding. */
|
|
441
|
+
export interface CommonJsBindingSetOperation extends IrOperationBase {
|
|
442
|
+
readonly kind: 'commonjs-binding-set';
|
|
443
|
+
readonly global: 'require' | 'exports' | 'module';
|
|
444
|
+
readonly owner: RegionId;
|
|
445
|
+
readonly value: IrOperand;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* `super(...)`: the base class's initialization, run against the object this
|
|
449
|
+
* constructor is already building.
|
|
450
|
+
*
|
|
451
|
+
* Not a call, and deliberately not carried as one. A class constructor has no
|
|
452
|
+
* `[[Call]]` at all -- invoking one is a TypeError -- so a `call` whose callee
|
|
453
|
+
* is a constructor has no invoke path, which is exactly what the emitter
|
|
454
|
+
* refused before this kind existed. What `super()` does is `[[Construct]]`'s
|
|
455
|
+
* initialization half against an *existing* receiver: it runs the base chain's
|
|
456
|
+
* field initializers and constructor body, and then, before the next statement
|
|
457
|
+
* of the derived constructor, the derived class's own field initializers.
|
|
458
|
+
*
|
|
459
|
+
* Which base, and whose field initializers, are not carried here: both are
|
|
460
|
+
* facts about the class whose constructor this body *is*, which the class
|
|
461
|
+
* projection publishes (`ClassLayout.base`, `ClassLayout.fields`) and IR
|
|
462
|
+
* lowering cannot see. Recording the arguments and the fact that this is a
|
|
463
|
+
* super-initialization -- which normalize published as
|
|
464
|
+
* `InvocationResultDivergence` -- is the whole of what this layer knows.
|
|
465
|
+
*/
|
|
466
|
+
export interface SuperInitializeOperation extends IrOperationBase {
|
|
467
|
+
readonly kind: 'super-initialize';
|
|
468
|
+
readonly arguments: readonly IrOperand[];
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* `Object.setPrototypeOf(C.prototype, B.prototype)` for a class `C` the
|
|
472
|
+
* program models as inheriting from `B` (`semantics/prototype-reparenting.ts`).
|
|
473
|
+
*
|
|
474
|
+
* The layout, dispatch and upcasts already treat `base` as `C`'s base. What is
|
|
475
|
+
* left for run time is the one thing a declaration cannot know: which
|
|
476
|
+
* evaluation of `B` the value is, so `C`'s evaluation can reach that
|
|
477
|
+
* evaluation's prototype for a `B` method read as a value or an `instanceof`
|
|
478
|
+
* -- the same link `allocate-constructor`'s `heritage` makes for `extends`.
|
|
479
|
+
* The heritage value must be exactly `base`; a subclass stored in the same
|
|
480
|
+
* slot has a different prototype than the layout assumed, and is refused.
|
|
481
|
+
*/
|
|
482
|
+
export interface ReparentConstructorOperation extends IrOperationBase {
|
|
483
|
+
readonly kind: 'reparent-constructor';
|
|
484
|
+
readonly derived: DeclarationId;
|
|
485
|
+
readonly base: DeclarationId;
|
|
486
|
+
readonly classValue: IrOperand;
|
|
487
|
+
readonly heritage: IrOperand;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* `newTarget` is always explicit, even for ordinary `new C()` where it equals
|
|
491
|
+
* `callee`. Defaulting it silently would let an omission at a derived-class
|
|
492
|
+
* construction site pass as ordinary construction instead of failing closed.
|
|
493
|
+
*/
|
|
494
|
+
export interface ConstructOperation extends IrOperationBase {
|
|
495
|
+
readonly kind: 'construct';
|
|
496
|
+
readonly callee: IrOperand;
|
|
497
|
+
readonly newTarget: IrOperand;
|
|
498
|
+
/** Normalization's proof of which runtime function/class the callee denotes; retained so emission never guesses constructability from a carrier shared with arrows. */
|
|
499
|
+
readonly target: SemanticTargetProof;
|
|
500
|
+
/** Published by the call-entry census; both reflection and emission consume this convention. */
|
|
501
|
+
readonly entry?: {
|
|
502
|
+
readonly kind: 'explicit-object-return';
|
|
503
|
+
readonly functionId: FunctionId;
|
|
504
|
+
readonly abi: CallableAbi;
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
* The frame this site fills of the host-constructor overload the checker
|
|
508
|
+
* selected (`representation/derive.ts`'s `selectedHostConstructFrameOf`).
|
|
509
|
+
* Published only for a `native-handle` callee whose overload set joins into
|
|
510
|
+
* no single `construct` convention -- `new WeakMap()`, `new Map()`, typed
|
|
511
|
+
* arrays. The reflection census consumes it (`native-host-construction.ts`);
|
|
512
|
+
* emission reads the same operands and result carrier it was derived from.
|
|
513
|
+
*/
|
|
514
|
+
readonly hostFrame?: CallableAbi;
|
|
515
|
+
readonly arguments: readonly IrOperand[];
|
|
516
|
+
readonly result: IrResult;
|
|
517
|
+
}
|
|
518
|
+
export interface ConstantOperation extends IrOperationBase {
|
|
519
|
+
readonly kind: 'constant';
|
|
520
|
+
/** The constant's own value, in the same textual form `OperandSource.constant.text` uses. */
|
|
521
|
+
readonly text: string;
|
|
522
|
+
/** Which literal form the text spells, since the text alone cannot say. */
|
|
523
|
+
readonly literal: ConstantLiteral;
|
|
524
|
+
readonly result: IrResult;
|
|
525
|
+
}
|
|
526
|
+
export interface BindingReadOperation extends IrOperationBase {
|
|
527
|
+
readonly kind: 'binding-read';
|
|
528
|
+
readonly declaration: DeclarationId;
|
|
529
|
+
readonly result: IrResult;
|
|
530
|
+
/** Unique compiler-owned callable stored in this cell, published by the call-identity census. */
|
|
531
|
+
readonly closedCallable?: CallCalleeIdentity;
|
|
532
|
+
/**
|
|
533
|
+
* `true` when `declaration` names a class field an installed plugin
|
|
534
|
+
* declared a reactive cell -- see `GetOperation.reactive`, which this
|
|
535
|
+
* mirrors for the one path a property read reaches a field WITHOUT a `get`:
|
|
536
|
+
* `PropertyOperation.resolvedBinding` (`lower-property.ts`), where
|
|
537
|
+
* `this.count` resolves straight to the field's own declaration rather than
|
|
538
|
+
* through `[[Get]]`. Filled from the identical merged plugin table
|
|
539
|
+
* (`ir/lower.ts`'s `reactiveFieldDeclarations`), so a component field reads
|
|
540
|
+
* the same answer regardless of which of the two shapes lowers it.
|
|
541
|
+
*/
|
|
542
|
+
readonly reactive?: boolean;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* The value the caller's frame supplied at one ABI position.
|
|
546
|
+
*
|
|
547
|
+
* This is not a `constant` (nothing here knows the value) and not a
|
|
548
|
+
* `binding-read` (no operation in this body wrote the cell). Modelling it as
|
|
549
|
+
* either would make a parameter indistinguishable from a local, and the
|
|
550
|
+
* emitter would then read a variable it never declared.
|
|
551
|
+
*/
|
|
552
|
+
export interface ParameterOperation extends IrOperationBase {
|
|
553
|
+
readonly kind: 'parameter';
|
|
554
|
+
/** The position in `IrBody.abi.parameters` this value comes from. */
|
|
555
|
+
readonly ordinal: number;
|
|
556
|
+
readonly result: IrResult;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* The receiver the caller's frame supplied.
|
|
560
|
+
*
|
|
561
|
+
* Separate from `parameter` because a convention has at most one receiver and
|
|
562
|
+
* it occupies no argument position: giving it an ordinal would put it in the
|
|
563
|
+
* same numbering as the arguments, and every later reader would have to know
|
|
564
|
+
* which ordinals were real.
|
|
565
|
+
*/
|
|
566
|
+
export interface ReceiverOperation extends IrOperationBase {
|
|
567
|
+
readonly kind: 'receiver';
|
|
568
|
+
readonly result: IrResult;
|
|
569
|
+
}
|
|
570
|
+
/** The one process-wide ECMAScript global object, carried as an open native dictionary. */
|
|
571
|
+
export interface GlobalThisOperation extends IrOperationBase {
|
|
572
|
+
readonly kind: 'global-this';
|
|
573
|
+
readonly result: IrResult;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* A binding that resolves to no declaration anywhere in the program --
|
|
577
|
+
* `ResolveBinding` (ECMA-262 6.2.5.6) finds no environment record naming it,
|
|
578
|
+
* so `GetValue` throws a ReferenceError before any value is produced.
|
|
579
|
+
*
|
|
580
|
+
* `semantics/normalize/producers/references.ts`'s `buildReference` publishes
|
|
581
|
+
* this citation's `value` result anyway, and says why: "the result exists so
|
|
582
|
+
* the graph can be built and the throw stated, not because a value ever
|
|
583
|
+
* arrives". A citing operand still needs an SSA id to name -- an argument
|
|
584
|
+
* list, a callee slot -- and this is what that id resolves to: a fact about
|
|
585
|
+
* the PROGRAM (the name really is undeclared) that is decidable with no C++
|
|
586
|
+
* value at all, the same way `class-ref`'s "no own `toString`" case answers
|
|
587
|
+
* `"[object Object]"` without a call.
|
|
588
|
+
*
|
|
589
|
+
* Its own IR kind rather than a `compute` form: `compute`'s own doc restricts
|
|
590
|
+
* it to "operators over evaluated operands" with a physical primitive behind
|
|
591
|
+
* them, and this has no operand at all to operate over -- it is a citable
|
|
592
|
+
* fact about a NAME, the same reason `this`/`super`/`parameter-value`
|
|
593
|
+
* (`ReferenceOperation.form`) each get their own dedicated verb here instead
|
|
594
|
+
* of being folded into `compute`.
|
|
595
|
+
*/
|
|
596
|
+
export interface UnresolvableReferenceOperation extends IrOperationBase {
|
|
597
|
+
readonly kind: 'unresolvable-reference';
|
|
598
|
+
readonly result: IrResult;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* `await`, restricted to the one shape this runtime's `gea::Promise<V>` can
|
|
602
|
+
* ever represent: a settled value with no job queue behind it
|
|
603
|
+
* (`runtime/gea_runtime.h`'s `Promise` doc comment). There is no suspension
|
|
604
|
+
* primitive here -- a physical coroutine transform, the way v1's `co_await`
|
|
605
|
+
* lowering works, is a different and much larger feature this substrate does
|
|
606
|
+
* not have -- so this operation is the honest, narrower answer: read the
|
|
607
|
+
* operand's value immediately, exactly as ECMA-262 27.7.5.3 `Await` would if
|
|
608
|
+
* every promise it ever saw were already fulfilled, which is the only kind
|
|
609
|
+
* `PromiseConstructor::resolve` and every gea host capture ever construct.
|
|
610
|
+
*
|
|
611
|
+
* `operand` is not always a `promise` carrier: `await` accepts any
|
|
612
|
+
* expression, and `Awaited<T>` is `T` unchanged for a non-thenable `T`, so a
|
|
613
|
+
* non-promise operand renders as a plain pass-through (see `emitAwait`,
|
|
614
|
+
* `targets/cpp/emit.ts`). `result` is `null` only when the awaited payload is
|
|
615
|
+
* `void` -- a `Promise<void>` -- mirroring `CallOperation.result`'s identical
|
|
616
|
+
* reason.
|
|
617
|
+
*/
|
|
618
|
+
export interface AwaitOperation extends IrOperationBase {
|
|
619
|
+
readonly kind: 'await';
|
|
620
|
+
readonly operand: IrOperand;
|
|
621
|
+
readonly result: IrResult | null;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* `yield x` inside a `function*`.
|
|
625
|
+
*
|
|
626
|
+
* A real suspension, unlike `await` (whose own comment above explains why this
|
|
627
|
+
* backend completes it synchronously): the enclosing body is emitted as a
|
|
628
|
+
* C++20 coroutine returning `gea::Iterator<T, TReturn, TNext>`, and this
|
|
629
|
+
* renders as `co_yield`, which suspends the frame and hands the value to
|
|
630
|
+
* whichever `next()` resumed it.
|
|
631
|
+
*
|
|
632
|
+
* `result` is what a consumer of the yield EXPRESSION's own value reads --
|
|
633
|
+
* ECMA-262 makes that the RESUME channel, what the next `next(v)` (or an
|
|
634
|
+
* abrupt `.return`/`.throw`) sends back in -- mirroring `AwaitOperation`'s
|
|
635
|
+
* identical split between its operand and its result. It is `null` only when
|
|
636
|
+
* `TNext` never resolved to a native carrier for this generator
|
|
637
|
+
* (`representation/derive.ts`'s `GeneratorDeclarationPolicy`), matching
|
|
638
|
+
* `CallOperation.result`'s identical reason for a payload with no carrier.
|
|
639
|
+
* `yield*` is refused by name in `semantics/normalize/producers/control.ts`:
|
|
640
|
+
* delegation is a loop, and a loop cannot be built in the middle of an
|
|
641
|
+
* expression here any more than a spread's own drain can.
|
|
642
|
+
*/
|
|
643
|
+
export interface YieldOperation extends IrOperationBase {
|
|
644
|
+
readonly kind: 'yield';
|
|
645
|
+
readonly operand: IrOperand | null;
|
|
646
|
+
readonly result: IrResult | null;
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* The value a native C++ `catch` clause binds.
|
|
650
|
+
*
|
|
651
|
+
* Not a `constant` (nothing here knows the value) and not a `binding-read`
|
|
652
|
+
* (no operation in this body wrote the cell) -- the same reasoning
|
|
653
|
+
* `ParameterOperation`'s own comment states for a value the calling frame
|
|
654
|
+
* supplies. This is the try-region twin: the block this operation opens is
|
|
655
|
+
* rendered as the body of a `catch` clause (`IrBody.tryRegions`), and the
|
|
656
|
+
* catch's own parameter binds this value there; nothing else in this body's
|
|
657
|
+
* sequence ever writes it.
|
|
658
|
+
*/
|
|
659
|
+
export interface CatchBindingOperation extends IrOperationBase {
|
|
660
|
+
readonly kind: 'catch-binding';
|
|
661
|
+
readonly result: IrResult;
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* A primitive computation over operands that already carry their own physical
|
|
665
|
+
* types.
|
|
666
|
+
*
|
|
667
|
+
* `form` is deliberately only the shapes with a physical primitive behind them.
|
|
668
|
+
* `logical`, `conditional`, `template`, and the rest are not operators over
|
|
669
|
+
* evaluated operands at all -- they select, concatenate, or short-circuit --
|
|
670
|
+
* and admitting them here would let an operation whose semantics are a branch
|
|
671
|
+
* render as if it were an arithmetic instruction.
|
|
672
|
+
*
|
|
673
|
+
* `typeof` is here because it *is* one: it reads a carrier's discriminant, or
|
|
674
|
+
* no carrier state at all, and yields a string. It is not a branch -- the arm
|
|
675
|
+
* it selects is a value, not a region -- so it renders as an instruction like
|
|
676
|
+
* the arithmetic ones do.
|
|
677
|
+
*
|
|
678
|
+
* `in` is here for the same reason and no other: `[[HasProperty]]` evaluates
|
|
679
|
+
* both operands, consults the receiver's carrier, and yields a boolean, with no
|
|
680
|
+
* region and no short circuit anywhere in it. Being an object-substrate
|
|
681
|
+
* interrogation rather than arithmetic changes which backends can render it --
|
|
682
|
+
* which is a manifest claim (`computation:in:*`), not an IR shape.
|
|
683
|
+
*/
|
|
684
|
+
export interface ComputeOperation extends IrOperationBase {
|
|
685
|
+
readonly kind: 'compute';
|
|
686
|
+
readonly nativeEquality?: NativeEqualityRecipe;
|
|
687
|
+
readonly classInstanceTest?: import('../projection/instance-test.js').ClassInstanceTestRecipe;
|
|
688
|
+
/**
|
|
689
|
+
* `update` is the arithmetic half of `++`/`--`: the store it feeds is a
|
|
690
|
+
* separate binding-write or property-set operation, so this instruction only
|
|
691
|
+
* ever computes the number that gets stored.
|
|
692
|
+
*/
|
|
693
|
+
readonly form: 'unary' | 'binary' | 'update' | 'equality' | 'typeof' | 'in' | 'instanceof' | 'template' | 'require-object-coercible'
|
|
694
|
+
/**
|
|
695
|
+
* The presence half of an array pattern's own possibly-absent source
|
|
696
|
+
* (`ir/lower-destructuring.ts`'s `lowerArrayPatternSource`): asserts the
|
|
697
|
+
* one operand is not `undefined`/`null` (ECMA-262 7.4.2 `GetIterator`
|
|
698
|
+
* throws on either) and unwraps its `optional` carrier to the payload,
|
|
699
|
+
* the same `gea::detail::requireIterablePresent` the general `for`-`of`
|
|
700
|
+
* protocol's own absent sources already call (`targets/cpp/emit-iterator.ts`).
|
|
701
|
+
*/
|
|
702
|
+
| 'require-iterable-present'
|
|
703
|
+
/**
|
|
704
|
+
* The arm half of the same source, when the unwrapped payload is a
|
|
705
|
+
* tagged union only ONE arm of which this pattern can read positionally
|
|
706
|
+
* (`representation/model.ts`'s `soleArrayPatternCapableArm`): asserts the
|
|
707
|
+
* runtime tag is that arm and reads it, throwing the way the same
|
|
708
|
+
* `GetIterator` throws over the union's other, non-iterable arm. The arm
|
|
709
|
+
* index is not a language operator -- there is no source syntax this
|
|
710
|
+
* form renders -- but it is carried through the same `operator` field
|
|
711
|
+
* `require-object-coercible` already reuses for a descriptive label
|
|
712
|
+
* rather than a real one, stringified so `targets/cpp/emit.ts` can read
|
|
713
|
+
* it back as the compile-time `.is<N>()`/`.get<N>()` template argument.
|
|
714
|
+
*/
|
|
715
|
+
| 'require-tagged-union-arm';
|
|
716
|
+
/** The language operator, carried through from the semantic operation unchanged. */
|
|
717
|
+
readonly operator: string;
|
|
718
|
+
readonly operands: readonly IrOperand[];
|
|
719
|
+
readonly result: IrResult;
|
|
720
|
+
}
|
|
721
|
+
/** A binding cell is a mutable environment slot, not an SSA value; the write has no result of its own. */
|
|
722
|
+
export interface BindingWriteOperation extends IrOperationBase {
|
|
723
|
+
readonly kind: 'binding-write';
|
|
724
|
+
readonly declaration: DeclarationId;
|
|
725
|
+
readonly value: IrOperand;
|
|
726
|
+
}
|
|
727
|
+
/** One incoming edge of a phi: the predecessor it is reached from, and the value visible at that predecessor's exit. */
|
|
728
|
+
export interface IrPhiIncoming {
|
|
729
|
+
readonly block: IrBlockId;
|
|
730
|
+
readonly value: IrOperand;
|
|
731
|
+
}
|
|
732
|
+
export interface PhiOperation extends IrOperationBase {
|
|
733
|
+
readonly kind: 'phi';
|
|
734
|
+
readonly incoming: readonly IrPhiIncoming[];
|
|
735
|
+
readonly result: IrResult;
|
|
736
|
+
}
|
|
737
|
+
export interface BranchOperation extends IrOperationBase {
|
|
738
|
+
readonly kind: 'branch';
|
|
739
|
+
readonly condition: IrOperand;
|
|
740
|
+
readonly whenTrue: IrBlockId;
|
|
741
|
+
readonly whenFalse: IrBlockId;
|
|
742
|
+
}
|
|
743
|
+
export interface JumpOperation extends Omit<IrOperationBase, 'lineage'> {
|
|
744
|
+
readonly lineage: SemanticResultId | null;
|
|
745
|
+
readonly kind: 'jump';
|
|
746
|
+
readonly target: IrBlockId;
|
|
747
|
+
}
|
|
748
|
+
export interface ReturnOperation extends Omit<IrOperationBase, 'lineage'> {
|
|
749
|
+
readonly lineage: SemanticResultId | null;
|
|
750
|
+
readonly kind: 'return';
|
|
751
|
+
/** `null` for a body whose declared result is `void`; there is no value to carry. */
|
|
752
|
+
readonly value: IrOperand | null;
|
|
753
|
+
}
|
|
754
|
+
export interface ThrowOperation extends IrOperationBase {
|
|
755
|
+
readonly kind: 'throw';
|
|
756
|
+
readonly value: IrOperand;
|
|
757
|
+
}
|
|
758
|
+
export interface IrSwitchCase {
|
|
759
|
+
readonly test: IrOperand;
|
|
760
|
+
readonly target: IrBlockId;
|
|
761
|
+
}
|
|
762
|
+
export interface SwitchOperation extends IrOperationBase {
|
|
763
|
+
readonly kind: 'switch';
|
|
764
|
+
readonly discriminant: IrOperand;
|
|
765
|
+
readonly cases: readonly IrSwitchCase[];
|
|
766
|
+
readonly defaultTarget: IrBlockId;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* A fresh `OrdinaryObject` with no declared fields yet. Population is a
|
|
770
|
+
* sequence of ordinary `set`/`define-own-property` operations afterward --
|
|
771
|
+
* there is no separate initializer payload here, because the substrate does
|
|
772
|
+
* not admit a second route from allocation straight to installed state.
|
|
773
|
+
*/
|
|
774
|
+
export interface AllocateOrdinaryObjectOperation extends IrOperationBase {
|
|
775
|
+
readonly kind: 'allocate-ordinary-object';
|
|
776
|
+
readonly result: IrResult;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* A present element and a hole are different; collapsing them loses
|
|
780
|
+
* observable Array behavior. A `spread` slot is neither: it names a whole
|
|
781
|
+
* source array to range-copy in place rather than a single value to push --
|
|
782
|
+
* `from` is the zero-based index its own copy starts at, so an array-literal
|
|
783
|
+
* spread ("everything") and a pattern's rest element ("everything past
|
|
784
|
+
* position N") are the same primitive at two different start points. A
|
|
785
|
+
* `gather` is deliberately separate: it drains one already-acquired dynamic
|
|
786
|
+
* iterator record, not a Value projected as a native array.
|
|
787
|
+
*/
|
|
788
|
+
export type IrArrayElement = {
|
|
789
|
+
readonly kind: 'element';
|
|
790
|
+
readonly value: IrOperand;
|
|
791
|
+
} | {
|
|
792
|
+
readonly kind: 'hole';
|
|
793
|
+
} | {
|
|
794
|
+
readonly kind: 'spread';
|
|
795
|
+
readonly value: IrOperand;
|
|
796
|
+
readonly from: number;
|
|
797
|
+
/**
|
|
798
|
+
* Present when the lowering admitted a PER-ELEMENT conversion into this
|
|
799
|
+
* array's own element carrier -- the source's elements are carried
|
|
800
|
+
* wider than the destination's (an open-ended tuple's tail, whose
|
|
801
|
+
* array carries the union of every position, range-copied into a rest
|
|
802
|
+
* parameter of the tail's own type). Absent, the two carriers must be
|
|
803
|
+
* identical and the emitter refuses otherwise; present, the emitter
|
|
804
|
+
* converts each copied element with the ordinary conversion recipes and
|
|
805
|
+
* refuses when none exists.
|
|
806
|
+
*/
|
|
807
|
+
readonly element?: Representation;
|
|
808
|
+
}
|
|
809
|
+
/** Drain one genuinely dynamic iterator record into this fresh/native array. */
|
|
810
|
+
| {
|
|
811
|
+
readonly kind: 'gather';
|
|
812
|
+
readonly iterator: IrOperand;
|
|
813
|
+
};
|
|
814
|
+
export interface AllocateArrayObjectOperation extends IrOperationBase {
|
|
815
|
+
readonly kind: 'allocate-array-object';
|
|
816
|
+
readonly elements: readonly IrArrayElement[];
|
|
817
|
+
readonly result: IrResult;
|
|
818
|
+
}
|
|
819
|
+
export interface AllocateCallableOperation extends IrOperationBase {
|
|
820
|
+
readonly kind: 'allocate-callable';
|
|
821
|
+
readonly functionId: FunctionId;
|
|
822
|
+
/**
|
|
823
|
+
* Captured environment slots, in capture order.
|
|
824
|
+
*
|
|
825
|
+
* Still unfilled by every producer, exactly as when this field was added:
|
|
826
|
+
* an `IrOperand` only ever names an already-DEFINED SSA value
|
|
827
|
+
* (`verify.ts`'s `value-used-before-defined` guard), so populating one
|
|
828
|
+
* per capture here would mean minting a real `binding-read` operation for
|
|
829
|
+
* every relayed declaration at every allocation site -- and that operation
|
|
830
|
+
* is a genuine new operand everywhere `operandsOfIrOperation` is asked
|
|
831
|
+
* (`ir/captures.ts`'s own `buildDyingArgumentIndex`/`ownedDyingValuesOf`
|
|
832
|
+
* among them), which would perturb move/dying-value analysis this task
|
|
833
|
+
* does not own. `ir/captures.ts`'s `computeCaptureFacts` publishes the
|
|
834
|
+
* same information instead on `IrBody.facts.capturedDeclarations` /
|
|
835
|
+
* `.capturedReceiver`, keyed by `functionId` through `IrBody.sourceOwner`
|
|
836
|
+
* -- a side channel that adds no new operand and so cannot move this. If
|
|
837
|
+
* `IrOperand.transfer` (the later phase-3 row) ever needs a real capture
|
|
838
|
+
* operand, that is the point to revisit this field, not before.
|
|
839
|
+
*/
|
|
840
|
+
readonly captures: readonly IrOperand[];
|
|
841
|
+
readonly result: IrResult;
|
|
842
|
+
}
|
|
843
|
+
/** A native `Function.prototype.bind` result with its receiver and leading arguments captured once. */
|
|
844
|
+
export interface BindCallableOperation extends IrOperationBase {
|
|
845
|
+
readonly kind: 'bind-callable';
|
|
846
|
+
readonly source: IrOperand;
|
|
847
|
+
/** Exact semantic origin required when `source` is a dynamic Function object. */
|
|
848
|
+
readonly sourceFunctionId: FunctionId | null;
|
|
849
|
+
/**
|
|
850
|
+
* The source callable's checked physical convention. `source` itself may be
|
|
851
|
+
* dynamic solely because its Function object has dynamic own-property
|
|
852
|
+
* semantics; that carrier must not erase the frame its bound prefix enters.
|
|
853
|
+
*/
|
|
854
|
+
readonly sourceAbi: CallableAbi;
|
|
855
|
+
/** Retained for evaluation even when the source convention has no receiver slot. */
|
|
856
|
+
readonly thisArgument: IrOperand | null;
|
|
857
|
+
/** The source frame's receiver, when its convention declares one. */
|
|
858
|
+
readonly receiver: IrOperand | null;
|
|
859
|
+
readonly bound: readonly IrOperand[];
|
|
860
|
+
/**
|
|
861
|
+
* A method read as a VALUE and handed to a receiver-less slot (`map(this.f)`,
|
|
862
|
+
* `const g = obj.m`), bound to the object it was read from only because the
|
|
863
|
+
* C++ member needs a receiver to be invoked at all. The language calls a
|
|
864
|
+
* detached method with no `this`, so the printer refuses a body that reads
|
|
865
|
+
* it rather than answer where the program would have thrown; a real
|
|
866
|
+
* `Function.prototype.bind` (`false`) binds whatever its body does.
|
|
867
|
+
*/
|
|
868
|
+
readonly detached: boolean;
|
|
869
|
+
readonly result: IrResult;
|
|
870
|
+
}
|
|
871
|
+
export interface AllocateConstructorOperation extends IrOperationBase {
|
|
872
|
+
readonly kind: 'allocate-constructor';
|
|
873
|
+
readonly declaration: DeclarationId;
|
|
874
|
+
/** Same status as `AllocateCallableOperation.captures` -- see its comment. */
|
|
875
|
+
readonly captures: readonly IrOperand[];
|
|
876
|
+
/** The evaluated superclass object, whose prototype belongs to that evaluation rather than its declaration. */
|
|
877
|
+
readonly heritage?: IrOperand;
|
|
878
|
+
readonly result: IrResult;
|
|
879
|
+
}
|
|
880
|
+
/** A proxy carries exactly target and handler; there is no target-only carrier (architecture.md substrate section). */
|
|
881
|
+
export interface AllocateProxyOperation extends IrOperationBase {
|
|
882
|
+
readonly kind: 'allocate-proxy';
|
|
883
|
+
readonly target: IrOperand;
|
|
884
|
+
readonly handler: IrOperand;
|
|
885
|
+
readonly result: IrResult;
|
|
886
|
+
}
|
|
887
|
+
export interface IrRecordFieldInit {
|
|
888
|
+
readonly key: string;
|
|
889
|
+
readonly value: IrOperand;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Allocation of a value whose whole layout the plan already selected: a
|
|
893
|
+
* struct, a native record reference, or a keyed container. `fields` carries
|
|
894
|
+
* the initializers a producer supplied at the allocation site; an object
|
|
895
|
+
* literal that installs its members as separate `define-own-property`
|
|
896
|
+
* operations allocates with none.
|
|
897
|
+
*/
|
|
898
|
+
export interface AllocateRecordOperation extends IrOperationBase {
|
|
899
|
+
readonly kind: 'allocate-record';
|
|
900
|
+
readonly fields: readonly IrRecordFieldInit[];
|
|
901
|
+
readonly result: IrResult;
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* The template object a tagged template site hands its tag (ECMA-262 13.2.8.3
|
|
905
|
+
* `GetTemplateObject`).
|
|
906
|
+
*
|
|
907
|
+
* It is the only operation in this file that does not allocate when it runs.
|
|
908
|
+
* `GetTemplateObject` caches its answer per Parse Node, so one site's object is
|
|
909
|
+
* created once and the SAME object is handed to the tag on every evaluation --
|
|
910
|
+
* which is the whole reason the operation exists rather than being an ordinary
|
|
911
|
+
* `allocate-record` plus a sequence of stores. A target renders it as a read of
|
|
912
|
+
* a per-site immortal; nothing about it is per-evaluation.
|
|
913
|
+
*
|
|
914
|
+
* `raw[i]` is the final segment text. `cooked[i]` is either its final string
|
|
915
|
+
* or the explicit `undefined` state an invalid escape produces; no runtime
|
|
916
|
+
* step computes, converts or re-escapes either one.
|
|
917
|
+
*/
|
|
918
|
+
export type IrTemplateCookedSegment = {
|
|
919
|
+
readonly kind: 'string';
|
|
920
|
+
readonly text: string;
|
|
921
|
+
} | {
|
|
922
|
+
readonly kind: 'undefined';
|
|
923
|
+
};
|
|
924
|
+
export interface AllocateTemplateObjectOperation extends IrOperationBase {
|
|
925
|
+
readonly kind: 'allocate-template-object';
|
|
926
|
+
readonly cooked: readonly IrTemplateCookedSegment[];
|
|
927
|
+
readonly raw: readonly string[];
|
|
928
|
+
readonly result: IrResult;
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* A regular-expression object, from the pattern and flags a literal or a
|
|
932
|
+
* `RegExp` construction states (ECMA-262 22.2.4.1 `RegExp(pattern, flags)`,
|
|
933
|
+
* which reaches 22.2.3.1 `RegExpAlloc` then 22.2.3.2 `RegExpInitialize`).
|
|
934
|
+
*
|
|
935
|
+
* `source` and `flags` are the texts the producer read off the literal's own
|
|
936
|
+
* token, already final: 22.2.3.2 hands `RegExpInitialize` the pattern text
|
|
937
|
+
* unmodified, so no runtime step computes, converts or re-escapes either one.
|
|
938
|
+
* They are the literal's BODY and FLAGS, without the delimiting slashes --
|
|
939
|
+
* which is what `RegExp.prototype.source` and `.flags` answer, so the same two
|
|
940
|
+
* strings serve both the construction and the accessors.
|
|
941
|
+
*
|
|
942
|
+
* Unlike `allocate-template-object` this really does allocate on every
|
|
943
|
+
* evaluation, and that is observable rather than incidental: 22.2.4.1 creates a
|
|
944
|
+
* fresh object per evaluation of the literal, and `lastIndex` is mutable state
|
|
945
|
+
* on it -- two evaluations of the same `/g` literal must not share a cursor.
|
|
946
|
+
*/
|
|
947
|
+
export interface AllocateRegExpOperation extends IrOperationBase {
|
|
948
|
+
readonly kind: 'allocate-regexp';
|
|
949
|
+
readonly source: string;
|
|
950
|
+
readonly flags: string;
|
|
951
|
+
readonly result: IrResult;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* A conversion-use application.
|
|
955
|
+
*
|
|
956
|
+
* Deliberately minimal: an authenticated conversion-use identity plus its
|
|
957
|
+
* exact source and result SSA identities, and nothing else. Carrying a second
|
|
958
|
+
* capability payload, a re-stated classifier, or a reason string here would
|
|
959
|
+
* be the second provenance proof the canonical provenance graph forbids
|
|
960
|
+
* (architecture.md, "Canonical semantic provenance graph").
|
|
961
|
+
*/
|
|
962
|
+
export interface ConvertOperation extends IrOperationBase {
|
|
963
|
+
readonly kind: 'convert';
|
|
964
|
+
readonly conversionUse: ConversionUseId;
|
|
965
|
+
readonly source: IrOperand;
|
|
966
|
+
readonly result: IrResult;
|
|
967
|
+
/**
|
|
968
|
+
* `'checked'` on a load out of an `optional` that no program fact proves
|
|
969
|
+
* present (`ir/presence-proof.ts`): the printer tests presence and raises a
|
|
970
|
+
* TypeError rather than read a payload that may not be there. Absent on every
|
|
971
|
+
* proven load, and on every conversion that is not an unchecked load at all.
|
|
972
|
+
*/
|
|
973
|
+
readonly presence?: 'checked';
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Rebuilding a merge input into the merge's own carrier when control flow has
|
|
977
|
+
* proven some state of a tagged union carrier dead at THIS merge.
|
|
978
|
+
*
|
|
979
|
+
* Two lowerings carry that proof here. `mergeIncoming`
|
|
980
|
+
* (`ir/lower-narrow.ts`) uses `partialDeadMergeArms` for a `&&` merge's kept
|
|
981
|
+
* operand, where some arms can never be the falsy reason that arm ran.
|
|
982
|
+
* `lowerDefaultValueStep` (`ir/lower-destructuring.ts`) uses the truthy arm of
|
|
983
|
+
* an `is-defined` guard, where top-level `undefined` arms are dead but a
|
|
984
|
+
* sibling `null` arm remains live. In both cases the operation records the
|
|
985
|
+
* exact surviving indices at the site that established them.
|
|
986
|
+
*
|
|
987
|
+
* A general `convert` cannot express this. `convert`'s C++ rendering
|
|
988
|
+
* (`emit.ts`'s `emitConvert`) dispatches purely on the source/result
|
|
989
|
+
* REPRESENTATION PAIR (`convertedValueText`), which is a promise that holds
|
|
990
|
+
* everywhere that exact pair recurs in the program -- and "the dead arm
|
|
991
|
+
* never needs testing" is true only at merges the checker's own narrowing
|
|
992
|
+
* already proved it for, not for every occurrence of the same two carriers.
|
|
993
|
+
* Widening `convertedValueText` to drop an arm generically would silently
|
|
994
|
+
* mis-render an actually-live value of that arm's shape at any other,
|
|
995
|
+
* unguarded call site sharing the pair.
|
|
996
|
+
*
|
|
997
|
+
* `liveArms` is therefore the proof, not a hint: the arm indices the producing
|
|
998
|
+
* control-flow lowering proved live, computed once there and carried forward
|
|
999
|
+
* rather than re-derived -- or guessed from carrier shape alone -- at
|
|
1000
|
+
* emission.
|
|
1001
|
+
* Rendering tests only these indices, in source-arm order, against `source`
|
|
1002
|
+
* (unwrapped of one optional layer first, exactly as `isDeadMergeContribution`
|
|
1003
|
+
* unwraps it), converts each live arm's own payload into `result`'s carrier
|
|
1004
|
+
* through the ordinary, unmodified `convertedValueText` (a live arm's payload
|
|
1005
|
+
* really can convert to the merge's carrier everywhere that pair recurs --
|
|
1006
|
+
* only the DEAD arms are the merge-site-specific fact), and falls back to
|
|
1007
|
+
* `result`'s own absent value when `source` itself is optional and that
|
|
1008
|
+
* absence remains live. A `??` kept branch proves precisely that top-level
|
|
1009
|
+
* absence dead while leaving every payload arm live; `sourceAbsenceLive`
|
|
1010
|
+
* carries that distinct proof without pretending any payload arm disappeared.
|
|
1011
|
+
*/
|
|
1012
|
+
export interface MergeLiveArmRebuildOperation extends IrOperationBase {
|
|
1013
|
+
readonly kind: 'merge-live-arm-rebuild';
|
|
1014
|
+
readonly nativeTransport?: import('./native-merge-transport.js').NativeMergeTransport;
|
|
1015
|
+
readonly source: IrOperand;
|
|
1016
|
+
readonly result: IrResult;
|
|
1017
|
+
/**
|
|
1018
|
+
* Indices, into `source`'s (optional-unwrapped) tagged union arms, of the
|
|
1019
|
+
* arms the producing control-flow guard proved live -- in ascending
|
|
1020
|
+
* source-arm order. Never empty. It is smaller than the union's full arm
|
|
1021
|
+
* count when a payload arm was ruled out, and may equal the full count when
|
|
1022
|
+
* a `??` presence guard ruled out only the optional wrapper's absence. The
|
|
1023
|
+
* `&&` producer obtains that split from `partialDeadMergeArms`; the
|
|
1024
|
+
* default-value producer removes only top-level `undefined` on the
|
|
1025
|
+
* `is-defined` branch. Both route a whole-live or whole-dead set elsewhere.
|
|
1026
|
+
*/
|
|
1027
|
+
readonly liveArms: readonly number[];
|
|
1028
|
+
/** Whether an absent optional source can still reach this merge input. */
|
|
1029
|
+
readonly sourceAbsenceLive: boolean;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* `method` is the already-fetched `@@iterator`/`@@asyncIterator` method;
|
|
1033
|
+
* fetching it is an ordinary `get`, not part of this op. `null` for the
|
|
1034
|
+
* native array fast path: a provably plain `T[]` has no dynamic method to
|
|
1035
|
+
* fetch at all (ECMA-262 23.1.5's Array Iterator is a plain index/length
|
|
1036
|
+
* walk), so there is nothing to pass -- see `emit-iterator.ts`'s
|
|
1037
|
+
* `emitGetIterator`, which requires a null `method` for exactly the
|
|
1038
|
+
* `array-object` receiver this shape is reached with.
|
|
1039
|
+
*/
|
|
1040
|
+
export interface GetIteratorOperation extends IrOperationBase {
|
|
1041
|
+
readonly kind: 'get-iterator';
|
|
1042
|
+
/**
|
|
1043
|
+
* Which walk this is. Two protocols reach this one operation over the same
|
|
1044
|
+
* receiver carrier and mean opposite things: `for`-`in` over a struct yields
|
|
1045
|
+
* its KEYS, `for`-`of` over a fixed-arity tuple -- also carried as a
|
|
1046
|
+
* positional record -- yields its VALUES. Both cursors are
|
|
1047
|
+
* `gea::Iterator<std::string>` when the fields are strings, so neither the
|
|
1048
|
+
* receiver's carrier nor the result's can tell the emitter which walk to
|
|
1049
|
+
* build, and picking the wrong one is a silent miscompile rather than a
|
|
1050
|
+
* refusal. Preflight already keys its obligations on the protocol
|
|
1051
|
+
* (`protocol:enumerate:...` vs `protocol:iterator:...`); this carries the
|
|
1052
|
+
* same fact to emission instead of leaving it to infer one from a carrier
|
|
1053
|
+
* spelling.
|
|
1054
|
+
*/
|
|
1055
|
+
readonly protocol: 'iterator' | 'async-iterator' | 'enumerate';
|
|
1056
|
+
readonly receiver: IrOperand;
|
|
1057
|
+
readonly method: IrOperand | null;
|
|
1058
|
+
readonly result: IrResult;
|
|
1059
|
+
}
|
|
1060
|
+
export interface IteratorNextOperation extends IrOperationBase {
|
|
1061
|
+
readonly kind: 'iterator-next';
|
|
1062
|
+
readonly iterator: IrOperand;
|
|
1063
|
+
/** The optional argument to `.next(value)`; absent for ordinary `for-of` consumption. */
|
|
1064
|
+
readonly value: IrOperand | null;
|
|
1065
|
+
readonly result: IrResult;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* `IteratorResult`'s `done` half, split out as its own IR operation rather
|
|
1069
|
+
* than a second result field on `IteratorNextOperation` -- every other
|
|
1070
|
+
* operation in this IR publishes exactly one result, and `resultOfIrOperation`
|
|
1071
|
+
* reads that as `operation.result` unconditionally; a second result field
|
|
1072
|
+
* would be invisible to it. The native array fast path's `next` sets the
|
|
1073
|
+
* cursor's own `done` flag as a side effect of stepping it
|
|
1074
|
+
* (`gea::Iterator::arrayNext`), and this op reads that flag back -- ordered
|
|
1075
|
+
* after `next` by an ordinary operand edge (the negation `contributeForOfIn`
|
|
1076
|
+
* mints over this op's result), never by construction order alone.
|
|
1077
|
+
*/
|
|
1078
|
+
export interface IteratorDoneOperation extends IrOperationBase {
|
|
1079
|
+
readonly kind: 'iterator-done';
|
|
1080
|
+
readonly iterator: IrOperand;
|
|
1081
|
+
readonly result: IrResult;
|
|
1082
|
+
}
|
|
1083
|
+
export interface IteratorCloseOperation extends IrOperationBase {
|
|
1084
|
+
readonly kind: 'iterator-close';
|
|
1085
|
+
readonly iterator: IrOperand;
|
|
1086
|
+
readonly result: IrResult | null;
|
|
1087
|
+
/** Finite destructuring closes only while no step has observed exhaustion. */
|
|
1088
|
+
readonly onlyIfOpen: boolean;
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* One JSX element, constructed.
|
|
1092
|
+
*
|
|
1093
|
+
* This stays a single operation rather than a create-then-mutate sequence
|
|
1094
|
+
* because that is what the language states: `<div a={x}>{y}</div>` evaluates
|
|
1095
|
+
* its attributes and children and then produces one element, and no
|
|
1096
|
+
* intermediate half-built element is observable. A sequence would also let a
|
|
1097
|
+
* later pass reorder or drop one step, which for a child list is the whole
|
|
1098
|
+
* content of the value.
|
|
1099
|
+
*
|
|
1100
|
+
* The props are key/value pairs rather than a record operand: under `jsx:
|
|
1101
|
+
* "preserve"` no props object is ever created, so allocating one here would
|
|
1102
|
+
* publish an object identity the program does not have.
|
|
1103
|
+
*/
|
|
1104
|
+
export interface IrElementPropertyInit {
|
|
1105
|
+
readonly key: IrOperand;
|
|
1106
|
+
readonly value: IrOperand;
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* Creating one host element node -- the tag alone, with nothing yet on it.
|
|
1110
|
+
*
|
|
1111
|
+
* Properties and children are separate operations rather than fields here, and
|
|
1112
|
+
* the reason is ordering. A bundled element states its whole subtree as values
|
|
1113
|
+
* that must already exist, which forces the tree to lower leaves-first: every
|
|
1114
|
+
* child is materialized before the parent that will hold it. That is the wrong
|
|
1115
|
+
* order for a library whose children *attach into* a parent instead of
|
|
1116
|
+
* returning a node -- such a child needs its parent to exist before it can run
|
|
1117
|
+
* at all, and no arrangement of a bundled operation's operand list expresses
|
|
1118
|
+
* that.
|
|
1119
|
+
*
|
|
1120
|
+
* Split into three, the order is written down instead of implied: create the
|
|
1121
|
+
* node, then set properties on it, then attach children to it. Anything a
|
|
1122
|
+
* consumer wants to interleave between those steps -- attaching a nested tree
|
|
1123
|
+
* into the node, capturing the node for a later update -- has a place to
|
|
1124
|
+
* happen, and the emitted sequence is unchanged for the ordinary case.
|
|
1125
|
+
*/
|
|
1126
|
+
export interface ElementOperation extends IrOperationBase {
|
|
1127
|
+
readonly kind: 'element';
|
|
1128
|
+
readonly form: 'intrinsic' | 'value' | 'fragment';
|
|
1129
|
+
/** The intrinsic tag or the tag value; `null` only for a fragment, which names nothing. */
|
|
1130
|
+
readonly tag: IrOperand | null;
|
|
1131
|
+
/**
|
|
1132
|
+
* This element IS its text, rather than containing it.
|
|
1133
|
+
*
|
|
1134
|
+
* `<span>front</span>` is a leaf that carries characters, and a host with a
|
|
1135
|
+
* text node builds it as one -- carrying the span's own class and style --
|
|
1136
|
+
* rather than as a container holding a separate text child. Which tags may be
|
|
1137
|
+
* one is the host's answer (`PluginCapabilities.elementTextTags`); whether
|
|
1138
|
+
* THIS element's contents are a single text run is the language's, decided
|
|
1139
|
+
* from the children's own carriers in `lower-element.ts`.
|
|
1140
|
+
*
|
|
1141
|
+
* Set here rather than left to the emitter because the node's kind is fixed
|
|
1142
|
+
* at creation -- a host cannot turn a container into a text node afterwards
|
|
1143
|
+
* -- and the create operation is the only one that sees the tag and the whole
|
|
1144
|
+
* child list at once. `false` for every element that is not proven to be one,
|
|
1145
|
+
* which is the answer every element got before this existed.
|
|
1146
|
+
*/
|
|
1147
|
+
readonly textLeaf: boolean;
|
|
1148
|
+
readonly result: IrResult;
|
|
1149
|
+
}
|
|
1150
|
+
/** Setting one property on an element node already created. Publishes no result: it is a store. */
|
|
1151
|
+
export interface ElementPropOperation extends IrOperationBase {
|
|
1152
|
+
readonly kind: 'element-prop';
|
|
1153
|
+
readonly node: IrOperand;
|
|
1154
|
+
readonly key: IrOperand;
|
|
1155
|
+
readonly value: IrOperand;
|
|
1156
|
+
/** Always absent: setting a property evaluates to nothing there is an SSA name for. */
|
|
1157
|
+
readonly result: null;
|
|
1158
|
+
}
|
|
1159
|
+
/** Attaching one child to an element node already created. Publishes no result: it is a store. */
|
|
1160
|
+
export interface ElementChildOperation extends IrOperationBase {
|
|
1161
|
+
readonly kind: 'element-child';
|
|
1162
|
+
readonly node: IrOperand;
|
|
1163
|
+
readonly child: IrOperand;
|
|
1164
|
+
/**
|
|
1165
|
+
* The node this attaches to IS its text -- see `ElementOperation.textLeaf`.
|
|
1166
|
+
*
|
|
1167
|
+
* Carried here as well as on the create, because both operations act on it
|
|
1168
|
+
* and neither can see the other: this one names the node and not its tag, and
|
|
1169
|
+
* the create sees the tag and not what the child turns out to be. One
|
|
1170
|
+
* decision in `lower-element.ts` sets both, so the two cannot disagree.
|
|
1171
|
+
*/
|
|
1172
|
+
readonly textLeaf: boolean;
|
|
1173
|
+
/** Always absent: attaching a child evaluates to nothing there is an SSA name for. */
|
|
1174
|
+
readonly result: null;
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* A predicate over one value, yielding a boolean.
|
|
1178
|
+
*
|
|
1179
|
+
* `to-boolean` is the language's `ToBoolean`, and it is exact and
|
|
1180
|
+
* carrier-specific: an empty string is false and a non-empty one true, `0` and
|
|
1181
|
+
* `NaN` are false and every other number true, an absent optional is false, and
|
|
1182
|
+
* every object is true whatever it contains.
|
|
1183
|
+
*
|
|
1184
|
+
* `is-present` is the *other* test the language performs, and it is not a
|
|
1185
|
+
* weaker or stricter truthiness. `a?.b` and `a ?? b` branch on whether `a` is
|
|
1186
|
+
* `null` or `undefined` and on nothing else: `0`, `''` and `NaN` are all
|
|
1187
|
+
* present, and every one of them is falsy. Running `ToBoolean` where the
|
|
1188
|
+
* language runs a nullish check takes the wrong branch for exactly those
|
|
1189
|
+
* values, which is why they are two predicates here rather than one with a
|
|
1190
|
+
* flag applied afterwards.
|
|
1191
|
+
*
|
|
1192
|
+
* `is-defined` is the third, and it is the narrow half of `is-present`: only
|
|
1193
|
+
* `undefined` counts as absent. That is the test a defaulted parameter runs --
|
|
1194
|
+
* the language substitutes an initializer for a missing argument and for
|
|
1195
|
+
* nothing else, so `f(x = 0)` called `f(null)` binds `null`.
|
|
1196
|
+
*
|
|
1197
|
+
* All three are one operation over a stated carrier rather than a cast, and a
|
|
1198
|
+
* backend either has the rule for that carrier or refuses -- which is why the
|
|
1199
|
+
* carrier stays on the operand instead of being erased into a
|
|
1200
|
+
* boolean-producing coercion. The result is always a boolean scalar; there is
|
|
1201
|
+
* no other thing either predicate can produce.
|
|
1202
|
+
*/
|
|
1203
|
+
export interface TestOperation extends IrOperationBase {
|
|
1204
|
+
readonly kind: 'test';
|
|
1205
|
+
readonly predicate: 'to-boolean' | 'is-present' | 'is-defined';
|
|
1206
|
+
readonly value: IrOperand;
|
|
1207
|
+
readonly result: IrResult;
|
|
1208
|
+
}
|
|
1209
|
+
export type IrTerminatorOperation = BranchOperation | JumpOperation | ReturnOperation | ThrowOperation | SwitchOperation;
|
|
1210
|
+
export type IrOperation = GetOperation | SetOperation | DeleteOperation | HasPropertyOperation | OwnPropertyKeysOperation | DefineOwnPropertyOperation | SpreadCopyOperation | CallOperation | CommonJsRequireOperation | CommonJsBindingOperation | CommonJsBindingSetOperation | SuperInitializeOperation | ReparentConstructorOperation | ConstructOperation | ConstantOperation | BindingReadOperation | BindingWriteOperation | ParameterOperation | ReceiverOperation | GlobalThisOperation | UnresolvableReferenceOperation | AwaitOperation | YieldOperation | CatchBindingOperation | ComputeOperation | PhiOperation | IrTerminatorOperation | AllocateOrdinaryObjectOperation | AllocateArrayObjectOperation | AllocateCallableOperation | BindCallableOperation | AllocateConstructorOperation | AllocateProxyOperation | AllocateRecordOperation | AllocateTemplateObjectOperation | AllocateRegExpOperation | ConvertOperation | MergeLiveArmRebuildOperation | GetIteratorOperation | IteratorNextOperation | IteratorDoneOperation | IteratorCloseOperation | ElementOperation | ElementPropOperation | ElementChildOperation | TestOperation;
|
|
1211
|
+
/** Every operation kind that may terminate a block. Used to keep the "terminator is last" invariant checkable. */
|
|
1212
|
+
export declare const terminatorKinds: readonly ["branch", "jump", "return", "throw", "switch"];
|
|
1213
|
+
export declare const isTerminatorOperation: (operation: IrOperation) => operation is IrTerminatorOperation;
|
|
1214
|
+
/** An operation the type system already excludes from `IrBlock.operations` -- see `isTerminatorOperation` for the runtime mirror. */
|
|
1215
|
+
export type IrNonTerminatorOperation = Exclude<IrOperation, IrTerminatorOperation>;
|
|
1216
|
+
/**
|
|
1217
|
+
* A basic block.
|
|
1218
|
+
*
|
|
1219
|
+
* `terminator` is its own field, not the last array element, so "no
|
|
1220
|
+
* terminator" and "terminator not last" are unrepresentable by construction
|
|
1221
|
+
* rather than facts `verify` has to rediscover by scanning an array.
|
|
1222
|
+
*/
|
|
1223
|
+
export interface IrBlock {
|
|
1224
|
+
readonly id: IrBlockId;
|
|
1225
|
+
readonly operations: readonly IrNonTerminatorOperation[];
|
|
1226
|
+
readonly terminator: IrTerminatorOperation;
|
|
1227
|
+
}
|
|
1228
|
+
/** Every operation in a block, in execution order, terminator last. */
|
|
1229
|
+
export declare const allOperationsOf: (block: IrBlock) => readonly IrOperation[];
|
|
1230
|
+
export interface IrBody {
|
|
1231
|
+
readonly owner: PhysicalBodyId;
|
|
1232
|
+
/**
|
|
1233
|
+
* The execution region this body belongs to, carried alongside the folded
|
|
1234
|
+
* identity rather than recovered from it.
|
|
1235
|
+
*
|
|
1236
|
+
* `physicalBodyId` folds an owner and a variant key into one opaque string,
|
|
1237
|
+
* and taking it apart again would make every reader a second authority over
|
|
1238
|
+
* a structure `identity/ids.ts` alone is allowed to define -- the same
|
|
1239
|
+
* objection that forbids parsing rendered C++ to recover a decision. A
|
|
1240
|
+
* consumer that needs the real owner is told it, once, by the layer that
|
|
1241
|
+
* had it.
|
|
1242
|
+
*/
|
|
1243
|
+
readonly sourceOwner: FunctionId | RegionId;
|
|
1244
|
+
/** Observable [[SourceText]], retained even when the allocating expression is dead. */
|
|
1245
|
+
readonly functionSource?: string;
|
|
1246
|
+
/** `[[Name]]` -- own declared name or `NamedEvaluation` name; `''` for a truly anonymous callable. Carried alongside `functionSource`, present under the identical condition. */
|
|
1247
|
+
readonly functionName?: string;
|
|
1248
|
+
/** `Function.prototype.length` -- written parameters before the first default/rest one. Carried alongside `functionSource`. */
|
|
1249
|
+
readonly functionLength?: number;
|
|
1250
|
+
/**
|
|
1251
|
+
* Whether this body is a `function*` -- the DECLARATION's fact, carried from
|
|
1252
|
+
* the allocation operation because the result carrier cannot answer it: a
|
|
1253
|
+
* plain `function makeGen() { return g() }` returns the same `iterator`
|
|
1254
|
+
* cursor a generator does, and only the former spells `return`.
|
|
1255
|
+
*/
|
|
1256
|
+
readonly generator?: boolean;
|
|
1257
|
+
/**
|
|
1258
|
+
* Where `FunctionDeclarationInstantiation`'s own work ends inside this
|
|
1259
|
+
* generator's entry -- `null` for a non-generator, and for a generator
|
|
1260
|
+
* whose formals need nothing run early (no default, no destructured
|
|
1261
|
+
* pattern): the plain `parameter` copies a coroutine's own frame already
|
|
1262
|
+
* makes before `initial_suspend` need no help.
|
|
1263
|
+
*
|
|
1264
|
+
* ECMA-262 runs a function's parameter defaults and destructuring
|
|
1265
|
+
* (10.2.1 step 8, `FunctionDeclarationInstantiation`) as part of `[[Call]]`,
|
|
1266
|
+
* before `EvaluateGeneratorBody` (15.5.2) ever creates the suspended
|
|
1267
|
+
* generator object -- so a default's thrown error, or a pattern's failed
|
|
1268
|
+
* iterator-close, surfaces at the CALL, not at the first `next()`. A C++20
|
|
1269
|
+
* coroutine cannot express that split within one function: the whole
|
|
1270
|
+
* function's execution -- including its very first statement -- is
|
|
1271
|
+
* deferred behind `initial_suspend`, coroutine-ness being a whole-function
|
|
1272
|
+
* property. `ir/generator-split.ts` reads this field to carve such a body
|
|
1273
|
+
* into an ordinary OUTER function (this body's own declared signature,
|
|
1274
|
+
* running the prefix) that tail-calls a private INNER coroutine (holding
|
|
1275
|
+
* everything from `operationIndex` on, plus every block this owner's
|
|
1276
|
+
* `blockOrder` lists that is not in `outerBlocks`).
|
|
1277
|
+
*
|
|
1278
|
+
* `block`/`operationIndex` name the cut inside that one block: operations
|
|
1279
|
+
* `[0, operationIndex)` belong to the outer prefix, the rest -- plus that
|
|
1280
|
+
* block's own terminator -- start the inner coroutine. `outerBlocks` is
|
|
1281
|
+
* every block whose OWN operations lowering reached while still inside the
|
|
1282
|
+
* parameter-instantiation phase (`OrderedOwnerOperations.parameterPrologue`
|
|
1283
|
+
* in `lower-graph.ts`), captured here because lowering already has the
|
|
1284
|
+
* `blockStarts` table that answers it and a later consumer, working from
|
|
1285
|
+
* the sealed body alone, would have to re-derive block reachability from
|
|
1286
|
+
* scratch to recover the same set.
|
|
1287
|
+
*/
|
|
1288
|
+
readonly generatorPrologueBoundary?: {
|
|
1289
|
+
readonly block: IrBlockId;
|
|
1290
|
+
readonly operationIndex: number;
|
|
1291
|
+
readonly outerBlocks: ReadonlySet<IrBlockId>;
|
|
1292
|
+
} | null;
|
|
1293
|
+
/**
|
|
1294
|
+
* The calling convention this body implements, or `null` for a body nobody
|
|
1295
|
+
* calls -- a module body, a field initializer, a static block.
|
|
1296
|
+
*
|
|
1297
|
+
* It is stated once, here, rather than re-derived by each consumer from the
|
|
1298
|
+
* owner's signature. A `parameter` operation's ordinal indexes into
|
|
1299
|
+
* `abi.parameters`, and the emitter spells the signature from the same
|
|
1300
|
+
* field, so the frame the body reads and the frame the signature declares
|
|
1301
|
+
* cannot come apart.
|
|
1302
|
+
*/
|
|
1303
|
+
readonly abi: CallableAbi | null;
|
|
1304
|
+
/**
|
|
1305
|
+
* The convention `new` invokes into THIS SAME body, or `null` for a body
|
|
1306
|
+
* that is only ever called.
|
|
1307
|
+
*
|
|
1308
|
+
* A pre-`class` JavaScript constructor function is entered two ways
|
|
1309
|
+
* (`projection/abi.ts`'s `constructs`), and the two are separately physical:
|
|
1310
|
+
* `[[Call]]` is handed a receiver, `[[Construct]]` manufactures one
|
|
1311
|
+
* (ECMA-262 10.2.2) and evaluates to it. Both are needed to render the two
|
|
1312
|
+
* function pointers `gea::CallableConstructorObject` holds, and carrying the
|
|
1313
|
+
* second here -- beside the first, from the one projection that decided both
|
|
1314
|
+
* -- is what keeps the emitter from re-deriving it out of `abi.receiver`.
|
|
1315
|
+
*/
|
|
1316
|
+
readonly construct: CallableAbi | null;
|
|
1317
|
+
readonly entry: IrBlockId;
|
|
1318
|
+
readonly blocks: ReadonlyMap<IrBlockId, IrBlock>;
|
|
1319
|
+
/** Deterministic iteration order, fixed at build time so two verifications of the same body agree. */
|
|
1320
|
+
readonly blockOrder: readonly IrBlockId[];
|
|
1321
|
+
/** Every SSA value's declared carrier, indexed once so a consumer never re-derives it by re-scanning operations. */
|
|
1322
|
+
readonly values: ReadonlyMap<IrValueId, Representation>;
|
|
1323
|
+
/**
|
|
1324
|
+
* Every try statement this body lowered, naming the blocks C++ emission
|
|
1325
|
+
* cannot reach the ordinary way.
|
|
1326
|
+
*
|
|
1327
|
+
* `tryEntry` and `catchEntry` are real blocks with real terminators, exactly
|
|
1328
|
+
* like any other -- `verify.ts`'s guards all pass over them unmodified --
|
|
1329
|
+
* but nothing in this body's own jump/branch graph ever transfers control
|
|
1330
|
+
* into either from outside: entering `tryEntry` is C++'s own fallthrough
|
|
1331
|
+
* into a `try {` the emitter writes instead of a `goto`+label (which C++
|
|
1332
|
+
* forbids), and `catchEntry` is reached only by the runtime unwinding an
|
|
1333
|
+
* exception out of the try body. `emit.ts` reads this table to know which
|
|
1334
|
+
* blocks need that special rendering; nothing else does.
|
|
1335
|
+
*/
|
|
1336
|
+
readonly tryRegions: readonly IrTryRegion[];
|
|
1337
|
+
/** Synchronous iteration regions that route abrupt or finite completion through IteratorClose. */
|
|
1338
|
+
readonly iteratorCloseRegions?: readonly IrIteratorCloseRegion[];
|
|
1339
|
+
/**
|
|
1340
|
+
* What `ir/captures.ts` decided about this body from a whole-program walk
|
|
1341
|
+
* of the lowered bodies plus the binding placements -- absent only for a
|
|
1342
|
+
* body nobody has run that analysis over yet (a hand-built test body, or a
|
|
1343
|
+
* pipeline stage upstream of `publishCaptureFacts`). A body downstream of
|
|
1344
|
+
* that pass always carries one, even a body that captures nothing and is
|
|
1345
|
+
* never allocated as a value, so a reader default to the empty answer for
|
|
1346
|
+
* `undefined` rather than to a MISSING one it has to special-case.
|
|
1347
|
+
*
|
|
1348
|
+
* Read by `targets/cpp/captures.ts`'s `buildCaptureIndex`, which used to
|
|
1349
|
+
* recompute all of this itself from the same bodies and placements
|
|
1350
|
+
* (a program fact, so it belongs to the IR) -- a fact of the representation
|
|
1351
|
+
* the target had no business re-deriving at render time.
|
|
1352
|
+
*/
|
|
1353
|
+
readonly facts?: IrBodyFacts;
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* One body's own share of the whole-program capture analysis
|
|
1357
|
+
* `ir/captures.ts`'s `computeCaptureFacts` performs -- which declarations an
|
|
1358
|
+
* allocation THIS body's owner makes must transport from an enclosing frame,
|
|
1359
|
+
* and which declarations THIS body OWNS (per `BindingPlacement.storage`)
|
|
1360
|
+
* that some capturing frame needs shared by aliasing rather than by copying.
|
|
1361
|
+
*
|
|
1362
|
+
* `boxed` and `requiresEarlyBox` are scoped to the OWNING body rather than
|
|
1363
|
+
* published as one whole-program set, because a declaration belongs to
|
|
1364
|
+
* exactly one physical frame (`BindingPlacement.storage.owner`) and every
|
|
1365
|
+
* reader that needs the whole-program answer -- `CaptureIndex.isBoxed`,
|
|
1366
|
+
* consulted by any frame that reads or writes the cell, capturing or not --
|
|
1367
|
+
* gets it by taking the union of every body's own set. That union can never
|
|
1368
|
+
* disagree with itself the way two independently-recomputed whole-program
|
|
1369
|
+
* sets could.
|
|
1370
|
+
*/
|
|
1371
|
+
export interface IrBodyFacts {
|
|
1372
|
+
/**
|
|
1373
|
+
* Every declaration outside this body's own frame that an allocation this
|
|
1374
|
+
* body's owner is the target of must carry in its environment, in
|
|
1375
|
+
* first-mention/relay order -- the transitive closure over `allocate-callable`
|
|
1376
|
+
* allocation edges (`ir/captures.ts`'s `transitiveCaptures`). Empty for a
|
|
1377
|
+
* body that is never allocated as a value, or that closes over nothing.
|
|
1378
|
+
*/
|
|
1379
|
+
readonly capturedDeclarations: readonly DeclarationId[];
|
|
1380
|
+
/**
|
|
1381
|
+
* The enclosing method's receiver representation this body reads directly
|
|
1382
|
+
* or merely relays to a deeper closure that reads it, or `null` when this
|
|
1383
|
+
* body needs no receiver from anywhere but its own ABI.
|
|
1384
|
+
*/
|
|
1385
|
+
readonly capturedReceiver: Representation | null;
|
|
1386
|
+
/**
|
|
1387
|
+
* Whether some `allocate-callable` operation anywhere in the program names
|
|
1388
|
+
* this body's own `sourceOwner` as the function it allocates -- the same
|
|
1389
|
+
* gate `buildCaptureIndex` used to re-derive by scanning every body.
|
|
1390
|
+
*/
|
|
1391
|
+
readonly allocatedAsValue: boolean;
|
|
1392
|
+
/**
|
|
1393
|
+
* Whether this body reads `this` -- in its own operations, or by allocating
|
|
1394
|
+
* a nested closure that has no receiver of its own and reads this one.
|
|
1395
|
+
*/
|
|
1396
|
+
readonly readsReceiver: boolean;
|
|
1397
|
+
/** Declarations OWNED by this body that must be shared by aliasing rather than copied into a capturing environment. */
|
|
1398
|
+
readonly boxed: ReadonlySet<DeclarationId>;
|
|
1399
|
+
/**
|
|
1400
|
+
* Declarations OWNED by this body for which no individual write dominates
|
|
1401
|
+
* every allocation that captures them -- the owning frame must allocate the
|
|
1402
|
+
* shared cell before its first rendered block rather than at the write.
|
|
1403
|
+
*/
|
|
1404
|
+
readonly requiresEarlyBox: ReadonlySet<DeclarationId>;
|
|
1405
|
+
}
|
|
1406
|
+
/** One synchronous `for`-`of` iteration or finite destructuring sequence protected by ECMAScript IteratorClose. */
|
|
1407
|
+
export interface IrIteratorCloseRegion {
|
|
1408
|
+
readonly loop: OperationId;
|
|
1409
|
+
readonly lineage: SemanticResultId;
|
|
1410
|
+
readonly iterator: IrOperand;
|
|
1411
|
+
readonly entry: IrBlockId;
|
|
1412
|
+
readonly blocks: readonly IrBlockId[];
|
|
1413
|
+
/** Jumps representing same-loop continuation or normal exhaustion dismiss cleanup; empty for finite patterns. */
|
|
1414
|
+
readonly dismissTargets: readonly IrBlockId[];
|
|
1415
|
+
/** Finite patterns close only if no step has already observed exhaustion. */
|
|
1416
|
+
readonly onlyIfOpen: boolean;
|
|
1417
|
+
/**
|
|
1418
|
+
* Where the loop BODY starts, or `null` for a finite pattern.
|
|
1419
|
+
*
|
|
1420
|
+
* The region covers the head test and the body alike, but ECMA-262 14.7.5.7
|
|
1421
|
+
* closes for only one of them. It calls `next` with `?` -- ReturnIfAbrupt --
|
|
1422
|
+
* and IteratorComplete and IteratorValue likewise set `[[Done]]` and
|
|
1423
|
+
* propagate, so **a throw out of the step does not close the iterator**;
|
|
1424
|
+
* only a throw out of the body does, and that one discards the close's own
|
|
1425
|
+
* failure (7.4.9 step 3). The two cannot be separate C++ `try` blocks -- the
|
|
1426
|
+
* head test's branch jumps INTO the body, and a `goto` into a try block is
|
|
1427
|
+
* ill-formed -- so the rendering keeps one handler and this names the point
|
|
1428
|
+
* at which it starts closing.
|
|
1429
|
+
*/
|
|
1430
|
+
readonly bodyEntry: IrBlockId | null;
|
|
1431
|
+
}
|
|
1432
|
+
/** One try statement's blocks, keyed by its own control operation. See `IrBody.tryRegions`. */
|
|
1433
|
+
export interface IrTryRegion {
|
|
1434
|
+
readonly region: OperationId;
|
|
1435
|
+
/** First block of the try body. */
|
|
1436
|
+
readonly tryEntry: IrBlockId;
|
|
1437
|
+
/** First block of the catch handler, or `null` for a try with no catch clause. */
|
|
1438
|
+
readonly catchEntry: IrBlockId | null;
|
|
1439
|
+
/**
|
|
1440
|
+
* First block of the finally clause, or `null` for a try without one.
|
|
1441
|
+
*
|
|
1442
|
+
* Reached by no control-flow edge this IR builds, exactly as `catchEntry` is
|
|
1443
|
+
* reached by none: the C++ rendering runs it from a SCOPE GUARD's destructor
|
|
1444
|
+
* placed around the whole `try`/`catch`, which is what makes every one of
|
|
1445
|
+
* ECMAScript's five ways out of a try body run it without a completion record
|
|
1446
|
+
* to dispatch on. Falling off the end, a `return`, a `break`/`continue` to an
|
|
1447
|
+
* enclosing loop and a `goto` past the scope all destroy the guard on the way
|
|
1448
|
+
* out, and an exception propagating destroys it while unwinding.
|
|
1449
|
+
*
|
|
1450
|
+
* The part's own blocks end by reaching `join`, which the emitter renders as
|
|
1451
|
+
* falling off the end of the guard's body rather than as a jump -- a `goto`
|
|
1452
|
+
* out of the guard body is ill-formed C++, and that is the same fact as "a
|
|
1453
|
+
* finally clause does not decide where control goes next".
|
|
1454
|
+
*/
|
|
1455
|
+
readonly finallyEntry: IrBlockId | null;
|
|
1456
|
+
/**
|
|
1457
|
+
* Where the finally clause's own normal completion goes, or `null` for a try
|
|
1458
|
+
* without one (or one whose clause never completes normally).
|
|
1459
|
+
*
|
|
1460
|
+
* Not the region's `join`, which is where the try body and the catch handler
|
|
1461
|
+
* converge: a finally clause decides nothing about where control goes next,
|
|
1462
|
+
* so its end is not an arrival, it is a hand-back. The emitter renders
|
|
1463
|
+
* reaching this block as falling off the end of the guard body, after which
|
|
1464
|
+
* control resumes wherever the completion that ran the clause was headed.
|
|
1465
|
+
*/
|
|
1466
|
+
readonly finallyExit: IrBlockId | null;
|
|
1467
|
+
/**
|
|
1468
|
+
* Where both sides rejoin on ordinary completion, or `null` when neither
|
|
1469
|
+
* side ever does (both end in `return`/`throw`, so nothing ever asked for a
|
|
1470
|
+
* join).
|
|
1471
|
+
*/
|
|
1472
|
+
readonly join: IrBlockId | null;
|
|
1473
|
+
}
|
|
1474
|
+
export {};
|