@scriptc/compiler 0.3.0 → 0.3.2
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 +346 -17
- package/dist/backend/executable-features.js +1 -0
- package/dist/backend/executable-features.js.map +1 -1
- package/dist/backend/literals.d.ts +7 -0
- package/dist/backend/literals.js +32 -0
- package/dist/backend/literals.js.map +1 -1
- package/dist/backend/literals.test.js +17 -1
- package/dist/backend/literals.test.js.map +1 -1
- package/dist/backend/llvm/alloc.d.ts +15 -4
- package/dist/backend/llvm/alloc.js +39 -15
- package/dist/backend/llvm/alloc.js.map +1 -1
- package/dist/backend/llvm/alloc.test.js +15 -1
- package/dist/backend/llvm/alloc.test.js.map +1 -1
- package/dist/backend/llvm/appended-array-literals.d.ts +2 -0
- package/dist/backend/llvm/appended-array-literals.js +109 -0
- package/dist/backend/llvm/appended-array-literals.js.map +1 -0
- package/dist/backend/llvm/appended-array-literals.test.d.ts +1 -0
- package/dist/backend/llvm/appended-array-literals.test.js +90 -0
- package/dist/backend/llvm/appended-array-literals.test.js.map +1 -0
- package/dist/backend/llvm/bigint-wrap.d.ts +4 -0
- package/dist/backend/llvm/bigint-wrap.js +590 -0
- package/dist/backend/llvm/bigint-wrap.js.map +1 -0
- package/dist/backend/llvm/blocks.d.ts +2 -0
- package/dist/backend/llvm/blocks.js +4 -0
- package/dist/backend/llvm/blocks.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.d.ts +4 -1
- package/dist/backend/llvm/call-lifetimes.js +66 -7
- package/dist/backend/llvm/call-lifetimes.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.test.js +14 -3
- package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/checked-narrows.test.js +1 -1
- package/dist/backend/llvm/checked-narrows.test.js.map +1 -1
- package/dist/backend/llvm/classes.js +67 -14
- package/dist/backend/llvm/classes.js.map +1 -1
- package/dist/backend/llvm/classes.test.js +6 -6
- package/dist/backend/llvm/classes.test.js.map +1 -1
- package/dist/backend/llvm/common.d.ts +7 -5
- package/dist/backend/llvm/common.js +7 -5
- package/dist/backend/llvm/common.js.map +1 -1
- package/dist/backend/llvm/constant-callbacks.js +10 -28
- package/dist/backend/llvm/constant-callbacks.js.map +1 -1
- package/dist/backend/llvm/dense-array-access.js +146 -53
- package/dist/backend/llvm/dense-array-access.js.map +1 -1
- package/dist/backend/llvm/dense-array-access.test.js +68 -3
- package/dist/backend/llvm/dense-array-access.test.js.map +1 -1
- package/dist/backend/llvm/dyn.d.ts +4 -0
- package/dist/backend/llvm/dyn.js +15 -2
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.d.ts +163 -8
- package/dist/backend/llvm/emitter.js +973 -100
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.test.js +14 -7
- package/dist/backend/llvm/emitter.test.js.map +1 -1
- package/dist/backend/llvm/expr-async.js +242 -49
- package/dist/backend/llvm/expr-async.js.map +1 -1
- package/dist/backend/llvm/expr-async.test.js +1 -1
- package/dist/backend/llvm/expr-async.test.js.map +1 -1
- package/dist/backend/llvm/expr-bytes.js +51 -36
- package/dist/backend/llvm/expr-bytes.js.map +1 -1
- package/dist/backend/llvm/expr-callbacks.d.ts +8 -0
- package/dist/backend/llvm/expr-callbacks.js +153 -4
- package/dist/backend/llvm/expr-callbacks.js.map +1 -1
- package/dist/backend/llvm/expr-calls.d.ts +12 -1
- package/dist/backend/llvm/expr-calls.js +279 -78
- package/dist/backend/llvm/expr-calls.js.map +1 -1
- package/dist/backend/llvm/expr-calls.test.d.ts +1 -0
- package/dist/backend/llvm/expr-calls.test.js +132 -0
- package/dist/backend/llvm/expr-calls.test.js.map +1 -0
- package/dist/backend/llvm/expr-containers.d.ts +7 -0
- package/dist/backend/llvm/expr-containers.js +49 -5
- package/dist/backend/llvm/expr-containers.js.map +1 -1
- package/dist/backend/llvm/expr-context.d.ts +4 -0
- package/dist/backend/llvm/expr-control.d.ts +8 -0
- package/dist/backend/llvm/expr-control.js +103 -69
- package/dist/backend/llvm/expr-control.js.map +1 -1
- package/dist/backend/llvm/expr-dispatch.js +3 -0
- package/dist/backend/llvm/expr-dispatch.js.map +1 -1
- package/dist/backend/llvm/expr-dynamic.js +28 -6
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.d.ts +14 -0
- package/dist/backend/llvm/expr-primitives.js +110 -48
- package/dist/backend/llvm/expr-primitives.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.test.js +95 -5
- package/dist/backend/llvm/expr-primitives.test.js.map +1 -1
- package/dist/backend/llvm/expr-records.d.ts +9 -0
- package/dist/backend/llvm/expr-records.js +144 -16
- package/dist/backend/llvm/expr-records.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.d.ts +9 -1
- package/dist/backend/llvm/expr-stream-bridges.js +152 -4
- package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.test.js +98 -1
- package/dist/backend/llvm/expr-stream-bridges.test.js.map +1 -1
- package/dist/backend/llvm/int32-abi.d.ts +47 -0
- package/dist/backend/llvm/int32-abi.js +83 -0
- package/dist/backend/llvm/int32-abi.js.map +1 -0
- package/dist/backend/llvm/int32-abi.test.d.ts +1 -0
- package/dist/backend/llvm/int32-abi.test.js +181 -0
- package/dist/backend/llvm/int32-abi.test.js.map +1 -0
- package/dist/backend/llvm/int32-locals.d.ts +30 -0
- package/dist/backend/llvm/int32-locals.js +95 -0
- package/dist/backend/llvm/int32-locals.js.map +1 -0
- package/dist/backend/llvm/integer-values.d.ts +4 -0
- package/dist/backend/llvm/integer-values.js +30 -1
- package/dist/backend/llvm/integer-values.js.map +1 -1
- package/dist/backend/llvm/integer-views.d.ts +8 -1
- package/dist/backend/llvm/integer-views.js +47 -2
- package/dist/backend/llvm/integer-views.js.map +1 -1
- package/dist/backend/llvm/lazy-captures.d.ts +16 -0
- package/dist/backend/llvm/lazy-captures.js +88 -2
- package/dist/backend/llvm/lazy-captures.js.map +1 -1
- package/dist/backend/llvm/lazy-captures.test.js +48 -0
- package/dist/backend/llvm/lazy-captures.test.js.map +1 -1
- package/dist/backend/llvm/lib-dispatch.js +21 -0
- package/dist/backend/llvm/lib-dispatch.js.map +1 -1
- package/dist/backend/llvm/lib-filesystem.js +61 -0
- package/dist/backend/llvm/lib-filesystem.js.map +1 -1
- package/dist/backend/llvm/lib-shared.js +83 -9
- package/dist/backend/llvm/lib-shared.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.js +26 -5
- package/dist/backend/llvm/local-array-reads.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.test.js +3 -2
- package/dist/backend/llvm/local-array-reads.test.js.map +1 -1
- package/dist/backend/llvm/local-union-storage.d.ts +24 -2
- package/dist/backend/llvm/local-union-storage.js +127 -12
- package/dist/backend/llvm/local-union-storage.js.map +1 -1
- package/dist/backend/llvm/local-union-storage.test.js +108 -3
- package/dist/backend/llvm/local-union-storage.test.js.map +1 -1
- package/dist/backend/llvm/map-read-lifetimes.test.js +2 -2
- package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/record-results.d.ts +26 -0
- package/dist/backend/llvm/record-results.js +252 -0
- package/dist/backend/llvm/record-results.js.map +1 -0
- package/dist/backend/llvm/reference-effects.js +4 -0
- package/dist/backend/llvm/reference-effects.js.map +1 -1
- package/dist/backend/llvm/reference-writes.d.ts +3 -0
- package/dist/backend/llvm/reference-writes.js +25 -11
- package/dist/backend/llvm/reference-writes.js.map +1 -1
- package/dist/backend/llvm/regex-matchers.d.ts +39 -0
- package/dist/backend/llvm/regex-matchers.js +1649 -0
- package/dist/backend/llvm/regex-matchers.js.map +1 -0
- package/dist/backend/llvm/regex-matchers.test.d.ts +1 -0
- package/dist/backend/llvm/regex-matchers.test.js +96 -0
- package/dist/backend/llvm/regex-matchers.test.js.map +1 -0
- package/dist/backend/llvm/regions.d.ts +67 -0
- package/dist/backend/llvm/regions.js +309 -0
- package/dist/backend/llvm/regions.js.map +1 -0
- package/dist/backend/llvm/regions.test.d.ts +1 -0
- package/dist/backend/llvm/regions.test.js +173 -0
- package/dist/backend/llvm/regions.test.js.map +1 -0
- package/dist/backend/llvm/shapes.d.ts +70 -8
- package/dist/backend/llvm/shapes.js +157 -29
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/shapes.test.js +7 -6
- package/dist/backend/llvm/shapes.test.js.map +1 -1
- package/dist/backend/llvm/split-loops.js +1 -1
- package/dist/backend/llvm/split-loops.js.map +1 -1
- package/dist/backend/llvm/stack-objects.d.ts +29 -0
- package/dist/backend/llvm/stack-objects.js +130 -0
- package/dist/backend/llvm/stack-objects.js.map +1 -0
- package/dist/backend/llvm/stack-objects.test.d.ts +1 -0
- package/dist/backend/llvm/stack-objects.test.js +252 -0
- package/dist/backend/llvm/stack-objects.test.js.map +1 -0
- package/dist/backend/llvm/stack-unions.test.js +1 -1
- package/dist/backend/llvm/stack-unions.test.js.map +1 -1
- package/dist/backend/llvm/string-construction.test.js +2 -2
- package/dist/backend/llvm/string-construction.test.js.map +1 -1
- package/dist/backend/llvm/string-lifetimes.test.js +5 -5
- package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/string-literal-equality.d.ts +22 -0
- package/dist/backend/llvm/string-literal-equality.js +78 -0
- package/dist/backend/llvm/string-literal-equality.js.map +1 -0
- package/dist/backend/llvm/string-reads.d.ts +4 -1
- package/dist/backend/llvm/string-reads.js +89 -9
- package/dist/backend/llvm/string-reads.js.map +1 -1
- package/dist/backend/llvm/switch-dispatch.js +60 -13
- package/dist/backend/llvm/switch-dispatch.js.map +1 -1
- package/dist/backend/llvm/switch-dispatch.test.js +71 -6
- package/dist/backend/llvm/switch-dispatch.test.js.map +1 -1
- package/dist/backend/llvm/union-retype.test.d.ts +1 -0
- package/dist/backend/llvm/union-retype.test.js +229 -0
- package/dist/backend/llvm/union-retype.test.js.map +1 -0
- package/dist/backend/llvm/walkers.d.ts +2 -0
- package/dist/backend/llvm/walkers.js +4 -2
- package/dist/backend/llvm/walkers.js.map +1 -1
- package/dist/backend/llvm/wrapping-sums.d.ts +17 -0
- package/dist/backend/llvm/wrapping-sums.js +113 -0
- package/dist/backend/llvm/wrapping-sums.js.map +1 -0
- package/dist/backend/loop-polls.js +1 -0
- package/dist/backend/loop-polls.js.map +1 -1
- package/dist/backend/mangle.d.ts +9 -0
- package/dist/backend/mangle.js +15 -0
- package/dist/backend/mangle.js.map +1 -1
- package/dist/backend/may-throw.js +7 -3
- package/dist/backend/may-throw.js.map +1 -1
- package/dist/backend/native/contracts.d.ts +5 -0
- package/dist/backend/native/executable.js +16 -1
- package/dist/backend/native/executable.js.map +1 -1
- package/dist/backend/native/library.js +1 -1
- package/dist/backend/native/library.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-link-info-core.d.ts +1 -0
- package/dist/backend/native-link-info-core.js.map +1 -1
- 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 +1 -0
- package/dist/backend/runtime-pack-core.js +1 -0
- package/dist/backend/runtime-pack-core.js.map +1 -1
- package/dist/backend/runtime-pack-targets.test.js +1 -1
- package/dist/backend/runtime-pack.test.js +1 -1
- package/dist/backend/target-diagnostics.js +14 -0
- package/dist/backend/target-diagnostics.js.map +1 -1
- package/dist/backend/target-diagnostics.test.js +13 -0
- package/dist/backend/target-diagnostics.test.js.map +1 -1
- package/dist/contracts/check.js +4 -0
- package/dist/contracts/check.js.map +1 -1
- package/dist/executable/executable-cache.d.ts +1 -0
- package/dist/executable/executable-cache.js.map +1 -1
- package/dist/frontend/experimental-import.d.ts +12 -0
- package/dist/frontend/experimental-import.js +63 -0
- package/dist/frontend/experimental-import.js.map +1 -0
- package/dist/frontend/lowering/array-values.d.ts +14 -0
- package/dist/frontend/lowering/array-values.js +29 -0
- package/dist/frontend/lowering/array-values.js.map +1 -1
- package/dist/frontend/lowering/builtin-calls.d.ts +6 -1
- package/dist/frontend/lowering/builtin-calls.js +36 -0
- package/dist/frontend/lowering/builtin-calls.js.map +1 -1
- package/dist/frontend/lowering/builtins/console.d.ts +16 -6
- package/dist/frontend/lowering/builtins/console.js +33 -9
- package/dist/frontend/lowering/builtins/console.js.map +1 -1
- package/dist/frontend/lowering/builtins/errors.js +20 -0
- package/dist/frontend/lowering/builtins/errors.js.map +1 -1
- package/dist/frontend/lowering/builtins/json.d.ts +2 -2
- package/dist/frontend/lowering/builtins/json.js +13 -4
- package/dist/frontend/lowering/builtins/json.js.map +1 -1
- package/dist/frontend/lowering/builtins/module-calls.js +16 -1
- package/dist/frontend/lowering/builtins/module-calls.js.map +1 -1
- package/dist/frontend/lowering/builtins/numbers.d.ts +1 -0
- package/dist/frontend/lowering/builtins/numbers.js +17 -0
- package/dist/frontend/lowering/builtins/numbers.js.map +1 -1
- package/dist/frontend/lowering/builtins/operating-system.d.ts +18 -0
- package/dist/frontend/lowering/builtins/operating-system.js +361 -1
- package/dist/frontend/lowering/builtins/operating-system.js.map +1 -1
- package/dist/frontend/lowering/builtins/process.js +15 -3
- package/dist/frontend/lowering/builtins/process.js.map +1 -1
- package/dist/frontend/lowering/builtins/promises.js +109 -2
- package/dist/frontend/lowering/builtins/promises.js.map +1 -1
- package/dist/frontend/lowering/builtins/text-codecs.d.ts +3 -4
- package/dist/frontend/lowering/builtins/text-codecs.js +3 -4
- package/dist/frontend/lowering/builtins/text-codecs.js.map +1 -1
- package/dist/frontend/lowering/checked-promise-all.d.ts +10 -3
- package/dist/frontend/lowering/checked-promise-all.js +52 -6
- package/dist/frontend/lowering/checked-promise-all.js.map +1 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +6 -3
- package/dist/frontend/lowering/class-dynamic-dispatch.js +54 -31
- package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
- package/dist/frontend/lowering/containers/array-callbacks.js +74 -4
- package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -1
- package/dist/frontend/lowering/containers/array-construction.js +8 -4
- package/dist/frontend/lowering/containers/array-construction.js.map +1 -1
- package/dist/frontend/lowering/containers/array-pipelines.d.ts +54 -0
- package/dist/frontend/lowering/containers/array-pipelines.js +1827 -0
- package/dist/frontend/lowering/containers/array-pipelines.js.map +1 -0
- package/dist/frontend/lowering/containers/exec-result-uses.d.ts +10 -0
- package/dist/frontend/lowering/containers/exec-result-uses.js +88 -0
- package/dist/frontend/lowering/containers/exec-result-uses.js.map +1 -0
- package/dist/frontend/lowering/containers/string-and-regexp.js +106 -7
- package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
- package/dist/frontend/lowering/containers/string-replacement.d.ts +2 -1
- package/dist/frontend/lowering/containers/string-replacement.js +32 -136
- package/dist/frontend/lowering/containers/string-replacement.js.map +1 -1
- package/dist/frontend/lowering/cycle-initialization.d.ts +18 -2
- package/dist/frontend/lowering/cycle-initialization.js +166 -12
- package/dist/frontend/lowering/cycle-initialization.js.map +1 -1
- package/dist/frontend/lowering/deferred-module-initializers.js +7 -2
- package/dist/frontend/lowering/deferred-module-initializers.js.map +1 -1
- package/dist/frontend/lowering/deferred-module-initializers.test.js +28 -0
- package/dist/frontend/lowering/deferred-module-initializers.test.js.map +1 -1
- package/dist/frontend/lowering/devirtualize.d.ts +33 -0
- package/dist/frontend/lowering/devirtualize.js +199 -0
- package/dist/frontend/lowering/devirtualize.js.map +1 -0
- package/dist/frontend/lowering/expressions/nullish-assignment.js +55 -7
- package/dist/frontend/lowering/expressions/nullish-assignment.js.map +1 -1
- package/dist/frontend/lowering/expressions/object-literals.js +5 -56
- package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
- package/dist/frontend/lowering/generator-delegation.d.ts +8 -0
- package/dist/frontend/lowering/generator-delegation.js +231 -10
- package/dist/frontend/lowering/generator-delegation.js.map +1 -1
- package/dist/frontend/lowering/identifier-uses.d.ts +7 -0
- package/dist/frontend/lowering/identifier-uses.js +23 -0
- package/dist/frontend/lowering/identifier-uses.js.map +1 -0
- package/dist/frontend/lowering/iterator-adapters.js +51 -3
- package/dist/frontend/lowering/iterator-adapters.js.map +1 -1
- package/dist/frontend/lowering/lifetime-regions.d.ts +11 -0
- package/dist/frontend/lowering/lifetime-regions.js +216 -0
- package/dist/frontend/lowering/lifetime-regions.js.map +1 -0
- package/dist/frontend/lowering/lower-array-sort.d.ts +28 -2
- package/dist/frontend/lowering/lower-array-sort.js +112 -2
- package/dist/frontend/lowering/lower-array-sort.js.map +1 -1
- package/dist/frontend/lowering/lower-array-sort.test.js +99 -2
- package/dist/frontend/lowering/lower-array-sort.test.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.js +135 -131
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.d.ts +4 -3
- package/dist/frontend/lowering/lower-classes.js +117 -13
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-console.d.ts +27 -0
- package/dist/frontend/lowering/lower-console.js +651 -0
- package/dist/frontend/lowering/lower-console.js.map +1 -0
- package/dist/frontend/lowering/lower-event-emitter.d.ts +6 -0
- package/dist/frontend/lowering/lower-event-emitter.js +124 -38
- package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.js +272 -25
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-functions.js +7 -3
- package/dist/frontend/lowering/lower-functions.js.map +1 -1
- package/dist/frontend/lowering/lower-generators.d.ts +25 -7
- package/dist/frontend/lowering/lower-generators.js +264 -113
- package/dist/frontend/lowering/lower-generators.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.d.ts +8 -1
- package/dist/frontend/lowering/lower-inspect.js +119 -18
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.js +24 -14
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-stdlib.d.ts +4 -0
- package/dist/frontend/lowering/lower-stdlib.js +35 -1
- package/dist/frontend/lowering/lower-stdlib.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +66 -11
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lower-stream.js +13 -10
- package/dist/frontend/lowering/lower-stream.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +47 -5
- package/dist/frontend/lowering/lowerer.js +235 -54
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/nan-coded-reads.d.ts +16 -0
- package/dist/frontend/lowering/nan-coded-reads.js +108 -1
- package/dist/frontend/lowering/nan-coded-reads.js.map +1 -1
- package/dist/frontend/lowering/regex-span-reads.d.ts +12 -0
- package/dist/frontend/lowering/regex-span-reads.js +164 -0
- package/dist/frontend/lowering/regex-span-reads.js.map +1 -0
- package/dist/frontend/lowering/runtime-optional-bounds.d.ts +4 -0
- package/dist/frontend/lowering/runtime-optional-bounds.js +2 -0
- package/dist/frontend/lowering/runtime-optional-bounds.js.map +1 -1
- package/dist/frontend/lowering/runtime-optional-bounds.test.js +27 -0
- package/dist/frontend/lowering/runtime-optional-bounds.test.js.map +1 -1
- package/dist/frontend/lowering/split-consumers.js +2 -18
- package/dist/frontend/lowering/split-consumers.js.map +1 -1
- package/dist/frontend/lowering/surfaces.js +115 -18
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/lowering/union-retag.d.ts +6 -1
- package/dist/frontend/lowering/union-retag.js +64 -1
- package/dist/frontend/lowering/union-retag.js.map +1 -1
- package/dist/frontend/lowering/union-retag.test.js +46 -0
- package/dist/frontend/lowering/union-retag.test.js.map +1 -1
- package/dist/frontend/lowering/var-hoisting.d.ts +3 -0
- package/dist/frontend/lowering/var-hoisting.js +261 -0
- package/dist/frontend/lowering/var-hoisting.js.map +1 -0
- package/dist/frontend/pipeline.js +5 -3
- package/dist/frontend/pipeline.js.map +1 -1
- package/dist/frontend/program.d.ts +3 -2
- package/dist/frontend/program.js +23 -5
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/program.test.js +13 -0
- package/dist/frontend/program.test.js.map +1 -1
- package/dist/frontend/type-mapper.d.ts +13 -1
- package/dist/frontend/type-mapper.js +160 -14
- package/dist/frontend/type-mapper.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ir/builtin-effects.js +31 -2
- package/dist/ir/builtin-effects.js.map +1 -1
- package/dist/ir/builtin-signatures.d.ts +1 -1
- package/dist/ir/builtin-signatures.js +157 -16
- package/dist/ir/builtin-signatures.js.map +1 -1
- package/dist/ir/function-references.d.ts +12 -0
- package/dist/ir/function-references.js +29 -0
- package/dist/ir/function-references.js.map +1 -0
- package/dist/ir/function-references.test.d.ts +1 -0
- package/dist/ir/function-references.test.js +277 -0
- package/dist/ir/function-references.test.js.map +1 -0
- package/dist/ir/int32-slots.d.ts +7 -4
- package/dist/ir/int32-slots.js +215 -49
- package/dist/ir/int32-slots.js.map +1 -1
- package/dist/ir/int32-slots.test.js +38 -1
- package/dist/ir/int32-slots.test.js.map +1 -1
- package/dist/ir/integer-ranges.d.ts +4 -4
- package/dist/ir/integer-ranges.js +89 -64
- package/dist/ir/integer-ranges.js.map +1 -1
- package/dist/ir/integer-ranges.test.js +71 -9
- package/dist/ir/integer-ranges.test.js.map +1 -1
- package/dist/ir/intrinsic-signatures.js +3 -0
- package/dist/ir/intrinsic-signatures.js.map +1 -1
- package/dist/ir/ir.d.ts +111 -20
- package/dist/ir/ir.js +6 -0
- package/dist/ir/ir.js.map +1 -1
- package/dist/ir/runtime-features.d.ts +1 -0
- package/dist/ir/runtime-features.js +38 -3
- package/dist/ir/runtime-features.js.map +1 -1
- package/dist/ir/scalar-records.js +1 -2
- package/dist/ir/scalar-records.js.map +1 -1
- package/dist/ir/traverse.js +4 -0
- package/dist/ir/traverse.js.map +1 -1
- package/dist/ir/validate.js +201 -25
- package/dist/ir/validate.js.map +1 -1
- package/dist/ir/validate.test.js +90 -7
- package/dist/ir/validate.test.js.map +1 -1
- package/dist/library/ir-policy.js +1 -0
- package/dist/library/ir-policy.js.map +1 -1
- package/dist/native/sanitizer.test.js +1 -0
- package/dist/native/sanitizer.test.js.map +1 -1
- package/package.json +20 -20
- package/surface-manifest.json +159 -17
|
@@ -2,9 +2,12 @@ import type { IrBytesElem, IrExpr, IrFfiImport, IrFunction, IrLocal, IrModule, I
|
|
|
2
2
|
import { type SplitSpan } from "./split-loops.js";
|
|
3
3
|
import { type IntegerRanges } from "../../ir/integer-ranges.js";
|
|
4
4
|
import { type Int32Slots } from "../../ir/int32-slots.js";
|
|
5
|
+
import { type Int32Abi } from "./int32-abi.js";
|
|
6
|
+
import { type Int32Local } from "./int32-locals.js";
|
|
5
7
|
import { type ConstantNumericTable } from "../../ir/constant-tables.js";
|
|
6
8
|
import { type FfiCallbackAdapter } from "../ffi-callbacks.js";
|
|
7
9
|
import { type CallLifetimes } from "./call-lifetimes.js";
|
|
10
|
+
import { type UnionSources } from "./local-union-storage.js";
|
|
8
11
|
import { BlockBuilder } from "./blocks.js";
|
|
9
12
|
import { NullableRefFields, type NullableRefField } from "./nullable-fields.js";
|
|
10
13
|
import { OptionalArrayReads, type LocalArrayRead } from "./local-array-reads.js";
|
|
@@ -61,6 +64,10 @@ export declare class LlEmitter {
|
|
|
61
64
|
private scalarStringSlices;
|
|
62
65
|
readonly stringSlices: Map<string, StringSliceSnapshot>;
|
|
63
66
|
private localStackUnions;
|
|
67
|
+
private localStackObjects;
|
|
68
|
+
private reassignedStackObjects;
|
|
69
|
+
/** The binding slot of each reassigned stack-object local. */
|
|
70
|
+
private stackObjectSlots;
|
|
64
71
|
private localUnionStorageProofs;
|
|
65
72
|
private localUnionStorage;
|
|
66
73
|
integerArrayBindings: Set<string>;
|
|
@@ -72,17 +79,30 @@ export declare class LlEmitter {
|
|
|
72
79
|
* operations and record views conservatively alias all of them. */
|
|
73
80
|
private markFieldPointer;
|
|
74
81
|
markMemoryPointer(ptr: string, field: string): void;
|
|
82
|
+
/** The alias tag of a runtime word that emitted code reads and writes
|
|
83
|
+
* outside every field (the lifetime-region count, owner and cursors). */
|
|
84
|
+
memoryAliasAttachment(category: string): string;
|
|
75
85
|
fieldAliasAttachment(ptr: string): string;
|
|
76
86
|
private fieldAliasMetadata;
|
|
77
87
|
private readonly debug;
|
|
88
|
+
/** Projection-only scalar objects may live in frame storage (stack-objects.ts). */
|
|
89
|
+
readonly stackObjects: boolean;
|
|
78
90
|
private debugScope;
|
|
79
91
|
readonly sizeType: "i32" | "i64";
|
|
80
92
|
readonly ffiExtendNarrowIntegers: boolean;
|
|
81
|
-
readonly
|
|
93
|
+
readonly cycleBufOffset: number;
|
|
82
94
|
/** Emitted ScrCycType descriptors so far (their collector statistics
|
|
83
95
|
* indices; see ShapeHost.nextCycKind). */
|
|
84
96
|
private cycKinds;
|
|
85
97
|
readonly wasi: boolean;
|
|
98
|
+
/** Synchronous generator bodies compile to LLVM switched coroutines (a
|
|
99
|
+
* heap frame resumed by an ordinary call) instead of running on a fiber
|
|
100
|
+
* stack. Worker programs keep fibers (context shutdown unwinds suspended
|
|
101
|
+
* generator stacks) and so do debug builds (the debugger reads locals
|
|
102
|
+
* from the native frame). */
|
|
103
|
+
private stacklessGenerators;
|
|
104
|
+
/** Some function in the module is lowered as a coroutine. */
|
|
105
|
+
private usesCoroutines;
|
|
86
106
|
/** The target lacks a rounding instruction at its baseline CPU (x86-64
|
|
87
107
|
* before SSE4.1), so `llvm.trunc` would lower to a libm call: emit
|
|
88
108
|
* truncation inline through an integer round trip instead. */
|
|
@@ -102,6 +122,10 @@ export declare class LlEmitter {
|
|
|
102
122
|
/** Interned string literals: UTF-8 text → { symbol, byte length } —
|
|
103
123
|
* first-use order, the runtime ABI’s determinism discipline. */
|
|
104
124
|
private readonly literals;
|
|
125
|
+
/** Literal equality helpers: literal text → helper symbol (literalEquals). */
|
|
126
|
+
private readonly literalEqualities;
|
|
127
|
+
/** Interned bigint literals: hex magnitude with sign → { symbol, value }. */
|
|
128
|
+
private readonly bigintLiterals;
|
|
105
129
|
/** Symbols of interned constant data, named by content (contentSymbol). */
|
|
106
130
|
private readonly contentSymbols;
|
|
107
131
|
/** Interned unit-armed union instances: "unionId:tag" → symbol — one
|
|
@@ -110,6 +134,10 @@ export declare class LlEmitter {
|
|
|
110
134
|
private readonly unitInstances;
|
|
111
135
|
/** unionId → symbol of the union's immortal ABSENT field-slot instance. */
|
|
112
136
|
private readonly absentInstances;
|
|
137
|
+
/** unionId → symbol of a flag set once a checked-dynamic cast caches one
|
|
138
|
+
* of the union's boxes. A cached box is refreshed in place, possibly with
|
|
139
|
+
* a tag that another union numbers apart, so it is never shared. */
|
|
140
|
+
private readonly retypeGuards;
|
|
113
141
|
/** The nullable-union ABSENT sentinel was referenced (absentInstanceRef). */
|
|
114
142
|
private needsNullableAbsent;
|
|
115
143
|
private readonly immortalValues;
|
|
@@ -122,6 +150,8 @@ export declare class LlEmitter {
|
|
|
122
150
|
sym: string;
|
|
123
151
|
src: string;
|
|
124
152
|
fl: string;
|
|
153
|
+
pattern: string;
|
|
154
|
+
flags: string;
|
|
125
155
|
}>;
|
|
126
156
|
/** Interned tagged-template strings objects: per-site key → { symbol,
|
|
127
157
|
* interned cooked-literal refs }. One immortal ScrArr of string slots
|
|
@@ -156,6 +186,8 @@ export declare class LlEmitter {
|
|
|
156
186
|
* when inline RC is off. */
|
|
157
187
|
private readonly rcHelpers;
|
|
158
188
|
readonly fnByName: Map<string, IrFunction>;
|
|
189
|
+
/** Empty literals that construct with inline slots (appended-array-literals.ts). */
|
|
190
|
+
appendedArrayLiterals: ReadonlySet<IrExpr>;
|
|
159
191
|
/** Emitted LLVM text of every IR function body, by function name: the
|
|
160
192
|
* fiberless-async analysis scans it for suspension entry points. */
|
|
161
193
|
private readonly fnDefText;
|
|
@@ -167,6 +199,8 @@ export declare class LlEmitter {
|
|
|
167
199
|
* whose bindings end with the list (emitBlock and function bodies). */
|
|
168
200
|
private stmtCursor;
|
|
169
201
|
readonly optionalArrayReads: OptionalArrayReads;
|
|
202
|
+
/** Union sources a binding or projection can hold in a stack box. */
|
|
203
|
+
readonly unionSources: UnionSources;
|
|
170
204
|
readonly checkedNarrows: CheckedNarrows;
|
|
171
205
|
callArrayReads: Map<IrExpr, LocalArrayRead>;
|
|
172
206
|
mapReadLifetimes: MapReadLifetimes;
|
|
@@ -182,6 +216,9 @@ export declare class LlEmitter {
|
|
|
182
216
|
private readonly lazyCaptureBoxes;
|
|
183
217
|
private readonly lazyStackBoxes;
|
|
184
218
|
private borrowedParameters;
|
|
219
|
+
/** Captures of the current closure body that its environment holds
|
|
220
|
+
* unchanged for the closure's whole life (LazyCaptures.stableCaptures). */
|
|
221
|
+
private stableCaptureIds;
|
|
185
222
|
/** Parameters proven projection-only: callers may pass stack boxes. */
|
|
186
223
|
private projectedParameters;
|
|
187
224
|
private stableCallBindings;
|
|
@@ -237,6 +274,17 @@ export declare class LlEmitter {
|
|
|
237
274
|
/** Method names with at least one may-throw implementation — the
|
|
238
275
|
* virtualCall pending check's key. */
|
|
239
276
|
readonly mayThrowMethods: Set<string>;
|
|
277
|
+
/** Async functions awaited directly at some `await f(...)` site; each
|
|
278
|
+
* gets an await-call entry (emitAsyncAwaitCall). */
|
|
279
|
+
readonly awaitCallees: Set<string>;
|
|
280
|
+
/** Async functions returned directly at some `return f(...)` site of an
|
|
281
|
+
* async function; each gets an adopting entry (emitAsyncAwaitCall). */
|
|
282
|
+
readonly adoptCallees: Set<string>;
|
|
283
|
+
/** The promise a `return` emitted past its finally regions already
|
|
284
|
+
* produced for its adopting await (borrowed from the return's parked
|
|
285
|
+
* slot); that await takes it instead of evaluating its operand. */
|
|
286
|
+
private adoptedOperand;
|
|
287
|
+
takeAdoptedOperand(): LlValue | null;
|
|
240
288
|
/** setTimeout and friends appeared somewhere: main must run the event
|
|
241
289
|
* loop even in programs with no async functions. */
|
|
242
290
|
usesTimers: boolean;
|
|
@@ -244,6 +292,8 @@ export declare class LlEmitter {
|
|
|
244
292
|
* typeKey → thunk symbol. */
|
|
245
293
|
readonly resolveThunks: Map<string, string>;
|
|
246
294
|
readonly resolveThunkDefs: string[];
|
|
295
|
+
/** Typed-ref recipe constants by type key (lazy receivers). */
|
|
296
|
+
readonly typedRefRecipes: Map<string, string>;
|
|
247
297
|
/** ReadableStream.from adapters keep typed arrays by reference and box
|
|
248
298
|
* one current element per pull. */
|
|
249
299
|
readonly streamFromArrayAdapters: Map<string, string>;
|
|
@@ -309,6 +359,8 @@ export declare class LlEmitter {
|
|
|
309
359
|
private readonly initializerBindings;
|
|
310
360
|
/** Whole-program int32 storage and parameter/result facts. */
|
|
311
361
|
readonly int32Slots: Int32Slots;
|
|
362
|
+
/** Functions whose direct calls use i32 parameters or results. */
|
|
363
|
+
readonly int32Abis: ReadonlyMap<string, Int32Abi>;
|
|
312
364
|
/** Immutable module constants (contract types) whose graphs become
|
|
313
365
|
* immortal once initialized: their reads need no reference counting. */
|
|
314
366
|
readonly immortalGlobals: ReadonlySet<string>;
|
|
@@ -334,10 +386,17 @@ export declare class LlEmitter {
|
|
|
334
386
|
* not a constructor (where they change), not async or a generator. */
|
|
335
387
|
private finalFieldBorrows;
|
|
336
388
|
integerRanges: IntegerRanges;
|
|
389
|
+
/** Sums whose result only feeds 32-bit conversions (wrapping-sums.ts). */
|
|
390
|
+
wrappingSums: Set<IrExpr>;
|
|
337
391
|
private byteWindowsEnabled;
|
|
338
392
|
private byteWindowEntries;
|
|
339
393
|
bytesBounds: ReadonlySet<IrExpr | IrStmt>;
|
|
340
394
|
integerViews: Map<string, string>;
|
|
395
|
+
/** Number locals of the current function stored only as an i32
|
|
396
|
+
* (int32-locals.ts); their slots are `alloca i32`. */
|
|
397
|
+
int32Locals: Map<string, Int32Local>;
|
|
398
|
+
/** The written values (and `++`/`--` nodes) the int32 proof covers. */
|
|
399
|
+
int32LocalWrites: ReadonlySet<IrExpr>;
|
|
341
400
|
/** Enclosing try-with-FINALLY regions, innermost last: a `return`
|
|
342
401
|
* inside one runs every crossed finally (innermost first) before the
|
|
343
402
|
* actual ret — the runtime ABI’s pending-return path, with the finally
|
|
@@ -356,10 +415,16 @@ export declare class LlEmitter {
|
|
|
356
415
|
private tryStack;
|
|
357
416
|
/** Return type of the function being emitted — the unwind path returns
|
|
358
417
|
* a dummy of this type (never read: callers check the flag first). */
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
|
|
362
|
-
|
|
418
|
+
currentReturnType: IrType;
|
|
419
|
+
/** The current body returns its number result as i32. */
|
|
420
|
+
private currentInt32Result;
|
|
421
|
+
/** The function's i32 entry returns its scalar union result as tag and
|
|
422
|
+
* payload bits (Int32Abi.union). */
|
|
423
|
+
private currentUnionResult;
|
|
424
|
+
/** Active only while emitting a body lowered with LLVM's
|
|
425
|
+
* switched-coroutine intrinsics (wasm32 async bodies and generators,
|
|
426
|
+
* native synchronous generators; see coroLowered). */
|
|
427
|
+
currentCoro: {
|
|
363
428
|
kind: "async" | "generator";
|
|
364
429
|
id: string;
|
|
365
430
|
handle: string;
|
|
@@ -375,6 +440,8 @@ export declare class LlEmitter {
|
|
|
375
440
|
yieldT: IrType;
|
|
376
441
|
nextT: IrType;
|
|
377
442
|
} | null;
|
|
443
|
+
/** The function being emitted is an async generator body. */
|
|
444
|
+
private currentAsyncGenerator;
|
|
378
445
|
/** Active optional-chain bind slots, by chain id (chainRecv reads). */
|
|
379
446
|
readonly chainSlots: Map<string, LlValue>;
|
|
380
447
|
logArgSlots: number;
|
|
@@ -445,6 +512,24 @@ export declare class LlEmitter {
|
|
|
445
512
|
* fresh promise from its outcome — the fiber trampoline's epilogue,
|
|
446
513
|
* without the fiber. */
|
|
447
514
|
private emitFiberlessAsyncSpawn;
|
|
515
|
+
/** Whether `await f(...)` may enter f through its await-call entry. The
|
|
516
|
+
* entry's result is the awaited value of f's own body type; direct calls
|
|
517
|
+
* never carry a lifted environment. */
|
|
518
|
+
awaitCallEligible(fnName: string): boolean;
|
|
519
|
+
/** The await-call entry of an async function (`sc_aw_*`): one direct
|
|
520
|
+
* `await f(...)` as a call returning the awaited value, so the call site
|
|
521
|
+
* needs no promise of its own. A fiberless body runs on the caller's
|
|
522
|
+
* stack as in its spawn wrapper; a clean result then takes the await's
|
|
523
|
+
* one microtask turn (scr_await_hop) and is returned without ever
|
|
524
|
+
* materializing the promise, which nothing else could observe. A throw
|
|
525
|
+
* builds the rejected promise exactly as the spawn wrapper would and
|
|
526
|
+
* awaits it, so the rejection reaches the awaiter on the same turn. Other
|
|
527
|
+
* bodies pack their arguments as the spawn wrapper does and enter
|
|
528
|
+
* scr_async_spawn_await_*, which parks the caller on the promise as soon
|
|
529
|
+
* as the body first suspends. The adopting entry (`sc_ad_*`, for
|
|
530
|
+
* `return f(...)` in an async function) adds the turn of the then job
|
|
531
|
+
* that adopts the returned promise, before the await proper. */
|
|
532
|
+
private emitAsyncAwaitCall;
|
|
448
533
|
/** Per-async-function machinery — async.ts's scaffolding, .ll
|
|
449
534
|
* flavored: an argument-pack struct type, a fiber trampoline (unpacks,
|
|
450
535
|
* frees the pack, runs the ordinary compiled body, settles the
|
|
@@ -453,6 +538,9 @@ export declare class LlEmitter {
|
|
|
453
538
|
* closures enter through (packs the args +1, scr_async_spawn runs the
|
|
454
539
|
* fiber eagerly to its first suspension and returns the promise). */
|
|
455
540
|
private emitAsyncScaffolding;
|
|
541
|
+
/** Whether `fn`'s body is emitted as an LLVM switched coroutine: every
|
|
542
|
+
* wasm32 async or generator body, and native synchronous generators. */
|
|
543
|
+
private coroLowered;
|
|
456
544
|
/** Per-generator-function machinery — the async scaffolding's lazy
|
|
457
545
|
* sibling (async.ts's emitGenScaffolding): the same argument pack,
|
|
458
546
|
* a fiber trampoline whose epilogue stores the COMPLETION value (or
|
|
@@ -467,6 +555,14 @@ export declare class LlEmitter {
|
|
|
467
555
|
* collision retries with a counter, still in first-use order. */
|
|
468
556
|
private contentSymbol;
|
|
469
557
|
internLiteral(text: string): string;
|
|
558
|
+
/** The inline equality test against one string literal (an
|
|
559
|
+
* `i1 (ptr)` helper LLVM inlines at each site), by literal symbol. */
|
|
560
|
+
literalEquals(text: string): string;
|
|
561
|
+
/** `@`-ref of an immortal ScrBigInt holding `value`, or null when the
|
|
562
|
+
* text is not a valid StringToBigInt input (the runtime parse then
|
|
563
|
+
* throws as usual). BigInt here is the same StringToBigInt as the
|
|
564
|
+
* program's, so every accepted spelling folds to the value Node gives. */
|
|
565
|
+
internBigIntLiteral(text: string): string | null;
|
|
470
566
|
/** Interned NUL-terminated C-string constant (the scr_jb_puts /
|
|
471
567
|
* stringify-indent currency) — `@`-ref, first-use order. */
|
|
472
568
|
cstr(text: string): string;
|
|
@@ -476,6 +572,9 @@ export declare class LlEmitter {
|
|
|
476
572
|
* emission initializes undefined-admitting fields through it
|
|
477
573
|
* (ClassHost). */
|
|
478
574
|
unitInstanceRef(unionId: string, tag: number): string;
|
|
575
|
+
/** The i8 flag that a checked-dynamic cast sets before caching one of
|
|
576
|
+
* this tagged union's boxes (unionRetype rebuilds once it is set). */
|
|
577
|
+
retypeGuardRef(unionId: string): string;
|
|
479
578
|
/** The immortal ABSENT state of an undefined-armed record field slot
|
|
480
579
|
* (IR fieldAbsent). */
|
|
481
580
|
absentInstanceRef(unionId: string): string;
|
|
@@ -699,6 +798,11 @@ export declare class LlEmitter {
|
|
|
699
798
|
/** Declaration stores initialize an empty TDZ box. Later stores check
|
|
700
799
|
* it after the RHS and update scalar cells in place. References move in. */
|
|
701
800
|
writeBindingBox(box: string, local: IrLocal, value: string, initializes?: boolean, borrowed?: boolean): void;
|
|
801
|
+
/** True when `fnName`'s borrowing body lends every reference parameter
|
|
802
|
+
* and returns an owned result: a closure over it then carries that body
|
|
803
|
+
* as its borrowing entry (ScrClosure.fn_borrowed), which callers that
|
|
804
|
+
* keep their arguments alive across the call may enter instead of `fn`. */
|
|
805
|
+
lendsEveryArgument(fnName: string): boolean;
|
|
702
806
|
/** The LLVM symbol a direct call or closure enters a function through:
|
|
703
807
|
* async bodies are entered via their emitted spawn wrapper (which runs
|
|
704
808
|
* the fiber eagerly to its first suspension and returns the promise);
|
|
@@ -711,13 +815,34 @@ export declare class LlEmitter {
|
|
|
711
815
|
emitWasiSuspend(promise: string | null): void;
|
|
712
816
|
/** Suspend after a target-specific runtime helper already queued the
|
|
713
817
|
* continuation (used by module awaits, which skip the hop when settled). */
|
|
714
|
-
|
|
818
|
+
emitCoroSuspendPrepared(): void;
|
|
715
819
|
/** Move a clean async return value into the current fiber's promise. */
|
|
716
820
|
private emitWasiFulfill;
|
|
717
821
|
private emitFunction;
|
|
822
|
+
/** The double-ABI entry of a function with an i32 entry: every caller
|
|
823
|
+
* that is not a direct call (closures, dispatch, adapters, the runtime)
|
|
824
|
+
* enters here. A pending exception passes through to its caller. */
|
|
825
|
+
private emitInt32AbiWrapper;
|
|
826
|
+
/** The SCALAR_UNION_RESULT pair of a `%ScrUnion` box of `type`. */
|
|
827
|
+
scalarUnionPair(box: string, type: IrType): string;
|
|
828
|
+
/** A private stack box holding a SCALAR_UNION_RESULT pair of `type`. */
|
|
829
|
+
stackScalarUnion(pair: string, type: IrType): LlValue;
|
|
830
|
+
/** A direct call whose i32 entry returns its scalar union in registers. */
|
|
831
|
+
scalarResultCall(e: IrExpr): boolean;
|
|
832
|
+
/** A fresh heap box (+1) for a SCALAR_UNION_RESULT pair of `type`; the
|
|
833
|
+
* exception dummy (tag -1) answers NULL. */
|
|
834
|
+
boxScalarUnion(pair: string, type: IrType): string;
|
|
835
|
+
/** The i32 bits of a number proven an int32 (a direct call's i32
|
|
836
|
+
* argument or an i32 result): its exact integer when the value carries
|
|
837
|
+
* one, else the conversion the proof makes exact. */
|
|
838
|
+
int32Argument(value: LlValue, expr: IrExpr): string;
|
|
839
|
+
/** A direct call's i32 result as a number, with the i32 as its integer
|
|
840
|
+
* and ToUint32 forms. */
|
|
841
|
+
int32Result(bits: string, type: IrType): LlValue;
|
|
718
842
|
/** Keep the ordinary owned ABI for closures, virtual dispatch, generated
|
|
719
|
-
* runtime adapters and library exports. Only direct IR calls
|
|
720
|
-
*
|
|
843
|
+
* runtime adapters and library exports. Only direct IR calls, calls of a
|
|
844
|
+
* known closure body and borrowing closure entries (fn_borrowed) select
|
|
845
|
+
* the borrowing body. Ownership of other parameters moves into that body;
|
|
721
846
|
* borrowed parameters are released here on normal and exceptional exits.
|
|
722
847
|
* The pending exception remains for the adapter's caller to handle. */
|
|
723
848
|
/** With `kept`, the virtual adapter of a borrowing slot instead: the
|
|
@@ -751,6 +876,17 @@ export declare class LlEmitter {
|
|
|
751
876
|
* borrow the element when the callee and later arguments (`writes`)
|
|
752
877
|
* write no array element and nothing keeping the array alive. */
|
|
753
878
|
unwrittenCallArrayRead(read: LocalArrayRead, writes: Writes): boolean;
|
|
879
|
+
/** `return p` of a promise inside try regions of an async function. JS
|
|
880
|
+
* completes the return first: p is evaluated, every crossed finally runs,
|
|
881
|
+
* and only then does the function's promise adopt p's settlement (a then
|
|
882
|
+
* job, then p's reaction). So the promise parks in a slot through the
|
|
883
|
+
* finally copies, like any pending return value, and the adopting await
|
|
884
|
+
* runs afterwards with no handler in scope: a rejection settles the
|
|
885
|
+
* function's promise instead of reaching its own catch clauses. */
|
|
886
|
+
private emitAdoptingReturn;
|
|
887
|
+
/** An async generator completing without a further turn: its request
|
|
888
|
+
* settles as the body returns (scr_async_gen_hop_done). */
|
|
889
|
+
private emitAsyncGenSettled;
|
|
754
890
|
/** `return x` of a local whose slot is an owned scope entry of the same
|
|
755
891
|
* type: the return can take over the local's reference. */
|
|
756
892
|
private movableReturn;
|
|
@@ -851,9 +987,18 @@ export declare class LlEmitter {
|
|
|
851
987
|
private emitMovedSelfConcat;
|
|
852
988
|
emitContainerExpr(e: ExprOf<"arrayLit" | "arrayNewLen" | "arrayGet" | "arrayHas" | "arrayState" | "arrIntrinsic" | "bytesNew" | "bytesIntrinsic" | "mapNew" | "mapIntrinsic" | "setIntrinsic" | "setNew">): LlValue;
|
|
853
989
|
emitCallExpr(e: ExprOf<"call" | "ffiCall" | "closure" | "callValue" | "selfRef" | "new" | "classRef" | "newValue" | "instanceOfValue" | "promiseVoidWiden" | "upcast" | "downcast" | "instanceOf" | "virtualCall">): LlValue;
|
|
990
|
+
/** A direct async call an enclosing `await` consumes whole: emitted
|
|
991
|
+
* through the callee's await-call entry, yielding the awaited value. */
|
|
992
|
+
emitAwaitedCall(e: ExprOf<"call">, adopt?: boolean): LlValue;
|
|
854
993
|
emitRecordExpr(e: ExprOf<"fieldGet" | "recordGet" | "recordLit" | "recordClone" | "recordKeyGet" | "recordOvfKeys" | "recordOvfHas" | "recordHas" | "fieldAbsent">): LlValue;
|
|
855
994
|
emitDynamicExpr(e: ExprOf<"dynFrom" | "dynCall" | "dynInvoke" | "dynArrLit" | "dynObjLit" | "unionWrap" | "unionNarrow" | "unionDisc" | "unionKeyGet" | "unionIsTag" | "dynKeyGet" | "dynHasKey" | "dynScalarEq" | "dynTest" | "unionEq" | "unionFuncEq" | "caughtTest" | "caughtCheck" | "caughtNarrow" | "caughtToDyn">): LlValue;
|
|
856
995
|
emitIntrinsicExpr(e: ExprOf<"intrinsic">): LlValue;
|
|
996
|
+
/** Lifetime regions in modules with lifetimeRegions (llvm/regions.ts).
|
|
997
|
+
* Created with the class graph; null elsewhere. */
|
|
998
|
+
private regions;
|
|
999
|
+
/** LifetimeRegion's runtime calls: create answers the region id, enter
|
|
1000
|
+
* and leave bracket run(), release condemns. */
|
|
1001
|
+
private emitRegionIntrinsic;
|
|
857
1002
|
private publishWalkersCache;
|
|
858
1003
|
/** Per-type publication walkers, created on the first publish. */
|
|
859
1004
|
private get publishWalkers();
|
|
@@ -887,6 +1032,8 @@ export declare class LlEmitter {
|
|
|
887
1032
|
* their ordinary statement-frame ownership. The caller must retain any
|
|
888
1033
|
* reference result before evaluating another expression. */
|
|
889
1034
|
emitReadReceiver(e: IrExpr): LlValue;
|
|
1035
|
+
/** The frame slot a reassigned stack-object local keeps for its value. */
|
|
1036
|
+
private stackObjectSlot;
|
|
890
1037
|
/** A private stack union source with an independently owned payload. */
|
|
891
1038
|
canStackReceiver(e: IrExpr): boolean;
|
|
892
1039
|
/** True for union sources that emitReadReceiver can produce as a private
|
|
@@ -1032,6 +1179,14 @@ export declare class LlEmitter {
|
|
|
1032
1179
|
emitBytesLength(elem: IrBytesElem, receiver: string, bytes: boolean): LlValue;
|
|
1033
1180
|
emitBytesGet(elem: IrBytesElem, receiver: string, index: LlValue, expr?: IrExpr, inBounds?: boolean, invalidNaN?: boolean): LlValue;
|
|
1034
1181
|
emitToUint32(value: string, expr?: IrExpr, uint32?: string): string;
|
|
1182
|
+
/** Stores a number into its int32-stored local, when it is one. The
|
|
1183
|
+
* value is proven to be in the local's range, so its low 32 bits are the
|
|
1184
|
+
* exact value. */
|
|
1185
|
+
storeInt32Local(localId: string, value: LlValue, expr?: IrExpr): boolean;
|
|
1186
|
+
/** The number of an int32-stored local's i32, with the i32 as its
|
|
1187
|
+
* integer and ToUint32 forms. A parameter the body never writes reads
|
|
1188
|
+
* as its incoming double, which is the same number. */
|
|
1189
|
+
int32LocalValue(localId: string, bits: string, type: IrType): LlValue;
|
|
1035
1190
|
storeIntegerView(localId: string, value: LlValue, expr?: IrExpr): void;
|
|
1036
1191
|
private emitBytesSet;
|
|
1037
1192
|
emitBytesIntrinsic(e: IrExpr & {
|