eliscript 0.1.3 → 0.1.4
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/COPYING.RUNTIME +93 -0
- package/README.md +15 -3
- package/bin/eliscript-test +29 -0
- package/bootstrap/backends/README.md +5 -4
- package/bootstrap/backends/binary.eli +89 -22
- package/bootstrap/backends/capabilities.eli +9 -4
- package/bootstrap/backends/managed-layout.eli +93 -81
- package/bootstrap/backends/managed.eli +651 -125
- package/bootstrap/backends/native.eli +1791 -324
- package/bootstrap/backends/numeric.eli +71 -7
- package/bootstrap/backends/sha256.eli +165 -68
- package/bootstrap/backends/wasm.eli +461 -52
- package/bootstrap/compiler/analyzer.eli +692 -2
- package/bootstrap/compiler/compiler.eli +16 -3
- package/bootstrap/compiler/emitter.eli +80 -35
- package/bootstrap/compiler/project.eli +175 -1
- package/bootstrap/compiler/transient-analysis.eli +2 -2
- package/bootstrap/host/build.eli +1 -0
- package/bootstrap/host/build.mjs +1 -1
- package/bootstrap/host/build.mjs.map +1 -1
- package/bootstrap/host/bun.mjs +7 -9
- package/bootstrap/host/bun.mjs.map +1 -1
- package/bootstrap/host/check-cli-ground.eli +47 -5
- package/bootstrap/host/check-cli-ground.mjs +60 -19
- package/bootstrap/host/check-cli-ground.mjs.map +1 -1
- package/bootstrap/host/check-cli.mjs +41 -1
- package/bootstrap/host/check-cli.mjs.map +1 -1
- package/bootstrap/host/compiler-session.eli +136 -22
- package/bootstrap/host/eliscript-cli.mjs +1 -1
- package/bootstrap/host/eliscript-cli.mjs.map +1 -1
- package/bootstrap/host/evaluation-cli.eli +33 -1
- package/bootstrap/host/evaluation-cli.mjs +65 -28
- package/bootstrap/host/evaluation-cli.mjs.map +1 -1
- package/bootstrap/host/evaluation.eli +651 -42
- package/bootstrap/host/evaluation.mjs +884 -72
- package/bootstrap/host/evaluation.mjs.map +1 -1
- package/bootstrap/host/project-cli-ground.eli +6 -1
- package/bootstrap/host/project-cli-ground.mjs +33 -32
- package/bootstrap/host/project-cli-ground.mjs.map +1 -1
- package/bootstrap/host/project-cli.mjs +1 -1
- package/bootstrap/host/project-cli.mjs.map +1 -1
- package/bootstrap/host/project-ground.eli +266 -45
- package/bootstrap/host/project-ground.mjs +429 -159
- package/bootstrap/host/project-ground.mjs.map +1 -1
- package/bootstrap/host/project.mjs +30 -40
- package/bootstrap/host/project.mjs.map +1 -1
- package/bootstrap/host/test-cli.eli +379 -0
- package/bootstrap/host/test-cli.mjs +494 -0
- package/bootstrap/host/test-cli.mjs.map +1 -0
- package/browser/README.md +7 -0
- package/browser/host.mjs +21 -29
- package/browser/host.mjs.map +1 -1
- package/browser/worker.mjs +7 -9
- package/browser/worker.mjs.map +1 -1
- package/compiler/eliscript-analyzer.el +694 -0
- package/compiler/eliscript-cli.el +66 -22
- package/compiler/eliscript-emitter.el +67 -43
- package/compiler/eliscript-ir-emitter.el +71 -36
- package/compiler/eliscript-project.el +360 -80
- package/compiler/eliscript-transient-analysis.el +5 -5
- package/compiler/eliscript.el +6 -0
- package/dist/backends/binary.mjs +148 -26
- package/dist/backends/binary.mjs.map +1 -1
- package/dist/backends/capabilities.mjs +11 -4
- package/dist/backends/capabilities.mjs.map +1 -1
- package/dist/backends/elf.mjs +4 -4
- package/dist/backends/elf.mjs.map +1 -1
- package/dist/backends/managed-layout.mjs +53 -56
- package/dist/backends/managed-layout.mjs.map +1 -1
- package/dist/backends/managed.mjs +1116 -375
- package/dist/backends/managed.mjs.map +1 -1
- package/dist/backends/memory.mjs +24 -26
- package/dist/backends/memory.mjs.map +1 -1
- package/dist/backends/native.mjs +2529 -434
- package/dist/backends/native.mjs.map +1 -1
- package/dist/backends/numeric.mjs +140 -33
- package/dist/backends/numeric.mjs.map +1 -1
- package/dist/backends/optimize.mjs +2 -2
- package/dist/backends/optimize.mjs.map +1 -1
- package/dist/backends/regexp.mjs +33 -35
- package/dist/backends/regexp.mjs.map +1 -1
- package/dist/backends/sha256.mjs +159 -59
- package/dist/backends/sha256.mjs.map +1 -1
- package/dist/backends/wasm.mjs +609 -73
- package/dist/backends/wasm.mjs.map +1 -1
- package/dist/bootstrap/analyzer.mjs +1018 -2
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +30 -23
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +206 -161
- package/dist/bootstrap/emitter.mjs.macro-origins.json +16 -16
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +27 -31
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +22 -24
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/project.mjs +246 -1
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +2 -2
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/source-map.mjs +34 -48
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +2 -2
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +106 -106
- package/dist/browser/host.mjs +21 -29
- package/dist/browser/loader.js +1 -1
- package/dist/browser/worker.mjs +95 -95
- package/dist/compiler-artifact.json +1 -1
- package/dist/host/compiler-session.mjs +405 -228
- package/dist/host/compiler-session.mjs.map +1 -1
- package/dist/host/compiler-tools.mjs +44 -46
- package/dist/host/compiler-tools.mjs.map +1 -1
- package/dist/literal-sources/runtime/core/array-map.eli +45 -0
- package/dist/literal-sources/runtime/core/collection-internals.eli +22 -2
- package/dist/literal-sources/runtime/core/collection.eli +282 -23
- package/dist/literal-sources/runtime/core/data-text.eli +196 -13
- package/dist/literal-sources/runtime/core/data.eli +1 -1
- package/dist/literal-sources/runtime/core/identifier.eli +1 -1
- package/dist/literal-sources/runtime/core/lazy-sequence.eli +822 -44
- package/dist/literal-sources/runtime/core/list.eli +1 -1
- package/dist/literal-sources/runtime/core/map.eli +1 -1
- package/dist/literal-sources/runtime/core/metadata-internals.eli +2 -2
- package/dist/literal-sources/runtime/core/metadata.eli +2 -2
- package/dist/literal-sources/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
- package/dist/literal-sources/runtime/core/object.eli +1 -1
- package/dist/literal-sources/runtime/core/order.eli +3 -3
- package/dist/literal-sources/runtime/core/persistent-kind.eli +1 -1
- package/dist/literal-sources/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
- package/dist/literal-sources/runtime/core/protocol.eli +5 -3
- package/dist/literal-sources/runtime/core/queue.eli +1 -1
- package/dist/literal-sources/runtime/core/record.eli +3 -3
- package/dist/literal-sources/runtime/core/regex.eli +2 -2
- package/dist/literal-sources/runtime/core/sequence.eli +1 -1
- package/dist/literal-sources/runtime/core/set-algebra.eli +1 -1
- package/dist/literal-sources/runtime/core/set.eli +1 -1
- package/dist/literal-sources/runtime/core/sorted.eli +4 -4
- package/dist/literal-sources/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
- package/dist/literal-sources/runtime/core/text.eli +1 -1
- package/dist/literal-sources/runtime/core/transducer.eli +24 -2
- package/dist/literal-sources/runtime/core/transient.eli +7 -5
- package/dist/literal-sources/runtime/core/type.eli +1 -1
- package/dist/literal-sources/runtime/core/value-internals.eli +3 -3
- package/dist/literal-sources/runtime/core/value.eli +2 -2
- package/dist/literal-sources/runtime/core/vector.eli +5 -2
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-literals.eli +406 -81
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-queue-state.eli +1 -1
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-sorted-state.eli +1 -1
- package/dist/literal-sources/runtime/managed/managed-transient-state.eli +1206 -0
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-value-state.eli +30 -6
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
- package/dist/literal-sources/runtime/wire/http-rpc.eli +1 -1
- package/dist/literal-sources/runtime/wire/markdown.eli +1 -1
- package/dist/literal-sources/runtime/wire/schema.eli +1 -1
- package/dist/literal-sources/stdlib/bit.eli +89 -1
- package/dist/literal-sources/stdlib/data.eli +522 -0
- package/dist/literal-sources/stdlib/interop/object.eli +39 -0
- package/dist/literal-sources/stdlib/persistent-list.eli +60 -21
- package/dist/literal-sources/stdlib/persistent-map.eli +335 -324
- package/dist/literal-sources/stdlib/persistent-set.eli +8 -6
- package/dist/literal-sources/stdlib/persistent-vector.eli +18 -18
- package/dist/literal-sources/stdlib/protocol.eli +63 -0
- package/{stdlib/core → dist/literal-sources/stdlib}/set.eli +8 -8
- package/dist/literal-sources/stdlib/string.eli +362 -0
- package/dist/runtime/lisp/async-runtime.mjs +55 -59
- package/dist/runtime/lisp/async-runtime.mjs.map +1 -1
- package/dist/runtime/lisp/builtins.mjs +232 -280
- package/dist/runtime/lisp/builtins.mjs.map +1 -1
- package/dist/runtime/lisp/cli.mjs +159 -167
- package/dist/runtime/lisp/cli.mjs.map +1 -1
- package/dist/runtime/lisp/compiler.mjs +359 -419
- package/dist/runtime/lisp/compiler.mjs.map +1 -1
- package/dist/runtime/lisp/core.mjs +24 -24
- package/dist/runtime/lisp/core.mjs.map +1 -1
- package/dist/runtime/lisp/evaluator.mjs +315 -385
- package/dist/runtime/lisp/evaluator.mjs.map +1 -1
- package/dist/runtime/lisp/extensions.mjs +85 -103
- package/dist/runtime/lisp/extensions.mjs.map +1 -1
- package/dist/runtime/lisp/host-io.mjs +106 -122
- package/dist/runtime/lisp/host-io.mjs.map +1 -1
- package/dist/runtime/lisp/io-worker.mjs +117 -135
- package/dist/runtime/lisp/io-worker.mjs.map +1 -1
- package/dist/runtime/lisp/keymap.mjs +5 -5
- package/dist/runtime/lisp/keymap.mjs.map +1 -1
- package/dist/runtime/lisp/macros-forms.mjs +49 -51
- package/dist/runtime/lisp/macros-forms.mjs.map +1 -1
- package/dist/runtime/lisp/reader-format.mjs +31 -31
- package/dist/runtime/lisp/reader-format.mjs.map +1 -1
- package/dist/runtime/lisp/regexp-buffer.mjs +9 -9
- package/dist/runtime/lisp/regexp-buffer.mjs.map +1 -1
- package/dist/runtime/math.mjs +32 -38
- package/dist/runtime/math.mjs.map +1 -1
- package/dist/runtime/number-radix.mjs +5 -7
- package/dist/runtime/number-radix.mjs.map +1 -1
- package/dist/runtime/primitives.mjs +81 -46
- package/dist/runtime/primitives.mjs.macro-origins.json +294 -44
- package/dist/runtime/primitives.mjs.map +1 -1
- package/dist/runtime/unicode-case.mjs +6 -6
- package/dist/runtime/unicode-case.mjs.map +1 -1
- package/dist/runtime.eli +3068 -1882
- package/dist/stage3-release.json +1 -1
- package/dist/stdlib/async.mjs +1838 -0
- package/dist/stdlib/bit.mjs +116 -0
- package/dist/stdlib/collection.mjs +193 -0
- package/dist/stdlib/core.mjs +28 -0
- package/dist/stdlib/data-text.mjs +54 -0
- package/dist/stdlib/data.mjs +601 -0
- package/dist/stdlib/devtools.mjs +565 -0
- package/dist/stdlib/diff.mjs +180 -0
- package/dist/stdlib/fn.mjs +164 -0
- package/dist/stdlib/hierarchy.mjs +189 -0
- package/dist/stdlib/identifier.mjs +33 -0
- package/dist/stdlib/interop/js.mjs +706 -0
- package/dist/stdlib/interop/object.mjs +40 -0
- package/dist/stdlib/json.mjs +843 -0
- package/dist/stdlib/lazy-sequence.mjs +117 -0
- package/dist/stdlib/math.mjs +386 -0
- package/dist/stdlib/meta.mjs +21 -0
- package/dist/stdlib/multimethod.mjs +345 -0
- package/dist/stdlib/numeric.mjs +327 -0
- package/dist/stdlib/order.mjs +194 -0
- package/dist/stdlib/persistent-list.mjs +171 -0
- package/dist/stdlib/persistent-map.mjs +781 -0
- package/dist/stdlib/persistent-queue.mjs +44 -0
- package/dist/stdlib/persistent-set.mjs +225 -0
- package/dist/stdlib/persistent-vector.mjs +316 -0
- package/dist/stdlib/portable/data-text.mjs +1094 -0
- package/dist/stdlib/portable/data.mjs +62 -0
- package/dist/stdlib/portable/identifier.mjs +179 -0
- package/dist/stdlib/portable/metadata.mjs +63 -0
- package/dist/stdlib/portable/object.mjs +140 -0
- package/dist/stdlib/portable/sequence.mjs +142 -0
- package/dist/stdlib/portable/text.mjs +111 -0
- package/dist/stdlib/pprint.mjs +807 -0
- package/dist/stdlib/protocol.mjs +61 -0
- package/dist/stdlib/record.mjs +25 -0
- package/dist/stdlib/regex.mjs +115 -0
- package/dist/stdlib/result.mjs +198 -0
- package/dist/stdlib/schema.mjs +2828 -0
- package/dist/stdlib/seq.mjs +913 -0
- package/dist/stdlib/set.mjs +317 -0
- package/dist/stdlib/sorted.mjs +56 -0
- package/dist/stdlib/state.mjs +451 -0
- package/dist/stdlib/string.mjs +494 -0
- package/dist/stdlib/tap.mjs +187 -0
- package/dist/stdlib/test.mjs +669 -0
- package/dist/stdlib/time.mjs +522 -0
- package/dist/stdlib/transducer.mjs +85 -0
- package/dist/stdlib/transient.mjs +32 -0
- package/dist/stdlib/type.mjs +28 -0
- package/dist/stdlib/uuid.mjs +377 -0
- package/dist/stdlib/value.mjs +334 -0
- package/dist/stdlib/walk.mjs +243 -0
- package/dist/stdlib/wire/gepo.mjs +28 -0
- package/dist/stdlib/wire/mdp.mjs +13 -0
- package/dist/stdlib/wire/mds.mjs +10 -0
- package/dist/stdlib/zipper.mjs +1025 -0
- package/editor/README.md +15 -0
- package/editor/eliscript-data.el +221 -8
- package/editor/eliscript-mode.el +207 -48
- package/editor/eliscript-runtime.el +6 -3
- package/package.json +49 -15
- package/platform/README.md +6 -0
- package/platform/browser.mjs +10 -12
- package/platform/browser.mjs.map +1 -1
- package/runtime/README.md +12 -5
- package/runtime/core/array-map.eli +538 -0
- package/runtime/core/array-map.mjs +651 -0
- package/runtime/core/array-map.mjs.map +1 -0
- package/runtime/core/collection-internals.eli +85 -33
- package/runtime/core/collection-internals.mjs +245 -193
- package/runtime/core/collection-internals.mjs.map +1 -1
- package/runtime/core/collection.eli +105 -3
- package/runtime/core/collection.mjs +190 -53
- package/runtime/core/collection.mjs.map +1 -1
- package/runtime/core/data-text.eli +224 -16
- package/runtime/core/data-text.mjs +345 -83
- package/runtime/core/data-text.mjs.map +1 -1
- package/runtime/core/data.eli +50 -33
- package/runtime/core/data.mjs +72 -36
- package/runtime/core/data.mjs.map +1 -1
- package/runtime/core/identifier.mjs +15 -19
- package/runtime/core/identifier.mjs.map +1 -1
- package/runtime/core/lazy-sequence.eli +885 -15
- package/runtime/core/lazy-sequence.mjs +1265 -38
- package/runtime/core/lazy-sequence.mjs.map +1 -1
- package/runtime/core/map-internals.eli +209 -1
- package/runtime/core/map-internals.mjs +359 -71
- package/runtime/core/map-internals.mjs.map +1 -1
- package/runtime/core/map.eli +75 -7
- package/runtime/core/map.mjs +122 -47
- package/runtime/core/map.mjs.map +1 -1
- package/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
- package/runtime/core/object-impl.mjs +5 -5
- package/runtime/core/object-impl.mjs.map +1 -1
- package/runtime/core/order.eli +15 -3
- package/runtime/core/order.mjs +23 -8
- package/runtime/core/order.mjs.map +1 -1
- package/runtime/core/persistent-kind.mjs +9 -13
- package/runtime/core/persistent-kind.mjs.map +1 -1
- package/runtime/core/protocol-error.mjs +9 -11
- package/runtime/core/protocol-error.mjs.map +1 -1
- package/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
- package/runtime/core/protocol-impl.mjs +10 -10
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/queue.mjs +14 -16
- package/runtime/core/queue.mjs.map +1 -1
- package/runtime/core/record.eli +2 -2
- package/runtime/core/record.mjs +13 -17
- package/runtime/core/record.mjs.map +1 -1
- package/runtime/core/regex.mjs +18 -22
- package/runtime/core/regex.mjs.map +1 -1
- package/runtime/core/sequence.eli +33 -31
- package/runtime/core/sequence.mjs +60 -93
- package/runtime/core/sequence.mjs.map +1 -1
- package/runtime/core/set.eli +53 -27
- package/runtime/core/set.mjs +113 -82
- package/runtime/core/set.mjs.map +1 -1
- package/runtime/core/sorted.mjs +91 -108
- package/runtime/core/sorted.mjs.map +1 -1
- package/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
- package/runtime/core/text-impl.mjs +1 -1
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/transducer.eli +24 -0
- package/runtime/core/transducer.mjs +27 -1
- package/runtime/core/transducer.mjs.map +1 -1
- package/runtime/core/transient-internals.eli +12 -4
- package/runtime/core/transient-internals.mjs +19 -6
- package/runtime/core/transient-internals.mjs.map +1 -1
- package/runtime/core/transient.eli +31 -0
- package/runtime/core/transient.mjs +33 -2
- package/runtime/core/transient.mjs.map +1 -1
- package/runtime/core/value-internals.mjs +29 -35
- package/runtime/core/value-internals.mjs.map +1 -1
- package/runtime/core/vector.eli +73 -20
- package/runtime/core/vector.mjs +159 -156
- package/runtime/core/vector.mjs.map +1 -1
- package/runtime/literals.eli +16 -9
- package/runtime/literals.mjs +25 -9
- package/runtime/literals.mjs.map +1 -1
- package/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
- package/{stdlib → runtime/managed}/managed-literals.eli +406 -81
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-queue-state.eli +1 -1
- package/runtime/managed/managed-runtime-array-map.eli +45 -0
- package/{stdlib → runtime/managed}/managed-runtime-collection-internals.eli +22 -2
- package/{stdlib → runtime/managed}/managed-runtime-collection.eli +282 -23
- package/{stdlib → runtime/managed}/managed-runtime-data-text.eli +196 -13
- package/{stdlib → runtime/managed}/managed-runtime-data.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-identifier.eli +1 -1
- package/runtime/managed/managed-runtime-lazy-sequence.eli +935 -0
- package/{stdlib → runtime/managed}/managed-runtime-list.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-map.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-metadata-internals.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-metadata.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-object.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-order.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-persistent-kind.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-protocol.eli +5 -3
- package/{stdlib → runtime/managed}/managed-runtime-queue.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-record.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-regex.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-sequence.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-set-algebra.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-set.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-sorted.eli +4 -4
- package/{stdlib → runtime/managed}/managed-runtime-text.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-transducer.eli +24 -2
- package/{stdlib → runtime/managed}/managed-runtime-transient.eli +7 -5
- package/{stdlib → runtime/managed}/managed-runtime-type.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-value-internals.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-value.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-vector.eli +5 -2
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-sorted-state.eli +1 -1
- package/runtime/managed/managed-transient-state.eli +1206 -0
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-value-state.eli +30 -6
- package/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-http-rpc.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-markdown.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-schema.eli +1 -1
- package/runtime/math.mjs +32 -38
- package/runtime/math.mjs.map +1 -1
- package/runtime/number-radix.mjs +5 -7
- package/runtime/number-radix.mjs.map +1 -1
- package/runtime/primitives.eli +19 -6
- package/runtime/primitives.mjs +81 -46
- package/runtime/primitives.mjs.map +1 -1
- package/runtime/source-mapping.mjs +17 -23
- package/runtime/source-mapping.mjs.map +1 -1
- package/runtime/testing/map.eli +70 -41
- package/runtime/testing/map.mjs +57 -34
- package/runtime/testing/map.mjs.map +1 -1
- package/runtime/unicode-case.mjs +6 -6
- package/runtime/unicode-case.mjs.map +1 -1
- package/runtime/wire/http-rpc.mjs +12 -18
- package/runtime/wire/http-rpc.mjs.map +1 -1
- package/runtime/wire/markdown.mjs +42 -42
- package/runtime/wire/markdown.mjs.map +1 -1
- package/runtime/wire/schema.mjs +13 -13
- package/runtime/wire/schema.mjs.map +1 -1
- package/runtime/worker-value-codec.mjs +5 -7
- package/runtime/worker-value-codec.mjs.map +1 -1
- package/runtime/worker-value-stream.mjs +128 -135
- package/runtime/worker-value-stream.mjs.map +1 -1
- package/runtime/worker.mjs +75 -89
- package/runtime/worker.mjs.map +1 -1
- package/stdlib/README.md +25 -18
- package/stdlib/async.eli +1245 -0
- package/stdlib/bit.eli +89 -1
- package/stdlib/bit.mjs +89 -2
- package/stdlib/bit.mjs.map +1 -1
- package/stdlib/{core/collection.eli → collection.eli} +39 -4
- package/stdlib/core.eli +956 -0
- package/stdlib/data-text.eli +62 -1091
- package/stdlib/data.eli +517 -37
- package/stdlib/devtools.eli +399 -0
- package/stdlib/diff.eli +134 -0
- package/stdlib/{function.eli → fn.eli} +1 -1
- package/stdlib/identifier.eli +21 -136
- package/stdlib/interop/object.eli +39 -0
- package/stdlib/{core/lazy-sequence.eli → lazy-sequence.eli} +28 -2
- package/stdlib/math.eli +267 -0
- package/stdlib/{core/metadata.eli → meta.eli} +2 -2
- package/stdlib/{core/order.eli → order.eli} +6 -6
- package/stdlib/persistent-list.eli +60 -21
- package/stdlib/persistent-map.eli +335 -324
- package/stdlib/persistent-set.eli +8 -6
- package/stdlib/persistent-vector.eli +18 -18
- package/stdlib/portable/data-text.eli +1092 -0
- package/stdlib/portable/data.eli +42 -0
- package/stdlib/portable/identifier.eli +147 -0
- package/stdlib/{metadata.eli → portable/metadata.eli} +5 -5
- package/stdlib/{object.eli → portable/object.eli} +1 -1
- package/stdlib/{sequence.eli → portable/sequence.eli} +1 -1
- package/stdlib/{text.eli → portable/text.eli} +1 -1
- package/stdlib/pprint.eli +588 -0
- package/stdlib/protocol.eli +63 -0
- package/stdlib/{core/record.eli → record.eli} +2 -2
- package/stdlib/regex.eli +70 -0
- package/stdlib/result.eli +53 -44
- package/stdlib/schema.eli +1886 -0
- package/stdlib/{core/seq.eli → seq.eli} +97 -90
- package/{dist/literal-sources/stdlib/core → stdlib}/set.eli +8 -8
- package/stdlib/{core/sorted.eli → sorted.eli} +2 -2
- package/stdlib/{state/atom.eli → state.eli} +137 -7
- package/stdlib/string.eli +362 -0
- package/stdlib/tap.eli +135 -0
- package/stdlib/test.eli +566 -0
- package/stdlib/time.eli +419 -0
- package/stdlib/{core/transducer.eli → transducer.eli} +4 -2
- package/stdlib/{core/transient.eli → transient.eli} +11 -5
- package/stdlib/{core/type.eli → type.eli} +2 -2
- package/stdlib/uuid.eli +288 -0
- package/stdlib/{core/walk.eli → walk.eli} +6 -6
- package/stdlib/{gepo.eli → wire/gepo.eli} +2 -2
- package/stdlib/{mdp.eli → wire/mdp.eli} +2 -2
- package/stdlib/{mds.eli → wire/mds.eli} +2 -2
- package/stdlib/{core/zipper.eli → zipper.eli} +179 -138
- package/tests/helpers/wasm-managed-math-node.mjs +495 -582
- package/tools/acceptance/check-ground.mjs +106 -132
- package/tools/acceptance/check.mjs +16 -16
- package/tools/acceptance/retained-performance-snapshot.mjs +265 -149
- package/tools/acceptance/retained-soak.mjs +5 -7
- package/tools/acceptance/retained-transient.mjs +5 -7
- package/tools/backends/build.mjs +373 -95
- package/tools/backends/compiler-bootstrap.mjs +271 -317
- package/tools/backends/compiler-browser.mjs +7 -9
- package/tools/backends/compiler-build.mjs +77 -97
- package/tools/backends/compiler-cli-ground.mjs +47 -47
- package/tools/backends/compiler-data-transport.mjs +27 -31
- package/tools/backends/compiler-host-iteration.mjs +13 -21
- package/tools/backends/compiler-host-record.mjs +28 -34
- package/tools/backends/compiler-metadata.mjs +145 -53
- package/tools/backends/compiler-package-ground.mjs +39 -47
- package/tools/backends/compiler-package-loader.mjs +164 -206
- package/tools/backends/compiler-session.mjs +432 -324
- package/tools/backends/compiler-worker.mjs +79 -89
- package/tools/backends/dist/bootstrap-js-stages.mjs +17 -19
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
- package/tools/backends/dist/release-cli.mjs +151 -22
- package/tools/backends/dist/release-cli.mjs.map +1 -1
- package/tools/backends/dist/run-artifact.mjs +54 -76
- package/tools/backends/dist/run-artifact.mjs.map +1 -1
- package/tools/backends/managed-foreign-binding.mjs +370 -114
- package/tools/backends/managed-host-ground.mjs +14 -17
- package/tools/backends/managed-host-lifecycle.mjs +42 -53
- package/tools/backends/managed-host-object-realm.mjs +121 -111
- package/tools/backends/managed-host-proxy.mjs +5 -7
- package/tools/backends/managed-host-runtime.mjs +6295 -4350
- package/tools/backends/managed-host.mjs +234 -188
- package/tools/backends/managed-layout.mjs +53 -56
- package/tools/backends/managed-module-graph-ground.mjs +488 -568
- package/tools/backends/managed-module-graph.mjs +62 -76
- package/tools/backends/managed-runtime-host-ground.mjs +352 -400
- package/tools/backends/managed-runtime.mjs +227 -266
- package/tools/backends/managed-source-view-ground.mjs +165 -161
- package/tools/backends/managed-source-view.mjs +415 -154
- package/tools/backends/native-managed-runtime.mjs +96 -138
- package/tools/backends/native-memory.mjs +1122 -742
- package/tools/backends/native-node-ffi.mjs +2439 -0
- package/tools/backends/native-node-memory.mjs +793 -383
- package/tools/backends/native-node-runner.mjs +1458 -579
- package/tools/backends/native-node-watchdog.mjs +12 -14
- package/tools/backends/native-node-worker.mjs +46 -50
- package/tools/backends/stage3-targets.mjs +2 -2
- package/tools/bootstrap-runtime.el +4 -4
- package/tools/collections/transient-builder-benchmark.mjs +17 -17
- package/tools/project/check-cli.eli +27 -3
- package/tools/project/project-cli.eli +1 -1
- package/tools/testing/maintained-suite-source.mjs +5 -7
- package/tools/testing/maintained-suite-source.mjs.map +1 -1
- package/dist/literal-sources/stdlib/core/data.eli +0 -306
- package/dist/literal-sources/stdlib/managed-transient-state.eli +0 -353
- package/stdlib/core/data-text.eli +0 -16
- package/stdlib/core/data.eli +0 -306
- package/stdlib/core/identifier.eli +0 -32
- package/stdlib/core/regex.eli +0 -17
- package/stdlib/deferred.eli +0 -70
- package/stdlib/managed-runtime-lazy-sequence.eli +0 -157
- package/stdlib/managed-transient-state.eli +0 -353
- /package/{stdlib → runtime/managed}/managed-protocol-error.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-runtime-literals.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-runtime-truth.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-testing-value.eli +0 -0
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
// Generated by Eliscript. Do not edit.
|
|
2
|
+
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "eliscript/runtime/errors.mjs";
|
|
3
|
+
var __eliscript_tdz_ready_27;
|
|
4
|
+
var __eliscript_tdz_ready_28;
|
|
5
|
+
var __eliscript_tdz_ready_29;
|
|
6
|
+
var __eliscript_tdz_ready_30;
|
|
7
|
+
function __eliscript_tdz_write_30(__eliscript_tdz_value_30) { if (__eliscript_tdz_ready_30 !== true) __eliscript_tdz_error("dispatch_signatures"); return (dispatch_signatures = __eliscript_tdz_value_30); }
|
|
2
8
|
import "eliscript/runtime/unicode-case.mjs";
|
|
3
9
|
import "eliscript/runtime/math.mjs";
|
|
4
10
|
import { __eliscript_at, __eliscript_at_direct, __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numeric_relation, __eliscript_numeric_sub, __eliscript_numeric_mul, __eliscript_numeric_div, __eliscript_numeric_rem, __eliscript_numeric_and, __eliscript_numeric_or, __eliscript_numeric_xor, __eliscript_numeric_shl, __eliscript_numeric_shr, __eliscript_numeric_ushr, __eliscript_numeric_neg, __eliscript_numeric_int32, __eliscript_numeric_uint32, __eliscript_numeric_not } from "eliscript/runtime/prelude.mjs";
|
|
11
|
+
import { hashMap as __eliscript_hash_map, hashSet as __eliscript_hash_set, keyword as __eliscript_keyword, list as __eliscript_list, queue as __eliscript_queue, symbol as __eliscript_symbol, vector as __eliscript_vector } from "eliscript/runtime/literals.mjs";
|
|
5
12
|
import { valueType as __eliscript_value_type } from "eliscript/runtime/primitives.mjs";
|
|
6
13
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
7
14
|
|
|
@@ -50,6 +57,8 @@ let callback_sequence = 0;
|
|
|
50
57
|
let remainder = Buffer.alloc(0);
|
|
51
58
|
let eof = false;
|
|
52
59
|
const pending_foreign = [];
|
|
60
|
+
const apply_tuple_pool = [null, null, null, null, null];
|
|
61
|
+
let apply_tuple_heap = undefined;
|
|
53
62
|
const fast_number_buffer = new (globalThis.DataView)(new (globalThis.ArrayBuffer)(8));
|
|
54
63
|
const input = Buffer.allocUnsafe(65536);
|
|
55
64
|
const host_failures = new (globalThis.WeakMap)();
|
|
@@ -146,17 +155,14 @@ function execute_fast_op(heap, op) {
|
|
|
146
155
|
let arr = fast_value(invoke_checked("value-array-new", heap, count));
|
|
147
156
|
let i = 0;
|
|
148
157
|
invoke_checked("heap-pin", heap, arr);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
((i = (i + 1)));
|
|
154
|
-
}
|
|
155
|
-
return null;
|
|
156
|
-
} finally {
|
|
157
|
-
(memory)["invoke"]("heap-release", heap, arr);
|
|
158
|
+
try {
|
|
159
|
+
while (__eliscript_numeric_relation("<", i, count)) {
|
|
160
|
+
invoke_checked("value-set", heap, arr, i, alloc_fast_string(heap, (list)[i]));
|
|
161
|
+
((i = (i + 1)));
|
|
158
162
|
}
|
|
159
|
-
}
|
|
163
|
+
} finally {
|
|
164
|
+
(memory)["invoke"]("heap-release", heap, arr);
|
|
165
|
+
}
|
|
160
166
|
return arr;
|
|
161
167
|
}
|
|
162
168
|
} else {
|
|
@@ -194,13 +200,11 @@ function execute_fast_op(heap, op) {
|
|
|
194
200
|
let key = fast_value((op)["key"]);
|
|
195
201
|
let value = fast_value((op)["value"]);
|
|
196
202
|
invoke_checked("heap-pin", heap, args);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
})();
|
|
203
|
+
try {
|
|
204
|
+
invoke_checked("value-object-put", heap, receiver, key, value, 2);
|
|
205
|
+
} finally {
|
|
206
|
+
(memory)["invoke"]("heap-release", heap, args);
|
|
207
|
+
}
|
|
204
208
|
return VAL64_TRUE;
|
|
205
209
|
}
|
|
206
210
|
} else {
|
|
@@ -216,35 +220,31 @@ function execute_fast_op(heap, op) {
|
|
|
216
220
|
let mode = (op)["mode"];
|
|
217
221
|
if ((mode === "put")) {
|
|
218
222
|
invoke_checked("heap-pin", heap, args);
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
})();
|
|
223
|
+
try {
|
|
224
|
+
invoke_checked("value-table-put", heap, table, arg0, arg1);
|
|
225
|
+
} finally {
|
|
226
|
+
(memory)["invoke"]("heap-release", heap, args);
|
|
227
|
+
}
|
|
226
228
|
return target;
|
|
227
229
|
} else {
|
|
228
230
|
if ((mode === "add")) {
|
|
229
231
|
invoke_checked("heap-pin", heap, args);
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
})();
|
|
232
|
+
try {
|
|
233
|
+
invoke_checked("value-table-add", heap, table, arg0);
|
|
234
|
+
} finally {
|
|
235
|
+
(memory)["invoke"]("heap-release", heap, args);
|
|
236
|
+
}
|
|
237
237
|
return target;
|
|
238
238
|
} else {
|
|
239
239
|
if ((mode === "has")) {
|
|
240
|
-
if ((
|
|
240
|
+
if ((invoke_checked("value-table-has", heap, table, arg0) !== 0)) {
|
|
241
241
|
return VAL64_TRUE;
|
|
242
242
|
} else {
|
|
243
243
|
return VAL64_FALSE;
|
|
244
244
|
}
|
|
245
245
|
} else {
|
|
246
246
|
if ((mode === "delete")) {
|
|
247
|
-
if ((
|
|
247
|
+
if ((invoke_checked("value-table-delete", heap, table, arg0) !== 0)) {
|
|
248
248
|
return VAL64_TRUE;
|
|
249
249
|
} else {
|
|
250
250
|
return VAL64_FALSE;
|
|
@@ -260,7 +260,7 @@ function execute_fast_op(heap, op) {
|
|
|
260
260
|
if ((mode === "size")) {
|
|
261
261
|
return fast_number(heap, invoke_checked("value-table-size", heap, table));
|
|
262
262
|
} else {
|
|
263
|
-
return ((
|
|
263
|
+
return ((__eliscript_value_5) => { throw __eliscript_value_5; })(new (globalThis.TypeError)("unknown fast table op"));
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
}
|
|
@@ -270,7 +270,7 @@ function execute_fast_op(heap, op) {
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
} else {
|
|
273
|
-
return ((
|
|
273
|
+
return ((__eliscript_value_6) => { throw __eliscript_value_6; })(new (globalThis.TypeError)("unknown native fastOp"));
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
}
|
|
@@ -285,14 +285,14 @@ function parse_fast_request(text) {
|
|
|
285
285
|
{
|
|
286
286
|
let parts = (text)["split"](" ");
|
|
287
287
|
if ((!(__eliscript_numeric_relation(">=", ((parts) ?? []).length, 2) && __eliscript_truthy(((parts)[0])["startsWith"]("F")) && ((parts)[1] === "invoke")))) {
|
|
288
|
-
((
|
|
288
|
+
((__eliscript_value_7) => { throw __eliscript_value_7; })(new (globalThis.TypeError)("invalid native fast request"));
|
|
289
289
|
}
|
|
290
290
|
{
|
|
291
291
|
let id = globalThis.Number(((parts)[0])["slice"](1));
|
|
292
292
|
let args = [];
|
|
293
293
|
let index = 2;
|
|
294
294
|
if ((!(__eliscript_truthy(Number.isSafeInteger(id)) && __eliscript_numeric_relation(">=", id, 1)))) {
|
|
295
|
-
((
|
|
295
|
+
((__eliscript_value_8) => { throw __eliscript_value_8; })(new (globalThis.TypeError)("invalid native fast request"));
|
|
296
296
|
}
|
|
297
297
|
while (__eliscript_numeric_relation("<", index, ((parts) ?? []).length)) {
|
|
298
298
|
{
|
|
@@ -301,7 +301,7 @@ function parse_fast_request(text) {
|
|
|
301
301
|
let body = (token)["slice"](1);
|
|
302
302
|
if ((tag === "s")) {
|
|
303
303
|
if ((!__eliscript_numeric_relation(">", ((body) ?? []).length, 0))) {
|
|
304
|
-
((
|
|
304
|
+
((__eliscript_value_9) => { throw __eliscript_value_9; })(new (globalThis.TypeError)("invalid native fast request"));
|
|
305
305
|
}
|
|
306
306
|
(args)["push"](body);
|
|
307
307
|
} else {
|
|
@@ -309,7 +309,7 @@ function parse_fast_request(text) {
|
|
|
309
309
|
{
|
|
310
310
|
let value = globalThis.Number(body);
|
|
311
311
|
if ((!(__eliscript_truthy(Number.isSafeInteger(value)) && __eliscript_numeric_relation(">=", value, 0) && __eliscript_numeric_relation("<=", value, 4294967295)))) {
|
|
312
|
-
((
|
|
312
|
+
((__eliscript_value_10) => { throw __eliscript_value_10; })(new (globalThis.TypeError)("invalid native fast request"));
|
|
313
313
|
}
|
|
314
314
|
(args)["push"](value);
|
|
315
315
|
}
|
|
@@ -317,7 +317,7 @@ function parse_fast_request(text) {
|
|
|
317
317
|
if ((tag === "b")) {
|
|
318
318
|
(args)["push"](normalize_u64(globalThis.BigInt(body)));
|
|
319
319
|
} else {
|
|
320
|
-
((
|
|
320
|
+
((__eliscript_value_11) => { throw __eliscript_value_11; })(new (globalThis.TypeError)("invalid native fast request"));
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
}
|
|
@@ -343,6 +343,100 @@ function fast_result_line(record) {
|
|
|
343
343
|
return null;
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
+
function wire_encode_str(s) {
|
|
347
|
+
if ((((s)["indexOf"]("\t") === -1) && ((s)["indexOf"]("\n") === -1) && ((s)["indexOf"]("\r") === -1))) {
|
|
348
|
+
return (String("S") + String(s));
|
|
349
|
+
} else {
|
|
350
|
+
return (String("Q") + String(JSON.stringify(s)));
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function wire_decode_str(tok) {
|
|
354
|
+
if (__eliscript_truthy((tok)["startsWith"]("S"))) {
|
|
355
|
+
return (tok)["slice"](1);
|
|
356
|
+
} else {
|
|
357
|
+
return JSON.parse((tok)["slice"](1));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function parse_compact_val(tok) {
|
|
361
|
+
{
|
|
362
|
+
let tag = (tok)["charAt"](0);
|
|
363
|
+
if ((tag === "r")) {
|
|
364
|
+
return ({"kind": "raw", "raw": normalize_u64(globalThis.BigInt((tok)["slice"](1)))});
|
|
365
|
+
} else {
|
|
366
|
+
if ((tag === "n")) {
|
|
367
|
+
return ({"kind": "number", "value": globalThis.Number((tok)["slice"](1))});
|
|
368
|
+
} else {
|
|
369
|
+
if ((tag === "m")) {
|
|
370
|
+
return ({"kind": "number", "value": __eliscript_numeric_mul(-1, 0)});
|
|
371
|
+
} else {
|
|
372
|
+
if (((tag === "S") || (tag === "Q"))) {
|
|
373
|
+
return ({"kind": "string", "text": wire_decode_str(tok)});
|
|
374
|
+
} else {
|
|
375
|
+
if ((tag === "f")) {
|
|
376
|
+
{
|
|
377
|
+
let parts = ((tok)["slice"](1))["split"](":");
|
|
378
|
+
return ({"kind": "foreign", "token": globalThis.Number((parts)[0]), "slot": globalThis.Number((parts)[1]), "constructible": ((parts)[2] === "1")});
|
|
379
|
+
}
|
|
380
|
+
} else {
|
|
381
|
+
return ((__eliscript_value_12) => { throw __eliscript_value_12; })(new (globalThis.TypeError)("invalid compact apply value"));
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function parse_compact_apply(text) {
|
|
390
|
+
{
|
|
391
|
+
let parts = (text)["split"]("\t");
|
|
392
|
+
let id = globalThis.Number(((parts)[0])["slice"](1));
|
|
393
|
+
let heap = globalThis.Number((parts)[1]);
|
|
394
|
+
let ttag = (parts)[2];
|
|
395
|
+
let idx = 3;
|
|
396
|
+
let spec = ({"heap": heap});
|
|
397
|
+
if ((ttag === "R")) {
|
|
398
|
+
((spec)["targetRaw"] = normalize_u64(globalThis.BigInt((parts)[idx])));
|
|
399
|
+
((idx = (idx + 1)));
|
|
400
|
+
} else {
|
|
401
|
+
((spec)["hoistedIndex"] = globalThis.Number((parts)[idx]));
|
|
402
|
+
((spec)["invokeName"] = wire_decode_str((parts)[(idx + 1)]));
|
|
403
|
+
((idx = (idx + 2)));
|
|
404
|
+
}
|
|
405
|
+
((spec)["receiver"] = parse_compact_val((parts)[idx]));
|
|
406
|
+
((idx = (idx + 1)));
|
|
407
|
+
{
|
|
408
|
+
let argc = globalThis.Number((parts)[idx]);
|
|
409
|
+
let args = [];
|
|
410
|
+
let ai = 0;
|
|
411
|
+
((idx = (idx + 1)));
|
|
412
|
+
while (__eliscript_numeric_relation("<", ai, argc)) {
|
|
413
|
+
(args)["push"](parse_compact_val((parts)[(idx + ai)]));
|
|
414
|
+
((ai = (ai + 1)));
|
|
415
|
+
}
|
|
416
|
+
((spec)["args"] = args);
|
|
417
|
+
}
|
|
418
|
+
return ({"id": id, "method": "fastApply", "compact": true, "args": [spec]});
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
function parse_fast_get_request(text) {
|
|
422
|
+
{
|
|
423
|
+
let parts = (text)["split"]("\t");
|
|
424
|
+
let id = globalThis.Number(((parts)[0])["slice"](1));
|
|
425
|
+
let heap = globalThis.Number((parts)[1]);
|
|
426
|
+
let raw = normalize_u64(globalThis.BigInt((parts)[2]));
|
|
427
|
+
let key = wire_decode_str((parts)[3]);
|
|
428
|
+
return ({"id": id, "method": "fastGet", "args": [heap, raw, key]});
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
function parse_release_batch_request(text) {
|
|
432
|
+
{
|
|
433
|
+
let parts = (text)["split"]("\t");
|
|
434
|
+
let id = globalThis.Number(((parts)[0])["slice"](1));
|
|
435
|
+
let heap = globalThis.Number((parts)[1]);
|
|
436
|
+
let items = (__eliscript_numeric_relation(">", ((parts) ?? []).length, 2) ? (parts)[2] : "");
|
|
437
|
+
return ({"id": id, "method": "releaseBatch", "args": [heap, items]});
|
|
438
|
+
}
|
|
439
|
+
}
|
|
346
440
|
function read_packet() {
|
|
347
441
|
{
|
|
348
442
|
let pieces = [];
|
|
@@ -357,7 +451,10 @@ function read_packet() {
|
|
|
357
451
|
let tail = (remainder)["subarray"](0, end);
|
|
358
452
|
let bytes = (__eliscript_numeric_relation(">", ((pieces) ?? []).length, 0) ? Buffer.concat((pieces)["concat"]([tail]), (length + ((tail) ?? []).length)) : tail);
|
|
359
453
|
((remainder = (remainder)["subarray"]((end + 1))));
|
|
360
|
-
|
|
454
|
+
{
|
|
455
|
+
let b0 = (__eliscript_numeric_relation(">", ((bytes) ?? []).length, 0) ? (bytes)[0] : 0);
|
|
456
|
+
((result = ((b0 === 70) ? parse_fast_request((decoder)["decode"](bytes)) : ((b0 === 65) ? parse_compact_apply((decoder)["decode"](bytes)) : ((b0 === 71) ? parse_fast_get_request((decoder)["decode"](bytes)) : ((b0 === 85) ? parse_release_batch_request((decoder)["decode"](bytes)) : JSON.parse((decoder)["decode"](bytes), wire_reviver)))))));
|
|
457
|
+
}
|
|
361
458
|
((done = true));
|
|
362
459
|
}
|
|
363
460
|
} else {
|
|
@@ -368,7 +465,7 @@ function read_packet() {
|
|
|
368
465
|
}
|
|
369
466
|
if (__eliscript_truthy(eof)) {
|
|
370
467
|
if (__eliscript_numeric_relation(">", length, 0)) {
|
|
371
|
-
((
|
|
468
|
+
((__eliscript_value_13) => { throw __eliscript_value_13; })(new (globalThis.Error)("incomplete native transport request"));
|
|
372
469
|
}
|
|
373
470
|
((result = null));
|
|
374
471
|
((done = true));
|
|
@@ -376,25 +473,23 @@ function read_packet() {
|
|
|
376
473
|
{
|
|
377
474
|
let count = undefined;
|
|
378
475
|
let retry = false;
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
476
|
+
try {
|
|
477
|
+
((count = readSync(0, input, 0, ((input) ?? []).length, null)));
|
|
478
|
+
} catch (error) {
|
|
479
|
+
{
|
|
480
|
+
let code = ((error == null) ? undefined : (error)["code"]);
|
|
481
|
+
if ((code === "EINTR")) {
|
|
482
|
+
((retry = true));
|
|
483
|
+
} else {
|
|
484
|
+
if (((code === "EAGAIN") || (code === "EWOULDBLOCK"))) {
|
|
485
|
+
Atomics.wait(pause, 0, 0, 1);
|
|
486
|
+
((retry = true));
|
|
387
487
|
} else {
|
|
388
|
-
|
|
389
|
-
Atomics.wait(pause, 0, 0, 1);
|
|
390
|
-
return ((retry = true));
|
|
391
|
-
} else {
|
|
392
|
-
return ((__eliscript_value_17) => { throw __eliscript_value_17; })(error);
|
|
393
|
-
}
|
|
488
|
+
((__eliscript_value_14) => { throw __eliscript_value_14; })(error);
|
|
394
489
|
}
|
|
395
490
|
}
|
|
396
491
|
}
|
|
397
|
-
}
|
|
492
|
+
}
|
|
398
493
|
if ((!__eliscript_truthy(retry))) {
|
|
399
494
|
if ((count === 0)) {
|
|
400
495
|
((eof = true));
|
|
@@ -410,36 +505,65 @@ function read_packet() {
|
|
|
410
505
|
return result;
|
|
411
506
|
}
|
|
412
507
|
}
|
|
508
|
+
function send_raw_line(line) {
|
|
509
|
+
{
|
|
510
|
+
let bytes = Buffer.from((String(line) + String("\n")));
|
|
511
|
+
let offset = 0;
|
|
512
|
+
while (__eliscript_numeric_relation("<", offset, ((bytes) ?? []).length)) {
|
|
513
|
+
try {
|
|
514
|
+
{
|
|
515
|
+
let written = writeSync(1, bytes, offset, __eliscript_numeric_sub(((bytes) ?? []).length, offset), null);
|
|
516
|
+
if ((written === 0)) {
|
|
517
|
+
((__eliscript_value_15) => { throw __eliscript_value_15; })(new (globalThis.Error)("native transport output made no progress"));
|
|
518
|
+
}
|
|
519
|
+
((offset = (offset + written)));
|
|
520
|
+
}
|
|
521
|
+
} catch (error) {
|
|
522
|
+
{
|
|
523
|
+
let code = ((error == null) ? undefined : (error)["code"]);
|
|
524
|
+
if ((code === "EINTR")) {
|
|
525
|
+
null;
|
|
526
|
+
} else {
|
|
527
|
+
if (((code === "EAGAIN") || (code === "EWOULDBLOCK"))) {
|
|
528
|
+
Atomics.wait(pause, 0, 0, 1);
|
|
529
|
+
} else {
|
|
530
|
+
((__eliscript_value_16) => { throw __eliscript_value_16; })(error);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
return null;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
413
539
|
function send(record, ...supplied) {
|
|
414
540
|
{
|
|
415
541
|
let fast = (((supplied)[0] === true) ? fast_result_line(record) : null);
|
|
416
542
|
let bytes = Buffer.from((__eliscript_truthy(fast) ? (String(fast) + String("\n")) : (String(JSON.stringify(record, wire_replacer)) + String("\n"))));
|
|
417
543
|
let offset = 0;
|
|
418
544
|
while (__eliscript_numeric_relation("<", offset, ((bytes) ?? []).length)) {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
((__eliscript_value_18) => { throw __eliscript_value_18; })(new (globalThis.Error)("native transport output made no progress"));
|
|
425
|
-
}
|
|
426
|
-
return ((offset = (offset + written)));
|
|
545
|
+
try {
|
|
546
|
+
{
|
|
547
|
+
let written = writeSync(1, bytes, offset, __eliscript_numeric_sub(((bytes) ?? []).length, offset), null);
|
|
548
|
+
if ((written === 0)) {
|
|
549
|
+
((__eliscript_value_17) => { throw __eliscript_value_17; })(new (globalThis.Error)("native transport output made no progress"));
|
|
427
550
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
551
|
+
((offset = (offset + written)));
|
|
552
|
+
}
|
|
553
|
+
} catch (error) {
|
|
554
|
+
{
|
|
555
|
+
let code = ((error == null) ? undefined : (error)["code"]);
|
|
556
|
+
if ((code === "EINTR")) {
|
|
557
|
+
null;
|
|
558
|
+
} else {
|
|
559
|
+
if (((code === "EAGAIN") || (code === "EWOULDBLOCK"))) {
|
|
560
|
+
Atomics.wait(pause, 0, 0, 1);
|
|
433
561
|
} else {
|
|
434
|
-
|
|
435
|
-
return Atomics.wait(pause, 0, 0, 1);
|
|
436
|
-
} else {
|
|
437
|
-
return ((__eliscript_value_19) => { throw __eliscript_value_19; })(error);
|
|
438
|
-
}
|
|
562
|
+
((__eliscript_value_18) => { throw __eliscript_value_18; })(error);
|
|
439
563
|
}
|
|
440
564
|
}
|
|
441
565
|
}
|
|
442
|
-
}
|
|
566
|
+
}
|
|
443
567
|
}
|
|
444
568
|
return null;
|
|
445
569
|
}
|
|
@@ -491,7 +615,7 @@ function invoke_checked(name, ...args) {
|
|
|
491
615
|
let value = __eliscript_at(Reflect, "apply")((memory)["invoke"], memory, ([name])["concat"](args));
|
|
492
616
|
let code = (memory)["invoke"]("last-error");
|
|
493
617
|
if ((!(code === 0))) {
|
|
494
|
-
((
|
|
618
|
+
((__eliscript_value_19) => { throw __eliscript_value_19; })(({"__fastApplyRuntimeError": code}));
|
|
495
619
|
}
|
|
496
620
|
return value;
|
|
497
621
|
}
|
|
@@ -523,12 +647,12 @@ function flush_pending_foreign(heap) {
|
|
|
523
647
|
if (((err2 === 0) && (actual_tok === token))) {
|
|
524
648
|
((alive = true));
|
|
525
649
|
}
|
|
526
|
-
if ((
|
|
650
|
+
if ((err2 !== 0)) {
|
|
527
651
|
(memory)["invoke"]("value-error-restore", 0);
|
|
528
652
|
}
|
|
529
653
|
}
|
|
530
654
|
} else {
|
|
531
|
-
if ((
|
|
655
|
+
if ((err1 !== 0)) {
|
|
532
656
|
(memory)["invoke"]("value-error-restore", 0);
|
|
533
657
|
}
|
|
534
658
|
}
|
|
@@ -558,21 +682,93 @@ function current_root_mark(heap) {
|
|
|
558
682
|
}
|
|
559
683
|
function restore_root_mark(heap, mark) {
|
|
560
684
|
if (__eliscript_truthy(has_root_scope_unwind)) {
|
|
561
|
-
|
|
685
|
+
try {
|
|
686
|
+
return (memory)["invoke"]("root-scope-unwind", heap, mark);
|
|
687
|
+
} catch (ignored) {
|
|
688
|
+
return null;
|
|
689
|
+
}
|
|
690
|
+
} else {
|
|
691
|
+
return null;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
function clear_apply_tuple_pool() {
|
|
695
|
+
{
|
|
696
|
+
let h = apply_tuple_heap;
|
|
697
|
+
let i = 0;
|
|
698
|
+
while (__eliscript_numeric_relation("<", i, 5)) {
|
|
699
|
+
{
|
|
700
|
+
let item = (apply_tuple_pool)[i];
|
|
701
|
+
if ((__eliscript_truthy(item) && !((h === undefined)) && __eliscript_truthy(memory))) {
|
|
702
|
+
try {
|
|
703
|
+
(memory)["invoke"]("heap-release", h, item);
|
|
704
|
+
} catch (ignored) {
|
|
705
|
+
null;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
((apply_tuple_pool)[i] = null);
|
|
709
|
+
}
|
|
710
|
+
((i = (i + 1)));
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
return ((apply_tuple_heap = undefined));
|
|
714
|
+
}
|
|
715
|
+
function acquire_apply_tuple(heap, argc) {
|
|
716
|
+
if ((!((apply_tuple_heap === undefined)) && (apply_tuple_heap !== heap))) {
|
|
717
|
+
clear_apply_tuple_pool();
|
|
718
|
+
}
|
|
719
|
+
if ((__eliscript_numeric_relation("<", argc, 5) && !(((apply_tuple_pool)[argc] === null)))) {
|
|
720
|
+
{
|
|
721
|
+
let tuple = (apply_tuple_pool)[argc];
|
|
722
|
+
((apply_tuple_pool)[argc] = null);
|
|
723
|
+
return tuple;
|
|
724
|
+
}
|
|
725
|
+
} else {
|
|
726
|
+
{
|
|
727
|
+
let tuple = fast_value(invoke_checked("value-refs", heap, 7, argc));
|
|
728
|
+
invoke_checked("heap-pin", heap, tuple);
|
|
729
|
+
((apply_tuple_heap = heap));
|
|
730
|
+
return tuple;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
function release_apply_tuple(heap, argc, tuple) {
|
|
735
|
+
if ((__eliscript_numeric_relation("<", argc, 5) && (apply_tuple_heap === heap) && ((apply_tuple_pool)[argc] === null))) {
|
|
736
|
+
{
|
|
737
|
+
let ok = true;
|
|
738
|
+
let i = 0;
|
|
562
739
|
try {
|
|
563
|
-
|
|
740
|
+
while (__eliscript_numeric_relation("<", i, argc)) {
|
|
741
|
+
invoke_checked("value-set", heap, tuple, i, VAL64_UNDEFINED);
|
|
742
|
+
((i = (i + 1)));
|
|
743
|
+
}
|
|
564
744
|
} catch (ignored) {
|
|
565
|
-
|
|
745
|
+
((ok = false));
|
|
746
|
+
}
|
|
747
|
+
if (__eliscript_truthy(ok)) {
|
|
748
|
+
return ((apply_tuple_pool)[argc] = tuple);
|
|
749
|
+
} else {
|
|
750
|
+
try {
|
|
751
|
+
return (memory)["invoke"]("heap-release", heap, tuple);
|
|
752
|
+
} catch (ignored) {
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
566
755
|
}
|
|
567
|
-
}
|
|
756
|
+
}
|
|
568
757
|
} else {
|
|
569
|
-
|
|
758
|
+
try {
|
|
759
|
+
return (memory)["invoke"]("heap-release", heap, tuple);
|
|
760
|
+
} catch (ignored) {
|
|
761
|
+
return null;
|
|
762
|
+
}
|
|
570
763
|
}
|
|
571
764
|
}
|
|
572
765
|
function execute_fast_apply(spec) {
|
|
573
766
|
{
|
|
574
767
|
let heap = __eliscript_numeric_ushr((spec)["heap"], 0);
|
|
575
|
-
let
|
|
768
|
+
let hoisted_index = (spec)["hoistedIndex"];
|
|
769
|
+
let invoke_name = (spec)["invokeName"];
|
|
770
|
+
let has_hoisted = false;
|
|
771
|
+
let target_raw = VAL64_NIL;
|
|
576
772
|
let receiver = (spec)["receiver"];
|
|
577
773
|
let args = (spec)["args"];
|
|
578
774
|
let previous_this = VAL64_UNDEFINED;
|
|
@@ -580,7 +776,13 @@ function execute_fast_apply(spec) {
|
|
|
580
776
|
let target_frame = undefined;
|
|
581
777
|
let root_mark = 0;
|
|
582
778
|
let call_entered = false;
|
|
779
|
+
let pooled_tuple = undefined;
|
|
780
|
+
let pooled_argc = 0;
|
|
583
781
|
let pinned = [];
|
|
782
|
+
((has_hoisted = ((__eliscript_value_20) => (__eliscript_truthy(__eliscript_value_20) ? (__eliscript_numeric_relation(">=", hoisted_index, 0) && (__eliscript_value_type(invoke_name) === "string")) : __eliscript_value_20))(Number.isInteger(hoisted_index))));
|
|
783
|
+
if ((!__eliscript_truthy(has_hoisted))) {
|
|
784
|
+
((target_raw = fast_value((spec)["targetRaw"])));
|
|
785
|
+
}
|
|
584
786
|
{
|
|
585
787
|
let pin_raw = null;
|
|
586
788
|
(pin_raw = ((r) => {
|
|
@@ -591,155 +793,151 @@ function execute_fast_apply(spec) {
|
|
|
591
793
|
return null;
|
|
592
794
|
}
|
|
593
795
|
}));
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
((pinned_previous_this = true));
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
((target_frame = fast_value(invoke_checked("frame-current", heap))), (root_mark = current_root_mark(heap)), (call_entered = true));
|
|
604
|
-
if (((receiver)["kind"] === "raw")) {
|
|
605
|
-
pin_raw(fast_value((receiver)["raw"]));
|
|
796
|
+
try {
|
|
797
|
+
if (__eliscript_truthy(has_current_this)) {
|
|
798
|
+
((previous_this = fast_value(invoke_checked("value-function-current-this", heap))));
|
|
799
|
+
if (!(__eliscript_truthy(val64_singleton_p(previous_this)))) {
|
|
800
|
+
invoke_checked("heap-pin", heap, previous_this);
|
|
801
|
+
((pinned_previous_this = true));
|
|
606
802
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
803
|
+
}
|
|
804
|
+
((target_frame = fast_value(invoke_checked("frame-current", heap))), (root_mark = current_root_mark(heap)), (call_entered = true));
|
|
805
|
+
if (((receiver)["kind"] === "raw")) {
|
|
806
|
+
pin_raw(fast_value((receiver)["raw"]));
|
|
807
|
+
}
|
|
808
|
+
{
|
|
809
|
+
let argc = ((args) ?? []).length;
|
|
810
|
+
let i = 0;
|
|
811
|
+
while (__eliscript_numeric_relation("<", i, argc)) {
|
|
812
|
+
{
|
|
813
|
+
let arg = (args)[i];
|
|
814
|
+
if (((arg)["kind"] === "raw")) {
|
|
815
|
+
pin_raw(fast_value((arg)["raw"]));
|
|
616
816
|
}
|
|
617
|
-
((i = (i + 1)));
|
|
618
817
|
}
|
|
818
|
+
((i = (i + 1)));
|
|
819
|
+
}
|
|
820
|
+
{
|
|
821
|
+
let tuple = acquire_apply_tuple(heap, argc);
|
|
822
|
+
let allocated_foreign = new (globalThis.Map)();
|
|
823
|
+
((pooled_tuple = tuple), (pooled_argc = argc));
|
|
619
824
|
{
|
|
620
|
-
let
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
{
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
} else {
|
|
630
|
-
if ((kind === "number")) {
|
|
825
|
+
let encode_arg = ((arg, is_this) => {
|
|
826
|
+
{
|
|
827
|
+
let kind = (arg)["kind"];
|
|
828
|
+
if ((kind === "raw")) {
|
|
829
|
+
return fast_value((arg)["raw"]);
|
|
830
|
+
} else {
|
|
831
|
+
if ((kind === "number")) {
|
|
832
|
+
{
|
|
833
|
+
const __eliscript_value_21 = fast_number(heap, (arg)["value"]);
|
|
631
834
|
{
|
|
632
|
-
let
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
{
|
|
636
|
-
let raw = fast_value(invoke_checked("value-number", heap, (fast_number_buffer)["getUint32"](0, true), (fast_number_buffer)["getUint32"](4, true)));
|
|
637
|
-
if (__eliscript_truthy(is_this)) {
|
|
638
|
-
pin_raw(raw);
|
|
639
|
-
}
|
|
640
|
-
return raw;
|
|
835
|
+
let raw = __eliscript_value_21;
|
|
836
|
+
if (__eliscript_truthy(is_this)) {
|
|
837
|
+
pin_raw(raw);
|
|
641
838
|
}
|
|
839
|
+
return raw;
|
|
642
840
|
}
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
return raw;
|
|
654
|
-
}
|
|
655
|
-
} else {
|
|
656
|
-
{
|
|
657
|
-
let slot = __eliscript_numeric_ushr((arg)["slot"], 0);
|
|
658
|
-
let raw = fast_value(invoke_checked("value-foreign-new", heap, token, slot));
|
|
659
|
-
if (__eliscript_truthy((arg)["constructible"])) {
|
|
660
|
-
invoke_checked("value-foreign-constructor-set", heap, raw, 1);
|
|
661
|
-
}
|
|
662
|
-
(allocated_foreign)["set"](token, raw);
|
|
663
|
-
(pending_foreign)["push"]([token, raw]);
|
|
664
|
-
if (__eliscript_truthy(is_this)) {
|
|
665
|
-
pin_raw(raw);
|
|
666
|
-
}
|
|
667
|
-
return raw;
|
|
841
|
+
}
|
|
842
|
+
} else {
|
|
843
|
+
if ((kind === "foreign")) {
|
|
844
|
+
{
|
|
845
|
+
let token = __eliscript_numeric_ushr((arg)["token"], 0);
|
|
846
|
+
if (__eliscript_truthy((allocated_foreign)["has"](token))) {
|
|
847
|
+
{
|
|
848
|
+
let raw = (allocated_foreign)["get"](token);
|
|
849
|
+
if (__eliscript_truthy(is_this)) {
|
|
850
|
+
pin_raw(raw);
|
|
668
851
|
}
|
|
852
|
+
return raw;
|
|
669
853
|
}
|
|
670
|
-
}
|
|
671
|
-
} else {
|
|
672
|
-
if ((kind === "string")) {
|
|
854
|
+
} else {
|
|
673
855
|
{
|
|
674
|
-
let
|
|
675
|
-
let
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
{
|
|
679
|
-
let off = invoke_checked("value-data", heap, raw, 5);
|
|
680
|
-
let j = 0;
|
|
681
|
-
while (__eliscript_numeric_relation("<", j, len)) {
|
|
682
|
-
(memory)["setUint16"]((off + __eliscript_numeric_mul(j, 2)), (text)["charCodeAt"](j), true);
|
|
683
|
-
((j = (j + 1)));
|
|
684
|
-
}
|
|
685
|
-
}
|
|
856
|
+
let slot = __eliscript_numeric_ushr((arg)["slot"], 0);
|
|
857
|
+
let raw = fast_value(invoke_checked("value-foreign-new", heap, token, slot));
|
|
858
|
+
if (__eliscript_truthy((arg)["constructible"])) {
|
|
859
|
+
invoke_checked("value-foreign-constructor-set", heap, raw, 1);
|
|
686
860
|
}
|
|
687
|
-
|
|
861
|
+
(allocated_foreign)["set"](token, raw);
|
|
862
|
+
(pending_foreign)["push"]([token, raw]);
|
|
688
863
|
if (__eliscript_truthy(is_this)) {
|
|
689
864
|
pin_raw(raw);
|
|
690
865
|
}
|
|
691
866
|
return raw;
|
|
692
867
|
}
|
|
693
|
-
} else {
|
|
694
|
-
return ((__eliscript_value_25) => { throw __eliscript_value_25; })(new (globalThis.TypeError)("unsupported fastApply argument"));
|
|
695
868
|
}
|
|
696
869
|
}
|
|
870
|
+
} else {
|
|
871
|
+
if ((kind === "string")) {
|
|
872
|
+
{
|
|
873
|
+
let text = (arg)["text"];
|
|
874
|
+
let len = __eliscript_numeric_ushr(((text) ?? []).length, 0);
|
|
875
|
+
let raw = fast_value(invoke_checked("value-string", heap, len));
|
|
876
|
+
if (__eliscript_numeric_relation(">", len, 0)) {
|
|
877
|
+
{
|
|
878
|
+
let off = invoke_checked("value-data", heap, raw, 5);
|
|
879
|
+
let j = 0;
|
|
880
|
+
while (__eliscript_numeric_relation("<", j, len)) {
|
|
881
|
+
(memory)["setUint16"]((off + __eliscript_numeric_mul(j, 2)), (text)["charCodeAt"](j), true);
|
|
882
|
+
((j = (j + 1)));
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
invoke_checked("value-seal", heap, raw);
|
|
887
|
+
if (__eliscript_truthy(is_this)) {
|
|
888
|
+
pin_raw(raw);
|
|
889
|
+
}
|
|
890
|
+
return raw;
|
|
891
|
+
}
|
|
892
|
+
} else {
|
|
893
|
+
return ((__eliscript_value_22) => { throw __eliscript_value_22; })(new (globalThis.TypeError)("unsupported fastApply argument"));
|
|
894
|
+
}
|
|
697
895
|
}
|
|
698
896
|
}
|
|
699
897
|
}
|
|
700
|
-
});
|
|
701
|
-
let this_raw = encode_arg(receiver, true);
|
|
702
|
-
let idx = 0;
|
|
703
|
-
while (__eliscript_numeric_relation("<", idx, argc)) {
|
|
704
|
-
{
|
|
705
|
-
let item_raw = encode_arg((args)[idx], false);
|
|
706
|
-
invoke_checked("value-set", heap, tuple, idx, item_raw);
|
|
707
|
-
}
|
|
708
|
-
((idx = (idx + 1)));
|
|
709
898
|
}
|
|
899
|
+
});
|
|
900
|
+
let this_raw = encode_arg(receiver, true);
|
|
901
|
+
let idx = 0;
|
|
902
|
+
while (__eliscript_numeric_relation("<", idx, argc)) {
|
|
710
903
|
{
|
|
711
|
-
let
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
904
|
+
let item_raw = encode_arg((args)[idx], false);
|
|
905
|
+
invoke_checked("value-set", heap, tuple, idx, item_raw);
|
|
906
|
+
}
|
|
907
|
+
((idx = (idx + 1)));
|
|
908
|
+
}
|
|
909
|
+
{
|
|
910
|
+
let raw = fast_value((__eliscript_truthy(has_hoisted) ? invoke_checked(invoke_name, heap, hoisted_index, this_raw, tuple, argc) : invoke_checked("value-source-invoke-with-this", heap, target_raw, this_raw, tuple, argc)));
|
|
911
|
+
let collections = (__eliscript_truthy(has_collections) ? invoke_checked("heap-collections", heap) : -1);
|
|
912
|
+
if (__eliscript_truthy(val64_singleton_p(raw))) {
|
|
913
|
+
{
|
|
914
|
+
let synced = flush_pending_foreign(heap);
|
|
915
|
+
return ({"kind": "immediate", "raw": raw, "collections": collections, "pendingForeign": synced});
|
|
916
|
+
}
|
|
917
|
+
} else {
|
|
918
|
+
{
|
|
919
|
+
let res_kind = invoke_checked("value-kind", heap, raw);
|
|
920
|
+
if ((res_kind === 4)) {
|
|
921
|
+
{
|
|
922
|
+
let v = (__eliscript_truthy(val64_inline_number_p(raw)) ? val64_decode_inline_number(raw) : bits64_u64_to_f64(invoke_checked("value-number-bits", heap, raw)));
|
|
923
|
+
let enc = v;
|
|
924
|
+
let synced = flush_pending_foreign(heap);
|
|
925
|
+
return ({"kind": "number", "value": enc, "collections": collections, "pendingForeign": synced});
|
|
926
|
+
}
|
|
927
|
+
} else {
|
|
928
|
+
if (((res_kind === 5) && __eliscript_numeric_relation("<=", invoke_checked("value-length", heap, raw), 1024))) {
|
|
722
929
|
{
|
|
723
|
-
let
|
|
724
|
-
let enc = v;
|
|
930
|
+
let str = decode_short_string(heap, raw);
|
|
725
931
|
let synced = flush_pending_foreign(heap);
|
|
726
|
-
return ({"kind": "
|
|
932
|
+
return ({"kind": "string", "value": str, "collections": collections, "pendingForeign": synced});
|
|
727
933
|
}
|
|
728
934
|
} else {
|
|
729
|
-
|
|
935
|
+
{
|
|
936
|
+
let token = (((res_kind === 35) && __eliscript_truthy(has_foreign_token)) ? __eliscript_numeric_ushr(invoke_checked("value-foreign-token", heap, raw), 0) : 0);
|
|
937
|
+
invoke_checked("heap-pin", heap, raw);
|
|
730
938
|
{
|
|
731
|
-
let str = decode_short_string(heap, raw);
|
|
732
939
|
let synced = flush_pending_foreign(heap);
|
|
733
|
-
return ({"kind": "
|
|
734
|
-
}
|
|
735
|
-
} else {
|
|
736
|
-
{
|
|
737
|
-
let token = (((res_kind === 35) && __eliscript_truthy(has_foreign_token)) ? __eliscript_numeric_ushr(invoke_checked("value-foreign-token", heap, raw), 0) : 0);
|
|
738
|
-
invoke_checked("heap-pin", heap, raw);
|
|
739
|
-
{
|
|
740
|
-
let synced = flush_pending_foreign(heap);
|
|
741
|
-
return ({"kind": "pinned", "raw": raw, "valueKind": res_kind, "token": token, "collections": collections, "pendingForeign": synced});
|
|
742
|
-
}
|
|
940
|
+
return ({"kind": "pinned", "raw": raw, "valueKind": res_kind, "token": token, "collections": collections, "pendingForeign": synced});
|
|
743
941
|
}
|
|
744
942
|
}
|
|
745
943
|
}
|
|
@@ -749,161 +947,839 @@ function execute_fast_apply(spec) {
|
|
|
749
947
|
}
|
|
750
948
|
}
|
|
751
949
|
}
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
}
|
|
767
|
-
})();
|
|
768
|
-
restore_root_mark(heap, root_mark);
|
|
769
|
-
(() => {
|
|
770
|
-
try {
|
|
771
|
-
if (__eliscript_truthy(has_call_restore)) {
|
|
772
|
-
return (memory)["invoke"]("value-call-restore", heap, previous_this);
|
|
773
|
-
} else {
|
|
774
|
-
if (__eliscript_truthy(has_call_reset)) {
|
|
775
|
-
return (memory)["invoke"]("value-call-reset", heap);
|
|
776
|
-
} else {
|
|
777
|
-
return null;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
} catch (ignored) {
|
|
781
|
-
return null;
|
|
782
|
-
}
|
|
783
|
-
})();
|
|
950
|
+
}
|
|
951
|
+
} catch (error) {
|
|
952
|
+
if ((!((error === null)) && (__eliscript_value_type(error) === "object") && __eliscript_truthy(Object.hasOwn(error, "__fastApplyRuntimeError")))) {
|
|
953
|
+
{
|
|
954
|
+
let code = (error)["__fastApplyRuntimeError"];
|
|
955
|
+
if (((code === 11) && __eliscript_truthy(has_exception_take))) {
|
|
956
|
+
{
|
|
957
|
+
let thrown = fast_value((memory)["invoke"]("value-exception-take", heap));
|
|
958
|
+
let take_err = (memory)["invoke"]("last-error");
|
|
959
|
+
if (__eliscript_truthy(call_entered)) {
|
|
960
|
+
try {
|
|
961
|
+
(memory)["invoke"]("frame-unwind", heap, target_frame);
|
|
962
|
+
} catch (ignored) {
|
|
963
|
+
null;
|
|
784
964
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
965
|
+
restore_root_mark(heap, root_mark);
|
|
966
|
+
try {
|
|
967
|
+
if (__eliscript_truthy(has_call_restore)) {
|
|
968
|
+
(memory)["invoke"]("value-call-restore", heap, previous_this);
|
|
969
|
+
} else {
|
|
970
|
+
if (__eliscript_truthy(has_call_reset)) {
|
|
971
|
+
(memory)["invoke"]("value-call-reset", heap);
|
|
972
|
+
} else {
|
|
973
|
+
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
} catch (ignored) {
|
|
977
|
+
null;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
if ((take_err !== 0)) {
|
|
981
|
+
{
|
|
982
|
+
let synced = flush_pending_foreign(heap);
|
|
983
|
+
return ({"kind": "runtimeError", "code": take_err, "exceptionClass": 0, "pendingForeign": synced});
|
|
984
|
+
}
|
|
985
|
+
} else {
|
|
986
|
+
{
|
|
987
|
+
let thrown_kind = (!(__eliscript_truthy(val64_singleton_p(thrown))) ? (memory)["invoke"]("value-kind", heap, thrown) : 0);
|
|
988
|
+
let thrown_token = (((thrown_kind === 35) && __eliscript_truthy(has_foreign_token)) ? __eliscript_numeric_ushr((memory)["invoke"]("value-foreign-token", heap, thrown), 0) : 0);
|
|
989
|
+
let thrown_pinned = ((!__eliscript_truthy(val64_singleton_p(thrown))) && (thrown_kind !== 35));
|
|
990
|
+
if (__eliscript_truthy(thrown_pinned)) {
|
|
991
|
+
(memory)["invoke"]("heap-pin", heap, thrown);
|
|
789
992
|
}
|
|
790
|
-
} else {
|
|
791
993
|
{
|
|
792
|
-
let
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
994
|
+
let synced = flush_pending_foreign(heap);
|
|
995
|
+
return ({"kind": "thrown", "raw": thrown, "valueKind": thrown_kind, "token": thrown_token, "pinned": thrown_pinned, "pendingForeign": synced});
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
} else {
|
|
1001
|
+
{
|
|
1002
|
+
let cls = (__eliscript_truthy(has_exception_class) ? __eliscript_numeric_ushr((memory)["invoke"]("value-exception-class", heap), 0) : 0);
|
|
1003
|
+
if (__eliscript_truthy(has_exception_class_set)) {
|
|
1004
|
+
(memory)["invoke"]("value-exception-class-set", heap, 0);
|
|
1005
|
+
}
|
|
1006
|
+
if (__eliscript_truthy(call_entered)) {
|
|
1007
|
+
try {
|
|
1008
|
+
(memory)["invoke"]("frame-unwind", heap, target_frame);
|
|
1009
|
+
} catch (ignored) {
|
|
1010
|
+
null;
|
|
1011
|
+
}
|
|
1012
|
+
restore_root_mark(heap, root_mark);
|
|
1013
|
+
try {
|
|
1014
|
+
if (__eliscript_truthy(has_call_restore)) {
|
|
1015
|
+
(memory)["invoke"]("value-call-restore", heap, previous_this);
|
|
1016
|
+
} else {
|
|
1017
|
+
if (__eliscript_truthy(has_call_reset)) {
|
|
1018
|
+
(memory)["invoke"]("value-call-reset", heap);
|
|
1019
|
+
} else {
|
|
1020
|
+
|
|
801
1021
|
}
|
|
802
1022
|
}
|
|
1023
|
+
} catch (ignored) {
|
|
1024
|
+
null;
|
|
803
1025
|
}
|
|
804
1026
|
}
|
|
805
|
-
} else {
|
|
806
1027
|
{
|
|
807
|
-
let
|
|
808
|
-
|
|
809
|
-
|
|
1028
|
+
let synced = flush_pending_foreign(heap);
|
|
1029
|
+
return ({"kind": "runtimeError", "code": code, "exceptionClass": cls, "pendingForeign": synced});
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
} else {
|
|
1035
|
+
if (__eliscript_truthy(call_entered)) {
|
|
1036
|
+
try {
|
|
1037
|
+
(memory)["invoke"]("frame-unwind", heap, target_frame);
|
|
1038
|
+
} catch (ignored) {
|
|
1039
|
+
null;
|
|
1040
|
+
}
|
|
1041
|
+
restore_root_mark(heap, root_mark);
|
|
1042
|
+
try {
|
|
1043
|
+
if (__eliscript_truthy(has_call_restore)) {
|
|
1044
|
+
(memory)["invoke"]("value-call-restore", heap, previous_this);
|
|
1045
|
+
} else {
|
|
1046
|
+
if (__eliscript_truthy(has_call_reset)) {
|
|
1047
|
+
(memory)["invoke"]("value-call-reset", heap);
|
|
1048
|
+
} else {
|
|
1049
|
+
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
} catch (ignored) {
|
|
1053
|
+
null;
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
return ((__eliscript_value_23) => { throw __eliscript_value_23; })(error);
|
|
1057
|
+
}
|
|
1058
|
+
} finally {
|
|
1059
|
+
if (!((pooled_tuple === undefined))) {
|
|
1060
|
+
release_apply_tuple(heap, pooled_argc, pooled_tuple);
|
|
1061
|
+
}
|
|
1062
|
+
while (__eliscript_numeric_relation(">", ((pinned) ?? []).length, 0)) {
|
|
1063
|
+
try {
|
|
1064
|
+
(memory)["invoke"]("heap-release", heap, (pinned)["pop"]());
|
|
1065
|
+
} catch (ignored) {
|
|
1066
|
+
null;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
if (__eliscript_truthy(pinned_previous_this)) {
|
|
1070
|
+
try {
|
|
1071
|
+
(memory)["invoke"]("heap-release", heap, previous_this);
|
|
1072
|
+
} catch (ignored) {
|
|
1073
|
+
null;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
const runner_ge = (a, b) => a >= b;
|
|
1081
|
+
__eliscript_tdz_ready_27 = true;
|
|
1082
|
+
const runner_lt = (a, b) => a < b;
|
|
1083
|
+
__eliscript_tdz_ready_28 = true;
|
|
1084
|
+
function runner_resolve_block(v, ctrl, rawVal) {
|
|
1085
|
+
(fast_number_buffer)["setBigUint64"](0, rawVal, true);
|
|
1086
|
+
{
|
|
1087
|
+
let lo = (fast_number_buffer)["getUint32"](0, true);
|
|
1088
|
+
let hi = (fast_number_buffer)["getUint32"](4, true);
|
|
1089
|
+
if (((__eliscript_numeric_ushr(hi, 16) === 65528) && (__eliscript_numeric_and(hi, 65535) === (v)["getUint32"]((ctrl + 52), true)) && (__eliscript_numeric_and(lo, 7) === 0) && __eliscript_truthy((__eliscript_tdz_ready_27 === true ? runner_ge : __eliscript_tdz_error("runner_ge"))(lo, (v)["getUint32"]((ctrl + 56), true))) && __eliscript_truthy((__eliscript_tdz_ready_28 === true ? runner_lt : __eliscript_tdz_error("runner_lt"))(lo, (v)["getUint32"]((ctrl + 60), true))) && ((v)["getUint32"](__eliscript_numeric_sub(lo, 8), true) === 1330726989) && (__eliscript_numeric_and((v)["getUint32"](__eliscript_numeric_sub(lo, 24), true), 1) !== 0))) {
|
|
1090
|
+
{
|
|
1091
|
+
let segCount = (v)["getUint32"]((ctrl + 48), true);
|
|
1092
|
+
let inSeg = false;
|
|
1093
|
+
if ((segCount === 1)) {
|
|
1094
|
+
{
|
|
1095
|
+
let seg = (v)["getUint32"]((ctrl + 4), true);
|
|
1096
|
+
((inSeg = ((__eliscript_value_24) => (__eliscript_truthy(__eliscript_value_24) ? (__eliscript_tdz_ready_28 === true ? runner_lt : __eliscript_tdz_error("runner_lt"))(lo, (v)["getUint32"]((seg + 8), true)) : __eliscript_value_24))((__eliscript_tdz_ready_27 === true ? runner_ge : __eliscript_tdz_error("runner_ge"))(__eliscript_numeric_sub(lo, 32), (seg + 32)))));
|
|
1097
|
+
}
|
|
1098
|
+
} else {
|
|
1099
|
+
{
|
|
1100
|
+
let tail = (v)["getUint32"]((ctrl + 8), true);
|
|
1101
|
+
if (((tail !== 0) && __eliscript_truthy((__eliscript_tdz_ready_27 === true ? runner_ge : __eliscript_tdz_error("runner_ge"))(__eliscript_numeric_sub(lo, 32), (tail + 32))) && __eliscript_truthy((__eliscript_tdz_ready_28 === true ? runner_lt : __eliscript_tdz_error("runner_lt"))(lo, (v)["getUint32"]((tail + 8), true))))) {
|
|
1102
|
+
((inSeg = true));
|
|
1103
|
+
}
|
|
1104
|
+
if ((!__eliscript_truthy(inSeg))) {
|
|
1105
|
+
{
|
|
1106
|
+
let seg = (v)["getUint32"]((ctrl + 4), true);
|
|
1107
|
+
while (((seg !== 0) && (seg !== tail) && !(__eliscript_truthy(inSeg)))) {
|
|
1108
|
+
if ((__eliscript_truthy((__eliscript_tdz_ready_27 === true ? runner_ge : __eliscript_tdz_error("runner_ge"))(__eliscript_numeric_sub(lo, 32), (seg + 32))) && __eliscript_truthy((__eliscript_tdz_ready_28 === true ? runner_lt : __eliscript_tdz_error("runner_lt"))(lo, (v)["getUint32"]((seg + 8), true))))) {
|
|
1109
|
+
((inSeg = true));
|
|
1110
|
+
} else {
|
|
1111
|
+
((seg = (v)["getUint32"](seg, true)));
|
|
810
1112
|
}
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
if (__eliscript_truthy(inSeg)) {
|
|
1119
|
+
return (v)["getUint32"](__eliscript_numeric_sub(lo, 4), true);
|
|
1120
|
+
} else {
|
|
1121
|
+
return null;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
} else {
|
|
1125
|
+
return null;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
function runner_read_utf16(v, offset, len) {
|
|
1130
|
+
if ((len === 0)) {
|
|
1131
|
+
return "";
|
|
1132
|
+
} else {
|
|
1133
|
+
{
|
|
1134
|
+
let units = new (globalThis.Array)(len);
|
|
1135
|
+
let ui = 0;
|
|
1136
|
+
while (__eliscript_numeric_relation("<", ui, len)) {
|
|
1137
|
+
((units)[ui] = (v)["getUint16"]((offset + __eliscript_numeric_mul(ui, 2)), true));
|
|
1138
|
+
((ui = (ui + 1)));
|
|
1139
|
+
}
|
|
1140
|
+
return __eliscript_at(Reflect, "apply")(globalThis.String.fromCharCode, undefined, units);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
function runner_read_string_fast(v, ctrl, rawKey) {
|
|
1145
|
+
(fast_number_buffer)["setBigUint64"](0, rawKey, true);
|
|
1146
|
+
{
|
|
1147
|
+
let klo = (fast_number_buffer)["getUint32"](0, true);
|
|
1148
|
+
let khi = (fast_number_buffer)["getUint32"](4, true);
|
|
1149
|
+
let ktag = __eliscript_numeric_ushr(khi, 16);
|
|
1150
|
+
if ((ktag === 65529)) {
|
|
1151
|
+
if (((__eliscript_numeric_and(khi, 65535) === (v)["getUint32"]((ctrl + 32), true)) && __eliscript_numeric_relation("<", klo, (v)["getUint32"]((ctrl + 28), true)))) {
|
|
1152
|
+
{
|
|
1153
|
+
let rp = (v)["getUint32"](((v)["getUint32"]((ctrl + 24), true) + __eliscript_numeric_mul(klo, 4)), true);
|
|
1154
|
+
let rend = (256 + (v)["getUint32"]((ctrl + 36), true));
|
|
1155
|
+
if ((__eliscript_numeric_relation(">=", rp, 288) && (__eliscript_numeric_and(rp, 7) === 0) && __eliscript_numeric_relation("<=", rp, __eliscript_numeric_sub(rend, 32)) && ((v)["getUint32"](rp, true) === 5))) {
|
|
1156
|
+
{
|
|
1157
|
+
let slen = (v)["getUint32"]((rp + 4), true);
|
|
1158
|
+
if ((__eliscript_numeric_relation("<=", slen, 1024) && __eliscript_numeric_relation("<=", (rp + 32 + __eliscript_numeric_mul(slen, 2)), rend))) {
|
|
1159
|
+
return runner_read_utf16(v, (rp + 32), slen);
|
|
1160
|
+
} else {
|
|
1161
|
+
return null;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
} else {
|
|
1165
|
+
return null;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
} else {
|
|
1169
|
+
return null;
|
|
1170
|
+
}
|
|
1171
|
+
} else {
|
|
1172
|
+
if ((ktag === 65528)) {
|
|
1173
|
+
{
|
|
1174
|
+
let bp = runner_resolve_block(v, ctrl, rawKey);
|
|
1175
|
+
if ((__eliscript_truthy(bp) && ((v)["getUint32"](bp, true) === 5) && ((v)["getUint32"]((bp + 12), true) !== 0))) {
|
|
1176
|
+
{
|
|
1177
|
+
let slen = (v)["getUint32"]((bp + 4), true);
|
|
1178
|
+
if (__eliscript_numeric_relation("<=", slen, 1024)) {
|
|
1179
|
+
return runner_read_utf16(v, (bp + 32), slen);
|
|
1180
|
+
} else {
|
|
1181
|
+
return null;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
} else {
|
|
1185
|
+
return null;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
} else {
|
|
1189
|
+
return null;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
function encode_bundle_num(n) {
|
|
1195
|
+
if (__eliscript_truthy(Number.isNaN(n))) {
|
|
1196
|
+
return "Z";
|
|
1197
|
+
} else {
|
|
1198
|
+
if (!(__eliscript_truthy(Number.isFinite(n)))) {
|
|
1199
|
+
if (__eliscript_numeric_relation(">", n, 0)) {
|
|
1200
|
+
return "P";
|
|
1201
|
+
} else {
|
|
1202
|
+
return "M";
|
|
1203
|
+
}
|
|
1204
|
+
} else {
|
|
1205
|
+
if (__eliscript_truthy(Object.is(n, __eliscript_numeric_mul(-1, 0)))) {
|
|
1206
|
+
return "m";
|
|
1207
|
+
} else {
|
|
1208
|
+
return (String("n") + String(n));
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
function runner_inspect_bundle_val(v, ctrl, rawVal) {
|
|
1214
|
+
if ((rawVal === VAL64_NIL)) {
|
|
1215
|
+
return ({"tok": "z"});
|
|
1216
|
+
} else {
|
|
1217
|
+
if ((rawVal === VAL64_FALSE)) {
|
|
1218
|
+
return ({"tok": "f"});
|
|
1219
|
+
} else {
|
|
1220
|
+
if ((rawVal === VAL64_TRUE)) {
|
|
1221
|
+
return ({"tok": "t"});
|
|
1222
|
+
} else {
|
|
1223
|
+
if ((rawVal === VAL64_UNDEFINED)) {
|
|
1224
|
+
return ({"tok": "u"});
|
|
1225
|
+
} else {
|
|
1226
|
+
if ((rawVal === VAL64_HOLE)) {
|
|
1227
|
+
return null;
|
|
1228
|
+
} else {
|
|
1229
|
+
(fast_number_buffer)["setBigUint64"](0, rawVal, true);
|
|
1230
|
+
{
|
|
1231
|
+
let vlo = (fast_number_buffer)["getUint32"](0, true);
|
|
1232
|
+
let vhi = (fast_number_buffer)["getUint32"](4, true);
|
|
1233
|
+
let vtag = __eliscript_numeric_ushr(vhi, 16);
|
|
1234
|
+
if ((__eliscript_numeric_relation(">=", vhi, 65536) && __eliscript_numeric_relation("<", vhi, 4294443008))) {
|
|
1235
|
+
(fast_number_buffer)["setUint32"](4, __eliscript_numeric_sub(vhi, 65536), true);
|
|
1236
|
+
return ({"tok": encode_bundle_num((fast_number_buffer)["getFloat64"](0, true))});
|
|
1237
|
+
} else {
|
|
1238
|
+
if ((vtag === 65529)) {
|
|
1239
|
+
if (((__eliscript_numeric_and(vhi, 65535) === (v)["getUint32"]((ctrl + 32), true)) && __eliscript_numeric_relation("<", vlo, (v)["getUint32"]((ctrl + 28), true)))) {
|
|
1240
|
+
{
|
|
1241
|
+
let rp = (v)["getUint32"](((v)["getUint32"]((ctrl + 24), true) + __eliscript_numeric_mul(vlo, 4)), true);
|
|
1242
|
+
let rend = (256 + (v)["getUint32"]((ctrl + 36), true));
|
|
1243
|
+
if ((__eliscript_numeric_relation(">=", rp, 288) && (__eliscript_numeric_and(rp, 7) === 0) && __eliscript_numeric_relation("<=", rp, __eliscript_numeric_sub(rend, 32)))) {
|
|
1244
|
+
{
|
|
1245
|
+
let rk = (v)["getUint32"](rp, true);
|
|
1246
|
+
if ((rk === 4)) {
|
|
1247
|
+
return ({"tok": encode_bundle_num((v)["getFloat64"]((rp + 32), true))});
|
|
1248
|
+
} else {
|
|
1249
|
+
if ((rk === 5)) {
|
|
1250
|
+
{
|
|
1251
|
+
let slen = (v)["getUint32"]((rp + 4), true);
|
|
1252
|
+
if ((__eliscript_numeric_relation("<=", slen, 1024) && __eliscript_numeric_relation("<=", (rp + 32 + __eliscript_numeric_mul(slen, 2)), rend))) {
|
|
1253
|
+
return ({"tok": wire_encode_str(runner_read_utf16(v, (rp + 32), slen))});
|
|
1254
|
+
} else {
|
|
1255
|
+
return null;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
} else {
|
|
1259
|
+
return null;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
} else {
|
|
816
1264
|
return null;
|
|
817
1265
|
}
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
1266
|
+
}
|
|
1267
|
+
} else {
|
|
1268
|
+
return null;
|
|
1269
|
+
}
|
|
1270
|
+
} else {
|
|
1271
|
+
if ((vtag === 65528)) {
|
|
1272
|
+
{
|
|
1273
|
+
let ep = runner_resolve_block(v, ctrl, rawVal);
|
|
1274
|
+
if (__eliscript_truthy(ep)) {
|
|
1275
|
+
{
|
|
1276
|
+
let ek = (v)["getUint32"](ep, true);
|
|
1277
|
+
if ((ek === 4)) {
|
|
1278
|
+
return ({"tok": encode_bundle_num((v)["getFloat64"]((ep + 32), true))});
|
|
827
1279
|
} else {
|
|
828
|
-
|
|
1280
|
+
if ((ek === 5)) {
|
|
1281
|
+
if (((v)["getUint32"]((ep + 12), true) !== 0)) {
|
|
1282
|
+
{
|
|
1283
|
+
let slen = (v)["getUint32"]((ep + 4), true);
|
|
1284
|
+
if (__eliscript_numeric_relation("<=", slen, 1024)) {
|
|
1285
|
+
return ({"tok": wire_encode_str(runner_read_utf16(v, (ep + 32), slen))});
|
|
1286
|
+
} else {
|
|
1287
|
+
return null;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
} else {
|
|
1291
|
+
return null;
|
|
1292
|
+
}
|
|
1293
|
+
} else {
|
|
1294
|
+
if ((ek === 35)) {
|
|
1295
|
+
{
|
|
1296
|
+
let token = __eliscript_numeric_ushr((v)["getUint32"]((ep + 32), true), 0);
|
|
1297
|
+
return ({"tok": (String("x") + String(rawVal) + String(":") + String(token))});
|
|
1298
|
+
}
|
|
1299
|
+
} else {
|
|
1300
|
+
if (((ek === 13) || (ek === 14))) {
|
|
1301
|
+
return ({"tok": (String("o") + String(rawVal) + String(":") + String(ek)), "pinRaw": rawVal, "ek": ek, "ep": ep});
|
|
1302
|
+
} else {
|
|
1303
|
+
return null;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
829
1307
|
}
|
|
830
1308
|
}
|
|
831
|
-
}
|
|
1309
|
+
} else {
|
|
832
1310
|
return null;
|
|
833
1311
|
}
|
|
834
|
-
})();
|
|
835
|
-
}
|
|
836
|
-
{
|
|
837
|
-
let synced = flush_pending_foreign(heap);
|
|
838
|
-
return ({"kind": "runtimeError", "code": code, "exceptionClass": cls, "pendingForeign": synced});
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
} else {
|
|
844
|
-
if (__eliscript_truthy(call_entered)) {
|
|
845
|
-
(() => {
|
|
846
|
-
try {
|
|
847
|
-
return (memory)["invoke"]("frame-unwind", heap, target_frame);
|
|
848
|
-
} catch (ignored) {
|
|
849
|
-
return null;
|
|
850
|
-
}
|
|
851
|
-
})();
|
|
852
|
-
restore_root_mark(heap, root_mark);
|
|
853
|
-
(() => {
|
|
854
|
-
try {
|
|
855
|
-
if (__eliscript_truthy(has_call_restore)) {
|
|
856
|
-
return (memory)["invoke"]("value-call-restore", heap, previous_this);
|
|
857
|
-
} else {
|
|
858
|
-
if (__eliscript_truthy(has_call_reset)) {
|
|
859
|
-
return (memory)["invoke"]("value-call-reset", heap);
|
|
860
|
-
} else {
|
|
861
|
-
return null;
|
|
862
1312
|
}
|
|
1313
|
+
} else {
|
|
1314
|
+
return null;
|
|
863
1315
|
}
|
|
864
|
-
} catch (ignored) {
|
|
865
|
-
return null;
|
|
866
1316
|
}
|
|
867
|
-
}
|
|
1317
|
+
}
|
|
868
1318
|
}
|
|
869
|
-
return ((__eliscript_value_30) => { throw __eliscript_value_30; })(error);
|
|
870
1319
|
}
|
|
871
|
-
}
|
|
872
|
-
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
function execute_fast_get(id, heap, raw, key) {
|
|
1326
|
+
{
|
|
1327
|
+
let v = (memory)["view"]();
|
|
1328
|
+
let acquired_pins = [];
|
|
1329
|
+
if (((v == null) || __eliscript_truthy(val64_singleton_p(raw)) || (key === "__proto__"))) {
|
|
1330
|
+
return (String("P") + String(id) + String("\tM"));
|
|
1331
|
+
} else {
|
|
1332
|
+
{
|
|
1333
|
+
let ctrl = (v)["getUint32"]((heap + 16), true);
|
|
1334
|
+
let bl = (!(((v)["buffer"] == null)) ? ((v)["buffer"])["byteLength"] : (v)["byteLength"]);
|
|
1335
|
+
if (((ctrl === 0) || __eliscript_numeric_relation("<", bl, (ctrl + 144)) || ((v)["getUint32"](ctrl, true) !== 1212498256))) {
|
|
1336
|
+
return (String("P") + String(id) + String("\tM"));
|
|
1337
|
+
} else {
|
|
1338
|
+
{
|
|
1339
|
+
let out = [(String("P") + String(id)), "G"];
|
|
1340
|
+
let emitted = new (globalThis.Set)();
|
|
1341
|
+
let queue = [({"raw": raw, "keyFilter": key, "isRoot": true})];
|
|
1342
|
+
let qhead = 0;
|
|
1343
|
+
let block_count = 0;
|
|
1344
|
+
let root_ok = false;
|
|
1345
|
+
let aborted = false;
|
|
873
1346
|
(() => {
|
|
874
1347
|
try {
|
|
875
|
-
|
|
876
|
-
|
|
1348
|
+
while ((!(__eliscript_truthy(aborted)) && __eliscript_numeric_relation("<", qhead, ((queue) ?? []).length) && __eliscript_numeric_relation("<", block_count, 48))) {
|
|
1349
|
+
{
|
|
1350
|
+
let item = (queue)[qhead];
|
|
1351
|
+
let blk_raw = (item)["raw"];
|
|
1352
|
+
let is_root = (item)["isRoot"];
|
|
1353
|
+
((qhead = (qhead + 1)));
|
|
1354
|
+
if ((!__eliscript_truthy((emitted)["has"](blk_raw)))) {
|
|
1355
|
+
{
|
|
1356
|
+
let p = runner_resolve_block(v, ctrl, blk_raw);
|
|
1357
|
+
if (__eliscript_truthy(p)) {
|
|
1358
|
+
{
|
|
1359
|
+
let kind = (v)["getUint32"](p, true);
|
|
1360
|
+
if ((kind === 14)) {
|
|
1361
|
+
{
|
|
1362
|
+
let flags = (v)["getUint32"]((p + 24), true);
|
|
1363
|
+
let table = (v)["getBigUint64"]((p + 32), true);
|
|
1364
|
+
let len = (v)["getUint32"]((p + 4), true);
|
|
1365
|
+
let cap = (v)["getUint32"]((p + 8), true);
|
|
1366
|
+
if (((__eliscript_numeric_and(flags, 282656) === 0) && (table === VAL64_NIL))) {
|
|
1367
|
+
if ((__eliscript_numeric_relation("<=", len, 32) && (len === cap))) {
|
|
1368
|
+
{
|
|
1369
|
+
let vals = [];
|
|
1370
|
+
let pending_pins = [];
|
|
1371
|
+
let elem_ok = true;
|
|
1372
|
+
let i = 0;
|
|
1373
|
+
while ((__eliscript_truthy(elem_ok) && __eliscript_numeric_relation("<", i, len))) {
|
|
1374
|
+
{
|
|
1375
|
+
let elem = (v)["getBigUint64"]((p + 48 + __eliscript_numeric_mul(i, 8)), true);
|
|
1376
|
+
let dec = runner_inspect_bundle_val(v, ctrl, elem);
|
|
1377
|
+
if (__eliscript_truthy(dec)) {
|
|
1378
|
+
(vals)["push"](dec);
|
|
1379
|
+
if (__eliscript_truthy((dec)["pinRaw"])) {
|
|
1380
|
+
(pending_pins)["push"](dec);
|
|
1381
|
+
}
|
|
1382
|
+
} else {
|
|
1383
|
+
((elem_ok = false));
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
((i = (i + 1)));
|
|
1387
|
+
}
|
|
1388
|
+
if (__eliscript_truthy(elem_ok)) {
|
|
1389
|
+
{
|
|
1390
|
+
let pin_ok = true;
|
|
1391
|
+
let pi = 0;
|
|
1392
|
+
let block_pins_start = ((acquired_pins) ?? []).length;
|
|
1393
|
+
while ((__eliscript_truthy(pin_ok) && __eliscript_numeric_relation("<", pi, ((pending_pins) ?? []).length))) {
|
|
1394
|
+
{
|
|
1395
|
+
let pr = ((pending_pins)[pi])["pinRaw"];
|
|
1396
|
+
if ((!((memory)["invoke"]("last-error") === 0))) {
|
|
1397
|
+
(memory)["invoke"]("value-error-restore", 0);
|
|
1398
|
+
}
|
|
1399
|
+
(memory)["invoke"]("heap-pin", heap, pr);
|
|
1400
|
+
if (((memory)["invoke"]("last-error") === 0)) {
|
|
1401
|
+
(acquired_pins)["push"](pr);
|
|
1402
|
+
} else {
|
|
1403
|
+
(memory)["invoke"]("value-error-restore", 0);
|
|
1404
|
+
((pin_ok = false));
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
((pi = (pi + 1)));
|
|
1408
|
+
}
|
|
1409
|
+
if (!(__eliscript_truthy(pin_ok))) {
|
|
1410
|
+
while (__eliscript_numeric_relation(">", ((acquired_pins) ?? []).length, block_pins_start)) {
|
|
1411
|
+
try {
|
|
1412
|
+
(memory)["invoke"]("heap-release", heap, (acquired_pins)["pop"]());
|
|
1413
|
+
} catch (ignored) {
|
|
1414
|
+
null;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
if (__eliscript_truthy(is_root)) {
|
|
1418
|
+
((aborted = true));
|
|
1419
|
+
}
|
|
1420
|
+
} else {
|
|
1421
|
+
{
|
|
1422
|
+
let qi = 0;
|
|
1423
|
+
while (__eliscript_numeric_relation("<", qi, ((pending_pins) ?? []).length)) {
|
|
1424
|
+
{
|
|
1425
|
+
let pr = ((pending_pins)[qi])["pinRaw"];
|
|
1426
|
+
if ((!__eliscript_truthy((emitted)["has"](pr)))) {
|
|
1427
|
+
(queue)["push"](({"raw": pr, "keyFilter": null, "isRoot": false}));
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
((qi = (qi + 1)));
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
(emitted)["add"](blk_raw);
|
|
1434
|
+
((block_count = (block_count + 1)));
|
|
1435
|
+
if (__eliscript_truthy(is_root)) {
|
|
1436
|
+
((root_ok = true));
|
|
1437
|
+
}
|
|
1438
|
+
(out)["push"]("Y", (String(blk_raw)), len, len);
|
|
1439
|
+
{
|
|
1440
|
+
let vi = 0;
|
|
1441
|
+
while (__eliscript_numeric_relation("<", vi, len)) {
|
|
1442
|
+
(out)["push"](vi, ((vals)[vi])["tok"]);
|
|
1443
|
+
((vi = (vi + 1)));
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
} else {
|
|
1451
|
+
if (__eliscript_truthy(is_root)) {
|
|
1452
|
+
if (((item)["keyFilter"] === "length")) {
|
|
1453
|
+
(emitted)["add"](blk_raw);
|
|
1454
|
+
((root_ok = true), (block_count = (block_count + 1)));
|
|
1455
|
+
(out)["push"]("Y", (String(blk_raw)), len, 0);
|
|
1456
|
+
} else {
|
|
1457
|
+
{
|
|
1458
|
+
const __eliscript_value_25 = (item)["keyFilter"];
|
|
1459
|
+
{
|
|
1460
|
+
let kf = __eliscript_value_25;
|
|
1461
|
+
{
|
|
1462
|
+
const __eliscript_value_26 = (__eliscript_truthy((/^(?:0|[1-9]\d{0,9})$/)["test"](kf)) ? globalThis.Number(kf) : -1);
|
|
1463
|
+
{
|
|
1464
|
+
let idx = __eliscript_value_26;
|
|
1465
|
+
if ((__eliscript_numeric_relation(">=", idx, 0) && __eliscript_numeric_relation("<", idx, len) && __eliscript_numeric_relation("<", idx, cap))) {
|
|
1466
|
+
{
|
|
1467
|
+
let elem = (v)["getBigUint64"]((p + 48 + __eliscript_numeric_mul(idx, 8)), true);
|
|
1468
|
+
let dec = runner_inspect_bundle_val(v, ctrl, elem);
|
|
1469
|
+
if (__eliscript_truthy(dec)) {
|
|
1470
|
+
{
|
|
1471
|
+
let pin_ok = true;
|
|
1472
|
+
if (__eliscript_truthy((dec)["pinRaw"])) {
|
|
1473
|
+
(memory)["invoke"]("heap-pin", heap, (dec)["pinRaw"]);
|
|
1474
|
+
if (((memory)["invoke"]("last-error") === 0)) {
|
|
1475
|
+
(acquired_pins)["push"]((dec)["pinRaw"]);
|
|
1476
|
+
} else {
|
|
1477
|
+
(memory)["invoke"]("value-error-restore", 0);
|
|
1478
|
+
((pin_ok = false));
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
if (__eliscript_truthy(pin_ok)) {
|
|
1482
|
+
(emitted)["add"](blk_raw);
|
|
1483
|
+
((root_ok = true), (block_count = (block_count + 1)));
|
|
1484
|
+
(out)["push"]("Y", (String(blk_raw)), len, 1, idx, (dec)["tok"]);
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
} else {
|
|
1500
|
+
if ((kind === 13)) {
|
|
1501
|
+
{
|
|
1502
|
+
let flags = (v)["getUint32"]((p + 24), true);
|
|
1503
|
+
if ((((v)["getUint32"]((p + 20), true) === 0) && ((flags === 0) || (flags === 65536)))) {
|
|
1504
|
+
{
|
|
1505
|
+
let table = (v)["getBigUint64"]((p + 32), true);
|
|
1506
|
+
let inline = (table === blk_raw);
|
|
1507
|
+
let tp = (__eliscript_truthy(inline) ? p : runner_resolve_block(v, ctrl, table));
|
|
1508
|
+
if ((__eliscript_truthy(tp) && (__eliscript_truthy(inline) || ((v)["getUint32"](tp, true) === 10)))) {
|
|
1509
|
+
{
|
|
1510
|
+
let cap = (v)["getUint32"]((tp + 8), true);
|
|
1511
|
+
let used = (v)["getUint32"]((tp + 12), true);
|
|
1512
|
+
if ((__eliscript_numeric_relation("<=", used, cap) && __eliscript_numeric_relation("<=", used, (__eliscript_truthy(is_root) ? 32 : 16)))) {
|
|
1513
|
+
{
|
|
1514
|
+
let cells = (tp + (__eliscript_truthy(inline) ? 80 : 32) + __eliscript_numeric_mul(cap, 8));
|
|
1515
|
+
let entries = [];
|
|
1516
|
+
let pending_pins = [];
|
|
1517
|
+
let ci = 0;
|
|
1518
|
+
let all_ok = true;
|
|
1519
|
+
while ((__eliscript_truthy(all_ok) && __eliscript_numeric_relation("<", ci, used))) {
|
|
1520
|
+
{
|
|
1521
|
+
let cell = (cells + __eliscript_numeric_mul(ci, 32));
|
|
1522
|
+
let cstate = (v)["getUint32"]((cell + 28), true);
|
|
1523
|
+
if ((cstate !== 0)) {
|
|
1524
|
+
{
|
|
1525
|
+
let kstr = runner_read_string_fast(v, ctrl, (v)["getBigUint64"](cell, true));
|
|
1526
|
+
let dflags = (((__eliscript_numeric_and(flags, 65536) !== 0) && (__eliscript_numeric_and(cstate, 3) === 3)) ? __eliscript_numeric_ushr(cstate, 2) : 7);
|
|
1527
|
+
if ((!((__eliscript_value_type(kstr) === "string")) || (__eliscript_numeric_and(dflags, 8) !== 0) || (kstr === "__proto__"))) {
|
|
1528
|
+
((all_ok = false));
|
|
1529
|
+
} else {
|
|
1530
|
+
{
|
|
1531
|
+
let dec = runner_inspect_bundle_val(v, ctrl, (v)["getBigUint64"]((cell + 8), true));
|
|
1532
|
+
if (!(__eliscript_truthy(dec))) {
|
|
1533
|
+
((all_ok = false));
|
|
1534
|
+
} else {
|
|
1535
|
+
{
|
|
1536
|
+
let pair = ({"key": kstr, "dec": dec});
|
|
1537
|
+
(entries)["push"](pair);
|
|
1538
|
+
if (__eliscript_truthy((dec)["pinRaw"])) {
|
|
1539
|
+
(pending_pins)["push"](pair);
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
((ci = (ci + 1)));
|
|
1549
|
+
}
|
|
1550
|
+
if (__eliscript_truthy(all_ok)) {
|
|
1551
|
+
{
|
|
1552
|
+
let pin_ok = true;
|
|
1553
|
+
let pi = 0;
|
|
1554
|
+
let kf = (item)["keyFilter"];
|
|
1555
|
+
if ((__eliscript_truthy(is_root) && __eliscript_numeric_relation("<=", used, 16))) {
|
|
1556
|
+
(pending_pins)["sort"](((a, b) => {
|
|
1557
|
+
{
|
|
1558
|
+
let ak = ((a)["key"] === kf);
|
|
1559
|
+
let bk = ((b)["key"] === kf);
|
|
1560
|
+
if (!((ak === bk))) {
|
|
1561
|
+
if (__eliscript_truthy(ak)) {
|
|
1562
|
+
return -1;
|
|
1563
|
+
} else {
|
|
1564
|
+
return 1;
|
|
1565
|
+
}
|
|
1566
|
+
} else {
|
|
1567
|
+
return __eliscript_numeric_sub(((b)["dec"])["ek"], ((a)["dec"])["ek"]);
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
}));
|
|
1571
|
+
}
|
|
1572
|
+
if ((!(__eliscript_truthy(is_root)) || __eliscript_numeric_relation("<=", used, 16))) {
|
|
1573
|
+
{
|
|
1574
|
+
let block_pins_start = ((acquired_pins) ?? []).length;
|
|
1575
|
+
while ((__eliscript_truthy(pin_ok) && __eliscript_numeric_relation("<", pi, ((pending_pins) ?? []).length))) {
|
|
1576
|
+
{
|
|
1577
|
+
let pr = (((pending_pins)[pi])["dec"])["pinRaw"];
|
|
1578
|
+
if ((!((memory)["invoke"]("last-error") === 0))) {
|
|
1579
|
+
(memory)["invoke"]("value-error-restore", 0);
|
|
1580
|
+
}
|
|
1581
|
+
(memory)["invoke"]("heap-pin", heap, pr);
|
|
1582
|
+
if (((memory)["invoke"]("last-error") === 0)) {
|
|
1583
|
+
(acquired_pins)["push"](pr);
|
|
1584
|
+
} else {
|
|
1585
|
+
(memory)["invoke"]("value-error-restore", 0);
|
|
1586
|
+
((pin_ok = false));
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
((pi = (pi + 1)));
|
|
1590
|
+
}
|
|
1591
|
+
if (!(__eliscript_truthy(pin_ok))) {
|
|
1592
|
+
while (__eliscript_numeric_relation(">", ((acquired_pins) ?? []).length, block_pins_start)) {
|
|
1593
|
+
try {
|
|
1594
|
+
(memory)["invoke"]("heap-release", heap, (acquired_pins)["pop"]());
|
|
1595
|
+
} catch (ignored) {
|
|
1596
|
+
null;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
if (__eliscript_truthy(is_root)) {
|
|
1600
|
+
((aborted = true));
|
|
1601
|
+
}
|
|
1602
|
+
} else {
|
|
1603
|
+
{
|
|
1604
|
+
let qi = 0;
|
|
1605
|
+
while (__eliscript_numeric_relation("<", qi, ((pending_pins) ?? []).length)) {
|
|
1606
|
+
{
|
|
1607
|
+
let pr = (((pending_pins)[qi])["dec"])["pinRaw"];
|
|
1608
|
+
if ((!__eliscript_truthy((emitted)["has"](pr)))) {
|
|
1609
|
+
(queue)["push"](({"raw": pr, "keyFilter": null, "isRoot": false}));
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
((qi = (qi + 1)));
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
(emitted)["add"](blk_raw);
|
|
1616
|
+
((block_count = (block_count + 1)));
|
|
1617
|
+
if (__eliscript_truthy(is_root)) {
|
|
1618
|
+
((root_ok = true));
|
|
1619
|
+
}
|
|
1620
|
+
(out)["push"]("O", (String(blk_raw)), ((entries) ?? []).length);
|
|
1621
|
+
{
|
|
1622
|
+
let ei = 0;
|
|
1623
|
+
while (__eliscript_numeric_relation("<", ei, ((entries) ?? []).length)) {
|
|
1624
|
+
{
|
|
1625
|
+
let e = (entries)[ei];
|
|
1626
|
+
(out)["push"](wire_encode_str((e)["key"]), ((e)["dec"])["tok"]);
|
|
1627
|
+
}
|
|
1628
|
+
((ei = (ei + 1)));
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
} else {
|
|
1634
|
+
{
|
|
1635
|
+
let match = (entries)["find"](((e) => {
|
|
1636
|
+
return ((e)["key"] === kf);
|
|
1637
|
+
}));
|
|
1638
|
+
if (__eliscript_truthy(match)) {
|
|
1639
|
+
{
|
|
1640
|
+
let dec = (match)["dec"];
|
|
1641
|
+
if (__eliscript_truthy((dec)["pinRaw"])) {
|
|
1642
|
+
(memory)["invoke"]("heap-pin", heap, (dec)["pinRaw"]);
|
|
1643
|
+
if (((memory)["invoke"]("last-error") === 0)) {
|
|
1644
|
+
(acquired_pins)["push"]((dec)["pinRaw"]);
|
|
1645
|
+
} else {
|
|
1646
|
+
(memory)["invoke"]("value-error-restore", 0);
|
|
1647
|
+
((pin_ok = false));
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
if (__eliscript_truthy(pin_ok)) {
|
|
1651
|
+
(emitted)["add"](blk_raw);
|
|
1652
|
+
((root_ok = true), (block_count = (block_count + 1)));
|
|
1653
|
+
(out)["push"]("O", (String(blk_raw)), 1, wire_encode_str(kf), (dec)["tok"]);
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
} else {
|
|
1661
|
+
if (__eliscript_truthy(is_root)) {
|
|
1662
|
+
((aborted = true));
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
} else {
|
|
1673
|
+
null;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
877
1682
|
return null;
|
|
1683
|
+
} catch (error) {
|
|
1684
|
+
return ((root_ok = false));
|
|
878
1685
|
}
|
|
879
1686
|
})();
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1687
|
+
if (__eliscript_truthy(root_ok)) {
|
|
1688
|
+
return __eliscript_at_direct(out, "join", "\t");
|
|
1689
|
+
} else {
|
|
1690
|
+
{
|
|
1691
|
+
let ri = 0;
|
|
1692
|
+
while (__eliscript_numeric_relation("<", ri, ((acquired_pins) ?? []).length)) {
|
|
1693
|
+
try {
|
|
1694
|
+
(memory)["invoke"]("heap-release", heap, (acquired_pins)[ri]);
|
|
1695
|
+
} catch (ignored) {
|
|
1696
|
+
null;
|
|
1697
|
+
}
|
|
1698
|
+
((ri = (ri + 1)));
|
|
1699
|
+
}
|
|
887
1700
|
}
|
|
888
|
-
|
|
1701
|
+
return (String("P") + String(id) + String("\tM"));
|
|
1702
|
+
}
|
|
889
1703
|
}
|
|
890
1704
|
}
|
|
891
|
-
}
|
|
1705
|
+
}
|
|
892
1706
|
}
|
|
893
1707
|
}
|
|
894
1708
|
}
|
|
1709
|
+
function execute_release_batch(id, heap, items_csv) {
|
|
1710
|
+
if (__eliscript_numeric_relation(">", ((items_csv) ?? []).length, 0)) {
|
|
1711
|
+
{
|
|
1712
|
+
let items = (items_csv)["split"](",");
|
|
1713
|
+
let i = 0;
|
|
1714
|
+
while (__eliscript_numeric_relation("<", i, ((items) ?? []).length)) {
|
|
1715
|
+
{
|
|
1716
|
+
let entry = (items)[i];
|
|
1717
|
+
let sep = (entry)["indexOf"](":");
|
|
1718
|
+
let raw_str = (__eliscript_numeric_relation(">=", sep, 0) ? (entry)["slice"](0, sep) : entry);
|
|
1719
|
+
let cnt = (__eliscript_numeric_relation(">=", sep, 0) ? globalThis.Number((entry)["slice"]((sep + 1))) : 1);
|
|
1720
|
+
let raw = normalize_u64(globalThis.BigInt(raw_str));
|
|
1721
|
+
let k = 0;
|
|
1722
|
+
while (__eliscript_numeric_relation("<", k, cnt)) {
|
|
1723
|
+
try {
|
|
1724
|
+
(memory)["invoke"]("heap-release", heap, raw);
|
|
1725
|
+
} catch (ignored) {
|
|
1726
|
+
null;
|
|
1727
|
+
}
|
|
1728
|
+
((k = (k + 1)));
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
((i = (i + 1)));
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
return (String("P") + String(id) + String("\tU"));
|
|
1736
|
+
}
|
|
1737
|
+
function compact_apply_line(id, result) {
|
|
1738
|
+
if ((((result)["pendingForeign"] === undefined) || (__eliscript_truthy(Array.isArray((result)["pendingForeign"])) && ((((result)["pendingForeign"]) ?? []).length === 0)))) {
|
|
1739
|
+
{
|
|
1740
|
+
let k = (result)["kind"];
|
|
1741
|
+
let col = (result)["collections"];
|
|
1742
|
+
if ((k === "immediate")) {
|
|
1743
|
+
return (String("P") + String(id) + String("\tA\t") + String(col) + String("\ti\t") + String((result)["raw"]));
|
|
1744
|
+
} else {
|
|
1745
|
+
if ((k === "number")) {
|
|
1746
|
+
{
|
|
1747
|
+
let v = (result)["value"];
|
|
1748
|
+
if (__eliscript_truthy(Number.isFinite(v))) {
|
|
1749
|
+
return (String("P") + String(id) + String("\tA\t") + String(col) + String("\tn\t") + String((__eliscript_truthy(Object.is(v, __eliscript_numeric_mul(-1, 0))) ? "m" : v)));
|
|
1750
|
+
} else {
|
|
1751
|
+
return null;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
} else {
|
|
1755
|
+
if ((k === "string")) {
|
|
1756
|
+
return (String("P") + String(id) + String("\tA\t") + String(col) + String("\ts\t") + String(wire_encode_str((result)["value"])));
|
|
1757
|
+
} else {
|
|
1758
|
+
if ((k === "pinned")) {
|
|
1759
|
+
return (String("P") + String(id) + String("\tA\t") + String(col) + String("\tp\t") + String((result)["raw"]) + String("\t") + String((result)["valueKind"]) + String("\t") + String((result)["token"]));
|
|
1760
|
+
} else {
|
|
1761
|
+
return null;
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
} else {
|
|
1768
|
+
return null;
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
895
1771
|
function capture_fast_raw_failure(heap, code) {
|
|
896
1772
|
if (((code === 11) && __eliscript_truthy(has_exception_take))) {
|
|
897
1773
|
{
|
|
898
1774
|
let thrown = fast_value((memory)["invoke"]("value-exception-take", heap));
|
|
899
1775
|
let take_err = (memory)["invoke"]("last-error");
|
|
900
|
-
if ((
|
|
1776
|
+
if ((take_err !== 0)) {
|
|
901
1777
|
return ({"ok": false, "code": take_err, "exceptionClass": 0});
|
|
902
1778
|
} else {
|
|
903
1779
|
{
|
|
904
1780
|
let thrown_kind = (!(__eliscript_truthy(val64_singleton_p(thrown))) ? (memory)["invoke"]("value-kind", heap, thrown) : 0);
|
|
905
1781
|
let thrown_token = (((thrown_kind === 35) && __eliscript_truthy(has_foreign_token)) ? __eliscript_numeric_ushr((memory)["invoke"]("value-foreign-token", heap, thrown), 0) : 0);
|
|
906
|
-
let thrown_pinned = ((!__eliscript_truthy(val64_singleton_p(thrown))) && (
|
|
1782
|
+
let thrown_pinned = ((!__eliscript_truthy(val64_singleton_p(thrown))) && (thrown_kind !== 35));
|
|
907
1783
|
if (__eliscript_truthy(thrown_pinned)) {
|
|
908
1784
|
(memory)["invoke"]("heap-pin", heap, thrown);
|
|
909
1785
|
}
|
|
@@ -926,103 +1802,95 @@ function execute_fast_raw(spec) {
|
|
|
926
1802
|
let op = (spec)["op"];
|
|
927
1803
|
let heap = __eliscript_numeric_ushr((spec)["heap"], 0);
|
|
928
1804
|
if ((op === "number")) {
|
|
929
|
-
|
|
1805
|
+
try {
|
|
1806
|
+
{
|
|
1807
|
+
let val = fast_value(invoke_checked("value-number", heap, __eliscript_numeric_ushr((spec)["low"], 0), __eliscript_numeric_ushr((spec)["high"], 0)));
|
|
1808
|
+
invoke_checked("heap-pin", heap, val);
|
|
1809
|
+
return ({"ok": true, "raw": val, "kind": 4});
|
|
1810
|
+
}
|
|
1811
|
+
} catch (error) {
|
|
1812
|
+
if ((!((error === null)) && (__eliscript_value_type(error) === "object") && __eliscript_truthy(Object.hasOwn(error, "__fastApplyRuntimeError")))) {
|
|
1813
|
+
return capture_fast_raw_failure(heap, (error)["__fastApplyRuntimeError"]);
|
|
1814
|
+
} else {
|
|
1815
|
+
return ((__eliscript_value_27) => { throw __eliscript_value_27; })(error);
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
} else {
|
|
1819
|
+
if ((op === "readNumber")) {
|
|
930
1820
|
try {
|
|
931
1821
|
{
|
|
932
|
-
let
|
|
933
|
-
invoke_checked("
|
|
934
|
-
|
|
1822
|
+
let raw = fast_value((spec)["raw"]);
|
|
1823
|
+
invoke_checked("value-kind", heap, raw);
|
|
1824
|
+
invoke_checked("value-length", heap, raw);
|
|
1825
|
+
{
|
|
1826
|
+
let bits = invoke_checked("value-number-bits", heap, raw);
|
|
1827
|
+
(fast_number_buffer)["setBigUint64"](0, bits, true);
|
|
1828
|
+
return ({"ok": true, "low": (fast_number_buffer)["getUint32"](0, true), "high": (fast_number_buffer)["getUint32"](4, true)});
|
|
1829
|
+
}
|
|
935
1830
|
}
|
|
936
1831
|
} catch (error) {
|
|
937
1832
|
if ((!((error === null)) && (__eliscript_value_type(error) === "object") && __eliscript_truthy(Object.hasOwn(error, "__fastApplyRuntimeError")))) {
|
|
938
1833
|
return capture_fast_raw_failure(heap, (error)["__fastApplyRuntimeError"]);
|
|
939
1834
|
} else {
|
|
940
|
-
return ((
|
|
1835
|
+
return ((__eliscript_value_28) => { throw __eliscript_value_28; })(error);
|
|
941
1836
|
}
|
|
942
1837
|
}
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
if ((op === "readNumber")) {
|
|
946
|
-
return (() => {
|
|
1838
|
+
} else {
|
|
1839
|
+
if ((op === "string")) {
|
|
947
1840
|
try {
|
|
948
1841
|
{
|
|
949
|
-
let
|
|
950
|
-
|
|
951
|
-
invoke_checked("value-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
1842
|
+
let text = (spec)["text"];
|
|
1843
|
+
let len = __eliscript_numeric_ushr(((text) ?? []).length, 0);
|
|
1844
|
+
let val = fast_value(invoke_checked("value-string", heap, len));
|
|
1845
|
+
let off = invoke_checked("value-data", heap, val, 5);
|
|
1846
|
+
let i = 0;
|
|
1847
|
+
while (__eliscript_numeric_relation("<", i, len)) {
|
|
1848
|
+
(memory)["setUint16"]((off + __eliscript_numeric_mul(i, 2)), (text)["charCodeAt"](i), true);
|
|
1849
|
+
((i = (i + 1)));
|
|
956
1850
|
}
|
|
1851
|
+
invoke_checked("value-seal", heap, val);
|
|
1852
|
+
invoke_checked("heap-pin", heap, val);
|
|
1853
|
+
return ({"ok": true, "raw": val, "kind": 5});
|
|
957
1854
|
}
|
|
958
1855
|
} catch (error) {
|
|
959
1856
|
if ((!((error === null)) && (__eliscript_value_type(error) === "object") && __eliscript_truthy(Object.hasOwn(error, "__fastApplyRuntimeError")))) {
|
|
960
1857
|
return capture_fast_raw_failure(heap, (error)["__fastApplyRuntimeError"]);
|
|
961
1858
|
} else {
|
|
962
|
-
return ((
|
|
1859
|
+
return ((__eliscript_value_29) => { throw __eliscript_value_29; })(error);
|
|
963
1860
|
}
|
|
964
1861
|
}
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
if ((op === "string")) {
|
|
968
|
-
return (() => {
|
|
1862
|
+
} else {
|
|
1863
|
+
if ((op === "readString")) {
|
|
969
1864
|
try {
|
|
970
1865
|
{
|
|
971
|
-
let
|
|
972
|
-
let
|
|
973
|
-
let
|
|
974
|
-
let off = invoke_checked("value-data", heap,
|
|
975
|
-
let
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1866
|
+
let raw = fast_value((spec)["raw"]);
|
|
1867
|
+
let _kind = invoke_checked("value-kind", heap, raw);
|
|
1868
|
+
let len = __eliscript_numeric_ushr(invoke_checked("value-length", heap, raw), 0);
|
|
1869
|
+
let off = invoke_checked("value-data", heap, raw, 5);
|
|
1870
|
+
let parts = [];
|
|
1871
|
+
let start = 0;
|
|
1872
|
+
while (__eliscript_numeric_relation("<", start, len)) {
|
|
1873
|
+
{
|
|
1874
|
+
let units = [];
|
|
1875
|
+
let i = start;
|
|
1876
|
+
let limit = Math.min((start + 8192), len);
|
|
1877
|
+
while (__eliscript_numeric_relation("<", i, limit)) {
|
|
1878
|
+
(units)["push"]((memory)["getUint16"]((off + __eliscript_numeric_mul(i, 2)), true));
|
|
1879
|
+
((i = (i + 1)));
|
|
1880
|
+
}
|
|
1881
|
+
(parts)["push"](__eliscript_at(Reflect, "apply")(globalThis.String.fromCharCode, globalThis.String, units));
|
|
1882
|
+
}
|
|
1883
|
+
((start = (start + 8192)));
|
|
979
1884
|
}
|
|
980
|
-
|
|
981
|
-
invoke_checked("heap-pin", heap, val);
|
|
982
|
-
return ({"ok": true, "raw": val, "kind": 5});
|
|
1885
|
+
return ({"ok": true, "text": __eliscript_at_direct(parts, "join", "")});
|
|
983
1886
|
}
|
|
984
1887
|
} catch (error) {
|
|
985
1888
|
if ((!((error === null)) && (__eliscript_value_type(error) === "object") && __eliscript_truthy(Object.hasOwn(error, "__fastApplyRuntimeError")))) {
|
|
986
1889
|
return capture_fast_raw_failure(heap, (error)["__fastApplyRuntimeError"]);
|
|
987
1890
|
} else {
|
|
988
|
-
return ((
|
|
1891
|
+
return ((__eliscript_value_30) => { throw __eliscript_value_30; })(error);
|
|
989
1892
|
}
|
|
990
1893
|
}
|
|
991
|
-
})();
|
|
992
|
-
} else {
|
|
993
|
-
if ((op === "readString")) {
|
|
994
|
-
return (() => {
|
|
995
|
-
try {
|
|
996
|
-
{
|
|
997
|
-
let raw = fast_value((spec)["raw"]);
|
|
998
|
-
let _kind = invoke_checked("value-kind", heap, raw);
|
|
999
|
-
let len = __eliscript_numeric_ushr(invoke_checked("value-length", heap, raw), 0);
|
|
1000
|
-
let off = invoke_checked("value-data", heap, raw, 5);
|
|
1001
|
-
let parts = [];
|
|
1002
|
-
let start = 0;
|
|
1003
|
-
while (__eliscript_numeric_relation("<", start, len)) {
|
|
1004
|
-
{
|
|
1005
|
-
let units = [];
|
|
1006
|
-
let i = start;
|
|
1007
|
-
let limit = Math.min((start + 8192), len);
|
|
1008
|
-
while (__eliscript_numeric_relation("<", i, limit)) {
|
|
1009
|
-
(units)["push"]((memory)["getUint16"]((off + __eliscript_numeric_mul(i, 2)), true));
|
|
1010
|
-
((i = (i + 1)));
|
|
1011
|
-
}
|
|
1012
|
-
(parts)["push"](__eliscript_at(Reflect, "apply")(globalThis.String.fromCharCode, globalThis.String, units));
|
|
1013
|
-
}
|
|
1014
|
-
((start = (start + 8192)));
|
|
1015
|
-
}
|
|
1016
|
-
return ({"ok": true, "text": __eliscript_at_direct(parts, "join", "")});
|
|
1017
|
-
}
|
|
1018
|
-
} catch (error) {
|
|
1019
|
-
if ((!((error === null)) && (__eliscript_value_type(error) === "object") && __eliscript_truthy(Object.hasOwn(error, "__fastApplyRuntimeError")))) {
|
|
1020
|
-
return capture_fast_raw_failure(heap, (error)["__fastApplyRuntimeError"]);
|
|
1021
|
-
} else {
|
|
1022
|
-
return ((__eliscript_value_38) => { throw __eliscript_value_38; })(error);
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
})();
|
|
1026
1894
|
} else {
|
|
1027
1895
|
if ((op === "invoke")) {
|
|
1028
1896
|
{
|
|
@@ -1037,122 +1905,108 @@ function execute_fast_raw(spec) {
|
|
|
1037
1905
|
let entered = false;
|
|
1038
1906
|
let borrowed = [];
|
|
1039
1907
|
let failure = null;
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
((pinned_previous = true));
|
|
1047
|
-
}
|
|
1908
|
+
try {
|
|
1909
|
+
if (__eliscript_truthy(has_current_this)) {
|
|
1910
|
+
((previous = fast_value(invoke_checked("value-function-current-this", heap))));
|
|
1911
|
+
if (!(__eliscript_truthy(val64_singleton_p(previous)))) {
|
|
1912
|
+
invoke_checked("heap-pin", heap, previous);
|
|
1913
|
+
((pinned_previous = true));
|
|
1048
1914
|
}
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
let item = (spec_args)[i];
|
|
1057
|
-
let v = fast_value((item)["raw"]);
|
|
1058
|
-
if (__eliscript_truthy((item)["checkKind"])) {
|
|
1059
|
-
invoke_checked("value-kind", heap, v);
|
|
1060
|
-
}
|
|
1061
|
-
invoke_checked("heap-pin", heap, v);
|
|
1062
|
-
(borrowed)["push"](v);
|
|
1063
|
-
(values)["push"](v);
|
|
1064
|
-
}
|
|
1065
|
-
((i = (i + 1)));
|
|
1066
|
-
}
|
|
1067
|
-
((inner_target = fast_value(invoke_checked("frame-current", heap))), (inner_mark = current_root_mark(heap)), (entered = true));
|
|
1915
|
+
}
|
|
1916
|
+
((outer_target = fast_value(invoke_checked("frame-current", heap))), (outer_mark = current_root_mark(heap)));
|
|
1917
|
+
{
|
|
1918
|
+
let values = [];
|
|
1919
|
+
let argc = ((spec_args) ?? []).length;
|
|
1920
|
+
let i = 0;
|
|
1921
|
+
while (__eliscript_numeric_relation("<", i, argc)) {
|
|
1068
1922
|
{
|
|
1069
|
-
let
|
|
1070
|
-
let
|
|
1071
|
-
if (__eliscript_truthy(
|
|
1072
|
-
invoke_checked("
|
|
1923
|
+
let item = (spec_args)[i];
|
|
1924
|
+
let v = fast_value((item)["raw"]);
|
|
1925
|
+
if (__eliscript_truthy((item)["checkKind"])) {
|
|
1926
|
+
invoke_checked("value-kind", heap, v);
|
|
1073
1927
|
}
|
|
1074
|
-
|
|
1928
|
+
invoke_checked("heap-pin", heap, v);
|
|
1929
|
+
(borrowed)["push"](v);
|
|
1930
|
+
(values)["push"](v);
|
|
1075
1931
|
}
|
|
1932
|
+
((i = (i + 1)));
|
|
1076
1933
|
}
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
((
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
return (memory)["invoke"]("frame-unwind", heap, inner_target);
|
|
1084
|
-
} catch (ignored) {
|
|
1085
|
-
return null;
|
|
1086
|
-
}
|
|
1087
|
-
})();
|
|
1088
|
-
restore_root_mark(heap, inner_mark);
|
|
1934
|
+
((inner_target = fast_value(invoke_checked("frame-current", heap))), (inner_mark = current_root_mark(heap)), (entered = true));
|
|
1935
|
+
{
|
|
1936
|
+
let res_raw = fast_value(__eliscript_at(Reflect, "apply")(invoke_checked, undefined, ([wire_name, heap])["concat"](values)));
|
|
1937
|
+
let res_kind = (!(__eliscript_truthy(val64_singleton_p(res_raw))) ? invoke_checked("value-kind", heap, res_raw) : 0);
|
|
1938
|
+
if (__eliscript_truthy(val64_dynamic_p(res_raw))) {
|
|
1939
|
+
invoke_checked("heap-pin", heap, res_raw);
|
|
1089
1940
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1941
|
+
return ({"ok": true, "raw": res_raw, "kind": res_kind});
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
} catch (error) {
|
|
1945
|
+
if ((!((error === null)) && (__eliscript_value_type(error) === "object") && __eliscript_truthy(Object.hasOwn(error, "__fastApplyRuntimeError")))) {
|
|
1946
|
+
((failure = capture_fast_raw_failure(heap, (error)["__fastApplyRuntimeError"])));
|
|
1947
|
+
if (__eliscript_truthy(entered)) {
|
|
1948
|
+
try {
|
|
1949
|
+
(memory)["invoke"]("frame-unwind", heap, inner_target);
|
|
1950
|
+
} catch (ignored) {
|
|
1951
|
+
null;
|
|
1098
1952
|
}
|
|
1099
|
-
|
|
1100
|
-
} else {
|
|
1101
|
-
return ((__eliscript_value_39) => { throw __eliscript_value_39; })(error);
|
|
1953
|
+
restore_root_mark(heap, inner_mark);
|
|
1102
1954
|
}
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
try {
|
|
1109
|
-
return (memory)["invoke"]("heap-release", heap, (borrowed)[bi]);
|
|
1110
|
-
} catch (ignored) {
|
|
1111
|
-
return null;
|
|
1112
|
-
}
|
|
1113
|
-
})();
|
|
1114
|
-
((bi = (bi + 1)));
|
|
1955
|
+
if (__eliscript_truthy(has_exception_clear)) {
|
|
1956
|
+
try {
|
|
1957
|
+
(memory)["invoke"]("value-exception-clear", heap);
|
|
1958
|
+
} catch (ignored) {
|
|
1959
|
+
null;
|
|
1115
1960
|
}
|
|
1116
1961
|
}
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
if (__eliscript_truthy(has_call_reset)) {
|
|
1132
|
-
return (memory)["invoke"]("value-call-reset", heap);
|
|
1133
|
-
} else {
|
|
1134
|
-
return null;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
} catch (ignored) {
|
|
1138
|
-
return null;
|
|
1139
|
-
}
|
|
1140
|
-
})();
|
|
1962
|
+
return failure;
|
|
1963
|
+
} else {
|
|
1964
|
+
return ((__eliscript_value_31) => { throw __eliscript_value_31; })(error);
|
|
1965
|
+
}
|
|
1966
|
+
} finally {
|
|
1967
|
+
{
|
|
1968
|
+
let bi = 0;
|
|
1969
|
+
while (__eliscript_numeric_relation("<", bi, ((borrowed) ?? []).length)) {
|
|
1970
|
+
try {
|
|
1971
|
+
(memory)["invoke"]("heap-release", heap, (borrowed)[bi]);
|
|
1972
|
+
} catch (ignored) {
|
|
1973
|
+
null;
|
|
1974
|
+
}
|
|
1975
|
+
((bi = (bi + 1)));
|
|
1141
1976
|
}
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1977
|
+
}
|
|
1978
|
+
if (__eliscript_truthy(failure)) {
|
|
1979
|
+
try {
|
|
1980
|
+
(memory)["invoke"]("frame-unwind", heap, outer_target);
|
|
1981
|
+
} catch (ignored) {
|
|
1982
|
+
null;
|
|
1983
|
+
}
|
|
1984
|
+
restore_root_mark(heap, outer_mark);
|
|
1985
|
+
try {
|
|
1986
|
+
if (__eliscript_truthy(has_call_restore)) {
|
|
1987
|
+
(memory)["invoke"]("value-call-restore", heap, previous);
|
|
1988
|
+
} else {
|
|
1989
|
+
if (__eliscript_truthy(has_call_reset)) {
|
|
1990
|
+
(memory)["invoke"]("value-call-reset", heap);
|
|
1991
|
+
} else {
|
|
1992
|
+
|
|
1148
1993
|
}
|
|
1149
|
-
}
|
|
1994
|
+
}
|
|
1995
|
+
} catch (ignored) {
|
|
1996
|
+
null;
|
|
1150
1997
|
}
|
|
1151
1998
|
}
|
|
1152
|
-
|
|
1999
|
+
if (__eliscript_truthy(pinned_previous)) {
|
|
2000
|
+
try {
|
|
2001
|
+
(memory)["invoke"]("heap-release", heap, previous);
|
|
2002
|
+
} catch (ignored) {
|
|
2003
|
+
null;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
1153
2007
|
}
|
|
1154
2008
|
} else {
|
|
1155
|
-
return ((
|
|
2009
|
+
return ((__eliscript_value_32) => { throw __eliscript_value_32; })(new (globalThis.TypeError)("unknown fastRaw operation"));
|
|
1156
2010
|
}
|
|
1157
2011
|
}
|
|
1158
2012
|
}
|
|
@@ -1161,10 +2015,12 @@ function execute_fast_raw(spec) {
|
|
|
1161
2015
|
}
|
|
1162
2016
|
}
|
|
1163
2017
|
let dispatch_fn = undefined;
|
|
2018
|
+
__eliscript_tdz_ready_29 = true;
|
|
1164
2019
|
let dispatch_signatures = undefined;
|
|
2020
|
+
__eliscript_tdz_ready_30 = true;
|
|
1165
2021
|
function signature_matches_p(name, parameters, result) {
|
|
1166
2022
|
{
|
|
1167
|
-
let signature = (dispatch_signatures)[name];
|
|
2023
|
+
let signature = ((__eliscript_tdz_ready_30 === true ? dispatch_signatures : __eliscript_tdz_error("dispatch_signatures")))[name];
|
|
1168
2024
|
let types = (__eliscript_truthy(signature) ? (signature)["parameterTypes"] : null);
|
|
1169
2025
|
let index = 0;
|
|
1170
2026
|
let matches = true;
|
|
@@ -1310,17 +2166,17 @@ function host_call(index, heap, argv) {
|
|
|
1310
2166
|
{
|
|
1311
2167
|
let message = read_packet();
|
|
1312
2168
|
if ((message === null)) {
|
|
1313
|
-
((
|
|
2169
|
+
((__eliscript_value_33) => { throw __eliscript_value_33; })(new (globalThis.Error)("native host disconnected during a callback"));
|
|
1314
2170
|
}
|
|
1315
2171
|
if (!(((message)["callback"] === undefined))) {
|
|
1316
2172
|
if ((!((message)["callback"] === id))) {
|
|
1317
|
-
((
|
|
2173
|
+
((__eliscript_value_34) => { throw __eliscript_value_34; })(new (globalThis.Error)("native callback response belongs to a different invocation"));
|
|
1318
2174
|
}
|
|
1319
2175
|
if (__eliscript_truthy(Object.hasOwn(message, "hostError"))) {
|
|
1320
2176
|
{
|
|
1321
2177
|
let error = Object.freeze(({}));
|
|
1322
2178
|
(host_failures)["set"](error, (message)["hostError"]);
|
|
1323
|
-
((
|
|
2179
|
+
((__eliscript_value_35) => { throw __eliscript_value_35; })(error);
|
|
1324
2180
|
}
|
|
1325
2181
|
}
|
|
1326
2182
|
((callback_result = (!(((message)["fastOp"] === undefined)) ? (() => {
|
|
@@ -1331,13 +2187,13 @@ function host_call(index, heap, argv) {
|
|
|
1331
2187
|
(memory)["invoke"]("value-error-restore", (error)["__fastApplyRuntimeError"]);
|
|
1332
2188
|
return VAL64_NIL;
|
|
1333
2189
|
} else {
|
|
1334
|
-
return ((
|
|
2190
|
+
return ((__eliscript_value_36) => { throw __eliscript_value_36; })(error);
|
|
1335
2191
|
}
|
|
1336
2192
|
}
|
|
1337
2193
|
})() : fast_value((message)["result"]))));
|
|
1338
2194
|
((done = true));
|
|
1339
2195
|
} else {
|
|
1340
|
-
dispatch_fn(message);
|
|
2196
|
+
(__eliscript_tdz_ready_29 === true ? dispatch_fn : __eliscript_tdz_error("dispatch_fn"))(message);
|
|
1341
2197
|
}
|
|
1342
2198
|
}
|
|
1343
2199
|
}
|
|
@@ -1351,86 +2207,98 @@ function dispatch(message) {
|
|
|
1351
2207
|
let method = (message)["method"];
|
|
1352
2208
|
let fast_request = ((message)["fast"] === true);
|
|
1353
2209
|
let args = (((message)["args"] === undefined) ? [] : (message)["args"]);
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
((__eliscript_value_48) => { throw __eliscript_value_48; })(new (globalThis.TypeError)("native export signature or argument count mismatch"));
|
|
1378
|
-
}
|
|
1379
|
-
((result = __eliscript_at(Reflect, "apply")((memory)["invoke"], memory, args)));
|
|
2210
|
+
try {
|
|
2211
|
+
if ((!(__eliscript_truthy(Number.isSafeInteger(id)) && __eliscript_numeric_relation(">=", id, 1)))) {
|
|
2212
|
+
((__eliscript_value_37) => { throw __eliscript_value_37; })(new (globalThis.TypeError)("invalid native transport invocation"));
|
|
2213
|
+
}
|
|
2214
|
+
if ((method === "open")) {
|
|
2215
|
+
((__eliscript_value_38) => { throw __eliscript_value_38; })(new (globalThis.Error)("native memory is already open"));
|
|
2216
|
+
}
|
|
2217
|
+
if ((!__eliscript_truthy(memory))) {
|
|
2218
|
+
((__eliscript_value_39) => { throw __eliscript_value_39; })(new (globalThis.Error)("native memory is closed"));
|
|
2219
|
+
}
|
|
2220
|
+
{
|
|
2221
|
+
let result = undefined;
|
|
2222
|
+
let last_error = undefined;
|
|
2223
|
+
let heap_stats = undefined;
|
|
2224
|
+
if ((method === "size")) {
|
|
2225
|
+
((result = (memory)["byteLength"]));
|
|
2226
|
+
} else {
|
|
2227
|
+
if ((method === "invoke")) {
|
|
2228
|
+
{
|
|
2229
|
+
let name = (args)[0];
|
|
2230
|
+
let signature = ((__eliscript_tdz_ready_30 === true ? dispatch_signatures : __eliscript_tdz_error("dispatch_signatures")))[name];
|
|
2231
|
+
if ((!(__eliscript_truthy(signature) && (((args) ?? []).length === ((signature)["arity"] + 1))))) {
|
|
2232
|
+
((__eliscript_value_40) => { throw __eliscript_value_40; })(new (globalThis.TypeError)("native export signature or argument count mismatch"));
|
|
1380
2233
|
}
|
|
1381
|
-
if (__eliscript_truthy(
|
|
1382
|
-
(
|
|
2234
|
+
if (((name === "heap-collect") || (name === "value-standard-prototypes-close") || (name === "value-call-reset") || __eliscript_truthy((name)["endsWith"]("_close")))) {
|
|
2235
|
+
clear_apply_tuple_pool();
|
|
1383
2236
|
}
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
2237
|
+
((result = __eliscript_at(Reflect, "apply")((memory)["invoke"], memory, args)));
|
|
2238
|
+
}
|
|
2239
|
+
if (__eliscript_truthy(has_last_error)) {
|
|
2240
|
+
((last_error = (((args)[0] === "last-error") ? result : (memory)["invoke"]("last-error"))));
|
|
2241
|
+
}
|
|
2242
|
+
if ((__eliscript_truthy(has_heap_stats) && (last_error === 0) && (((args) ?? []).length === 2) && (((args)[0] === "heap-collect") || ((args)[0] === "heap-used")))) {
|
|
2243
|
+
{
|
|
2244
|
+
let h = (args)[1];
|
|
2245
|
+
((heap_stats = [h, (((args)[0] === "heap-used") ? result : (memory)["invoke"]("heap-used", h)), (memory)["invoke"]("heap-capacity", h), (memory)["invoke"]("heap-live", h), (memory)["invoke"]("frame-depth", h), (memory)["invoke"]("heap-collections", h)]));
|
|
1389
2246
|
}
|
|
2247
|
+
}
|
|
2248
|
+
} else {
|
|
2249
|
+
if ((method === "getUint16")) {
|
|
2250
|
+
((result = __eliscript_at(Reflect, "apply")((memory)["getUint16"], memory, args)));
|
|
1390
2251
|
} else {
|
|
1391
|
-
if ((method === "
|
|
1392
|
-
((result = __eliscript_at(Reflect, "apply")((memory)["
|
|
2252
|
+
if ((method === "getUint32")) {
|
|
2253
|
+
((result = __eliscript_at(Reflect, "apply")((memory)["getUint32"], memory, args)));
|
|
1393
2254
|
} else {
|
|
1394
|
-
if ((method === "
|
|
1395
|
-
((result = __eliscript_at(Reflect, "apply")((memory)["
|
|
2255
|
+
if ((method === "getFloat64")) {
|
|
2256
|
+
((result = __eliscript_at(Reflect, "apply")((memory)["getFloat64"], memory, args)));
|
|
1396
2257
|
} else {
|
|
1397
|
-
if ((method === "
|
|
1398
|
-
((result = __eliscript_at(Reflect, "apply")((memory)["
|
|
2258
|
+
if ((method === "getBigUint64")) {
|
|
2259
|
+
((result = __eliscript_at(Reflect, "apply")((memory)["getBigUint64"], memory, args)));
|
|
1399
2260
|
} else {
|
|
1400
|
-
if ((method === "
|
|
1401
|
-
((result = __eliscript_at(Reflect, "apply")((memory)["
|
|
2261
|
+
if ((method === "setBigUint64")) {
|
|
2262
|
+
((result = __eliscript_at(Reflect, "apply")((memory)["setBigUint64"], memory, args)));
|
|
1402
2263
|
} else {
|
|
1403
|
-
if ((method === "
|
|
1404
|
-
((result = __eliscript_at(Reflect, "apply")((memory)["
|
|
2264
|
+
if ((method === "setUint16")) {
|
|
2265
|
+
((result = __eliscript_at(Reflect, "apply")((memory)["setUint16"], memory, args)));
|
|
1405
2266
|
} else {
|
|
1406
|
-
if ((method === "
|
|
1407
|
-
((result = __eliscript_at(Reflect, "apply")((memory)["
|
|
2267
|
+
if ((method === "setUint32")) {
|
|
2268
|
+
((result = __eliscript_at(Reflect, "apply")((memory)["setUint32"], memory, args)));
|
|
1408
2269
|
} else {
|
|
1409
|
-
if ((method === "
|
|
1410
|
-
((result = __eliscript_at(Reflect, "apply")((memory)["
|
|
2270
|
+
if ((method === "read")) {
|
|
2271
|
+
((result = __eliscript_at_direct(Buffer.from(__eliscript_at(Reflect, "apply")((memory)["read"], memory, args)), "toString", "base64")));
|
|
1411
2272
|
} else {
|
|
1412
|
-
if ((method === "
|
|
1413
|
-
((result =
|
|
2273
|
+
if ((method === "write")) {
|
|
2274
|
+
((result = (memory)["write"](new (globalThis.Uint8Array)(Buffer.from((args)[0], "base64")), (args)[1])));
|
|
1414
2275
|
} else {
|
|
1415
|
-
if ((method === "
|
|
1416
|
-
(
|
|
2276
|
+
if ((method === "close")) {
|
|
2277
|
+
clear_apply_tuple_pool();
|
|
2278
|
+
((result = (memory)["close"]()));
|
|
1417
2279
|
} else {
|
|
1418
|
-
if ((method === "
|
|
1419
|
-
((result = (
|
|
2280
|
+
if ((method === "fastApply")) {
|
|
2281
|
+
((result = execute_fast_apply((args)[0])));
|
|
2282
|
+
if ((__eliscript_truthy(has_last_error) && __eliscript_truthy((["immediate", "number", "string", "pinned"])["includes"]((result)["kind"])))) {
|
|
2283
|
+
((last_error = 0));
|
|
2284
|
+
}
|
|
1420
2285
|
} else {
|
|
1421
|
-
if ((method === "
|
|
1422
|
-
((
|
|
1423
|
-
|
|
1424
|
-
((last_error = 0));
|
|
1425
|
-
}
|
|
2286
|
+
if ((method === "fastGet")) {
|
|
2287
|
+
send_raw_line(execute_fast_get(id, (args)[0], (args)[1], (args)[2]));
|
|
2288
|
+
((result = __eliscript_keyword("__sentCompact")));
|
|
1426
2289
|
} else {
|
|
1427
|
-
if ((method === "
|
|
1428
|
-
((
|
|
1429
|
-
|
|
1430
|
-
((last_error = 0));
|
|
1431
|
-
}
|
|
2290
|
+
if ((method === "releaseBatch")) {
|
|
2291
|
+
send_raw_line(execute_release_batch(id, (args)[0], (args)[1]));
|
|
2292
|
+
((result = __eliscript_keyword("__sentCompact")));
|
|
1432
2293
|
} else {
|
|
1433
|
-
|
|
2294
|
+
if ((method === "fastRaw")) {
|
|
2295
|
+
((result = execute_fast_raw((args)[0])));
|
|
2296
|
+
if ((__eliscript_truthy(has_last_error) && __eliscript_truthy((result)["ok"]))) {
|
|
2297
|
+
((last_error = 0));
|
|
2298
|
+
}
|
|
2299
|
+
} else {
|
|
2300
|
+
((__eliscript_value_41) => { throw __eliscript_value_41; })(new (globalThis.TypeError)("unknown native transport method"));
|
|
2301
|
+
}
|
|
1434
2302
|
}
|
|
1435
2303
|
}
|
|
1436
2304
|
}
|
|
@@ -1445,16 +2313,27 @@ function dispatch(message) {
|
|
|
1445
2313
|
}
|
|
1446
2314
|
}
|
|
1447
2315
|
}
|
|
1448
|
-
return send(((!((last_error === undefined)) && __eliscript_truthy(heap_stats)) ? ({"id": id, "result": ((result == null) ? null : result), "lastError": last_error, "heapStats": heap_stats}) : (!((last_error === undefined)) ? ({"id": id, "result": ((result == null) ? null : result), "lastError": last_error}) : ({"id": id, "result": ((result == null) ? null : result)}))), fast_request);
|
|
1449
2316
|
}
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
2317
|
+
if ((!(result === __eliscript_keyword("__sentCompact")))) {
|
|
2318
|
+
{
|
|
2319
|
+
let compact_line = (((method === "fastApply") && __eliscript_truthy((message)["compact"])) ? compact_apply_line(id, result) : null);
|
|
2320
|
+
if (__eliscript_truthy(compact_line)) {
|
|
2321
|
+
return send_raw_line(compact_line);
|
|
2322
|
+
} else {
|
|
2323
|
+
return send(((!((last_error === undefined)) && __eliscript_truthy(heap_stats)) ? ({"id": id, "result": ((result == null) ? null : result), "lastError": last_error, "heapStats": heap_stats}) : (!((last_error === undefined)) ? ({"id": id, "result": ((result == null) ? null : result), "lastError": last_error}) : ({"id": id, "result": ((result == null) ? null : result)}))), fast_request);
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
1453
2326
|
} else {
|
|
1454
|
-
return
|
|
2327
|
+
return null;
|
|
1455
2328
|
}
|
|
1456
2329
|
}
|
|
1457
|
-
}
|
|
2330
|
+
} catch (error) {
|
|
2331
|
+
if ((!((error === null)) && ((__eliscript_value_type(error) === "object") || (__eliscript_value_type(error) === "function")) && __eliscript_truthy((host_failures)["has"](error)))) {
|
|
2332
|
+
return send(({"id": id, "hostError": (host_failures)["get"](error)}));
|
|
2333
|
+
} else {
|
|
2334
|
+
return send(({"id": id, "error": describe(error)}));
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
1458
2337
|
}
|
|
1459
2338
|
}
|
|
1460
2339
|
((dispatch_fn = dispatch));
|
|
@@ -1495,7 +2374,7 @@ async function run_native_node_runner() {
|
|
|
1495
2374
|
})));
|
|
1496
2375
|
} catch (error) {
|
|
1497
2376
|
await ((watchdog)["terminate"]());
|
|
1498
|
-
return ((
|
|
2377
|
+
return ((__eliscript_value_42) => { throw __eliscript_value_42; })(error);
|
|
1499
2378
|
}
|
|
1500
2379
|
})());
|
|
1501
2380
|
(watchdog)["on"]("error", ((error) => {
|
|
@@ -1512,27 +2391,27 @@ async function run_native_node_runner() {
|
|
|
1512
2391
|
try {
|
|
1513
2392
|
return (await (async () => {
|
|
1514
2393
|
if ((!(((first)["method"] === "open") && __eliscript_truthy(Array.isArray((first)["args"])) && ((((first)["args"]) ?? []).length === 3)))) {
|
|
1515
|
-
((
|
|
2394
|
+
((__eliscript_value_43) => { throw __eliscript_value_43; })(new (globalThis.TypeError)("native transport requires initialization"));
|
|
1516
2395
|
}
|
|
1517
2396
|
return (await (async (args) => {
|
|
1518
2397
|
return (await (async (signatures) => {
|
|
1519
2398
|
return (await (async () => {
|
|
1520
|
-
((
|
|
2399
|
+
(__eliscript_tdz_write_30(signatures));
|
|
1521
2400
|
((has_last_error = signature_matches_p("last-error", [], "u32")));
|
|
1522
|
-
((has_tuple_header = ((
|
|
1523
|
-
((has_foreign_token = ((
|
|
1524
|
-
((has_collections = ((
|
|
1525
|
-
((has_heap_stats = ((
|
|
1526
|
-
((has_fast_ops = ((
|
|
1527
|
-
((has_current_this = ((
|
|
1528
|
-
((has_call_restore = ((
|
|
1529
|
-
((has_call_reset = ((
|
|
1530
|
-
((has_exception_take = ((
|
|
1531
|
-
((has_exception_class = ((
|
|
1532
|
-
((has_exception_class_set = ((
|
|
1533
|
-
((has_exception_clear = ((
|
|
1534
|
-
((has_root_scope_mark = ((
|
|
1535
|
-
((has_root_scope_unwind = ((
|
|
2401
|
+
((has_tuple_header = ((__eliscript_value_44) => (__eliscript_truthy(__eliscript_value_44) ? ((__eliscript_value_45) => (__eliscript_truthy(__eliscript_value_45) ? ((__eliscript_value_46) => (__eliscript_truthy(__eliscript_value_46) ? ((__eliscript_value_47) => (__eliscript_truthy(__eliscript_value_47) ? ((__eliscript_value_48) => (__eliscript_truthy(__eliscript_value_48) ? ((__eliscript_value_49) => (__eliscript_truthy(__eliscript_value_49) ? signature_matches_p("value-number-bits", ["u32", "v64"], "bits64") : __eliscript_value_49))(signature_matches_p("value-data", ["u32", "v64", "u32"], "u32")) : __eliscript_value_48))(signature_matches_p("value-get", ["u32", "v64", "u32"], "v64")) : __eliscript_value_47))(signature_matches_p("value-length", ["u32", "v64"], "u32")) : __eliscript_value_46))(signature_matches_p("value-kind", ["u32", "v64"], "u32")) : __eliscript_value_45))(signature_matches_p("value-error-restore", ["u32"], "u32")) : __eliscript_value_44))(has_last_error)));
|
|
2402
|
+
((has_foreign_token = ((__eliscript_value_50) => (__eliscript_truthy(__eliscript_value_50) ? signature_matches_p("value-foreign-token", ["u32", "v64"], "u32") : __eliscript_value_50))(has_tuple_header)));
|
|
2403
|
+
((has_collections = ((__eliscript_value_51) => (__eliscript_truthy(__eliscript_value_51) ? signature_matches_p("heap-collections", ["u32"], "u32") : __eliscript_value_51))(has_tuple_header)));
|
|
2404
|
+
((has_heap_stats = ((__eliscript_value_52) => (__eliscript_truthy(__eliscript_value_52) ? ((__eliscript_value_53) => (__eliscript_truthy(__eliscript_value_53) ? ((__eliscript_value_54) => (__eliscript_truthy(__eliscript_value_54) ? ((__eliscript_value_55) => (__eliscript_truthy(__eliscript_value_55) ? signature_matches_p("frame-depth", ["u32"], "u32") : __eliscript_value_55))(signature_matches_p("heap-live", ["u32"], "u32")) : __eliscript_value_54))(signature_matches_p("heap-capacity", ["u32"], "u32")) : __eliscript_value_53))(signature_matches_p("heap-used", ["u32"], "u32")) : __eliscript_value_52))(has_collections)));
|
|
2405
|
+
((has_fast_ops = ((__eliscript_value_56) => (__eliscript_truthy(__eliscript_value_56) ? ((__eliscript_value_57) => (__eliscript_truthy(__eliscript_value_57) ? ((__eliscript_value_58) => (__eliscript_truthy(__eliscript_value_58) ? ((__eliscript_value_59) => (__eliscript_truthy(__eliscript_value_59) ? ((__eliscript_value_60) => (__eliscript_truthy(__eliscript_value_60) ? ((__eliscript_value_61) => (__eliscript_truthy(__eliscript_value_61) ? ((__eliscript_value_62) => (__eliscript_truthy(__eliscript_value_62) ? ((__eliscript_value_63) => (__eliscript_truthy(__eliscript_value_63) ? ((__eliscript_value_64) => (__eliscript_truthy(__eliscript_value_64) ? ((__eliscript_value_65) => (__eliscript_truthy(__eliscript_value_65) ? ((__eliscript_value_66) => (__eliscript_truthy(__eliscript_value_66) ? ((__eliscript_value_67) => (__eliscript_truthy(__eliscript_value_67) ? ((__eliscript_value_68) => (__eliscript_truthy(__eliscript_value_68) ? ((__eliscript_value_69) => (__eliscript_truthy(__eliscript_value_69) ? ((__eliscript_value_70) => (__eliscript_truthy(__eliscript_value_70) ? ((__eliscript_value_71) => (__eliscript_truthy(__eliscript_value_71) ? ((__eliscript_value_72) => (__eliscript_truthy(__eliscript_value_72) ? ((__eliscript_value_73) => (__eliscript_truthy(__eliscript_value_73) ? ((__eliscript_value_74) => (__eliscript_truthy(__eliscript_value_74) ? signature_matches_p("value-table-size", ["u32", "v64"], "u32") : __eliscript_value_74))(signature_matches_p("value-table-clear", ["u32", "v64"], "u32")) : __eliscript_value_73))(signature_matches_p("value-table-get", ["u32", "v64", "v64"], "v64")) : __eliscript_value_72))(signature_matches_p("value-table-delete", ["u32", "v64", "v64"], "u32")) : __eliscript_value_71))(signature_matches_p("value-table-has", ["u32", "v64", "v64"], "u32")) : __eliscript_value_70))(signature_matches_p("value-table-add", ["u32", "v64", "v64"], "u32")) : __eliscript_value_69))(signature_matches_p("value-table-put", ["u32", "v64", "v64", "v64"], "u32")) : __eliscript_value_68))(signature_matches_p("value-foreign-constructor-set", ["u32", "v64", "u32"], "v64")) : __eliscript_value_67))(signature_matches_p("value-foreign-new", ["u32", "u32", "u32"], "v64")) : __eliscript_value_66))(signature_matches_p("value-object-put", ["u32", "v64", "v64", "v64", "u32"], "u32")) : __eliscript_value_65))(signature_matches_p("value-object-has", ["u32", "v64", "v64"], "u32")) : __eliscript_value_64))(signature_matches_p("value-set", ["u32", "v64", "u32", "v64"], "u32")) : __eliscript_value_63))(signature_matches_p("value-array-resize", ["u32", "v64", "u32"], "u32")) : __eliscript_value_62))(signature_matches_p("value-array-new", ["u32", "u32"], "v64")) : __eliscript_value_61))(signature_matches_p("value-seal", ["u32", "v64"], "v64")) : __eliscript_value_60))(signature_matches_p("value-string", ["u32", "u32"], "v64")) : __eliscript_value_59))(signature_matches_p("value-number", ["u32", "u32", "u32"], "v64")) : __eliscript_value_58))(signature_matches_p("heap-release", ["u32", "v64"], "u32")) : __eliscript_value_57))(signature_matches_p("heap-pin", ["u32", "v64"], "u32")) : __eliscript_value_56))(has_tuple_header)));
|
|
2406
|
+
((has_current_this = ((__eliscript_value_75) => (__eliscript_truthy(__eliscript_value_75) ? signature_matches_p("value-function-current-this", ["u32"], "v64") : __eliscript_value_75))(has_tuple_header)));
|
|
2407
|
+
((has_call_restore = ((__eliscript_value_76) => (__eliscript_truthy(__eliscript_value_76) ? signature_matches_p("value-call-restore", ["u32", "v64"], "u32") : __eliscript_value_76))(has_tuple_header)));
|
|
2408
|
+
((has_call_reset = ((__eliscript_value_77) => (__eliscript_truthy(__eliscript_value_77) ? signature_matches_p("value-call-reset", ["u32"], "u32") : __eliscript_value_77))(has_tuple_header)));
|
|
2409
|
+
((has_exception_take = ((__eliscript_value_78) => (__eliscript_truthy(__eliscript_value_78) ? signature_matches_p("value-exception-take", ["u32"], "v64") : __eliscript_value_78))(has_tuple_header)));
|
|
2410
|
+
((has_exception_class = ((__eliscript_value_79) => (__eliscript_truthy(__eliscript_value_79) ? signature_matches_p("value-exception-class", ["u32"], "u32") : __eliscript_value_79))(has_tuple_header)));
|
|
2411
|
+
((has_exception_class_set = ((__eliscript_value_80) => (__eliscript_truthy(__eliscript_value_80) ? signature_matches_p("value-exception-class-set", ["u32", "u32"], "u32") : __eliscript_value_80))(has_tuple_header)));
|
|
2412
|
+
((has_exception_clear = ((__eliscript_value_81) => (__eliscript_truthy(__eliscript_value_81) ? signature_matches_p("value-exception-clear", ["u32"], "u32") : __eliscript_value_81))(has_tuple_header)));
|
|
2413
|
+
((has_root_scope_mark = ((__eliscript_value_82) => (__eliscript_truthy(__eliscript_value_82) ? signature_matches_p("root-scope-mark", ["u32"], "u32") : __eliscript_value_82))(has_tuple_header)));
|
|
2414
|
+
((has_root_scope_unwind = ((__eliscript_value_83) => (__eliscript_truthy(__eliscript_value_83) ? signature_matches_p("root-scope-unwind", ["u32", "u32"], "u32") : __eliscript_value_83))(has_tuple_header)));
|
|
1536
2415
|
((memory = await (openNativeMemory((args)[0], signatures, Object.assign(({}), (args)[2], ({"hostCall": host_call}))))));
|
|
1537
2416
|
return send(({"id": (first)["id"], "result": true}));
|
|
1538
2417
|
})());
|