@scriptc/compiler 0.2.6 → 0.2.7
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 +5 -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 +40 -0
- package/dist/backend/llvm/alloc.js +205 -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/call-lifetimes.d.ts +15 -3
- package/dist/backend/llvm/call-lifetimes.js +42 -18
- package/dist/backend/llvm/call-lifetimes.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.test.js +170 -0
- package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/classes.d.ts +4 -1
- package/dist/backend/llvm/classes.js +35 -32
- package/dist/backend/llvm/classes.js.map +1 -1
- package/dist/backend/llvm/classes.test.js +36 -3
- 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/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 +149 -0
- package/dist/backend/llvm/dense-array-access.test.js.map +1 -0
- package/dist/backend/llvm/dyn.d.ts +34 -0
- package/dist/backend/llvm/dyn.js +189 -1
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.d.ts +124 -4
- package/dist/backend/llvm/emitter.js +623 -105
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.test.js +68 -6
- package/dist/backend/llvm/emitter.test.js.map +1 -1
- package/dist/backend/llvm/expr-async.js +58 -4
- 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-calls.js +64 -6
- package/dist/backend/llvm/expr-calls.js.map +1 -1
- package/dist/backend/llvm/expr-containers.js +16 -5
- package/dist/backend/llvm/expr-containers.js.map +1 -1
- package/dist/backend/llvm/expr-control.js +92 -2
- 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 +174 -25
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.d.ts +1 -1
- package/dist/backend/llvm/expr-primitives.js +52 -24
- package/dist/backend/llvm/expr-primitives.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.test.js +1 -1
- package/dist/backend/llvm/expr-records.js +3 -3
- package/dist/backend/llvm/expr-records.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.js +59 -2
- 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/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 +2 -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-filesystem.js +3 -4
- package/dist/backend/llvm/lib-filesystem.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.d.ts +5 -1
- package/dist/backend/llvm/local-array-reads.js +78 -17
- package/dist/backend/llvm/local-array-reads.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.test.js +78 -1
- 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 +48 -6
- package/dist/backend/llvm/local-union-storage.js.map +1 -1
- package/dist/backend/llvm/local-union-storage.test.js +91 -4
- package/dist/backend/llvm/local-union-storage.test.js.map +1 -1
- package/dist/backend/llvm/map-read-lifetimes.test.js +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/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 +69 -2
- package/dist/backend/llvm/shapes.js +259 -27
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/shapes.test.js +114 -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 +38 -1
- package/dist/backend/llvm/stack-unions.test.js.map +1 -1
- package/dist/backend/llvm/string-construction.test.js +1 -1
- package/dist/backend/llvm/string-key-hash.d.ts +8 -0
- package/dist/backend/llvm/string-key-hash.js +59 -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 +34 -0
- package/dist/backend/llvm/string-key-hash.test.js.map +1 -0
- package/dist/backend/llvm/string-lifetimes.test.js +41 -4
- package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
- 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 +2 -2
- package/dist/backend/llvm/switch-dispatch.test.js.map +1 -1
- package/dist/backend/may-throw.js +3 -0
- package/dist/backend/may-throw.js.map +1 -1
- package/dist/backend/may-throw.test.js +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 +1 -0
- package/dist/backend/native/runtime-inputs.js.map +1 -1
- package/dist/backend/native-codegen-core.d.ts +2 -1
- package/dist/backend/native-codegen-core.js.map +1 -1
- package/dist/backend/native-codegen.d.ts +5 -0
- package/dist/backend/native-codegen.js +4 -0
- package/dist/backend/native-codegen.js.map +1 -1
- package/dist/backend/native-codegen.test.js +23 -0
- 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 +3 -1
- package/dist/backend/native-tools.js +0 -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/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 +5 -4
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/host.d.ts +2 -1
- package/dist/cli/usage.d.ts +1 -1
- package/dist/cli/usage.js +5 -2
- package/dist/cli/usage.js.map +1 -1
- package/dist/compile-types.d.ts +5 -2
- package/dist/diagnostics/diagnostic.js +10 -8
- package/dist/diagnostics/diagnostic.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/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 +23 -0
- package/dist/frontend/lowering/array-values.js +129 -0
- 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/process.d.ts +6 -17
- package/dist/frontend/lowering/builtins/process.js +56 -29
- package/dist/frontend/lowering/builtins/process.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 +4 -0
- package/dist/frontend/lowering/class-assertions.js +12 -4
- 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 +4 -1
- 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/structural.js +9 -6
- package/dist/frontend/lowering/coercions/structural.js.map +1 -1
- 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/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 +363 -49
- 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 +95 -3
- 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 +43 -132
- package/dist/frontend/lowering/containers/array-methods.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/cycle-initialization.d.ts +41 -0
- package/dist/frontend/lowering/cycle-initialization.js +277 -0
- package/dist/frontend/lowering/cycle-initialization.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 +138 -32
- 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 +3 -3
- package/dist/frontend/lowering/lower-calls.js +162 -121
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.d.ts +2 -0
- package/dist/frontend/lowering/lower-classes.js +45 -43
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +9 -2
- package/dist/frontend/lowering/lower-exprs.js +390 -157
- 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-inspect.js +26 -2
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.js +10 -2
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +46 -58
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +37 -0
- package/dist/frontend/lowering/lowerer.js +283 -18
- 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-provenance.d.ts +15 -0
- package/dist/frontend/lowering/runtime-optional-provenance.js +40 -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/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/program.d.ts +38 -2
- package/dist/frontend/program.js +440 -59
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/program.test.js +59 -6
- package/dist/frontend/program.test.js.map +1 -1
- package/dist/frontend/type-mapper.d.ts +1 -1
- package/dist/frontend/type-mapper.js +89 -14
- 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/index.js +25 -9
- 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/builtin-signatures.js +2 -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/ir.d.ts +78 -15
- 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 +118 -20
- package/dist/ir/validate.js.map +1 -1
- package/dist/ir/validate.test.js +269 -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/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.js +27 -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/package.json +20 -20
- package/surface-manifest.json +8 -2
|
@@ -5,10 +5,12 @@ import { type ConstantNumericTable } from "../../ir/constant-tables.js";
|
|
|
5
5
|
import { type FfiCallbackAdapter } from "../ffi-callbacks.js";
|
|
6
6
|
import { type CallLifetimes } from "./call-lifetimes.js";
|
|
7
7
|
import { BlockBuilder } from "./blocks.js";
|
|
8
|
-
import { type
|
|
8
|
+
import { NullableRefFields, type NullableRefField } from "./nullable-fields.js";
|
|
9
|
+
import { OptionalArrayReads, type LocalArrayRead } from "./local-array-reads.js";
|
|
9
10
|
import { type MapReadLifetimes } from "./map-read-lifetimes.js";
|
|
10
11
|
import { ReferenceEffects } from "./reference-effects.js";
|
|
11
12
|
import { StackCallbacks } from "./stack-callbacks.js";
|
|
13
|
+
import { AmbientReceiverReaders } from "./constant-callbacks.js";
|
|
12
14
|
import { type StringSliceSnapshot } from "./string-slices.js";
|
|
13
15
|
import { type LlClassMeta } from "./classes.js";
|
|
14
16
|
import { LlDyn, type DynHost } from "./dyn.js";
|
|
@@ -31,6 +33,14 @@ export interface LlvmTargetOptions {
|
|
|
31
33
|
/** Program objects carry a strong reference to the matching runtime ABI
|
|
32
34
|
* marker so manual links against an incompatible runtime fail loudly. */
|
|
33
35
|
runtimeAbiMarker?: boolean;
|
|
36
|
+
/** Emit live-object audit notes in emitted new/free helpers. Only the
|
|
37
|
+
* sanitized lane's SCR_RC_AUDIT runtime counts them; production plain
|
|
38
|
+
* builds pass false so release/dev objects carry no empty calls.
|
|
39
|
+
* Defaults to true for direct emission. */
|
|
40
|
+
objectAudit?: boolean;
|
|
41
|
+
/** Emit retain/release fast paths inline (the `speed` posture). Off, every
|
|
42
|
+
* retain and release is a runtime call. */
|
|
43
|
+
inlineRc?: boolean;
|
|
34
44
|
}
|
|
35
45
|
export declare function emitLlvmModule(mod: IrModule, options?: LlvmTargetOptions): string;
|
|
36
46
|
/** Keep large translation units below the host's single-string limit. */
|
|
@@ -70,6 +80,8 @@ export declare class LlEmitter {
|
|
|
70
80
|
* immortal (rc == SIZE_MAX) static per (union, unit tag).
|
|
71
81
|
* RC entry points and the collector skip immortals. */
|
|
72
82
|
private readonly unitInstances;
|
|
83
|
+
/** unionId → symbol of the union's immortal ABSENT field-slot instance. */
|
|
84
|
+
private readonly absentInstances;
|
|
73
85
|
private readonly immortalValues;
|
|
74
86
|
/** Regex literal templates: "<flags>/<pattern>" → { symbol, interned
|
|
75
87
|
* source/flags literal refs } — one immortal ScrRegex template per distinct
|
|
@@ -110,17 +122,31 @@ export declare class LlEmitter {
|
|
|
110
122
|
needsBadTag: boolean;
|
|
111
123
|
needsBadKey: boolean;
|
|
112
124
|
private needsRetainBox;
|
|
125
|
+
/** Inline RC fast-path helpers requested by call sites (shapes.ts); null
|
|
126
|
+
* when inline RC is off. */
|
|
127
|
+
private readonly rcHelpers;
|
|
113
128
|
readonly fnByName: Map<string, IrFunction>;
|
|
129
|
+
/** Emitted LLVM text of every IR function body, by function name: the
|
|
130
|
+
* fiberless-async analysis scans it for suspension entry points. */
|
|
131
|
+
private readonly fnDefText;
|
|
114
132
|
readonly referenceEffects: ReferenceEffects;
|
|
115
|
-
|
|
133
|
+
readonly optionalArrayReads: OptionalArrayReads;
|
|
116
134
|
callArrayReads: Map<IrExpr, LocalArrayRead>;
|
|
117
135
|
mapReadLifetimes: MapReadLifetimes;
|
|
118
136
|
readonly callLifetimes: CallLifetimes;
|
|
119
137
|
readonly constantCallbacks: Map<string, Map<string, string>>;
|
|
120
138
|
currentConstantCallbacks: ReadonlyMap<string, string>;
|
|
121
139
|
readonly stackCallbacks: StackCallbacks;
|
|
140
|
+
readonly receiverReaders: AmbientReceiverReaders;
|
|
122
141
|
private readonly stackCaptures;
|
|
142
|
+
private readonly lazyCaptures;
|
|
143
|
+
/** Unchanged captured parameters of the current function: each maps to
|
|
144
|
+
* the slot caching its box, NULL until the first closure needs it. */
|
|
145
|
+
private readonly lazyCaptureBoxes;
|
|
146
|
+
private readonly lazyStackBoxes;
|
|
123
147
|
private borrowedParameters;
|
|
148
|
+
/** Parameters proven projection-only: callers may pass stack boxes. */
|
|
149
|
+
private projectedParameters;
|
|
124
150
|
private stableCallBindings;
|
|
125
151
|
/** Manifest-bound native imports, used by ffiCall emission. */
|
|
126
152
|
readonly ffiByName: Map<string, IrFfiImport>;
|
|
@@ -160,6 +186,7 @@ export declare class LlEmitter {
|
|
|
160
186
|
readonly liveDynUnionRefAdapters: Map<string, string>;
|
|
161
187
|
readonly dynPromiseAdapters: Map<string, string>;
|
|
162
188
|
readonly unionsById: Map<string, IrUnionDef>;
|
|
189
|
+
readonly nullableFields: NullableRefFields;
|
|
163
190
|
readonly recordsById: Map<string, IrRecordShape>;
|
|
164
191
|
readonly recordCloneShapes: Set<string>;
|
|
165
192
|
readonly tracedShapes: Set<string>;
|
|
@@ -288,6 +315,11 @@ export declare class LlEmitter {
|
|
|
288
315
|
* abort of untraced shape allocation and the invalid-union-tag abort —
|
|
289
316
|
* both print the runtime ABI’s exact message on fd 2 and abort. */
|
|
290
317
|
private helperDefs;
|
|
318
|
+
/** The inline RC helpers every call site requested, emitted last so
|
|
319
|
+
* requests from main/library epilogues are included. Slow-path
|
|
320
|
+
* declarations a late request added after the extern block flushed land
|
|
321
|
+
* here too. */
|
|
322
|
+
private inlineRcTail;
|
|
291
323
|
/** Env-signature wrappers + interned immortal closures for declared
|
|
292
324
|
* functions used as values (the runtime ABI’s sc_w_/sc_fc_ pair): every
|
|
293
325
|
* mention of `f` yields the same pointer, so `f === f` holds. */
|
|
@@ -296,6 +328,30 @@ export declare class LlEmitter {
|
|
|
296
328
|
* and generators. Their promise/generator completion and spawn tails stay
|
|
297
329
|
* with the callers below. */
|
|
298
330
|
private emitArgPackAndTrampolinePrologue;
|
|
331
|
+
/** Settles `promise` from a clean async body result `%r` (moved in). */
|
|
332
|
+
private asyncFulfillLines;
|
|
333
|
+
/** Async functions whose calls can skip the fiber (scr_async_inline_*).
|
|
334
|
+
* A body qualifies only when nothing it runs can park its execution
|
|
335
|
+
* context: its emitted text, and the text of every module function it
|
|
336
|
+
* mentions (transitively), contains no suspension entry point. Such a
|
|
337
|
+
* body always completes before the call returns, which is exactly the
|
|
338
|
+
* behavior of a fiber that never suspends. Excluded conservatively:
|
|
339
|
+
* wasm32 (its coroutine lowering owns async bodies), programs embedding
|
|
340
|
+
* the dynamic engine, module-evaluation bodies (their promise caches),
|
|
341
|
+
* `dyn` results (resolution may adopt a thenable), and every program
|
|
342
|
+
* that uses node:test subtests — `t.test()` runs a subtest inline and
|
|
343
|
+
* awaits it on the CURRENT fiber even from synchronous code. Worker
|
|
344
|
+
* programs keep fibers too: their fiber epilogue owns context
|
|
345
|
+
* termination (a stopping worker rejects and observes the promise), which
|
|
346
|
+
* the fiberless wrapper does not reproduce. A missed suspension still
|
|
347
|
+
* cannot reorder silently: the runtime traps when a context parks while a
|
|
348
|
+
* fiberless body is on its stack. */
|
|
349
|
+
private fiberlessAsyncFunctions;
|
|
350
|
+
/** The spawn wrapper of a fiberless async function: runs the body on the
|
|
351
|
+
* caller's stack between scr_async_inline_enter/leave and settles the
|
|
352
|
+
* fresh promise from its outcome — the fiber trampoline's epilogue,
|
|
353
|
+
* without the fiber. */
|
|
354
|
+
private emitFiberlessAsyncSpawn;
|
|
299
355
|
/** Per-async-function machinery — async.ts's scaffolding, .ll
|
|
300
356
|
* flavored: an argument-pack struct type, a fiber trampoline (unpacks,
|
|
301
357
|
* frees the pack, runs the ordinary compiled body, settles the
|
|
@@ -321,6 +377,17 @@ export declare class LlEmitter {
|
|
|
321
377
|
* emission initializes undefined-admitting fields through it
|
|
322
378
|
* (ClassHost). */
|
|
323
379
|
unitInstanceRef(unionId: string, tag: number): string;
|
|
380
|
+
/** The immortal ABSENT state of an undefined-armed record field slot
|
|
381
|
+
* (IR fieldAbsent). */
|
|
382
|
+
absentInstanceRef(unionId: string): string;
|
|
383
|
+
/** i1: a union value loaded from a field slot is the ABSENT state — the
|
|
384
|
+
* undefined arm's tag with the absent payload marker. */
|
|
385
|
+
fieldAbsentTest(value: string, unionId: string): string;
|
|
386
|
+
/** Loads a record field slot as a VALUE: an undefined-armed union slot
|
|
387
|
+
* holding the ABSENT state surfaces as the ordinary undefined arm, so
|
|
388
|
+
* absence never travels beyond its slot (a later `{ f: r.f }` is an
|
|
389
|
+
* explicit, present property). */
|
|
390
|
+
loadRecordField(ptr: string, t: IrType): string;
|
|
324
391
|
declare(decl: string): void;
|
|
325
392
|
needOom(): void;
|
|
326
393
|
private currentFrame;
|
|
@@ -386,9 +453,14 @@ export declare class LlEmitter {
|
|
|
386
453
|
* reads can group equivalent storage prefixes and emit one representative. */
|
|
387
454
|
unionTagSwitch(uName: string, def: IrUnionDef, arm: (armType: IrType, tag: number) => void, fieldGroups?: number[][]): void;
|
|
388
455
|
/** The +1 extraction of a union's single narrowed arm (unionNarrow /
|
|
389
|
-
* the nullish-family reads): scalars via
|
|
456
|
+
* the nullish-family reads): scalars via inline payload loads, ref arms
|
|
390
457
|
* a retained peek. */
|
|
391
458
|
unionExtract(uName: string, arm: IrType): string;
|
|
459
|
+
/** A scalar f64 arm's payload (scr_union_get_f64 inlined). Inline loads
|
|
460
|
+
* keep stack boxes free of escaping calls, so LLVM can scalarize them. */
|
|
461
|
+
unionGetF64(uName: string): string;
|
|
462
|
+
/** A bool arm's payload (scr_union_get_bool inlined: nonzero slot). */
|
|
463
|
+
unionGetBool(uName: string): string;
|
|
392
464
|
/** Constructs a union box around an OWNED (+1, already moved) value —
|
|
393
465
|
* the scr_union_new_* dispatch of unionWrap and the wrap-into-join
|
|
394
466
|
* sites (shift). */
|
|
@@ -436,9 +508,15 @@ export declare class LlEmitter {
|
|
|
436
508
|
private emitDebugLocal;
|
|
437
509
|
/** Loads a boxed binding's box pointer out of its slot. */
|
|
438
510
|
loadBox(slot: string): string;
|
|
511
|
+
/** The payload slot of a capture box (ScrBox.slot, field 5). */
|
|
512
|
+
private boxSlot;
|
|
439
513
|
boxGet(box: string, t: IrType): string;
|
|
440
514
|
/** scr_box_set_* — the ref form takes ownership of the passed value. */
|
|
441
515
|
boxSet(box: string, t: IrType, value: string): void;
|
|
516
|
+
/** The box a new environment captures for `localId` (borrowed). An
|
|
517
|
+
* unchanged parameter gets one box on first capture, holding its own
|
|
518
|
+
* reference to the value; the function scope releases the cached box. */
|
|
519
|
+
captureBox(localId: string): string;
|
|
442
520
|
retainBox(box: string): string;
|
|
443
521
|
/** The initializing write of a scalar TDZ box: mint the one-element
|
|
444
522
|
* array cell holding the value and move it into the ARR-kind box
|
|
@@ -450,6 +528,8 @@ export declare class LlEmitter {
|
|
|
450
528
|
* array cell; ref kinds read the box normally (+1). */
|
|
451
529
|
private checkTdz;
|
|
452
530
|
checkGlobalTdz(id: string): void;
|
|
531
|
+
/** Throws the TDZ ReferenceError for `name` unless the i1 `flag` is set. */
|
|
532
|
+
checkInitializedFlag(flag: string, name: string): void;
|
|
453
533
|
private throwIfUninitialized;
|
|
454
534
|
tdzBoxRead(box: string, t: IrType, name: string): string;
|
|
455
535
|
/** Declaration stores initialize an empty TDZ box. Later stores check
|
|
@@ -546,7 +626,7 @@ export declare class LlEmitter {
|
|
|
546
626
|
emitStringSelfConcatAssign(localId: string, left: IrExpr, suffix: IrExpr, retainForYield: boolean): LlValue;
|
|
547
627
|
emitContainerExpr(e: ExprOf<"arrayLit" | "arrayNewLen" | "arrayGet" | "arrayHas" | "arrayState" | "arrIntrinsic" | "bytesNew" | "bytesIntrinsic" | "mapNew" | "mapIntrinsic" | "setIntrinsic" | "setNew">): LlValue;
|
|
548
628
|
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;
|
|
629
|
+
emitRecordExpr(e: ExprOf<"fieldGet" | "recordGet" | "recordLit" | "recordClone" | "recordKeyGet" | "recordOvfKeys" | "recordOvfHas" | "recordHas" | "fieldAbsent">): LlValue;
|
|
550
630
|
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
631
|
emitIntrinsicExpr(e: ExprOf<"intrinsic">): LlValue;
|
|
552
632
|
emitSerializationExpr(e: ExprOf<"jsonStringify" | "dynCheck">): LlValue;
|
|
@@ -558,6 +638,46 @@ export declare class LlEmitter {
|
|
|
558
638
|
* their ordinary statement-frame ownership. The caller must retain any
|
|
559
639
|
* reference result before evaluating another expression. */
|
|
560
640
|
emitReadReceiver(e: IrExpr): LlValue;
|
|
641
|
+
/** A private stack union source with an independently owned payload. */
|
|
642
|
+
canStackReceiver(e: IrExpr): boolean;
|
|
643
|
+
/** True for union sources that emitReadReceiver can produce as a private
|
|
644
|
+
* stack box with an independently owned payload (no heap union). */
|
|
645
|
+
isStackUnionSource(e: IrExpr): boolean;
|
|
646
|
+
/** The nullable-pointer representation behind a union-typed class field
|
|
647
|
+
* read, or null for every other expression. */
|
|
648
|
+
nullableFieldGet(e: IrExpr): NullableRefField | null;
|
|
649
|
+
/** A union operand consumed only by a projection (tag test, payload
|
|
650
|
+
* extraction, arm compare, truthiness). A nullable-pointer field read
|
|
651
|
+
* becomes a private stack box whose payload is borrowed from the field:
|
|
652
|
+
* the consumer must finish before any later expression can store to the
|
|
653
|
+
* field, and must never retain, release, or store the box. Every other
|
|
654
|
+
* operand takes the ordinary borrowed-receiver path. */
|
|
655
|
+
emitUnionProjection(e: IrExpr): LlValue;
|
|
656
|
+
/** A private stack box over a nullable-pointer field read whose payload
|
|
657
|
+
* is retained into the current frame: an independent owner, so the box
|
|
658
|
+
* may outlive later stores to the field (call arguments, local copies).
|
|
659
|
+
* The box itself must still never reach an RC entry point. */
|
|
660
|
+
emitOwnedNullableStack(e: IrExpr): {
|
|
661
|
+
box: string;
|
|
662
|
+
owner: LlValue;
|
|
663
|
+
};
|
|
664
|
+
/** A private stack box over a borrowed nullable pointer. */
|
|
665
|
+
stackNullableBox(p: string, nullable: NullableRefField): string;
|
|
666
|
+
/** The owned (+1) union value of a nullable-pointer slot: the unit arm's
|
|
667
|
+
* immortal instance, or a fresh heap box around a retained instance. */
|
|
668
|
+
nullableToOwnedUnion(p: string, nullable: NullableRefField): string;
|
|
669
|
+
/** The owned (+1) instance pointer (NULL for the unit arm) of a union
|
|
670
|
+
* box, which stays owned by its existing owner. */
|
|
671
|
+
unionToNullable(u: string, nullable: NullableRefField): string;
|
|
672
|
+
/** `obj.f = value` for a nullable-pointer field: the new instance pointer
|
|
673
|
+
* is produced without a union box where the value is a wrap, and as a
|
|
674
|
+
* retained payload of a borrowed box otherwise. Unlink-then-release like
|
|
675
|
+
* every field store. */
|
|
676
|
+
emitNullableFieldStore(obj: string, className: string, field: string, nullable: NullableRefField, value: IrExpr): void;
|
|
677
|
+
/** A union binding whose slot may hold a private stack box: stack locals
|
|
678
|
+
* and projection-only parameters (callers may pass stack boxes). Such a
|
|
679
|
+
* box must only be projected: never retained, released, or stored. */
|
|
680
|
+
isStackUnionLocal(localId: string): boolean;
|
|
561
681
|
canBorrowReceiver(e: IrExpr): boolean;
|
|
562
682
|
materializeSplitLocal(localId: string): void;
|
|
563
683
|
emitExpr(e: IrExpr): LlValue;
|