@scriptc/compiler 0.2.6 → 0.2.8
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/ambient/scriptc-node-fallback.d.ts +7 -18
- package/dist/backend/cycle-analysis.d.ts +21 -9
- package/dist/backend/cycle-analysis.js +139 -67
- package/dist/backend/cycle-analysis.js.map +1 -1
- package/dist/backend/cycle-analysis.test.js +283 -3
- package/dist/backend/cycle-analysis.test.js.map +1 -1
- package/dist/backend/cycle-mutability.d.ts +39 -0
- package/dist/backend/cycle-mutability.js +205 -0
- package/dist/backend/cycle-mutability.js.map +1 -0
- package/dist/backend/link-plan-core.d.ts +2 -1
- package/dist/backend/link-plan-core.js +15 -3
- package/dist/backend/link-plan-core.js.map +1 -1
- package/dist/backend/link-plan.d.ts +2 -1
- package/dist/backend/link-plan.js.map +1 -1
- package/dist/backend/llvm/alloc.d.ts +43 -0
- package/dist/backend/llvm/alloc.js +246 -0
- package/dist/backend/llvm/alloc.js.map +1 -0
- package/dist/backend/llvm/alloc.test.d.ts +1 -0
- package/dist/backend/llvm/alloc.test.js +102 -0
- package/dist/backend/llvm/alloc.test.js.map +1 -0
- package/dist/backend/llvm/blocks.d.ts +9 -0
- package/dist/backend/llvm/blocks.js +9 -0
- package/dist/backend/llvm/blocks.js.map +1 -1
- package/dist/backend/llvm/borrowed-receivers.d.ts +7 -0
- package/dist/backend/llvm/borrowed-receivers.js +39 -0
- package/dist/backend/llvm/borrowed-receivers.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.d.ts +18 -3
- package/dist/backend/llvm/call-lifetimes.js +54 -19
- package/dist/backend/llvm/call-lifetimes.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.test.js +178 -3
- package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/checked-narrows.d.ts +24 -0
- package/dist/backend/llvm/checked-narrows.js +108 -0
- package/dist/backend/llvm/checked-narrows.js.map +1 -0
- package/dist/backend/llvm/checked-narrows.test.d.ts +1 -0
- package/dist/backend/llvm/checked-narrows.test.js +208 -0
- package/dist/backend/llvm/checked-narrows.test.js.map +1 -0
- package/dist/backend/llvm/classes.d.ts +16 -1
- package/dist/backend/llvm/classes.js +60 -49
- package/dist/backend/llvm/classes.js.map +1 -1
- package/dist/backend/llvm/classes.test.js +68 -6
- package/dist/backend/llvm/classes.test.js.map +1 -1
- package/dist/backend/llvm/common.d.ts +13 -0
- package/dist/backend/llvm/common.js +30 -0
- package/dist/backend/llvm/common.js.map +1 -1
- package/dist/backend/llvm/constant-callbacks.d.ts +19 -3
- package/dist/backend/llvm/constant-callbacks.js +289 -52
- package/dist/backend/llvm/constant-callbacks.js.map +1 -1
- package/dist/backend/llvm/constant-callbacks.test.js +140 -3
- package/dist/backend/llvm/constant-callbacks.test.js.map +1 -1
- package/dist/backend/llvm/debug-info.d.ts +6 -2
- package/dist/backend/llvm/debug-info.js +11 -1
- package/dist/backend/llvm/debug-info.js.map +1 -1
- package/dist/backend/llvm/dense-array-access.d.ts +29 -0
- package/dist/backend/llvm/dense-array-access.js +335 -0
- package/dist/backend/llvm/dense-array-access.js.map +1 -0
- package/dist/backend/llvm/dense-array-access.test.d.ts +1 -0
- package/dist/backend/llvm/dense-array-access.test.js +238 -0
- package/dist/backend/llvm/dense-array-access.test.js.map +1 -0
- package/dist/backend/llvm/dyn.d.ts +38 -0
- package/dist/backend/llvm/dyn.js +213 -14
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.d.ts +308 -15
- package/dist/backend/llvm/emitter.js +1788 -206
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.test.js +89 -7
- package/dist/backend/llvm/emitter.test.js.map +1 -1
- package/dist/backend/llvm/expr-async.js +62 -8
- package/dist/backend/llvm/expr-async.js.map +1 -1
- package/dist/backend/llvm/expr-async.test.d.ts +1 -0
- package/dist/backend/llvm/expr-async.test.js +62 -0
- package/dist/backend/llvm/expr-async.test.js.map +1 -0
- package/dist/backend/llvm/expr-bytes.d.ts +1 -1
- package/dist/backend/llvm/expr-bytes.js +85 -8
- package/dist/backend/llvm/expr-bytes.js.map +1 -1
- package/dist/backend/llvm/expr-callbacks.js +29 -21
- package/dist/backend/llvm/expr-callbacks.js.map +1 -1
- package/dist/backend/llvm/expr-calls.d.ts +5 -0
- package/dist/backend/llvm/expr-calls.js +118 -15
- package/dist/backend/llvm/expr-calls.js.map +1 -1
- package/dist/backend/llvm/expr-containers.d.ts +7 -1
- package/dist/backend/llvm/expr-containers.js +246 -32
- package/dist/backend/llvm/expr-containers.js.map +1 -1
- package/dist/backend/llvm/expr-control.js +113 -8
- package/dist/backend/llvm/expr-control.js.map +1 -1
- package/dist/backend/llvm/expr-dispatch.js +2 -0
- package/dist/backend/llvm/expr-dispatch.js.map +1 -1
- package/dist/backend/llvm/expr-dynamic.js +244 -44
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/expr-island.js +3 -8
- package/dist/backend/llvm/expr-island.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.d.ts +1 -1
- package/dist/backend/llvm/expr-primitives.js +93 -36
- package/dist/backend/llvm/expr-primitives.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.test.js +51 -3
- package/dist/backend/llvm/expr-primitives.test.js.map +1 -1
- package/dist/backend/llvm/expr-records.js +31 -17
- package/dist/backend/llvm/expr-records.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.js +96 -29
- package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.test.js +1 -1
- package/dist/backend/llvm/expr-stream-callbacks.js +6 -3
- package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
- package/dist/backend/llvm/integer-remainder.d.ts +11 -0
- package/dist/backend/llvm/integer-remainder.js +91 -0
- package/dist/backend/llvm/integer-remainder.js.map +1 -1
- package/dist/backend/llvm/layouts.d.ts +3 -1
- package/dist/backend/llvm/layouts.js +3 -2
- package/dist/backend/llvm/layouts.js.map +1 -1
- package/dist/backend/llvm/lazy-captures.d.ts +16 -0
- package/dist/backend/llvm/lazy-captures.js +96 -0
- package/dist/backend/llvm/lazy-captures.js.map +1 -0
- package/dist/backend/llvm/lazy-captures.test.d.ts +1 -0
- package/dist/backend/llvm/lazy-captures.test.js +78 -0
- package/dist/backend/llvm/lazy-captures.test.js.map +1 -0
- package/dist/backend/llvm/lib-abi.js +10 -0
- package/dist/backend/llvm/lib-abi.js.map +1 -1
- package/dist/backend/llvm/lib-filesystem.js +10 -15
- package/dist/backend/llvm/lib-filesystem.js.map +1 -1
- package/dist/backend/llvm/lib-process.js +8 -8
- package/dist/backend/llvm/lib-process.js.map +1 -1
- package/dist/backend/llvm/lib-shared.js +1 -0
- package/dist/backend/llvm/lib-shared.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.d.ts +5 -1
- package/dist/backend/llvm/local-array-reads.js +147 -26
- package/dist/backend/llvm/local-array-reads.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.test.js +85 -4
- package/dist/backend/llvm/local-array-reads.test.js.map +1 -1
- package/dist/backend/llvm/local-union-storage.d.ts +5 -1
- package/dist/backend/llvm/local-union-storage.js +54 -8
- package/dist/backend/llvm/local-union-storage.js.map +1 -1
- package/dist/backend/llvm/local-union-storage.test.js +94 -6
- package/dist/backend/llvm/local-union-storage.test.js.map +1 -1
- package/dist/backend/llvm/map-number-lookup.d.ts +18 -0
- package/dist/backend/llvm/map-number-lookup.js +62 -0
- package/dist/backend/llvm/map-number-lookup.js.map +1 -0
- package/dist/backend/llvm/map-read-lifetimes.d.ts +6 -0
- package/dist/backend/llvm/map-read-lifetimes.js +24 -3
- package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
- package/dist/backend/llvm/map-read-lifetimes.test.js +39 -20
- package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/nullable-fields.d.ts +28 -0
- package/dist/backend/llvm/nullable-fields.js +45 -0
- package/dist/backend/llvm/nullable-fields.js.map +1 -0
- package/dist/backend/llvm/nullable-fields.test.d.ts +1 -0
- package/dist/backend/llvm/nullable-fields.test.js +48 -0
- package/dist/backend/llvm/nullable-fields.test.js.map +1 -0
- package/dist/backend/llvm/nullable-unions.d.ts +68 -0
- package/dist/backend/llvm/nullable-unions.js +132 -0
- package/dist/backend/llvm/nullable-unions.js.map +1 -0
- package/dist/backend/llvm/publish.d.ts +58 -0
- package/dist/backend/llvm/publish.js +286 -0
- package/dist/backend/llvm/publish.js.map +1 -0
- package/dist/backend/llvm/rebound-parameters.d.ts +12 -0
- package/dist/backend/llvm/rebound-parameters.js +72 -0
- package/dist/backend/llvm/rebound-parameters.js.map +1 -0
- package/dist/backend/llvm/rebound-parameters.test.d.ts +1 -0
- package/dist/backend/llvm/rebound-parameters.test.js +67 -0
- package/dist/backend/llvm/rebound-parameters.test.js.map +1 -0
- package/dist/backend/llvm/reference-effects.d.ts +18 -2
- package/dist/backend/llvm/reference-effects.js +106 -16
- package/dist/backend/llvm/reference-effects.js.map +1 -1
- package/dist/backend/llvm/reference-effects.test.js +52 -1
- package/dist/backend/llvm/reference-effects.test.js.map +1 -1
- package/dist/backend/llvm/serialized-ir-emission.test.d.ts +1 -0
- package/dist/backend/llvm/serialized-ir-emission.test.js +52 -0
- package/dist/backend/llvm/serialized-ir-emission.test.js.map +1 -0
- package/dist/backend/llvm/shapes.d.ts +104 -9
- package/dist/backend/llvm/shapes.js +356 -46
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/shapes.test.js +139 -5
- package/dist/backend/llvm/shapes.test.js.map +1 -1
- package/dist/backend/llvm/stack-callbacks.js +2 -3
- package/dist/backend/llvm/stack-callbacks.js.map +1 -1
- package/dist/backend/llvm/stack-captures.d.ts +3 -1
- package/dist/backend/llvm/stack-captures.js +5 -3
- package/dist/backend/llvm/stack-captures.js.map +1 -1
- package/dist/backend/llvm/stack-unions.test.js +43 -3
- package/dist/backend/llvm/stack-unions.test.js.map +1 -1
- package/dist/backend/llvm/string-construction.d.ts +10 -0
- package/dist/backend/llvm/string-construction.js +42 -0
- package/dist/backend/llvm/string-construction.js.map +1 -1
- package/dist/backend/llvm/string-construction.test.js +1 -1
- package/dist/backend/llvm/string-key-hash.d.ts +15 -0
- package/dist/backend/llvm/string-key-hash.js +76 -0
- package/dist/backend/llvm/string-key-hash.js.map +1 -0
- package/dist/backend/llvm/string-key-hash.test.d.ts +1 -0
- package/dist/backend/llvm/string-key-hash.test.js +45 -0
- package/dist/backend/llvm/string-key-hash.test.js.map +1 -0
- package/dist/backend/llvm/string-lifetimes.test.js +65 -15
- package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/string-reads.d.ts +7 -0
- package/dist/backend/llvm/string-reads.js +76 -0
- package/dist/backend/llvm/string-reads.js.map +1 -0
- package/dist/backend/llvm/switch-dispatch.js +1 -1
- package/dist/backend/llvm/switch-dispatch.js.map +1 -1
- package/dist/backend/llvm/switch-dispatch.test.js +3 -3
- package/dist/backend/llvm/switch-dispatch.test.js.map +1 -1
- package/dist/backend/llvm/test-boxed-unions.d.ts +5 -0
- package/dist/backend/llvm/test-boxed-unions.js +13 -0
- package/dist/backend/llvm/test-boxed-unions.js.map +1 -0
- package/dist/backend/llvm/union-repr.d.ts +15 -0
- package/dist/backend/llvm/union-repr.js +89 -0
- package/dist/backend/llvm/union-repr.js.map +1 -0
- package/dist/backend/llvm/virtual-borrows.d.ts +31 -0
- package/dist/backend/llvm/virtual-borrows.js +82 -0
- package/dist/backend/llvm/virtual-borrows.js.map +1 -0
- package/dist/backend/llvm/walk-borrows.d.ts +43 -0
- package/dist/backend/llvm/walk-borrows.js +150 -0
- package/dist/backend/llvm/walk-borrows.js.map +1 -0
- package/dist/backend/llvm/walk-borrows.test.d.ts +1 -0
- package/dist/backend/llvm/walk-borrows.test.js +119 -0
- package/dist/backend/llvm/walk-borrows.test.js.map +1 -0
- package/dist/backend/llvm/walkers.d.ts +5 -1
- package/dist/backend/llvm/walkers.js +24 -21
- package/dist/backend/llvm/walkers.js.map +1 -1
- package/dist/backend/may-throw.d.ts +29 -1
- package/dist/backend/may-throw.js +349 -3
- package/dist/backend/may-throw.js.map +1 -1
- package/dist/backend/may-throw.test.js +114 -2
- package/dist/backend/may-throw.test.js.map +1 -1
- package/dist/backend/native/cache-warm.d.ts +2 -1
- package/dist/backend/native/cache-warm.js.map +1 -1
- package/dist/backend/native/contracts.d.ts +3 -2
- package/dist/backend/native/contracts.js.map +1 -1
- package/dist/backend/native/runtime-inputs.d.ts +1 -1
- package/dist/backend/native/runtime-inputs.js +2 -0
- package/dist/backend/native/runtime-inputs.js.map +1 -1
- package/dist/backend/native-codegen-core.d.ts +7 -4
- package/dist/backend/native-codegen-core.js +14 -9
- package/dist/backend/native-codegen-core.js.map +1 -1
- package/dist/backend/native-codegen.d.ts +9 -0
- package/dist/backend/native-codegen.js +53 -2
- package/dist/backend/native-codegen.js.map +1 -1
- package/dist/backend/native-codegen.test.js +64 -10
- package/dist/backend/native-codegen.test.js.map +1 -1
- package/dist/backend/native-link-info-core.d.ts +3 -2
- package/dist/backend/native-link-info-core.js.map +1 -1
- package/dist/backend/native-link-info.d.ts +2 -1
- package/dist/backend/native-link-info.js.map +1 -1
- package/dist/backend/native-link-info.test.js +2 -2
- package/dist/backend/native-link-info.test.js.map +1 -1
- package/dist/backend/native-tools.d.ts +5 -1
- package/dist/backend/native-tools.js +3 -1
- package/dist/backend/native-tools.js.map +1 -1
- package/dist/backend/optimization.d.ts +25 -0
- package/dist/backend/optimization.js +21 -0
- package/dist/backend/optimization.js.map +1 -0
- package/dist/backend/optimization.test.d.ts +1 -0
- package/dist/backend/optimization.test.js +24 -0
- package/dist/backend/optimization.test.js.map +1 -0
- package/dist/backend/publication.d.ts +28 -0
- package/dist/backend/publication.js +155 -0
- package/dist/backend/publication.js.map +1 -0
- package/dist/backend/publication.test.d.ts +1 -0
- package/dist/backend/publication.test.js +72 -0
- package/dist/backend/publication.test.js.map +1 -0
- package/dist/backend/runtime-abi.d.ts +2 -2
- package/dist/backend/runtime-abi.js +2 -2
- package/dist/backend/runtime-pack-core.d.ts +15 -4
- package/dist/backend/runtime-pack-core.js +23 -12
- package/dist/backend/runtime-pack-core.js.map +1 -1
- package/dist/backend/runtime-pack-native.d.ts +7 -3
- package/dist/backend/runtime-pack-native.js +0 -3
- package/dist/backend/runtime-pack-native.js.map +1 -1
- package/dist/backend/runtime-pack-targets.test.js +1 -1
- package/dist/backend/runtime-pack.d.ts +20 -2
- package/dist/backend/runtime-pack.js +23 -0
- package/dist/backend/runtime-pack.js.map +1 -1
- package/dist/backend/runtime-pack.test.js +115 -2
- package/dist/backend/runtime-pack.test.js.map +1 -1
- package/dist/backend/target-diagnostics.test.js +1 -1
- package/dist/backend/targets.d.ts +2 -1
- package/dist/backend/targets.js +1 -1
- package/dist/backend/targets.js.map +1 -1
- package/dist/cli/command.js +75 -11
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/host.d.ts +2 -1
- package/dist/cli/usage.d.ts +4 -1
- package/dist/cli/usage.js +13 -3
- package/dist/cli/usage.js.map +1 -1
- package/dist/compile-types.d.ts +17 -5
- package/dist/coverage/report.d.ts +25 -2
- package/dist/coverage/report.js +161 -33
- package/dist/coverage/report.js.map +1 -1
- package/dist/coverage/verdict-cache.d.ts +63 -0
- package/dist/coverage/verdict-cache.js +193 -0
- package/dist/coverage/verdict-cache.js.map +1 -0
- package/dist/coverage/verdict-cache.test.d.ts +1 -0
- package/dist/coverage/verdict-cache.test.js +52 -0
- package/dist/coverage/verdict-cache.test.js.map +1 -0
- package/dist/coverage/verdict-semantic.d.ts +2 -0
- package/dist/coverage/verdict-semantic.js +24 -0
- package/dist/coverage/verdict-semantic.js.map +1 -0
- package/dist/coverage/verdict-startup.d.ts +15 -0
- package/dist/coverage/verdict-startup.js +66 -0
- package/dist/coverage/verdict-startup.js.map +1 -0
- package/dist/diagnostics/diagnostic.d.ts +29 -1
- package/dist/diagnostics/diagnostic.js +84 -12
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/diagnostics/envelope.d.ts +130 -0
- package/dist/diagnostics/envelope.js +257 -0
- package/dist/diagnostics/envelope.js.map +1 -0
- package/dist/diagnostics/envelope.test.d.ts +1 -0
- package/dist/diagnostics/envelope.test.js +91 -0
- package/dist/diagnostics/envelope.test.js.map +1 -0
- package/dist/diagnostics/render.d.ts +3 -0
- package/dist/diagnostics/render.js +13 -2
- package/dist/diagnostics/render.js.map +1 -1
- package/dist/executable/executable-cache.d.ts +2 -2
- package/dist/executable/executable-cache.js +7 -4
- package/dist/executable/executable-cache.js.map +1 -1
- package/dist/executable/executable-cache.test.js +20 -0
- package/dist/executable/executable-cache.test.js.map +1 -1
- package/dist/executable/prepare.d.ts +4 -0
- package/dist/executable/prepare.js +7 -1
- package/dist/executable/prepare.js.map +1 -1
- package/dist/frontend/analysis.js +1 -0
- package/dist/frontend/analysis.js.map +1 -1
- package/dist/frontend/lowering/abstract-equality.js +5 -49
- package/dist/frontend/lowering/abstract-equality.js.map +1 -1
- package/dist/frontend/lowering/array-values.d.ts +30 -0
- package/dist/frontend/lowering/array-values.js +246 -1
- package/dist/frontend/lowering/array-values.js.map +1 -1
- package/dist/frontend/lowering/builtins/errors.js +17 -2
- package/dist/frontend/lowering/builtins/errors.js.map +1 -1
- package/dist/frontend/lowering/builtins/numbers.js +29 -1
- package/dist/frontend/lowering/builtins/numbers.js.map +1 -1
- package/dist/frontend/lowering/builtins/process.d.ts +10 -17
- package/dist/frontend/lowering/builtins/process.js +66 -29
- package/dist/frontend/lowering/builtins/process.js.map +1 -1
- package/dist/frontend/lowering/builtins/workers.js +4 -2
- package/dist/frontend/lowering/builtins/workers.js.map +1 -1
- package/dist/frontend/lowering/caught-value-dispatch.d.ts +11 -0
- package/dist/frontend/lowering/caught-value-dispatch.js +87 -0
- package/dist/frontend/lowering/caught-value-dispatch.js.map +1 -0
- package/dist/frontend/lowering/class-assertions.d.ts +12 -0
- package/dist/frontend/lowering/class-assertions.js +229 -5
- package/dist/frontend/lowering/class-assertions.js.map +1 -1
- package/dist/frontend/lowering/class-callbacks.d.ts +3 -3
- package/dist/frontend/lowering/class-callbacks.js +18 -5
- package/dist/frontend/lowering/class-callbacks.js.map +1 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +1 -0
- package/dist/frontend/lowering/class-dynamic-dispatch.js +12 -6
- package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
- package/dist/frontend/lowering/class-method-mutations.d.ts +5 -0
- package/dist/frontend/lowering/class-method-mutations.js +472 -0
- package/dist/frontend/lowering/class-method-mutations.js.map +1 -0
- package/dist/frontend/lowering/class-method-values.js +25 -5
- package/dist/frontend/lowering/class-method-values.js.map +1 -1
- package/dist/frontend/lowering/class-prototypes.js +8 -2
- package/dist/frontend/lowering/class-prototypes.js.map +1 -1
- package/dist/frontend/lowering/class-unions.d.ts +16 -0
- package/dist/frontend/lowering/class-unions.js +127 -0
- package/dist/frontend/lowering/class-unions.js.map +1 -0
- package/dist/frontend/lowering/coercions/builders.js +8 -1
- package/dist/frontend/lowering/coercions/builders.js.map +1 -1
- package/dist/frontend/lowering/coercions/function-adapters.js +2 -0
- package/dist/frontend/lowering/coercions/function-adapters.js.map +1 -1
- package/dist/frontend/lowering/coercions/identity.d.ts +7 -0
- package/dist/frontend/lowering/coercions/identity.js +26 -0
- package/dist/frontend/lowering/coercions/identity.js.map +1 -0
- package/dist/frontend/lowering/coercions/state.d.ts +6 -0
- package/dist/frontend/lowering/coercions/state.js +2 -0
- package/dist/frontend/lowering/coercions/state.js.map +1 -1
- package/dist/frontend/lowering/coercions/structural.js +9 -6
- package/dist/frontend/lowering/coercions/structural.js.map +1 -1
- package/dist/frontend/lowering/coercions/unions.d.ts +8 -0
- package/dist/frontend/lowering/coercions/unions.js +67 -2
- package/dist/frontend/lowering/coercions/unions.js.map +1 -1
- package/dist/frontend/lowering/collation-repertoire.d.ts +1 -0
- package/dist/frontend/lowering/collation-repertoire.js +19 -0
- package/dist/frontend/lowering/collation-repertoire.js.map +1 -0
- package/dist/frontend/lowering/collection-narrowing.d.ts +6 -0
- package/dist/frontend/lowering/collection-narrowing.js +31 -0
- package/dist/frontend/lowering/collection-narrowing.js.map +1 -0
- package/dist/frontend/lowering/construction-escapes.d.ts +38 -0
- package/dist/frontend/lowering/construction-escapes.js +146 -0
- package/dist/frontend/lowering/construction-escapes.js.map +1 -0
- package/dist/frontend/lowering/construction-escapes.test.d.ts +1 -0
- package/dist/frontend/lowering/construction-escapes.test.js +150 -0
- package/dist/frontend/lowering/construction-escapes.test.js.map +1 -0
- package/dist/frontend/lowering/containers/array-callback-call.d.ts +7 -0
- package/dist/frontend/lowering/containers/array-callback-call.js +52 -0
- package/dist/frontend/lowering/containers/array-callback-call.js.map +1 -0
- package/dist/frontend/lowering/containers/array-callbacks.d.ts +1 -1
- package/dist/frontend/lowering/containers/array-callbacks.js +416 -65
- package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -1
- package/dist/frontend/lowering/containers/array-concat.d.ts +7 -0
- package/dist/frontend/lowering/containers/array-concat.js +130 -0
- package/dist/frontend/lowering/containers/array-concat.js.map +1 -0
- package/dist/frontend/lowering/containers/array-construction.d.ts +2 -0
- package/dist/frontend/lowering/containers/array-construction.js +110 -5
- package/dist/frontend/lowering/containers/array-construction.js.map +1 -1
- package/dist/frontend/lowering/containers/array-methods.d.ts +1 -11
- package/dist/frontend/lowering/containers/array-methods.js +274 -144
- package/dist/frontend/lowering/containers/array-methods.js.map +1 -1
- package/dist/frontend/lowering/containers/callback-arguments.js +43 -1
- package/dist/frontend/lowering/containers/callback-arguments.js.map +1 -1
- package/dist/frontend/lowering/containers/collection-methods.js +10 -1
- package/dist/frontend/lowering/containers/collection-methods.js.map +1 -1
- package/dist/frontend/lowering/containers/indexed-objects.js +56 -70
- package/dist/frontend/lowering/containers/indexed-objects.js.map +1 -1
- package/dist/frontend/lowering/containers/string-and-regexp.js +7 -63
- package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
- package/dist/frontend/lowering/cycle-initialization.d.ts +46 -0
- package/dist/frontend/lowering/cycle-initialization.js +303 -0
- package/dist/frontend/lowering/cycle-initialization.js.map +1 -0
- package/dist/frontend/lowering/divergences.d.ts +9 -0
- package/dist/frontend/lowering/divergences.js +630 -0
- package/dist/frontend/lowering/divergences.js.map +1 -0
- package/dist/frontend/lowering/expressions/evaluation-safety.js +4 -0
- package/dist/frontend/lowering/expressions/evaluation-safety.js.map +1 -1
- package/dist/frontend/lowering/expressions/object-literals.js +178 -34
- package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
- package/dist/frontend/lowering/expressions/union-field-write.d.ts +4 -4
- package/dist/frontend/lowering/expressions/union-field-write.js +54 -44
- package/dist/frontend/lowering/expressions/union-field-write.js.map +1 -1
- package/dist/frontend/lowering/iterator-adapters.d.ts +20 -0
- package/dist/frontend/lowering/iterator-adapters.js +605 -0
- package/dist/frontend/lowering/iterator-adapters.js.map +1 -0
- package/dist/frontend/lowering/lower-array-sort.d.ts +1 -1
- package/dist/frontend/lowering/lower-array-sort.js +44 -5
- package/dist/frontend/lowering/lower-array-sort.js.map +1 -1
- package/dist/frontend/lowering/lower-array-sort.test.d.ts +1 -0
- package/dist/frontend/lowering/lower-array-sort.test.js +31 -0
- package/dist/frontend/lowering/lower-array-sort.test.js.map +1 -0
- package/dist/frontend/lowering/lower-assert.js +7 -0
- package/dist/frontend/lowering/lower-assert.js.map +1 -1
- package/dist/frontend/lowering/lower-builtin-values.js +1 -0
- package/dist/frontend/lowering/lower-builtin-values.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +8 -3
- package/dist/frontend/lowering/lower-calls.js +388 -278
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.d.ts +6 -0
- package/dist/frontend/lowering/lower-classes.js +117 -65
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +22 -2
- package/dist/frontend/lowering/lower-exprs.js +811 -254
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-functions.js +32 -19
- package/dist/frontend/lowering/lower-functions.js.map +1 -1
- package/dist/frontend/lowering/lower-generators.d.ts +19 -13
- package/dist/frontend/lowering/lower-generators.js +67 -44
- package/dist/frontend/lowering/lower-generators.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.js +29 -4
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-island.d.ts +1 -1
- package/dist/frontend/lowering/lower-island.js +24 -7
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.js +100 -3
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +82 -64
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +115 -2
- package/dist/frontend/lowering/lowerer.js +1266 -88
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/native-ffi.js +3 -1
- package/dist/frontend/lowering/native-ffi.js.map +1 -1
- package/dist/frontend/lowering/runtime-optional-bounds.d.ts +19 -0
- package/dist/frontend/lowering/runtime-optional-bounds.js +354 -0
- package/dist/frontend/lowering/runtime-optional-bounds.js.map +1 -0
- package/dist/frontend/lowering/runtime-optional-bounds.test.d.ts +1 -0
- package/dist/frontend/lowering/runtime-optional-bounds.test.js +66 -0
- package/dist/frontend/lowering/runtime-optional-bounds.test.js.map +1 -0
- package/dist/frontend/lowering/runtime-optional-elements.d.ts +117 -0
- package/dist/frontend/lowering/runtime-optional-elements.js +738 -0
- package/dist/frontend/lowering/runtime-optional-elements.js.map +1 -0
- package/dist/frontend/lowering/runtime-optional-guards.d.ts +36 -0
- package/dist/frontend/lowering/runtime-optional-guards.js +375 -0
- package/dist/frontend/lowering/runtime-optional-guards.js.map +1 -0
- package/dist/frontend/lowering/runtime-optional-guards.test.d.ts +1 -0
- package/dist/frontend/lowering/runtime-optional-guards.test.js +92 -0
- package/dist/frontend/lowering/runtime-optional-guards.test.js.map +1 -0
- package/dist/frontend/lowering/runtime-optional-ownership.d.ts +63 -0
- package/dist/frontend/lowering/runtime-optional-ownership.js +382 -0
- package/dist/frontend/lowering/runtime-optional-ownership.js.map +1 -0
- package/dist/frontend/lowering/runtime-optional-provenance.d.ts +16 -0
- package/dist/frontend/lowering/runtime-optional-provenance.js +41 -0
- package/dist/frontend/lowering/runtime-optional-provenance.js.map +1 -0
- package/dist/frontend/lowering/sanitize-class-types.test.js +2 -2
- package/dist/frontend/lowering/strict-equality.d.ts +9 -0
- package/dist/frontend/lowering/strict-equality.js +116 -0
- package/dist/frontend/lowering/strict-equality.js.map +1 -0
- package/dist/frontend/lowering/string-index-bounds.d.ts +36 -0
- package/dist/frontend/lowering/string-index-bounds.js +537 -0
- package/dist/frontend/lowering/string-index-bounds.js.map +1 -0
- package/dist/frontend/lowering/string-index-bounds.test.d.ts +1 -0
- package/dist/frontend/lowering/string-index-bounds.test.js +223 -0
- package/dist/frontend/lowering/string-index-bounds.test.js.map +1 -0
- package/dist/frontend/lowering/surfaces.js +3 -0
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/lowering/union-comparison.d.ts +5 -0
- package/dist/frontend/lowering/union-comparison.js +47 -0
- package/dist/frontend/lowering/union-comparison.js.map +1 -0
- package/dist/frontend/lowering/union-narrow.d.ts +2 -0
- package/dist/frontend/lowering/union-narrow.js +10 -6
- package/dist/frontend/lowering/union-narrow.js.map +1 -1
- package/dist/frontend/program-analysis.d.ts +10 -0
- package/dist/frontend/program-analysis.js +7 -0
- package/dist/frontend/program-analysis.js.map +1 -1
- package/dist/frontend/program.d.ts +63 -2
- package/dist/frontend/program.js +1038 -61
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/program.test.js +122 -6
- package/dist/frontend/program.test.js.map +1 -1
- package/dist/frontend/resolve.d.ts +6 -0
- package/dist/frontend/resolve.js +14 -0
- package/dist/frontend/resolve.js.map +1 -1
- package/dist/frontend/threads-import.d.ts +5 -0
- package/dist/frontend/threads-import.js +21 -0
- package/dist/frontend/threads-import.js.map +1 -0
- package/dist/frontend/type-mapper.d.ts +4 -1
- package/dist/frontend/type-mapper.js +161 -20
- package/dist/frontend/type-mapper.js.map +1 -1
- package/dist/frontend/type-mapper.test.js +15 -3
- package/dist/frontend/type-mapper.test.js.map +1 -1
- package/dist/frontend/worker-target.d.ts +4 -0
- package/dist/frontend/worker-target.js +8 -1
- package/dist/frontend/worker-target.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +70 -16
- package/dist/index.js.map +1 -1
- package/dist/ir/analysis.d.ts +3 -1
- package/dist/ir/analysis.js +4 -0
- package/dist/ir/analysis.js.map +1 -1
- package/dist/ir/build.d.ts +5 -0
- package/dist/ir/build.js +7 -0
- package/dist/ir/build.js.map +1 -1
- package/dist/ir/builtin-signatures.d.ts +1 -1
- package/dist/ir/builtin-signatures.js +5 -3
- package/dist/ir/builtin-signatures.js.map +1 -1
- package/dist/ir/constant-tables.test.js +1 -1
- package/dist/ir/initializer-bindings.test.js +1 -1
- package/dist/ir/int32-slots.d.ts +72 -0
- package/dist/ir/int32-slots.js +837 -0
- package/dist/ir/int32-slots.js.map +1 -0
- package/dist/ir/int32-slots.test.d.ts +1 -0
- package/dist/ir/int32-slots.test.js +222 -0
- package/dist/ir/int32-slots.test.js.map +1 -0
- package/dist/ir/integer-ranges.d.ts +19 -3
- package/dist/ir/integer-ranges.js +168 -23
- package/dist/ir/integer-ranges.js.map +1 -1
- package/dist/ir/integer-ranges.test.js +74 -2
- package/dist/ir/integer-ranges.test.js.map +1 -1
- package/dist/ir/ir.d.ts +101 -20
- package/dist/ir/ir.js +20 -6
- package/dist/ir/ir.js.map +1 -1
- package/dist/ir/scalar-records.test.js +1 -1
- package/dist/ir/serialize.d.ts +1 -1
- package/dist/ir/serialize.js +3 -3
- package/dist/ir/serialize.js.map +1 -1
- package/dist/ir/traverse.js +8 -0
- package/dist/ir/traverse.js.map +1 -1
- package/dist/ir/validate.js +139 -22
- package/dist/ir/validate.js.map +1 -1
- package/dist/ir/validate.test.js +308 -8
- package/dist/ir/validate.test.js.map +1 -1
- package/dist/library/fence-eval.test.js +1 -1
- package/dist/library/int-infer.test.js +4 -4
- package/dist/library/library-cache.test.js +5 -5
- package/dist/library/library-profile.d.ts +2 -1
- package/dist/library/library-profile.js +4 -3
- package/dist/library/library-profile.js.map +1 -1
- package/dist/native/cache.d.ts +3 -0
- package/dist/native/cache.js +49 -1
- package/dist/native/cache.js.map +1 -1
- package/dist/native/cache.test.js +21 -1
- package/dist/native/cache.test.js.map +1 -1
- package/dist/native/cli.js +1 -1
- package/dist/native/cli.js.map +1 -1
- package/dist/native/compiler.d.ts +5 -0
- package/dist/native/compiler.js +51 -4
- package/dist/native/compiler.js.map +1 -1
- package/dist/native/compiler.test.js +2 -2
- package/dist/native/library.d.ts +2 -1
- package/dist/native/library.js.map +1 -1
- package/dist/native/prepare.d.ts +4 -0
- package/dist/native/prepare.js +28 -3
- package/dist/native/prepare.js.map +1 -1
- package/dist/native/sanitizer.d.ts +3 -2
- package/dist/native/sanitizer.js +3 -13
- package/dist/native/sanitizer.js.map +1 -1
- package/dist/startup-cache.d.ts +2 -0
- package/dist/startup-cache.js +2 -0
- package/dist/startup-cache.js.map +1 -1
- package/package.json +20 -20
- package/surface-manifest.json +8 -2
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import type { IrBytesElem, IrExpr, IrFfiImport, IrFunction, IrLocal, IrModule, IrRecordShape, IrStmt, IrType, IrUnionDef, SrcLoc } from "../../ir/ir.js";
|
|
2
2
|
import { type SplitSpan } from "./split-loops.js";
|
|
3
3
|
import { type IntegerRanges } from "../../ir/integer-ranges.js";
|
|
4
|
+
import { type Int32Slots } from "../../ir/int32-slots.js";
|
|
4
5
|
import { type ConstantNumericTable } from "../../ir/constant-tables.js";
|
|
5
6
|
import { type FfiCallbackAdapter } from "../ffi-callbacks.js";
|
|
6
7
|
import { type CallLifetimes } from "./call-lifetimes.js";
|
|
7
8
|
import { BlockBuilder } from "./blocks.js";
|
|
8
|
-
import { type
|
|
9
|
+
import { NullableRefFields, type NullableRefField } from "./nullable-fields.js";
|
|
10
|
+
import { OptionalArrayReads, type LocalArrayRead } from "./local-array-reads.js";
|
|
11
|
+
import { CheckedNarrows } from "./checked-narrows.js";
|
|
9
12
|
import { type MapReadLifetimes } from "./map-read-lifetimes.js";
|
|
10
13
|
import { ReferenceEffects } from "./reference-effects.js";
|
|
11
14
|
import { StackCallbacks } from "./stack-callbacks.js";
|
|
15
|
+
import { AmbientReceiverReaders } from "./constant-callbacks.js";
|
|
12
16
|
import { type StringSliceSnapshot } from "./string-slices.js";
|
|
17
|
+
import { type PublishedTypes } from "../publication.js";
|
|
13
18
|
import { type LlClassMeta } from "./classes.js";
|
|
14
19
|
import { LlDyn, type DynHost } from "./dyn.js";
|
|
15
20
|
import { LlWalkers } from "./walkers.js";
|
|
21
|
+
import { NullableUnions } from "./nullable-unions.js";
|
|
16
22
|
import { type MapKeyAccess } from "./shapes.js";
|
|
17
23
|
import type { ExprOf, LibCallExpr, LlStreamTypedRefAdapter, LlValue } from "./expr-context.js";
|
|
18
24
|
export { LlvmUnsupportedError } from "./unsupported.js";
|
|
@@ -31,6 +37,14 @@ export interface LlvmTargetOptions {
|
|
|
31
37
|
/** Program objects carry a strong reference to the matching runtime ABI
|
|
32
38
|
* marker so manual links against an incompatible runtime fail loudly. */
|
|
33
39
|
runtimeAbiMarker?: boolean;
|
|
40
|
+
/** Emit live-object audit notes in emitted new/free helpers. Only the
|
|
41
|
+
* sanitized lane's SCR_RC_AUDIT runtime counts them; production plain
|
|
42
|
+
* builds pass false so release/dev objects carry no empty calls.
|
|
43
|
+
* Defaults to true for direct emission. */
|
|
44
|
+
objectAudit?: boolean;
|
|
45
|
+
/** Emit retain/release fast paths inline (the `speed` posture). Off, every
|
|
46
|
+
* retain and release is a runtime call. */
|
|
47
|
+
inlineRc?: boolean;
|
|
34
48
|
}
|
|
35
49
|
export declare function emitLlvmModule(mod: IrModule, options?: LlvmTargetOptions): string;
|
|
36
50
|
/** Keep large translation units below the host's single-string limit. */
|
|
@@ -61,15 +75,23 @@ export declare class LlEmitter {
|
|
|
61
75
|
readonly ffiExtendNarrowIntegers: boolean;
|
|
62
76
|
readonly cycleColorOffset: number;
|
|
63
77
|
readonly wasi: boolean;
|
|
78
|
+
/** ELF worker executables give thread-locals the executable TLS models. */
|
|
79
|
+
private readonly executableTls;
|
|
64
80
|
private readonly emitLibraryIdentity;
|
|
65
81
|
private readonly runtimeAbiMarker;
|
|
66
82
|
/** Interned string literals: UTF-8 text → { symbol, byte length } —
|
|
67
83
|
* first-use order, the runtime ABI’s determinism discipline. */
|
|
68
84
|
private readonly literals;
|
|
85
|
+
/** Symbols of interned constant data, named by content (contentSymbol). */
|
|
86
|
+
private readonly contentSymbols;
|
|
69
87
|
/** Interned unit-armed union instances: "unionId:tag" → symbol — one
|
|
70
88
|
* immortal (rc == SIZE_MAX) static per (union, unit tag).
|
|
71
89
|
* RC entry points and the collector skip immortals. */
|
|
72
90
|
private readonly unitInstances;
|
|
91
|
+
/** unionId → symbol of the union's immortal ABSENT field-slot instance. */
|
|
92
|
+
private readonly absentInstances;
|
|
93
|
+
/** The nullable-union ABSENT sentinel was referenced (absentInstanceRef). */
|
|
94
|
+
private needsNullableAbsent;
|
|
73
95
|
private readonly immortalValues;
|
|
74
96
|
/** Regex literal templates: "<flags>/<pattern>" → { symbol, interned
|
|
75
97
|
* source/flags literal refs } — one immortal ScrRegex template per distinct
|
|
@@ -110,18 +132,45 @@ export declare class LlEmitter {
|
|
|
110
132
|
needsBadTag: boolean;
|
|
111
133
|
needsBadKey: boolean;
|
|
112
134
|
private needsRetainBox;
|
|
135
|
+
/** Inline RC fast-path helpers requested by call sites (shapes.ts); null
|
|
136
|
+
* when inline RC is off. */
|
|
137
|
+
private readonly rcHelpers;
|
|
113
138
|
readonly fnByName: Map<string, IrFunction>;
|
|
139
|
+
/** Emitted LLVM text of every IR function body, by function name: the
|
|
140
|
+
* fiberless-async analysis scans it for suspension entry points. */
|
|
141
|
+
private readonly fnDefText;
|
|
114
142
|
readonly referenceEffects: ReferenceEffects;
|
|
115
|
-
|
|
143
|
+
readonly optionalArrayReads: OptionalArrayReads;
|
|
144
|
+
readonly checkedNarrows: CheckedNarrows;
|
|
116
145
|
callArrayReads: Map<IrExpr, LocalArrayRead>;
|
|
117
146
|
mapReadLifetimes: MapReadLifetimes;
|
|
118
147
|
readonly callLifetimes: CallLifetimes;
|
|
119
148
|
readonly constantCallbacks: Map<string, Map<string, string>>;
|
|
120
149
|
currentConstantCallbacks: ReadonlyMap<string, string>;
|
|
121
150
|
readonly stackCallbacks: StackCallbacks;
|
|
151
|
+
readonly receiverReaders: AmbientReceiverReaders;
|
|
122
152
|
private readonly stackCaptures;
|
|
153
|
+
private readonly lazyCaptures;
|
|
154
|
+
/** Unchanged captured parameters of the current function: each maps to
|
|
155
|
+
* the slot caching its box, NULL until the first closure needs it. */
|
|
156
|
+
private readonly lazyCaptureBoxes;
|
|
157
|
+
private readonly lazyStackBoxes;
|
|
123
158
|
private borrowedParameters;
|
|
159
|
+
/** Parameters proven projection-only: callers may pass stack boxes. */
|
|
160
|
+
private projectedParameters;
|
|
124
161
|
private stableCallBindings;
|
|
162
|
+
/** Locals and rebound parameters holding borrowed pointers for their
|
|
163
|
+
* whole lifetime (walk-borrows.ts), per function and for the current one. */
|
|
164
|
+
private readonly walkBorrowsByFunction;
|
|
165
|
+
private walkBorrows;
|
|
166
|
+
/** Functions whose borrowing body returns its result without a reference
|
|
167
|
+
* (analyzeBorrowedReturns), and whether the current body is one. */
|
|
168
|
+
readonly borrowedReturns: Set<string>;
|
|
169
|
+
/** Rebound parameters that keep the borrowed convention with an owner
|
|
170
|
+
* slot (rebound-parameters.ts), per function, and the current owner slots. */
|
|
171
|
+
private readonly reboundByFunction;
|
|
172
|
+
private readonly reboundOwnerSlots;
|
|
173
|
+
private currentBorrowedReturn;
|
|
125
174
|
/** Manifest-bound native imports, used by ffiCall emission. */
|
|
126
175
|
readonly ffiByName: Map<string, IrFfiImport>;
|
|
127
176
|
/** C-ABI callback trampolines and (for raw/no-userdata callbacks) their
|
|
@@ -140,6 +189,15 @@ export declare class LlEmitter {
|
|
|
140
189
|
* checks are emitted only after calls that can actually raise. */
|
|
141
190
|
readonly mayThrow: Set<string>;
|
|
142
191
|
readonly indirectMayThrow: boolean;
|
|
192
|
+
/** Worker programs: the functions that poll for termination on entry
|
|
193
|
+
* (workerTerminationPolls); null outside worker programs. */
|
|
194
|
+
private readonly workerEntryPolls;
|
|
195
|
+
/** Functions that check the native stack guard on entry
|
|
196
|
+
* (stackCheckedFunctions); null where the runtime has no guard. */
|
|
197
|
+
private readonly stackChecks;
|
|
198
|
+
/** Static types whose values can be published (@scriptc/threads): their
|
|
199
|
+
* stores carry the frozen-object guard. Null without publish calls. */
|
|
200
|
+
readonly publishedTypes: PublishedTypes | null;
|
|
143
201
|
/** Method names with at least one may-throw implementation — the
|
|
144
202
|
* virtualCall pending check's key. */
|
|
145
203
|
readonly mayThrowMethods: Set<string>;
|
|
@@ -160,6 +218,11 @@ export declare class LlEmitter {
|
|
|
160
218
|
readonly liveDynUnionRefAdapters: Map<string, string>;
|
|
161
219
|
readonly dynPromiseAdapters: Map<string, string>;
|
|
162
220
|
readonly unionsById: Map<string, IrUnionDef>;
|
|
221
|
+
readonly nullableFields: NullableRefFields;
|
|
222
|
+
/** Unions whose values are nullable arm pointers (nullable-unions.ts). */
|
|
223
|
+
readonly nullableUnions: NullableUnions;
|
|
224
|
+
/** The union table without nullable unions: the stack-box analyses. */
|
|
225
|
+
readonly boxedUnionsById: Map<string, IrUnionDef>;
|
|
163
226
|
readonly recordsById: Map<string, IrRecordShape>;
|
|
164
227
|
readonly recordCloneShapes: Set<string>;
|
|
165
228
|
readonly tracedShapes: Set<string>;
|
|
@@ -167,6 +230,8 @@ export declare class LlEmitter {
|
|
|
167
230
|
/** The class graph (buildClassGraph): preorder numbering, hierarchy
|
|
168
231
|
* membership, virtual slot lists. */
|
|
169
232
|
readonly classMeta: Map<string, LlClassMeta>;
|
|
233
|
+
/** Which vtable slots borrow which parameters (virtual-borrows.ts). */
|
|
234
|
+
private virtualBorrows;
|
|
170
235
|
/** Class objects (classes as first-class values): className → the
|
|
171
236
|
* interned .name literal ref — registered during body emission, the
|
|
172
237
|
* statics and construct thunks assemble around the bodies. */
|
|
@@ -206,6 +271,8 @@ export declare class LlEmitter {
|
|
|
206
271
|
private storedSplits;
|
|
207
272
|
private streamingSplitsEnabled;
|
|
208
273
|
private readonly initializerBindings;
|
|
274
|
+
/** Whole-program int32 storage and parameter/result facts. */
|
|
275
|
+
readonly int32Slots: Int32Slots;
|
|
209
276
|
private numericLocals;
|
|
210
277
|
private captureIds;
|
|
211
278
|
/** Active induction bindings retain their width independently of size_t. */
|
|
@@ -266,6 +333,11 @@ export declare class LlEmitter {
|
|
|
266
333
|
logArgSlots: number;
|
|
267
334
|
private readonly stackTraces;
|
|
268
335
|
constructor(mod: IrModule, options: LlvmTargetOptions);
|
|
336
|
+
/** The borrowed parameters of a hierarchy's vtable slot (empty: owned). */
|
|
337
|
+
virtualSlotBorrowed(rootName: string, slotIndex: number): ReadonlySet<number>;
|
|
338
|
+
/** The vtable entry for one implementation (VirtualBorrows.entry). */
|
|
339
|
+
virtualEntry(implFn: string): string;
|
|
340
|
+
private implSlotBorrowed;
|
|
269
341
|
abiOffset(native64: number, wasm32: number): number;
|
|
270
342
|
llType(t: IrType): string;
|
|
271
343
|
ffiCallbackAdapter(binding: string, id: string): FfiCallbackAdapter;
|
|
@@ -276,6 +348,7 @@ export declare class LlEmitter {
|
|
|
276
348
|
private emitFfiCallbackDefs;
|
|
277
349
|
emit(): string;
|
|
278
350
|
emitParts(): string[];
|
|
351
|
+
private emitModuleParts;
|
|
279
352
|
/** LIBRARY mode: the profile-declared external definitions — the
|
|
280
353
|
* export-map wrappers plus init / sink-registration / reset / collect.
|
|
281
354
|
* Plain `define` (not `define internal`) — the exact linkage distinction
|
|
@@ -288,6 +361,11 @@ export declare class LlEmitter {
|
|
|
288
361
|
* abort of untraced shape allocation and the invalid-union-tag abort —
|
|
289
362
|
* both print the runtime ABI’s exact message on fd 2 and abort. */
|
|
290
363
|
private helperDefs;
|
|
364
|
+
/** The inline RC helpers every call site requested, emitted last so
|
|
365
|
+
* requests from main/library epilogues are included. Slow-path
|
|
366
|
+
* declarations a late request added after the extern block flushed land
|
|
367
|
+
* here too. */
|
|
368
|
+
private inlineRcTail;
|
|
291
369
|
/** Env-signature wrappers + interned immortal closures for declared
|
|
292
370
|
* functions used as values (the runtime ABI’s sc_w_/sc_fc_ pair): every
|
|
293
371
|
* mention of `f` yields the same pointer, so `f === f` holds. */
|
|
@@ -296,6 +374,30 @@ export declare class LlEmitter {
|
|
|
296
374
|
* and generators. Their promise/generator completion and spawn tails stay
|
|
297
375
|
* with the callers below. */
|
|
298
376
|
private emitArgPackAndTrampolinePrologue;
|
|
377
|
+
/** Settles `promise` from a clean async body result `%r` (moved in). */
|
|
378
|
+
private asyncFulfillLines;
|
|
379
|
+
/** Async functions whose calls can skip the fiber (scr_async_inline_*).
|
|
380
|
+
* A body qualifies only when nothing it runs can park its execution
|
|
381
|
+
* context: its emitted text, and the text of every module function it
|
|
382
|
+
* mentions (transitively), contains no suspension entry point. Such a
|
|
383
|
+
* body always completes before the call returns, which is exactly the
|
|
384
|
+
* behavior of a fiber that never suspends. Excluded conservatively:
|
|
385
|
+
* wasm32 (its coroutine lowering owns async bodies), programs embedding
|
|
386
|
+
* the dynamic engine, module-evaluation bodies (their promise caches),
|
|
387
|
+
* `dyn` results (resolution may adopt a thenable), and every program
|
|
388
|
+
* that uses node:test subtests — `t.test()` runs a subtest inline and
|
|
389
|
+
* awaits it on the CURRENT fiber even from synchronous code. Worker
|
|
390
|
+
* programs keep fibers too: their fiber epilogue owns context
|
|
391
|
+
* termination (a stopping worker rejects and observes the promise), which
|
|
392
|
+
* the fiberless wrapper does not reproduce. A missed suspension still
|
|
393
|
+
* cannot reorder silently: the runtime traps when a context parks while a
|
|
394
|
+
* fiberless body is on its stack. */
|
|
395
|
+
private fiberlessAsyncFunctions;
|
|
396
|
+
/** The spawn wrapper of a fiberless async function: runs the body on the
|
|
397
|
+
* caller's stack between scr_async_inline_enter/leave and settles the
|
|
398
|
+
* fresh promise from its outcome — the fiber trampoline's epilogue,
|
|
399
|
+
* without the fiber. */
|
|
400
|
+
private emitFiberlessAsyncSpawn;
|
|
299
401
|
/** Per-async-function machinery — async.ts's scaffolding, .ll
|
|
300
402
|
* flavored: an argument-pack struct type, a fiber trampoline (unpacks,
|
|
301
403
|
* frees the pack, runs the ordinary compiled body, settles the
|
|
@@ -311,6 +413,12 @@ export declare class LlEmitter {
|
|
|
311
413
|
* spawn wrapper that only ALLOCATES the suspended fiber, and the
|
|
312
414
|
* never-started teardown that drops the packed (+1) arguments. */
|
|
313
415
|
private emitGenScaffolding;
|
|
416
|
+
/** A symbol derived from the constant's text rather than its first-use
|
|
417
|
+
* index, so an edit that interns one more string leaves every other
|
|
418
|
+
* constant's symbol, and the code referencing it, unchanged. This lets
|
|
419
|
+
* native builds reuse the compiled partitions an edit does not touch. A
|
|
420
|
+
* collision retries with a counter, still in first-use order. */
|
|
421
|
+
private contentSymbol;
|
|
314
422
|
internLiteral(text: string): string;
|
|
315
423
|
/** Interned NUL-terminated C-string constant (the scr_jb_puts /
|
|
316
424
|
* stringify-indent currency) — `@`-ref, first-use order. */
|
|
@@ -321,9 +429,29 @@ export declare class LlEmitter {
|
|
|
321
429
|
* emission initializes undefined-admitting fields through it
|
|
322
430
|
* (ClassHost). */
|
|
323
431
|
unitInstanceRef(unionId: string, tag: number): string;
|
|
432
|
+
/** The immortal ABSENT state of an undefined-armed record field slot
|
|
433
|
+
* (IR fieldAbsent). */
|
|
434
|
+
absentInstanceRef(unionId: string): string;
|
|
435
|
+
/** i1: a union value loaded from a field slot is the ABSENT state — the
|
|
436
|
+
* undefined arm's tag with the absent payload marker. */
|
|
437
|
+
fieldAbsentTest(value: string, unionId: string): string;
|
|
438
|
+
/** fieldAbsentTest in another block builder (helper generators). A
|
|
439
|
+
* nullable union's ABSENT state is the module's immortal sentinel. */
|
|
440
|
+
fieldAbsentTestIn(B: BlockBuilder, value: string, unionId: string): string;
|
|
441
|
+
/** Loads a record field slot as a VALUE: an undefined-armed union slot
|
|
442
|
+
* holding the ABSENT state surfaces as the ordinary undefined arm, so
|
|
443
|
+
* absence never travels beyond its slot (a later `{ f: r.f }` is an
|
|
444
|
+
* explicit, present property). */
|
|
445
|
+
loadRecordField(ptr: string, t: IrType): string;
|
|
324
446
|
declare(decl: string): void;
|
|
325
447
|
needOom(): void;
|
|
326
448
|
private currentFrame;
|
|
449
|
+
/** Whether a value is immortal: an interned constant, or a temp marked by
|
|
450
|
+
* markImmortal. */
|
|
451
|
+
private isImmortal;
|
|
452
|
+
/** Record that a temp holds an immortal value (a choice between interned
|
|
453
|
+
* literals): nothing owns it, and retains, releases and moves skip it. */
|
|
454
|
+
markImmortal(v: LlValue): LlValue;
|
|
327
455
|
/** Registers an owned refcounted value on the current statement frame. */
|
|
328
456
|
own(v: LlValue): LlValue;
|
|
329
457
|
/** Registers a SLOT whose current contents the frame owns (conditional
|
|
@@ -353,13 +481,40 @@ export declare class LlEmitter {
|
|
|
353
481
|
* function — and branch to the handler / return a dummy value (never
|
|
354
482
|
* read: callers of a may-throw function test the pending flag before
|
|
355
483
|
* using the result). Callers own the surrounding pending branch; a
|
|
356
|
-
* `throw` unwinds unconditionally.
|
|
484
|
+
* `throw` unwinds unconditionally. `passThrough` names a scalar call
|
|
485
|
+
* result of the function's own return type: with nothing to release, the
|
|
486
|
+
* unwind returns it as the dummy, so a call in tail position keeps a single
|
|
487
|
+
* return and stays eligible for tail-call and recursion elimination. */
|
|
357
488
|
private emitUnwind;
|
|
489
|
+
/** Instructions (two-space indented) that set the i1 `dest` to "an
|
|
490
|
+
* exception is pending in the active context" — scr_exc_pending()'s
|
|
491
|
+
* meaning — for the helper and adapter bodies that test it outside
|
|
492
|
+
* emitPendingCheck. Executables read the runtime's exported active-cell
|
|
493
|
+
* pointer and compare its i32 kind (offset 0) against SCR_EXC_NONE inline,
|
|
494
|
+
* as emitPendingCheck does; the out-of-line call would be opaque to LLVM
|
|
495
|
+
* because the runtime links as prebuilt objects. Libraries and worker
|
|
496
|
+
* programs keep the runtime call, which is emitPendingCheck's path there
|
|
497
|
+
* too (workers also observe cross-thread termination in it). */
|
|
498
|
+
pendingTestLines(dest: string): string[];
|
|
358
499
|
/** The emitter contract for exceptions: after EVERY call that can throw
|
|
359
500
|
* (per the may-throw analysis), test the pending flag and unwind. The
|
|
360
501
|
* call's result temp must join its frame BEFORE this runs so the unwind
|
|
361
|
-
* releases the dummy (NULL for refcounted kinds) harmlessly.
|
|
362
|
-
|
|
502
|
+
* releases the dummy (NULL for refcounted kinds) harmlessly. A scalar
|
|
503
|
+
* call result of the function's return type may be passed as the unwind's
|
|
504
|
+
* dummy value (see emitUnwind). */
|
|
505
|
+
emitPendingCheck(passThrough?: {
|
|
506
|
+
name: string;
|
|
507
|
+
type: IrType;
|
|
508
|
+
}): void;
|
|
509
|
+
/** After a runtime call that ALWAYS leaves an exception pending (the
|
|
510
|
+
* compiler-resolved Node throws): the pending test would always answer
|
|
511
|
+
* true, so unwind unconditionally. Emission continues in a block with no
|
|
512
|
+
* predecessors so the caller's remaining instructions stay well-formed;
|
|
513
|
+
* LLVM deletes it. */
|
|
514
|
+
emitAlwaysPendingUnwind(): void;
|
|
515
|
+
/** A recursive function's entry check: below the running stack's guard,
|
|
516
|
+
* throw Node's RangeError and unwind like any other pending exception. */
|
|
517
|
+
private emitStackCheck;
|
|
363
518
|
private workerLoopBudget;
|
|
364
519
|
private emitWorkerLoopCheck;
|
|
365
520
|
/** Moves an already-evaluated value into the runtime's exception cell —
|
|
@@ -375,24 +530,34 @@ export declare class LlEmitter {
|
|
|
375
530
|
/** Emit truthiness for one non-union kind. Union arms are known-present,
|
|
376
531
|
* so object kinds become the constant true instead of a pointer test. */
|
|
377
532
|
private truthyOf;
|
|
378
|
-
/**
|
|
379
|
-
|
|
533
|
+
/** A union value's tag (i32): the box's tag word, or the NULL test of a
|
|
534
|
+
* nullable union's pointer. */
|
|
535
|
+
unionTag(uName: string, unionId: string): string;
|
|
536
|
+
/** Guard for helpers that build or read a union's `%ScrUnion` box
|
|
537
|
+
* directly (library-shaped unions with fixed arms): a nullable union
|
|
538
|
+
* reaching one is an emitter bug, never a silent miscompile. */
|
|
539
|
+
requireBoxedUnion(unionId: string): void;
|
|
380
540
|
/** The BORROWED payload pointer of a ref arm (scr_union_peek inlined —
|
|
381
|
-
* the runtime's is a static inline). */
|
|
382
|
-
unionPeek(uName: string): string;
|
|
541
|
+
* the runtime's is a static inline); a nullable union is its payload. */
|
|
542
|
+
unionPeek(uName: string, unionId: string): string;
|
|
383
543
|
/** Emits `switch` over a union's tag with one block per arm; each arm
|
|
384
544
|
* body must TERMINATE its block (the callers branch to a join). The
|
|
385
545
|
* default block is the runtime ABI’s invalid-tag abort. Shared field
|
|
386
546
|
* reads can group equivalent storage prefixes and emit one representative. */
|
|
387
547
|
unionTagSwitch(uName: string, def: IrUnionDef, arm: (armType: IrType, tag: number) => void, fieldGroups?: number[][]): void;
|
|
388
548
|
/** The +1 extraction of a union's single narrowed arm (unionNarrow /
|
|
389
|
-
* the nullish-family reads): scalars via
|
|
549
|
+
* the nullish-family reads): scalars via inline payload loads, ref arms
|
|
390
550
|
* a retained peek. */
|
|
391
|
-
unionExtract(uName: string, arm: IrType): string;
|
|
551
|
+
unionExtract(uName: string, unionId: string, arm: IrType): string;
|
|
552
|
+
/** A scalar f64 arm's payload (scr_union_get_f64 inlined). Inline loads
|
|
553
|
+
* keep stack boxes free of escaping calls, so LLVM can scalarize them. */
|
|
554
|
+
unionGetF64(uName: string): string;
|
|
555
|
+
/** A bool arm's payload (scr_union_get_bool inlined: nonzero slot). */
|
|
556
|
+
unionGetBool(uName: string): string;
|
|
392
557
|
/** Constructs a union box around an OWNED (+1, already moved) value —
|
|
393
558
|
* the scr_union_new_* dispatch of unionWrap and the wrap-into-join
|
|
394
559
|
* sites (shift). */
|
|
395
|
-
unionNewOwned(tag: number, v: LlValue): string;
|
|
560
|
+
unionNewOwned(unionId: string, tag: number, v: LlValue): string;
|
|
396
561
|
classMetaOf(className: string): LlClassMeta;
|
|
397
562
|
/** The field-slot pointer of a class member: rc at 0, the vtable word at
|
|
398
563
|
* 1 on hierarchy members, then the flattened field list. Runtime error
|
|
@@ -425,6 +590,12 @@ export declare class LlEmitter {
|
|
|
425
590
|
loadField(ptr: string, t: IrType): string;
|
|
426
591
|
/** Stores a record field (i1 zext to the i8 storage). */
|
|
427
592
|
storeField(ptr: string, t: IrType, value: string): void;
|
|
593
|
+
/** Reads an int32-specialized class field: the i32 slot is the value,
|
|
594
|
+
* and its widening is the exact double every program observation sees. */
|
|
595
|
+
loadInt32Field(ptr: string, type: IrType): LlValue;
|
|
596
|
+
/** Stores a value the whole-program analysis proved to be an int32 (never
|
|
597
|
+
* -0, NaN or fractional) into an int32-specialized class field. */
|
|
598
|
+
storeInt32Field(ptr: string, value: LlValue, expr: IrExpr): void;
|
|
428
599
|
/** A binding's storage: a module global, a plain local slot, or a boxed
|
|
429
600
|
* local (the slot holds the capture BOX; access goes through it). */
|
|
430
601
|
binding(id: string): {
|
|
@@ -436,9 +607,15 @@ export declare class LlEmitter {
|
|
|
436
607
|
private emitDebugLocal;
|
|
437
608
|
/** Loads a boxed binding's box pointer out of its slot. */
|
|
438
609
|
loadBox(slot: string): string;
|
|
610
|
+
/** The payload slot of a capture box (ScrBox.slot, field 5). */
|
|
611
|
+
private boxSlot;
|
|
439
612
|
boxGet(box: string, t: IrType): string;
|
|
440
613
|
/** scr_box_set_* — the ref form takes ownership of the passed value. */
|
|
441
614
|
boxSet(box: string, t: IrType, value: string): void;
|
|
615
|
+
/** The box a new environment captures for `localId` (borrowed). An
|
|
616
|
+
* unchanged parameter gets one box on first capture, holding its own
|
|
617
|
+
* reference to the value; the function scope releases the cached box. */
|
|
618
|
+
captureBox(localId: string): string;
|
|
442
619
|
retainBox(box: string): string;
|
|
443
620
|
/** The initializing write of a scalar TDZ box: mint the one-element
|
|
444
621
|
* array cell holding the value and move it into the ARR-kind box
|
|
@@ -450,6 +627,8 @@ export declare class LlEmitter {
|
|
|
450
627
|
* array cell; ref kinds read the box normally (+1). */
|
|
451
628
|
private checkTdz;
|
|
452
629
|
checkGlobalTdz(id: string): void;
|
|
630
|
+
/** Throws the TDZ ReferenceError for `name` unless the i1 `flag` is set. */
|
|
631
|
+
checkInitializedFlag(flag: string, name: string): void;
|
|
453
632
|
private throwIfUninitialized;
|
|
454
633
|
tdzBoxRead(box: string, t: IrType, name: string): string;
|
|
455
634
|
/** Declaration stores initialize an empty TDZ box. Later stores check
|
|
@@ -476,6 +655,9 @@ export declare class LlEmitter {
|
|
|
476
655
|
* borrowing body. Ownership of other parameters moves into that body;
|
|
477
656
|
* borrowed parameters are released here on normal and exceptional exits.
|
|
478
657
|
* The pending exception remains for the adapter's caller to handle. */
|
|
658
|
+
/** With `kept`, the virtual adapter of a borrowing slot instead: the
|
|
659
|
+
* slot's parameters stay borrowed, the body's other borrowed ones are
|
|
660
|
+
* released here. */
|
|
479
661
|
private emitOwnedCallAdapter;
|
|
480
662
|
/** A local stable binding keeps its value alive while later arguments
|
|
481
663
|
* and the callee execute. A proven local union box cannot escape or be
|
|
@@ -535,6 +717,22 @@ export declare class LlEmitter {
|
|
|
535
717
|
emitBranchInto(slot: string, expr: IrExpr, integerSlot?: string): boolean;
|
|
536
718
|
emitLiteralExpr(e: ExprOf<"numLit" | "boolLit" | "strLit" | "moduleNsRef" | "unitLit" | "varRef">): LlValue;
|
|
537
719
|
emitOperatorExpr(e: ExprOf<"bin" | "unary" | "incDec" | "fieldIncDec" | "assignExpr" | "seqExpr">): LlValue;
|
|
720
|
+
/** Saved operands can feed later call arguments. Transfer ownership of a
|
|
721
|
+
* sequence's locals to this expression's frame so they survive those
|
|
722
|
+
* reads and still die on the path that created them, including inside
|
|
723
|
+
* lazy branches. */
|
|
724
|
+
private emitSequence;
|
|
725
|
+
/** A statement-position expression whose value is dropped. When a
|
|
726
|
+
* sequence's result only reads an unchanged local (a derived
|
|
727
|
+
* constructor's `super()` evaluates to `this`), its statements still run
|
|
728
|
+
* in place, but the result is neither retained nor released. */
|
|
729
|
+
/** Whether a discarded value can be skipped entirely: a borrowable read
|
|
730
|
+
* with no effect of its own. canBorrowCallArgument also accepts checked
|
|
731
|
+
* projections (a ternary or narrow whose failing arm throws, and the
|
|
732
|
+
* throwing call itself) because a borrowed use still evaluates them;
|
|
733
|
+
* skipping those would drop the throw. */
|
|
734
|
+
private discardableRead;
|
|
735
|
+
private emitDiscarded;
|
|
538
736
|
emitControlExpr(e: ExprOf<"dynDestrCheck" | "dynIterN" | "toBool" | "logical" | "ternary" | "optChain" | "chainRecv" | "orDefault" | "nullish">): LlValue;
|
|
539
737
|
emitStringExpr(e: ExprOf<"strConcat" | "strEq" | "strCmp" | "toString" | "strIntrinsic" | "regexLit" | "templateStrings" | "regexIntrinsic">): LlValue;
|
|
540
738
|
/**
|
|
@@ -544,11 +742,39 @@ export declare class LlEmitter {
|
|
|
544
742
|
* value, making the snapshot unique unless a real observable alias exists.
|
|
545
743
|
*/
|
|
546
744
|
emitStringSelfConcatAssign(localId: string, left: IrExpr, suffix: IrExpr, retainForYield: boolean): LlValue;
|
|
745
|
+
/** `local = local + suffix` when the suffix cannot read or write the
|
|
746
|
+
* local (an unboxed binding is only reachable through this function's own
|
|
747
|
+
* expressions): reading the binding after the suffix gives the value the
|
|
748
|
+
* left side had, so it moves into a consuming concat, and the result takes
|
|
749
|
+
* its place. Null when the general snapshot path is needed. */
|
|
750
|
+
private emitMovedSelfConcat;
|
|
547
751
|
emitContainerExpr(e: ExprOf<"arrayLit" | "arrayNewLen" | "arrayGet" | "arrayHas" | "arrayState" | "arrIntrinsic" | "bytesNew" | "bytesIntrinsic" | "mapNew" | "mapIntrinsic" | "setIntrinsic" | "setNew">): LlValue;
|
|
548
752
|
emitCallExpr(e: ExprOf<"call" | "ffiCall" | "closure" | "callValue" | "selfRef" | "new" | "classRef" | "newValue" | "instanceOfValue" | "promiseVoidWiden" | "upcast" | "downcast" | "instanceOf" | "virtualCall">): LlValue;
|
|
549
|
-
emitRecordExpr(e: ExprOf<"fieldGet" | "recordGet" | "recordLit" | "recordClone" | "recordKeyGet" | "recordOvfKeys" | "recordOvfHas">): LlValue;
|
|
753
|
+
emitRecordExpr(e: ExprOf<"fieldGet" | "recordGet" | "recordLit" | "recordClone" | "recordKeyGet" | "recordOvfKeys" | "recordOvfHas" | "recordHas" | "fieldAbsent">): LlValue;
|
|
550
754
|
emitDynamicExpr(e: ExprOf<"dynFrom" | "dynFromJsval" | "dynCall" | "dynInvoke" | "dynArrLit" | "dynObjLit" | "unionWrap" | "unionNarrow" | "unionDisc" | "unionKeyGet" | "unionIsTag" | "dynKeyGet" | "dynHasKey" | "dynScalarEq" | "dynTest" | "unionEq" | "unionFuncEq" | "caughtTest" | "caughtCheck" | "caughtNarrow" | "caughtToDyn">): LlValue;
|
|
551
755
|
emitIntrinsicExpr(e: ExprOf<"intrinsic">): LlValue;
|
|
756
|
+
private publishWalkersCache;
|
|
757
|
+
/** Per-type publication walkers, created on the first publish. */
|
|
758
|
+
private get publishWalkers();
|
|
759
|
+
/** `publish(value)` (@scriptc/threads): makes the graph immortal and
|
|
760
|
+
* immutable (scr_publish with the static type's walker) and answers the
|
|
761
|
+
* same value. Throws (pending) when a dyn part is unpublishable. */
|
|
762
|
+
private emitPublish;
|
|
763
|
+
/** Branches on "`obj` is published" (rc == SIZE_MAX); leaves the builder
|
|
764
|
+
* in the cold block and answers the continuation label. */
|
|
765
|
+
private emitPublishedTest;
|
|
766
|
+
private publishedNamesSym;
|
|
767
|
+
/** The class-name table the hierarchy field guards index by preorder. */
|
|
768
|
+
private publishedClassNamesDefs;
|
|
769
|
+
/** The frozen-object guard of a class field or record field store:
|
|
770
|
+
* Node's "Cannot assign to read only property" TypeError when the target
|
|
771
|
+
* is published. `className` null means a record (`#<Object>`). */
|
|
772
|
+
emitPublishedFieldGuard(obj: string, className: string | null, field: string): void;
|
|
773
|
+
/** The frozen-array guard (scr_throw_published_array's ops): `index` and
|
|
774
|
+
* `count` are doubles (the written index, the argument count). */
|
|
775
|
+
emitPublishedArrayGuard(arr: string, arrType: IrType, op: number, index?: string, count?: string): void;
|
|
776
|
+
/** The published Map/Set guard: "Cannot modify a published Map/Set". */
|
|
777
|
+
emitPublishedCollectionGuard(m: string, t: IrType): void;
|
|
552
778
|
emitSerializationExpr(e: ExprOf<"jsonStringify" | "dynCheck">): LlValue;
|
|
553
779
|
emitAsyncExpr(e: ExprOf<"yieldExpr" | "genResume" | "awaitExpr" | "awaitUnionExpr" | "newPromise" | "promiseWithResolvers">): LlValue;
|
|
554
780
|
emitJsInteropExpr(e: ExprOf<"jsMarshal" | "jsOp" | "jsExit" | "jsBridgePromise">): LlValue;
|
|
@@ -558,7 +784,74 @@ export declare class LlEmitter {
|
|
|
558
784
|
* their ordinary statement-frame ownership. The caller must retain any
|
|
559
785
|
* reference result before evaluating another expression. */
|
|
560
786
|
emitReadReceiver(e: IrExpr): LlValue;
|
|
787
|
+
/** A private stack union source with an independently owned payload. */
|
|
788
|
+
canStackReceiver(e: IrExpr): boolean;
|
|
789
|
+
/** True for union sources that emitReadReceiver can produce as a private
|
|
790
|
+
* stack box with an independently owned payload (no heap union). */
|
|
791
|
+
isStackUnionSource(e: IrExpr): boolean;
|
|
792
|
+
/** The nullable-pointer representation behind a union-typed class field
|
|
793
|
+
* read, or null for every other expression. */
|
|
794
|
+
nullableFieldGet(e: IrExpr): NullableRefField | null;
|
|
795
|
+
/** A union operand consumed only by a projection (tag test, payload
|
|
796
|
+
* extraction, arm compare, truthiness). A nullable-pointer field read
|
|
797
|
+
* becomes a private stack box whose payload is borrowed from the field:
|
|
798
|
+
* the consumer must finish before any later expression can store to the
|
|
799
|
+
* field, and must never retain, release, or store the box. Every other
|
|
800
|
+
* operand takes the ordinary borrowed-receiver path. */
|
|
801
|
+
emitUnionProjection(e: IrExpr): LlValue;
|
|
802
|
+
/** A private stack box over a nullable-pointer field read whose payload
|
|
803
|
+
* is retained into the current frame: an independent owner, so the box
|
|
804
|
+
* may outlive later stores to the field (call arguments, local copies).
|
|
805
|
+
* The box itself must still never reach an RC entry point. */
|
|
806
|
+
emitOwnedNullableStack(e: IrExpr): {
|
|
807
|
+
box: string;
|
|
808
|
+
owner: LlValue;
|
|
809
|
+
};
|
|
810
|
+
/** A private stack box over a borrowed nullable pointer. */
|
|
811
|
+
stackNullableBox(p: string, nullable: NullableRefField): string;
|
|
812
|
+
/** The owned (+1) union value of a nullable-pointer slot: the unit arm's
|
|
813
|
+
* immortal instance, or a fresh heap box around a retained instance. */
|
|
814
|
+
nullableToOwnedUnion(p: string, nullable: NullableRefField): string;
|
|
815
|
+
/** The owned (+1) instance pointer (NULL for the unit arm) of a union
|
|
816
|
+
* box, which stays owned by its existing owner. */
|
|
817
|
+
unionToNullable(u: string, nullable: NullableRefField): string;
|
|
818
|
+
/** `obj.f = value` for a nullable-pointer field: the new instance pointer
|
|
819
|
+
* is produced without a union box where the value is a wrap, and as a
|
|
820
|
+
* retained payload of a borrowed box otherwise. Unlink-then-release like
|
|
821
|
+
* every field store. */
|
|
822
|
+
emitNullableFieldStore(obj: string, className: string, field: string, nullable: NullableRefField, value: IrExpr): void;
|
|
823
|
+
/** A union binding whose slot may hold a private stack box: stack locals
|
|
824
|
+
* and projection-only parameters (callers may pass stack boxes). Such a
|
|
825
|
+
* box must only be projected: never retained, released, or stored. */
|
|
826
|
+
isStackUnionLocal(localId: string): boolean;
|
|
561
827
|
canBorrowReceiver(e: IrExpr): boolean;
|
|
828
|
+
/** A reference held as one plain pointer that emitReadReceiver can read
|
|
829
|
+
* without owning: class instances, records, arrays, strings and
|
|
830
|
+
* nullable-pointer unions. Tagged union boxes, closures and dynamic
|
|
831
|
+
* values keep ordinary ownership. */
|
|
832
|
+
plainReference(type: IrType): boolean;
|
|
833
|
+
/** Functions returning a walk of their borrowed parameters return it
|
|
834
|
+
* without a reference (+0) from their borrowing body; direct callers
|
|
835
|
+
* either consume it as a receiver/walk or retain it at once, and the owned
|
|
836
|
+
* adapter retains before releasing its parameters. Candidates preserve
|
|
837
|
+
* every heap edge (so the result stays reachable from the arguments),
|
|
838
|
+
* borrow every reference parameter and return plain pointers. The set
|
|
839
|
+
* grows to a fixpoint because a call to a borrowed-return function with
|
|
840
|
+
* walk arguments is itself a walk; walk facts are then recomputed with
|
|
841
|
+
* the final set, admitting only parameters whose convention borrows. */
|
|
842
|
+
private analyzeBorrowedReturns;
|
|
843
|
+
/** emitReadReceiver produces this node's pointer without acquiring a
|
|
844
|
+
* reference, given operands (and ternary arms) that do the same: plain
|
|
845
|
+
* class/record field reads, class casts, nullable-pointer narrows and
|
|
846
|
+
* wraps, and checked ternaries. Stack-boxed, map-read and boxed-field
|
|
847
|
+
* sources are owned. Depends only on module facts, not the current
|
|
848
|
+
* function. */
|
|
849
|
+
borrowsWithoutOwning(e: IrExpr): boolean;
|
|
850
|
+
/** A wrap into a nullable-pointer union is the payload pointer itself
|
|
851
|
+
* (the reference arm) or an immortal constant (a unit arm), so it can
|
|
852
|
+
* borrow exactly when its payload can. Void payloads run for effects and
|
|
853
|
+
* keep the ordinary path; tagged unions still construct a box. */
|
|
854
|
+
borrowableNullableWrap(e: IrExpr): "unit" | "ref" | null;
|
|
562
855
|
materializeSplitLocal(localId: string): void;
|
|
563
856
|
emitExpr(e: IrExpr): LlValue;
|
|
564
857
|
emitJsMarshal(e: IrExpr & {
|
|
@@ -620,7 +913,7 @@ export declare class LlEmitter {
|
|
|
620
913
|
}): string;
|
|
621
914
|
streamCbThunkFor(kind: "r" | "w" | "f" | "d" | "t" | "l" | "e", cbT: IrType): string;
|
|
622
915
|
resolveThunkFor(inner: IrType): string;
|
|
623
|
-
tagInSet(uName: string, tags: number[]): string;
|
|
916
|
+
tagInSet(uName: string, unionId: string, tags: number[]): string;
|
|
624
917
|
arrPush(arr: string, acc: "f64" | "bool" | "ref", value: string): string;
|
|
625
918
|
emitArrayCopyLoop(dst: string, src: string, acc: "f64" | "bool" | "ref"): void;
|
|
626
919
|
emitStrIntrinsic(e: IrExpr & {
|
|
@@ -647,7 +940,7 @@ export declare class LlEmitter {
|
|
|
647
940
|
emitBytesIndex(receiver: string, index: LlValue, expr?: IrExpr, inBounds?: boolean): string;
|
|
648
941
|
emitBytesData(receiver: string): string;
|
|
649
942
|
emitBytesLength(elem: IrBytesElem, receiver: string, bytes: boolean): LlValue;
|
|
650
|
-
emitBytesGet(elem: IrBytesElem, receiver: string, index: LlValue, expr?: IrExpr, inBounds?: boolean): LlValue;
|
|
943
|
+
emitBytesGet(elem: IrBytesElem, receiver: string, index: LlValue, expr?: IrExpr, inBounds?: boolean, invalidNaN?: boolean): LlValue;
|
|
651
944
|
emitToUint32(value: string, expr?: IrExpr, uint32?: string): string;
|
|
652
945
|
storeIntegerView(localId: string, value: LlValue, expr?: IrExpr): void;
|
|
653
946
|
private emitBytesSet;
|