@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,319 @@
|
|
|
1
|
+
import { representationKey } from '../representation/model.js';
|
|
2
|
+
import { borrowEffectsOf } from './borrow-effects.js';
|
|
3
|
+
import { callableIdentityDemandOf } from './callable-identity-demand.js';
|
|
4
|
+
import { fixedFieldDeletionsOf, integrityRestrictionsOf } from './integrity-restrictions.js';
|
|
5
|
+
import { singleEvaluationClassesOf } from './class-evaluation.js';
|
|
6
|
+
import { callableMemberCandidatesOf } from './callable-member-candidates.js';
|
|
7
|
+
import { cyclicBlocksOf } from './dominance.js';
|
|
8
|
+
import { allOperationsOf } from './model.js';
|
|
9
|
+
import { operandsOfIrOperation } from './queries.js';
|
|
10
|
+
import { buildDyingArgumentIndex } from './transfer.js';
|
|
11
|
+
/**
|
|
12
|
+
* Constructor cells whose construction this unit should call BY NAME.
|
|
13
|
+
*
|
|
14
|
+
* Not every one of them: naming the construct function lets clang inline the
|
|
15
|
+
* whole construction -- `gea::makeRef`, its pool refill, its `try`/`catch` --
|
|
16
|
+
* into whatever body constructs, and that is either the point or a disaster
|
|
17
|
+
* depending on how often the body constructs. Both were measured, on the same
|
|
18
|
+
* day, with the same compiler:
|
|
19
|
+
*
|
|
20
|
+
* - `bench/comparison/fixtures/binary_trees.ts` constructs a million times
|
|
21
|
+
* inside a recursive body. Through the carrier the construction is an
|
|
22
|
+
* INDIRECT call taking two `gea::Ref` arguments by address, with a retain
|
|
23
|
+
* and a release around each: 46.1ms. Named, and therefore inlined: 41.9ms.
|
|
24
|
+
* - `bench/comparison/fixtures/method_calls.ts` constructs ONCE, before its
|
|
25
|
+
* hot loop. Naming it there spent the caller's inlining budget on a
|
|
26
|
+
* construction that runs a single time, and the loop's own callee stopped
|
|
27
|
+
* being inlined: 38.1ms to 49.0ms.
|
|
28
|
+
*
|
|
29
|
+
* So the question is not "can this be devirtualized" -- an earlier attempt
|
|
30
|
+
* asked that, got `yes` for both, and was reverted as a net loss -- but "does
|
|
31
|
+
* the program construct through this cell REPEATEDLY". A construction inside a
|
|
32
|
+
* cyclic block or in a body that calls itself runs many times; one in
|
|
33
|
+
* straight-line code in a non-recursive body runs as many times as its caller
|
|
34
|
+
* does. Callback arguments and the known call graph extend that repeated
|
|
35
|
+
* context to event-driven bodies without marking all initialization hot.
|
|
36
|
+
*
|
|
37
|
+
* `noinline` on the construct function was measured too, as the way to have
|
|
38
|
+
* the direct call without the inlining, and it is worse than either
|
|
39
|
+
* (binary_trees 41.9ms to 44.5ms): the inlining IS the win where the win is.
|
|
40
|
+
*/
|
|
41
|
+
const buildRepeatedConstructorIndex = (bodies, directCallables) => {
|
|
42
|
+
const allocated = new Map();
|
|
43
|
+
const writeCounts = new Map();
|
|
44
|
+
const written = new Map();
|
|
45
|
+
for (const body of bodies) {
|
|
46
|
+
for (const block of body.blocks.values()) {
|
|
47
|
+
for (const operation of block.operations) {
|
|
48
|
+
if (operation.kind === 'allocate-constructor' && operation.captures.length === 0)
|
|
49
|
+
allocated.set(operation.result.id, operation.declaration);
|
|
50
|
+
if (operation.kind !== 'binding-write')
|
|
51
|
+
continue;
|
|
52
|
+
writeCounts.set(operation.declaration, (writeCounts.get(operation.declaration) ?? 0) + 1);
|
|
53
|
+
const declaration = allocated.get(operation.value.value);
|
|
54
|
+
if (declaration !== undefined)
|
|
55
|
+
written.set(operation.declaration, declaration);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Callbacks may be invoked repeatedly by their consumer, including a host
|
|
60
|
+
// event loop. Propagate that context through known calls instead of treating
|
|
61
|
+
// every acyclic callback body as one-time initialization. This is an inlining
|
|
62
|
+
// heuristic; the single-write constructor proof below remains mandatory.
|
|
63
|
+
const callbacks = new Map();
|
|
64
|
+
const callbackReads = new Map();
|
|
65
|
+
for (const body of bodies) {
|
|
66
|
+
for (const block of body.blocks.values()) {
|
|
67
|
+
for (const operation of block.operations) {
|
|
68
|
+
if (operation.kind === 'allocate-callable')
|
|
69
|
+
callbacks.set(operation.result.id, operation.functionId);
|
|
70
|
+
if (operation.kind === 'binding-read')
|
|
71
|
+
callbackReads.set(operation.result.id, operation.declaration);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const functionOf = (value) => {
|
|
76
|
+
const declaration = callbackReads.get(value);
|
|
77
|
+
return callbacks.get(value) ?? (declaration === undefined ? undefined : directCallables.get(declaration));
|
|
78
|
+
};
|
|
79
|
+
const repeatedBodies = new Set();
|
|
80
|
+
const calls = new Map();
|
|
81
|
+
for (const body of bodies) {
|
|
82
|
+
const cyclic = cyclicBlocksOf(body);
|
|
83
|
+
for (const [blockId, block] of body.blocks) {
|
|
84
|
+
for (const operation of block.operations) {
|
|
85
|
+
if (operation.kind !== 'call' && operation.kind !== 'construct')
|
|
86
|
+
continue;
|
|
87
|
+
for (const argument of operation.arguments) {
|
|
88
|
+
const callback = functionOf(argument.value);
|
|
89
|
+
if (callback !== undefined)
|
|
90
|
+
repeatedBodies.add(callback);
|
|
91
|
+
}
|
|
92
|
+
if (operation.kind !== 'call')
|
|
93
|
+
continue;
|
|
94
|
+
const callee = functionOf(operation.callee.value);
|
|
95
|
+
if (callee === undefined)
|
|
96
|
+
continue;
|
|
97
|
+
const targets = calls.get(body.sourceOwner) ?? new Set();
|
|
98
|
+
targets.add(callee);
|
|
99
|
+
calls.set(body.sourceOwner, targets);
|
|
100
|
+
if (cyclic.has(blockId) || callee === body.sourceOwner)
|
|
101
|
+
repeatedBodies.add(callee);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
for (const caller of repeatedBodies) {
|
|
106
|
+
for (const callee of calls.get(caller) ?? [])
|
|
107
|
+
repeatedBodies.add(callee);
|
|
108
|
+
}
|
|
109
|
+
const repeated = new Map();
|
|
110
|
+
for (const body of bodies) {
|
|
111
|
+
const cyclic = cyclicBlocksOf(body);
|
|
112
|
+
const reads = new Map();
|
|
113
|
+
let recursive = false;
|
|
114
|
+
for (const block of body.blocks.values()) {
|
|
115
|
+
for (const operation of block.operations) {
|
|
116
|
+
if (operation.kind === 'binding-read')
|
|
117
|
+
reads.set(operation.result.id, operation.declaration);
|
|
118
|
+
// A body that calls ITSELF constructs as many times as it recurses,
|
|
119
|
+
// which is the same fact a cyclic block states one level down. The
|
|
120
|
+
// callee is a cell like any other, so the same index the emitter
|
|
121
|
+
// devirtualizes calls through is what answers which body it names.
|
|
122
|
+
if (operation.kind !== 'call')
|
|
123
|
+
continue;
|
|
124
|
+
const callee = reads.get(operation.callee.value);
|
|
125
|
+
if (callee !== undefined && directCallables.get(callee) === body.sourceOwner)
|
|
126
|
+
recursive = true;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
for (const [blockId, block] of body.blocks) {
|
|
130
|
+
if (!recursive && !repeatedBodies.has(body.sourceOwner) && !cyclic.has(blockId))
|
|
131
|
+
continue;
|
|
132
|
+
for (const operation of block.operations) {
|
|
133
|
+
if (operation.kind !== 'construct')
|
|
134
|
+
continue;
|
|
135
|
+
const cell = reads.get(operation.callee.value);
|
|
136
|
+
if (cell === undefined || writeCounts.get(cell) !== 1)
|
|
137
|
+
continue;
|
|
138
|
+
const declaration = written.get(cell);
|
|
139
|
+
if (declaration !== undefined)
|
|
140
|
+
repeated.set(cell, declaration);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return repeated;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Which parameter positions this body may declare `const T&` instead of `T`.
|
|
148
|
+
*
|
|
149
|
+
* A `std::string` formal taken by value is a heap copy per call and a
|
|
150
|
+
* `gea::Ref<T>` one an atomic pair, paid for an argument the caller already
|
|
151
|
+
* holds for the whole call. Like the target's `borrowsReceiver`, this is the
|
|
152
|
+
* BODY's spelling only: the ABI, the carrier and the thunk keep the by-value
|
|
153
|
+
* convention every caller agrees on, and the thunk's own copy binds to the
|
|
154
|
+
* reference.
|
|
155
|
+
*
|
|
156
|
+
* Unlike the receiver, a parameter may ALIAS storage the body can write.
|
|
157
|
+
* `this.label = f(this.label)` passes the field itself (a plain read is spelled
|
|
158
|
+
* inline, so the reference binds to `gea_this->label`), and a body that then
|
|
159
|
+
* assigned that field before reading its parameter would read the new value
|
|
160
|
+
* where the language gives it the old one. So a body borrows only when it can
|
|
161
|
+
* change no caller-owned handle/string slot or re-enter program code. The
|
|
162
|
+
* shared IR effect proof admits native byte stores and non-coercing primitive
|
|
163
|
+
* calls, but excludes accessors, arbitrary calls, deletes and construction.
|
|
164
|
+
* There is no `await`/`yield` (a
|
|
165
|
+
* reference across a suspension dangles -- the coroutine rule
|
|
166
|
+
* `borrowsReceiver` states), and writes only to its own locals. And a
|
|
167
|
+
* parameter the body hands on as a DYING argument is not borrowed either: that
|
|
168
|
+
* read is spelled `std::move(...)` (`emit-narrowing.ts`), which a `const&`
|
|
169
|
+
* refuses.
|
|
170
|
+
*
|
|
171
|
+
* `examples/apps/weather` formats temperatures and labels through forty such
|
|
172
|
+
* string parameters; every one of them was a copy.
|
|
173
|
+
*/
|
|
174
|
+
/** An `optional` over a reference-counted or string payload: physically one handle, copied by value only because the wrapper states no ownership. */
|
|
175
|
+
const refCarrierByValue = (value) => value.kind === 'optional' &&
|
|
176
|
+
(value.payload.kind === 'string' || ('ownership' in value.payload && value.payload.ownership === 'shared-refcount'));
|
|
177
|
+
const borrowedFormalsOf = (body, dyingArguments, isBoxed, isCoroutineBody, placements, safeOperations, borrowedForwarding) => {
|
|
178
|
+
const borrowed = new Set();
|
|
179
|
+
if (!body.abi || isCoroutineBody(body))
|
|
180
|
+
return borrowed;
|
|
181
|
+
const parameters = new Map();
|
|
182
|
+
const seededBy = new Map();
|
|
183
|
+
const readsOf = new Map();
|
|
184
|
+
for (const block of body.blocks.values()) {
|
|
185
|
+
for (const operation of block.operations) {
|
|
186
|
+
if (!safeOperations.has(operation))
|
|
187
|
+
return borrowed;
|
|
188
|
+
if (operation.kind === 'parameter')
|
|
189
|
+
parameters.set(operation.result.id, operation.ordinal);
|
|
190
|
+
if (operation.kind === 'binding-write') {
|
|
191
|
+
const placement = placements.get(operation.declaration);
|
|
192
|
+
if (!placement || placement.storage.kind !== 'local' || String(placement.storage.owner) !== String(body.sourceOwner))
|
|
193
|
+
return borrowed;
|
|
194
|
+
seededBy.set(operation.declaration, [...(seededBy.get(operation.declaration) ?? []), operation.value.value]);
|
|
195
|
+
}
|
|
196
|
+
if (operation.kind === 'binding-read')
|
|
197
|
+
readsOf.set(operation.declaration, [...(readsOf.get(operation.declaration) ?? []), operation.result.id]);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
for (const [value, ordinal] of parameters) {
|
|
201
|
+
const parameter = body.abi.parameters[ordinal];
|
|
202
|
+
if (!parameter || parameter.ownership === 'borrowed')
|
|
203
|
+
continue;
|
|
204
|
+
// A nullable handle (`TreeNode | null`) is passed by value -- `passingOf`
|
|
205
|
+
// gives an `optional` no ownership of its own -- yet copying it is the
|
|
206
|
+
// same retain/release as copying the handle it wraps, so it borrows on
|
|
207
|
+
// the same terms.
|
|
208
|
+
if (parameter.passing !== 'const-ref' && !refCarrierByValue(parameter.value))
|
|
209
|
+
continue;
|
|
210
|
+
// The parameter's own value usually has exactly one reader -- the write
|
|
211
|
+
// that seeds its cell -- and is therefore "dying" into it. That write is
|
|
212
|
+
// the one `collectFormalCells` elides (the body then reads the formal by
|
|
213
|
+
// name), so it moves nothing; but it is elided only under that function's
|
|
214
|
+
// own conditions -- one write, an unboxed cell, the same carrier -- and a
|
|
215
|
+
// seed that stays is spelled `std::move(gea_arg_N)`, which a `const&`
|
|
216
|
+
// refuses. So the same conditions decide here.
|
|
217
|
+
let moved = false;
|
|
218
|
+
for (const [declaration, values] of seededBy) {
|
|
219
|
+
if (!values.includes(value))
|
|
220
|
+
continue;
|
|
221
|
+
const placement = placements.get(declaration);
|
|
222
|
+
const sameCarrier = placement?.representation != null && representationKey(placement.representation) === representationKey(parameter.value);
|
|
223
|
+
if (values.length !== 1 || isBoxed(declaration) || !sameCarrier)
|
|
224
|
+
moved = true;
|
|
225
|
+
for (const read of readsOf.get(declaration) ?? [])
|
|
226
|
+
if (dyingArguments.has(read) && !borrowedForwarding.has(read))
|
|
227
|
+
moved = true;
|
|
228
|
+
}
|
|
229
|
+
if (!moved)
|
|
230
|
+
borrowed.add(ordinal);
|
|
231
|
+
}
|
|
232
|
+
return borrowed;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Everything a translation unit needs to know about the whole program before
|
|
236
|
+
* it renders a body, in the one dependency order these questions actually
|
|
237
|
+
* have: a callable must be named before repeated construction through it can
|
|
238
|
+
* be counted, and both must exist before the borrow fixed point can ask which
|
|
239
|
+
* calls forward an already-borrowed argument unchanged.
|
|
240
|
+
*/
|
|
241
|
+
export const programFactsOf = (bodies, directCallables, placements, policy) => {
|
|
242
|
+
const callableMemberCandidates = callableMemberCandidatesOf(bodies, directCallables);
|
|
243
|
+
const repeatedConstructors = buildRepeatedConstructorIndex(bodies, directCallables);
|
|
244
|
+
const dyingArguments = buildDyingArgumentIndex(bodies);
|
|
245
|
+
const borrowEffects = borrowEffectsOf(bodies, directCallables, policy.captureFree, (body) => !policy.isCoroutineBody(body), policy.isPrivateLocal, policy.plainFieldRead);
|
|
246
|
+
// A fixed point over the whole unit: a call forwarding one of ITS OWN
|
|
247
|
+
// already-borrowed formals to a callee position that callee also borrows
|
|
248
|
+
// adds no new alias the callee doesn't already tolerate, so the caller may
|
|
249
|
+
// borrow that formal too even though it also passes it on. Any other use
|
|
250
|
+
// -- read for anything but such a forwarded argument -- disqualifies it.
|
|
251
|
+
// Because a callee's admitted set can grow on a later pass (it may itself
|
|
252
|
+
// depend on a third body not yet settled), this iterates until nothing
|
|
253
|
+
// grows, exactly as `borrowEffectsOf`'s own effect proof does.
|
|
254
|
+
const borrowedFormals = new Map();
|
|
255
|
+
let borrowingChanged = true;
|
|
256
|
+
while (borrowingChanged) {
|
|
257
|
+
borrowingChanged = false;
|
|
258
|
+
for (const body of bodies) {
|
|
259
|
+
const forwarded = new Set();
|
|
260
|
+
const otherUses = new Set();
|
|
261
|
+
for (const block of body.blocks.values())
|
|
262
|
+
for (const operation of allOperationsOf(block)) {
|
|
263
|
+
const target = operation.kind === 'call' ? borrowEffects.targets.get(operation.callee.value) : undefined;
|
|
264
|
+
const admitted = target === undefined ? undefined : borrowedFormals.get(String(target));
|
|
265
|
+
for (const operand of operandsOfIrOperation(operation)) {
|
|
266
|
+
const positions = operation.kind === 'call'
|
|
267
|
+
? operation.arguments.flatMap((argument, index) => (argument.value === operand.value ? [index] : []))
|
|
268
|
+
: [];
|
|
269
|
+
if (admitted && positions.length > 0 && positions.every((position) => admitted.has(position)))
|
|
270
|
+
forwarded.add(operand.value);
|
|
271
|
+
else
|
|
272
|
+
otherUses.add(operand.value);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
for (const value of otherUses)
|
|
276
|
+
forwarded.delete(value);
|
|
277
|
+
const owner = String(body.sourceOwner);
|
|
278
|
+
const next = borrowedFormalsOf(body, dyingArguments, policy.isBoxed, policy.isCoroutineBody, placements, borrowEffects.operations.get(owner) ?? new Set(), forwarded);
|
|
279
|
+
if (next.size > (borrowedFormals.get(owner)?.size ?? 0))
|
|
280
|
+
borrowingChanged = true;
|
|
281
|
+
borrowedFormals.set(owner, next);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
const formalsBorrowedIn = (owner) => borrowedFormals.get(String(owner)) ?? new Set();
|
|
285
|
+
// See `ProgramFacts.bodyCallsUnsafeKnownCallee`'s doc: a body is flagged the
|
|
286
|
+
// moment ONE of its 'call' operations names a resolvable target
|
|
287
|
+
// (`borrowEffects.targets`) that the fixed point above never proved safe
|
|
288
|
+
// (absent from that owner's own final safe-operation set). An opaque call
|
|
289
|
+
// -- no resolvable target -- never flags anything here, on purpose: that
|
|
290
|
+
// hazard is the call-SITE's to rule out, not this body's.
|
|
291
|
+
const unsafeKnownCallees = new Set();
|
|
292
|
+
for (const body of bodies) {
|
|
293
|
+
const owner = String(body.sourceOwner);
|
|
294
|
+
const safe = borrowEffects.operations.get(owner);
|
|
295
|
+
for (const block of body.blocks.values())
|
|
296
|
+
for (const operation of allOperationsOf(block)) {
|
|
297
|
+
if (operation.kind !== 'call' || !borrowEffects.targets.has(operation.callee.value))
|
|
298
|
+
continue;
|
|
299
|
+
if (!safe?.has(operation))
|
|
300
|
+
unsafeKnownCallees.add(owner);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
const bodyCallsUnsafeKnownCallee = (owner) => unsafeKnownCallees.has(String(owner));
|
|
304
|
+
const callableIdentityDemand = callableIdentityDemandOf(bodies, { classInstanceOf: policy.classInstanceOf });
|
|
305
|
+
const nativeIntegrityRestricted = integrityRestrictionsOf(bodies);
|
|
306
|
+
const fixedFieldStateConstant = !nativeIntegrityRestricted && !fixedFieldDeletionsOf(bodies);
|
|
307
|
+
const singleEvaluationClasses = singleEvaluationClassesOf(bodies);
|
|
308
|
+
return {
|
|
309
|
+
callableMemberCandidates,
|
|
310
|
+
repeatedConstructors,
|
|
311
|
+
dyingArguments,
|
|
312
|
+
formalsBorrowedIn,
|
|
313
|
+
bodyCallsUnsafeKnownCallee,
|
|
314
|
+
callableIdentityDemand,
|
|
315
|
+
nativeIntegrityRestricted,
|
|
316
|
+
fixedFieldStateConstant,
|
|
317
|
+
singleEvaluationClasses
|
|
318
|
+
};
|
|
319
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type PhysicalBodyId, type SemanticResultId } from '../identity/ids.js';
|
|
2
|
+
import type { SemanticGraph } from '../semantics/model/graph.js';
|
|
3
|
+
import { type IrBody } from './model.js';
|
|
4
|
+
import type { SlotDrift } from './lower-operands.js';
|
|
5
|
+
/** Normal-completion truth facts derived from the semantic operations' sealed results. */
|
|
6
|
+
export declare const provenResultTruthiness: (graph: Pick<SemanticGraph, "operations">) => ReadonlyMap<SemanticResultId, boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* Remove impossible control-flow edges before liveness and certification.
|
|
9
|
+
* Evaluation of the condition is preserved, including calls and throws. This
|
|
10
|
+
* pass uses normal-result facts, never a cast's destination type as evidence
|
|
11
|
+
* that the cast's block is unreachable.
|
|
12
|
+
*/
|
|
13
|
+
export declare const pruneProvenBranches: (bodies: ReadonlyMap<PhysicalBodyId, IrBody>, graph: Pick<SemanticGraph, "operations">, slotDrift?: readonly SlotDrift[]) => {
|
|
14
|
+
readonly bodies: ReadonlyMap<PhysicalBodyId, IrBody>;
|
|
15
|
+
readonly slotDrift: readonly SlotDrift[];
|
|
16
|
+
};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { irValueId } from '../identity/ids.js';
|
|
2
|
+
import { allOperationsOf } from './model.js';
|
|
3
|
+
import { resultOfIrOperation, successorsOfTerminator } from './queries.js';
|
|
4
|
+
import { verifyIrBody } from './verify.js';
|
|
5
|
+
const nonNullPrimitive = (representation) => representation.kind === 'scalar' ||
|
|
6
|
+
representation.kind === 'string' ||
|
|
7
|
+
representation.kind === 'symbol' ||
|
|
8
|
+
(representation.kind === 'tagged-union' &&
|
|
9
|
+
representation.arms.length > 0 &&
|
|
10
|
+
representation.arms.every((arm) => nonNullPrimitive(arm.value)));
|
|
11
|
+
const primitiveOrNullish = (representation) => nonNullPrimitive(representation) ||
|
|
12
|
+
representation.kind === 'null' ||
|
|
13
|
+
representation.kind === 'undefined' ||
|
|
14
|
+
(representation.kind === 'optional' && primitiveOrNullish(representation.payload)) ||
|
|
15
|
+
(representation.kind === 'tagged-union' && representation.arms.every((arm) => primitiveOrNullish(arm.value)));
|
|
16
|
+
/** Normal-completion truth facts derived from the semantic operations' sealed results. */
|
|
17
|
+
export const provenResultTruthiness = (graph) => {
|
|
18
|
+
const facts = new Map();
|
|
19
|
+
const read = (source) => {
|
|
20
|
+
if (source?.kind === 'result')
|
|
21
|
+
return facts.get(source.result);
|
|
22
|
+
if (source?.kind !== 'constant')
|
|
23
|
+
return undefined;
|
|
24
|
+
switch (source.literal) {
|
|
25
|
+
case 'undefined':
|
|
26
|
+
case 'null':
|
|
27
|
+
return false;
|
|
28
|
+
case 'boolean':
|
|
29
|
+
return source.text === 'true';
|
|
30
|
+
case 'string':
|
|
31
|
+
return source.text.length !== 0;
|
|
32
|
+
case 'number':
|
|
33
|
+
return Number(source.text) !== 0 && !Number.isNaN(Number(source.text));
|
|
34
|
+
default:
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
let changed = true;
|
|
39
|
+
while (changed) {
|
|
40
|
+
changed = false;
|
|
41
|
+
for (const operation of graph.operations.values()) {
|
|
42
|
+
let truth;
|
|
43
|
+
if (operation.family === 'property' && operation.internalMethod === 'get' && operation.normalResult === 'undefined')
|
|
44
|
+
truth = false;
|
|
45
|
+
else if (operation.family === 'computation' && operation.form === 'logical') {
|
|
46
|
+
const left = read(operation.operands.find((operand) => operand.role === 'left')?.source);
|
|
47
|
+
const right = read(operation.operands.find((operand) => operand.role === 'right')?.source);
|
|
48
|
+
if (operation.operator === '&&')
|
|
49
|
+
truth = left === false || right === false ? false : left === true ? right : undefined;
|
|
50
|
+
if (operation.operator === '||')
|
|
51
|
+
truth = left === true || right === true ? true : left === false ? right : undefined;
|
|
52
|
+
}
|
|
53
|
+
if (truth === undefined)
|
|
54
|
+
continue;
|
|
55
|
+
for (const result of operation.results) {
|
|
56
|
+
if (result.role !== 'value' || facts.has(result.id))
|
|
57
|
+
continue;
|
|
58
|
+
facts.set(result.id, truth);
|
|
59
|
+
changed = true;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return facts;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Remove impossible control-flow edges before liveness and certification.
|
|
67
|
+
* Evaluation of the condition is preserved, including calls and throws. This
|
|
68
|
+
* pass uses normal-result facts, never a cast's destination type as evidence
|
|
69
|
+
* that the cast's block is unreachable.
|
|
70
|
+
*/
|
|
71
|
+
export const pruneProvenBranches = (bodies, graph, slotDrift = []) => {
|
|
72
|
+
const semantic = provenResultTruthiness(graph);
|
|
73
|
+
if (semantic.size === 0)
|
|
74
|
+
return { bodies, slotDrift };
|
|
75
|
+
const absentReads = new Set();
|
|
76
|
+
for (const operation of graph.operations.values()) {
|
|
77
|
+
if (operation.family === 'property' && operation.internalMethod === 'get' && operation.normalResult === 'undefined')
|
|
78
|
+
for (const result of operation.results)
|
|
79
|
+
if (result.role === 'value')
|
|
80
|
+
absentReads.add(result.id);
|
|
81
|
+
}
|
|
82
|
+
const output = new Map(bodies);
|
|
83
|
+
const removedBlocks = new Set();
|
|
84
|
+
let changedAny = false;
|
|
85
|
+
for (const [id, body] of bodies) {
|
|
86
|
+
// These regions have entry/cleanup edges beyond ordinary terminators.
|
|
87
|
+
// Keep their whole CFG until those edges have an explicit pruning recipe.
|
|
88
|
+
const protectedFlow = Boolean(body.tryRegions.length || body.iteratorCloseRegions?.length || body.generator || body.generatorPrologueBoundary);
|
|
89
|
+
const facts = new Map();
|
|
90
|
+
const operations = [...body.blocks.values()].flatMap((block) => block.operations);
|
|
91
|
+
for (const operation of operations) {
|
|
92
|
+
if (operation.kind !== 'get' && operation.kind !== 'phi')
|
|
93
|
+
continue;
|
|
94
|
+
const truth = semantic.get(operation.lineage);
|
|
95
|
+
if (truth !== undefined)
|
|
96
|
+
facts.set(operation.result.id, truth);
|
|
97
|
+
}
|
|
98
|
+
for (const operation of operations) {
|
|
99
|
+
if (operation.kind !== 'test' || operation.predicate !== 'to-boolean')
|
|
100
|
+
continue;
|
|
101
|
+
const truth = facts.get(operation.value.value);
|
|
102
|
+
if (truth !== undefined)
|
|
103
|
+
facts.set(operation.result.id, truth);
|
|
104
|
+
}
|
|
105
|
+
const blocks = new Map(body.blocks);
|
|
106
|
+
const expandedValues = new Map(body.values);
|
|
107
|
+
let ordinal = 0;
|
|
108
|
+
let changed = false;
|
|
109
|
+
for (const [blockId, original] of blocks) {
|
|
110
|
+
const operations = original.operations.flatMap((operation) => {
|
|
111
|
+
if (operation.kind !== 'get' ||
|
|
112
|
+
!absentReads.has(operation.lineage) ||
|
|
113
|
+
operation.result.representation.kind !== 'undefined' ||
|
|
114
|
+
!primitiveOrNullish(operation.receiver.representation))
|
|
115
|
+
return [operation];
|
|
116
|
+
// The base/key evaluations are separate SSA operations and remain.
|
|
117
|
+
// A nullable receiver retains GetV's RequireObjectCoercible step.
|
|
118
|
+
// The existing IR primitive preserves its TypeError without boxing.
|
|
119
|
+
changed = true;
|
|
120
|
+
const result = [];
|
|
121
|
+
if (!nonNullPrimitive(operation.receiver.representation)) {
|
|
122
|
+
while (expandedValues.has(irValueId(body.owner, ordinal)))
|
|
123
|
+
ordinal++;
|
|
124
|
+
const checked = irValueId(body.owner, ordinal++);
|
|
125
|
+
expandedValues.set(checked, operation.receiver.representation);
|
|
126
|
+
result.push({
|
|
127
|
+
kind: 'compute',
|
|
128
|
+
lineage: operation.lineage,
|
|
129
|
+
form: 'require-object-coercible',
|
|
130
|
+
operator: 'RequireObjectCoercible',
|
|
131
|
+
operands: [operation.receiver],
|
|
132
|
+
result: { id: checked, representation: operation.receiver.representation }
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
result.push({
|
|
136
|
+
kind: 'constant',
|
|
137
|
+
lineage: operation.lineage,
|
|
138
|
+
literal: 'undefined',
|
|
139
|
+
text: 'undefined',
|
|
140
|
+
result: operation.result
|
|
141
|
+
});
|
|
142
|
+
return result;
|
|
143
|
+
});
|
|
144
|
+
const block = { ...original, operations };
|
|
145
|
+
blocks.set(blockId, block);
|
|
146
|
+
if (protectedFlow || block.terminator.kind !== 'branch')
|
|
147
|
+
continue;
|
|
148
|
+
const truth = facts.get(block.terminator.condition.value);
|
|
149
|
+
if (truth === undefined)
|
|
150
|
+
continue;
|
|
151
|
+
blocks.set(blockId, {
|
|
152
|
+
...block,
|
|
153
|
+
terminator: {
|
|
154
|
+
kind: 'jump',
|
|
155
|
+
lineage: block.terminator.lineage,
|
|
156
|
+
target: truth ? block.terminator.whenTrue : block.terminator.whenFalse
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
changed = true;
|
|
160
|
+
}
|
|
161
|
+
if (!changed)
|
|
162
|
+
continue;
|
|
163
|
+
// Replacing a proven, non-throwing lookup does not change any region's
|
|
164
|
+
// control flow. Keep that operation-level simplification even when this
|
|
165
|
+
// pass cannot yet remove the region's exceptional or cleanup edges.
|
|
166
|
+
if (protectedFlow) {
|
|
167
|
+
output.set(id, { ...body, blocks, values: expandedValues });
|
|
168
|
+
changedAny = true;
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const live = new Set([body.entry]);
|
|
172
|
+
const pending = [body.entry];
|
|
173
|
+
while (pending.length) {
|
|
174
|
+
const block = blocks.get(pending.pop());
|
|
175
|
+
for (const target of successorsOfTerminator(block.terminator))
|
|
176
|
+
if (!live.has(target)) {
|
|
177
|
+
live.add(target);
|
|
178
|
+
pending.push(target);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const retained = new Map();
|
|
182
|
+
const values = new Map();
|
|
183
|
+
for (const blockId of body.blockOrder) {
|
|
184
|
+
if (!live.has(blockId)) {
|
|
185
|
+
removedBlocks.add(blockId);
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
const block = blocks.get(blockId);
|
|
189
|
+
const next = {
|
|
190
|
+
...block,
|
|
191
|
+
operations: block.operations.map((operation) => operation.kind === 'phi'
|
|
192
|
+
? {
|
|
193
|
+
...operation,
|
|
194
|
+
incoming: operation.incoming.filter((edge) => live.has(edge.block) && successorsOfTerminator(blocks.get(edge.block).terminator).includes(blockId))
|
|
195
|
+
}
|
|
196
|
+
: operation)
|
|
197
|
+
};
|
|
198
|
+
retained.set(blockId, next);
|
|
199
|
+
for (const operation of allOperationsOf(next)) {
|
|
200
|
+
const result = resultOfIrOperation(operation);
|
|
201
|
+
if (result)
|
|
202
|
+
values.set(result.id, result.representation);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const pruned = { ...body, blocks: retained, blockOrder: body.blockOrder.filter((block) => live.has(block)), values };
|
|
206
|
+
const violations = verifyIrBody(pruned);
|
|
207
|
+
if (violations.length)
|
|
208
|
+
throw new Error(`Proven branch pruning produced invalid IR: ${JSON.stringify(violations)}`);
|
|
209
|
+
output.set(id, pruned);
|
|
210
|
+
changedAny = true;
|
|
211
|
+
}
|
|
212
|
+
// Lowering records failed slot conversions before this CFG exists. Drop
|
|
213
|
+
// only rows attached to blocks this pass has proved unreachable; unrelated
|
|
214
|
+
// and surviving failures still reach the unchanged certification guard.
|
|
215
|
+
return {
|
|
216
|
+
bodies: changedAny ? output : bodies,
|
|
217
|
+
slotDrift: removedBlocks.size ? slotDrift.filter((row) => !removedBlocks.has(row.block)) : slotDrift
|
|
218
|
+
};
|
|
219
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { AllocateArrayObjectOperation, IrBlockId, IrOperand, IrOperation, IrResult, IrTerminatorOperation } from './model.js';
|
|
2
|
+
/**
|
|
3
|
+
* Uniform queries over an IR operation.
|
|
4
|
+
*
|
|
5
|
+
* Split out of `model.ts`: the model states what an operation *is*; these
|
|
6
|
+
* state what any consumer needs to ask of one -- its successors, the value it
|
|
7
|
+
* defines, the values it reads -- so no consumer re-derives the answer per
|
|
8
|
+
* kind and drifts from the others.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Whether building this array runs a genuinely dynamic iteration protocol --
|
|
12
|
+
* a `gather` element drains an already-acquired iterator record
|
|
13
|
+
* (`ir/model.ts`'s `IrArrayElement`), and GetIterator/IteratorStep/
|
|
14
|
+
* IteratorValue can each invoke a user-defined method (`producers/
|
|
15
|
+
* protocol.ts`'s `mintIteratorSteps` marks every one of those steps
|
|
16
|
+
* `callsUserCode: true`). A `spread` element is the opposite: a native
|
|
17
|
+
* range-copy off an Array/Set/Map/string/cursor with no protocol dispatch at
|
|
18
|
+
* all, and an `element`/`hole` is a value the program already has.
|
|
19
|
+
*
|
|
20
|
+
* One authority for both DCE passes that ask "is this allocation pure": a
|
|
21
|
+
* body-local backward slice (`ir/shake.ts`) and a per-value dead-result check
|
|
22
|
+
* (`ir/dead-values.ts`). Both used to answer `allocate-array-object`
|
|
23
|
+
* unconditionally `true` -- correct for `[1, 2, 3]`, wrong for
|
|
24
|
+
* `[...abrupt]`, whose `next()` can throw. An unread `[...abrupt]` then
|
|
25
|
+
* disappeared whole, silently skipping an iteration the language always runs.
|
|
26
|
+
*/
|
|
27
|
+
export declare const arrayAllocationDrainsDynamicIterator: (operation: AllocateArrayObjectOperation) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Carrier observations do not expose object fields or invoke coercion methods.
|
|
30
|
+
* Instance tests qualify only through their sealed native membership recipe;
|
|
31
|
+
* an arbitrary constructor can still execute Symbol.hasInstance. Both callable
|
|
32
|
+
* escape and reflection must consume this same effect, or an already-native
|
|
33
|
+
* test can invent an escape that indirectly restores every reflection hook.
|
|
34
|
+
*/
|
|
35
|
+
export declare const observesNativeCarrierOnly: (operation: IrOperation) => boolean;
|
|
36
|
+
/** The block each terminator can transfer control to, in no particular order. */
|
|
37
|
+
export declare const successorsOfTerminator: (terminator: IrTerminatorOperation) => readonly IrBlockId[];
|
|
38
|
+
/** The value this operation defines, or `null` for an operation that only has effects or transfers control. */
|
|
39
|
+
export declare const resultOfIrOperation: (operation: IrOperation) => IrResult | null;
|
|
40
|
+
/** Every value this operation reads, flattened and stripped of role, for uniform representation-consistency checking. */
|
|
41
|
+
export declare const operandsOfIrOperation: (operation: IrOperation) => readonly IrOperand[];
|