eliscript 0.0.1 → 0.0.3
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/README.md +61 -0
- package/bootstrap/README.md +26 -0
- package/bootstrap/backends/README.md +515 -0
- package/bootstrap/backends/async.eli +230 -0
- package/bootstrap/backends/binary.eli +173 -0
- package/bootstrap/backends/capabilities.eli +74 -0
- package/bootstrap/backends/elf.eli +246 -0
- package/bootstrap/backends/managed.eli +5976 -0
- package/bootstrap/backends/memory.eli +100 -0
- package/bootstrap/backends/native.eli +2000 -0
- package/bootstrap/backends/numeric.eli +1362 -0
- package/bootstrap/backends/optimize.eli +79 -0
- package/bootstrap/backends/regexp.eli +2263 -0
- package/bootstrap/backends/sha256.eli +138 -0
- package/bootstrap/backends/wasm.eli +1161 -0
- package/bootstrap/compiler/analyzer.eli +165 -77
- package/bootstrap/compiler/compiler.eli +43 -19
- package/bootstrap/compiler/emitter.eli +780 -170
- package/bootstrap/compiler/expander.eli +136 -45
- package/bootstrap/compiler/formatter.eli +8 -1
- package/bootstrap/compiler/ir.eli +148 -45
- package/bootstrap/compiler/lower.eli +29 -2
- package/bootstrap/compiler/project.eli +51 -21
- package/bootstrap/compiler/reader.eli +128 -36
- package/bootstrap/compiler/source-map.eli +46 -4
- package/bootstrap/compiler/symbol.eli +2 -1
- package/bootstrap/compiler/syntax.eli +47 -12
- package/bootstrap/compiler/transient-analysis.eli +40 -4
- package/bootstrap/host/check-cli-legacy.mjs +163 -0
- package/bootstrap/host/check-cli.mjs +59 -158
- package/bootstrap/host/check-cli.mjs.map +1 -0
- package/bootstrap/host/compiler-session.eli +1579 -0
- package/bootstrap/host/compiler-tools.eli +513 -0
- package/bootstrap/host/eliscript-cli.mjs +53 -33
- package/bootstrap/host/eliscript-cli.mjs.map +1 -0
- package/bootstrap/host/project-cli-legacy.mjs +295 -0
- package/bootstrap/host/project-cli.mjs +74 -289
- package/bootstrap/host/project-cli.mjs.map +1 -0
- package/bootstrap/host/project-legacy.mjs +1080 -0
- package/bootstrap/host/project.mjs +210 -1060
- package/bootstrap/host/project.mjs.map +1 -0
- package/bootstrap/runtime/UNICODE-LICENSE.txt +39 -0
- package/bootstrap/runtime/memory.eli +30379 -0
- package/browser/host.mjs +732 -11
- package/browser/worker.mjs +6 -3
- package/compiler/eliscript-analyzer.el +371 -4
- package/compiler/eliscript-cli.el +84 -1
- package/compiler/eliscript-emitter.el +1189 -256
- package/compiler/eliscript-expander.el +147 -10
- package/compiler/eliscript-ir-emitter.el +725 -208
- package/compiler/eliscript-lower.el +127 -1
- package/compiler/eliscript-portable.el +177 -51
- package/compiler/eliscript-project.el +20 -2
- package/compiler/eliscript-reader.el +141 -57
- package/compiler/eliscript-source-map.el +26 -12
- package/compiler/eliscript-transient-analysis.el +382 -19
- package/dist/backends/async.mjs +561 -0
- package/dist/backends/async.mjs.macro-origins.json +1 -0
- package/dist/backends/async.mjs.map +1 -0
- package/dist/backends/binary.mjs +381 -0
- package/dist/backends/binary.mjs.macro-origins.json +1 -0
- package/dist/backends/binary.mjs.map +1 -0
- package/dist/backends/capabilities.mjs +237 -0
- package/dist/backends/capabilities.mjs.macro-origins.json +1 -0
- package/dist/backends/capabilities.mjs.map +1 -0
- package/dist/backends/elf.mjs +540 -0
- package/dist/backends/elf.mjs.macro-origins.json +1 -0
- package/dist/backends/elf.mjs.map +1 -0
- package/dist/backends/managed.mjs +10616 -0
- package/dist/backends/managed.mjs.macro-origins.json +1 -0
- package/dist/backends/managed.mjs.map +1 -0
- package/dist/backends/memory.mjs +278 -0
- package/dist/backends/memory.mjs.macro-origins.json +1 -0
- package/dist/backends/memory.mjs.map +1 -0
- package/dist/backends/native.mjs +4099 -0
- package/dist/backends/native.mjs.macro-origins.json +1 -0
- package/dist/backends/native.mjs.map +1 -0
- package/dist/backends/numeric.mjs +2458 -0
- package/dist/backends/numeric.mjs.macro-origins.json +1 -0
- package/dist/backends/numeric.mjs.map +1 -0
- package/dist/backends/optimize.mjs +204 -0
- package/dist/backends/optimize.mjs.macro-origins.json +1 -0
- package/dist/backends/optimize.mjs.map +1 -0
- package/dist/backends/regexp.mjs +2033 -0
- package/dist/backends/regexp.mjs.macro-origins.json +1 -0
- package/dist/backends/regexp.mjs.map +1 -0
- package/dist/backends/sha256.mjs +310 -0
- package/dist/backends/sha256.mjs.macro-origins.json +1 -0
- package/dist/backends/sha256.mjs.map +1 -0
- package/dist/backends/wasm.mjs +2258 -0
- package/dist/backends/wasm.mjs.macro-origins.json +1 -0
- package/dist/backends/wasm.mjs.map +1 -0
- package/dist/bootstrap/analyzer.mjs +1908 -776
- package/dist/bootstrap/analyzer.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +450 -142
- package/dist/bootstrap/compiler.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +3083 -909
- package/dist/bootstrap/emitter.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +2887 -1233
- package/dist/bootstrap/expander.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/formatter.mjs +582 -218
- package/dist/bootstrap/formatter.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/formatter.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +670 -116
- package/dist/bootstrap/ir.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/lower.mjs +866 -257
- package/dist/bootstrap/lower.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/lower.mjs.map +1 -1
- package/dist/bootstrap/package.json +1 -0
- package/dist/bootstrap/project.mjs +1168 -498
- package/dist/bootstrap/project.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +674 -175
- package/dist/bootstrap/reader.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/runtime/math.mjs +1117 -0
- package/dist/bootstrap/runtime/math.mjs.map +1 -0
- package/dist/bootstrap/runtime/unicode-case-data.mjs +10125 -0
- package/dist/bootstrap/runtime/unicode-case-data.mjs.map +1 -0
- package/dist/bootstrap/runtime/unicode-case.mjs +281 -0
- package/dist/bootstrap/runtime/unicode-case.mjs.map +1 -0
- package/dist/bootstrap/source-map.mjs +430 -119
- package/dist/bootstrap/source-map.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/symbol.mjs +229 -53
- package/dist/bootstrap/symbol.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/symbol.mjs.map +1 -1
- package/dist/bootstrap/syntax.mjs +205 -7
- package/dist/bootstrap/syntax.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/syntax.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +1185 -489
- package/dist/bootstrap/transient-analysis.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +199 -6478
- package/dist/browser/host.mjs +1078 -0
- package/dist/browser/loader.js +1 -0
- package/dist/browser/loader.mjs +231 -0
- package/dist/browser/worker.mjs +63 -0
- package/dist/compiler-artifact.json +1 -0
- package/dist/host/compiler-session.mjs +2980 -0
- package/dist/host/compiler-session.mjs.macro-origins.json +1 -0
- package/dist/host/compiler-session.mjs.map +1 -0
- package/dist/host/compiler-tools.mjs +1084 -0
- package/dist/host/compiler-tools.mjs.macro-origins.json +1 -0
- package/dist/host/compiler-tools.mjs.map +1 -0
- package/dist/literal-sources/runtime/core/collection-internals.eli +60 -0
- package/dist/literal-sources/runtime/core/collection.eli +639 -0
- package/dist/literal-sources/runtime/core/data-text.eli +290 -0
- package/dist/literal-sources/runtime/core/data.eli +22 -0
- package/dist/literal-sources/runtime/core/identifier.eli +44 -0
- package/dist/literal-sources/runtime/core/lazy-sequence.eli +131 -0
- package/dist/literal-sources/runtime/core/list.eli +19 -0
- package/dist/literal-sources/runtime/core/map.eli +9 -0
- package/dist/literal-sources/runtime/core/metadata-internals.eli +6 -0
- package/dist/literal-sources/runtime/core/metadata.eli +40 -0
- package/dist/literal-sources/runtime/core/object.eli +8 -0
- package/dist/literal-sources/runtime/core/order.eli +123 -0
- package/dist/literal-sources/runtime/core/persistent-kind.eli +28 -0
- package/dist/literal-sources/runtime/core/protocol-error.eli +32 -0
- package/dist/literal-sources/runtime/core/protocol.eli +28 -0
- package/dist/literal-sources/runtime/core/queue.eli +9 -0
- package/dist/literal-sources/runtime/core/record.eli +191 -0
- package/dist/literal-sources/runtime/core/regex.eli +158 -0
- package/dist/literal-sources/runtime/core/sequence.eli +305 -0
- package/dist/literal-sources/runtime/core/set-algebra.eli +28 -0
- package/dist/literal-sources/runtime/core/set.eli +9 -0
- package/dist/literal-sources/runtime/core/sorted.eli +408 -0
- package/dist/literal-sources/runtime/core/text.eli +14 -0
- package/dist/literal-sources/runtime/core/transducer.eli +268 -0
- package/dist/literal-sources/runtime/core/transient.eli +17 -0
- package/dist/literal-sources/runtime/core/truth.eli +4 -0
- package/dist/literal-sources/runtime/core/type.eli +232 -0
- package/dist/literal-sources/runtime/core/value-internals.eli +13 -0
- package/dist/literal-sources/runtime/core/value.eli +19 -0
- package/dist/literal-sources/runtime/core/vector.eli +25 -0
- package/dist/literal-sources/runtime/literals.eli +23 -0
- package/dist/literal-sources/runtime/testing/value.eli +6 -0
- package/dist/literal-sources/runtime/wire/http-rpc.eli +362 -0
- package/dist/literal-sources/runtime/wire/markdown.eli +275 -0
- package/dist/literal-sources/runtime/wire/schema.eli +193 -0
- package/dist/literal-sources/stdlib/bit.eli +36 -0
- package/dist/literal-sources/stdlib/core/data.eli +306 -0
- package/dist/literal-sources/stdlib/core/object.eli +89 -0
- package/dist/literal-sources/stdlib/core/protocol.eli +451 -0
- package/dist/literal-sources/stdlib/core/set.eli +312 -0
- package/dist/literal-sources/stdlib/core/text.eli +103 -0
- package/dist/literal-sources/stdlib/managed-literal-protocols.eli +494 -0
- package/dist/literal-sources/stdlib/managed-literals.eli +1469 -0
- package/dist/literal-sources/stdlib/managed-queue-state.eli +65 -0
- package/dist/literal-sources/stdlib/managed-sorted-state.eli +233 -0
- package/dist/literal-sources/stdlib/managed-transient-state.eli +348 -0
- package/dist/literal-sources/stdlib/managed-value-state.eli +153 -0
- package/dist/literal-sources/stdlib/managed-vector-view-state.eli +102 -0
- package/dist/literal-sources/stdlib/persistent-list.eli +145 -0
- package/dist/literal-sources/stdlib/persistent-map.eli +724 -0
- package/dist/literal-sources/stdlib/persistent-set.eli +236 -0
- package/dist/literal-sources/stdlib/persistent-vector.eli +359 -0
- package/dist/literal-sources/stdlib/value.eli +325 -0
- package/dist/package.json +10 -0
- package/dist/runtime/math.mjs +1116 -0
- package/dist/runtime/math.mjs.macro-origins.json +1 -0
- package/dist/runtime/math.mjs.map +1 -0
- package/dist/runtime/unicode-case-data.mjs +10124 -0
- package/dist/runtime/unicode-case-data.mjs.macro-origins.json +1 -0
- package/dist/runtime/unicode-case-data.mjs.map +1 -0
- package/dist/runtime/unicode-case.mjs +280 -0
- package/dist/runtime/unicode-case.mjs.macro-origins.json +1 -0
- package/dist/runtime/unicode-case.mjs.map +1 -0
- package/dist/runtime.eli +30379 -0
- package/dist/stage3-release.json +1 -0
- package/editor/README.md +1 -1
- package/editor/eliscript-mode.el +1 -1
- package/editor/eliscript-repl.el +1 -1
- package/package.json +106 -11
- package/platform/http.mjs +20 -0
- package/runtime/array-text.mjs +159 -0
- package/runtime/core/map-internals.mjs +27 -9
- package/runtime/core/object-impl.mjs +26 -17
- package/runtime/core/object-impl.mjs.map +1 -1
- package/runtime/core/protocol-impl.mjs +682 -255
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/protocol.mjs +4 -0
- package/runtime/core/record.mjs +23 -2
- package/runtime/core/regex.mjs +4 -0
- package/runtime/core/sorted.mjs +53 -0
- package/runtime/core/text-impl.mjs +167 -48
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/type.mjs +75 -3
- package/runtime/core/vector.mjs +6 -0
- package/runtime/math.eli +429 -0
- package/runtime/math.mjs +1116 -0
- package/runtime/math.mjs.map +1 -0
- package/runtime/number-radix.mjs +105 -0
- package/runtime/unicode-case-data.eli +29 -0
- package/runtime/unicode-case-data.mjs +10124 -0
- package/runtime/unicode-case-data.mjs.map +1 -0
- package/runtime/unicode-case.eli +100 -0
- package/runtime/unicode-case.mjs +280 -0
- package/runtime/unicode-case.mjs.map +1 -0
- package/runtime/wire/http-rpc.mjs +168 -0
- package/runtime/wire/markdown.mjs +196 -0
- package/runtime/wire/schema.mjs +109 -0
- package/stdlib/README.md +54 -0
- package/stdlib/core/protocol.eli +81 -17
- package/stdlib/core/seq.eli +1 -1
- package/stdlib/core/zipper.eli +172 -72
- package/stdlib/gepo.eli +12 -0
- package/stdlib/interop/js.eli +56 -15
- package/stdlib/managed-literal-protocols.eli +494 -0
- package/stdlib/managed-literals.eli +1469 -0
- package/stdlib/managed-protocol-error.eli +32 -0
- package/stdlib/managed-queue-state.eli +65 -0
- package/stdlib/managed-runtime-collection-internals.eli +60 -0
- package/stdlib/managed-runtime-collection.eli +639 -0
- package/stdlib/managed-runtime-data-text.eli +290 -0
- package/stdlib/managed-runtime-data.eli +22 -0
- package/stdlib/managed-runtime-identifier.eli +44 -0
- package/stdlib/managed-runtime-lazy-sequence.eli +131 -0
- package/stdlib/managed-runtime-list.eli +19 -0
- package/stdlib/managed-runtime-literals.eli +23 -0
- package/stdlib/managed-runtime-map.eli +9 -0
- package/stdlib/managed-runtime-metadata-internals.eli +6 -0
- package/stdlib/managed-runtime-metadata.eli +40 -0
- package/stdlib/managed-runtime-object.eli +8 -0
- package/stdlib/managed-runtime-order.eli +123 -0
- package/stdlib/managed-runtime-persistent-kind.eli +28 -0
- package/stdlib/managed-runtime-protocol.eli +28 -0
- package/stdlib/managed-runtime-queue.eli +9 -0
- package/stdlib/managed-runtime-record.eli +191 -0
- package/stdlib/managed-runtime-regex.eli +158 -0
- package/stdlib/managed-runtime-sequence.eli +305 -0
- package/stdlib/managed-runtime-set-algebra.eli +28 -0
- package/stdlib/managed-runtime-set.eli +9 -0
- package/stdlib/managed-runtime-sorted.eli +408 -0
- package/stdlib/managed-runtime-text.eli +14 -0
- package/stdlib/managed-runtime-transducer.eli +268 -0
- package/stdlib/managed-runtime-transient.eli +17 -0
- package/stdlib/managed-runtime-truth.eli +4 -0
- package/stdlib/managed-runtime-type.eli +232 -0
- package/stdlib/managed-runtime-value-internals.eli +13 -0
- package/stdlib/managed-runtime-value.eli +19 -0
- package/stdlib/managed-runtime-vector.eli +25 -0
- package/stdlib/managed-sorted-state.eli +233 -0
- package/stdlib/managed-testing-value.eli +6 -0
- package/stdlib/managed-transient-state.eli +348 -0
- package/stdlib/managed-value-state.eli +153 -0
- package/stdlib/managed-vector-view-state.eli +102 -0
- package/stdlib/managed-wire-http-rpc.eli +362 -0
- package/stdlib/managed-wire-markdown.eli +275 -0
- package/stdlib/managed-wire-schema.eli +193 -0
- package/stdlib/mdp.eli +7 -0
- package/stdlib/mds.eli +4 -0
- package/stdlib/persistent-vector.eli +23 -6
- package/tools/acceptance/check-legacy.mjs +687 -0
- package/tools/acceptance/check.eli +431 -0
- package/tools/acceptance/compile-evidence.el +49 -0
- package/tools/acceptance/finalize-legacy.mjs +498 -0
- package/tools/acceptance/finalize.eli +270 -0
- package/tools/backends/benchmark.mjs +175 -0
- package/tools/backends/build.mjs +135 -0
- package/tools/backends/compile.mjs +94 -0
- package/tools/backends/compiler-bootstrap.mjs +1001 -0
- package/tools/backends/compiler-browser.mjs +361 -0
- package/tools/backends/compiler-build.mjs +1628 -0
- package/tools/backends/compiler-cli-legacy.mjs +334 -0
- package/tools/backends/compiler-cli.mjs +29 -0
- package/tools/backends/compiler-corpus-bit.mjs +234 -0
- package/tools/backends/compiler-corpus-cli-adapters-legacy.mjs +362 -0
- package/tools/backends/compiler-corpus-cli-adapters.mjs +247 -0
- package/tools/backends/compiler-corpus-debugging.mjs +221 -0
- package/tools/backends/compiler-corpus-emitter.mjs +324 -0
- package/tools/backends/compiler-corpus-evaluation-adapters.mjs +65 -0
- package/tools/backends/compiler-corpus-execution-legacy.mjs +769 -0
- package/tools/backends/compiler-corpus-execution.mjs +3324 -0
- package/tools/backends/compiler-corpus-fuzz.mjs +229 -0
- package/tools/backends/compiler-corpus-generations.mjs +208 -0
- package/tools/backends/compiler-corpus-host-context-legacy.mjs +114 -0
- package/tools/backends/compiler-corpus-host-context.mjs +550 -0
- package/tools/backends/compiler-corpus-identity-host.mjs +553 -0
- package/tools/backends/compiler-corpus-identity-value-adapters-legacy.mjs +298 -0
- package/tools/backends/compiler-corpus-identity-value-adapters.mjs +69 -0
- package/tools/backends/compiler-corpus-isolated-exports.mjs +21 -0
- package/tools/backends/compiler-corpus-legacy.mjs +1155 -0
- package/tools/backends/compiler-corpus-literal-provider.mjs +282 -0
- package/tools/backends/compiler-corpus-managed-adapters-legacy.mjs +334 -0
- package/tools/backends/compiler-corpus-managed-adapters.mjs +937 -0
- package/tools/backends/compiler-corpus-managed-cases.mjs +179 -0
- package/tools/backends/compiler-corpus-managed-fixtures-legacy.mjs +879 -0
- package/tools/backends/compiler-corpus-managed-fixtures.mjs +1287 -0
- package/tools/backends/compiler-corpus-matchers.mjs +173 -0
- package/tools/backends/compiler-corpus-original-program.mjs +612 -0
- package/tools/backends/compiler-corpus-process.mjs +765 -0
- package/tools/backends/compiler-corpus-program-driver.mjs +306 -0
- package/tools/backends/compiler-corpus-project-adapters-legacy.mjs +497 -0
- package/tools/backends/compiler-corpus-project-adapters.mjs +340 -0
- package/tools/backends/compiler-corpus-project-entry-host.mjs +511 -0
- package/tools/backends/compiler-corpus-project-transport.mjs +151 -0
- package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1438 -0
- package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1456 -0
- package/tools/backends/compiler-corpus-raw-math-fixture.mjs +346 -0
- package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +523 -0
- package/tools/backends/compiler-corpus-reference-legacy.mjs +263 -0
- package/tools/backends/compiler-corpus-reference.mjs +241 -0
- package/tools/backends/compiler-corpus-runtime-adapters-legacy.mjs +843 -0
- package/tools/backends/compiler-corpus-runtime-adapters.mjs +663 -0
- package/tools/backends/compiler-corpus-source-archive.mjs +206 -0
- package/tools/backends/compiler-corpus-tools-artifact-adapters.mjs +410 -0
- package/tools/backends/compiler-corpus-tools-cli.mjs +363 -0
- package/tools/backends/compiler-corpus-tools-reference.mjs +264 -0
- package/tools/backends/compiler-corpus.mjs +2054 -0
- package/tools/backends/compiler-debug.mjs +142 -0
- package/tools/backends/compiler-matrix.mjs +1955 -0
- package/tools/backends/compiler-metadata.mjs +203 -0
- package/tools/backends/compiler-package-browser.mjs +120 -0
- package/tools/backends/compiler-package-legacy.mjs +654 -0
- package/tools/backends/compiler-package.mjs +464 -0
- package/tools/backends/compiler-project.mjs +126 -0
- package/tools/backends/compiler-session.mjs +843 -0
- package/tools/backends/compiler-sha256.mjs +152 -0
- package/tools/backends/compiler-unicode-profile-host.mjs +196 -0
- package/tools/backends/compiler-worker.mjs +573 -0
- package/tools/backends/dist/bootstrap-js-stages.mjs +919 -0
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -0
- package/tools/backends/dist/managed-ir-inventory.mjs +488 -0
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -0
- package/tools/backends/dist/record-grid.mjs +1256 -0
- package/tools/backends/dist/record-grid.mjs.map +1 -0
- package/tools/backends/dist/release-cli.mjs +462 -0
- package/tools/backends/dist/release-cli.mjs.map +1 -0
- package/tools/backends/dist/run-artifact.mjs +517 -0
- package/tools/backends/dist/run-artifact.mjs.map +1 -0
- package/tools/backends/eliscript/compiler-corpus-bit.eli +77 -0
- package/tools/backends/eliscript/compiler-corpus-debugging.eli +70 -0
- package/tools/backends/eliscript/compiler-corpus-project-entry-host.eli +256 -0
- package/tools/backends/managed-foreign-binding.mjs +497 -0
- package/tools/backends/managed-host-legacy.mjs +1181 -0
- package/tools/backends/managed-host-lifecycle.mjs +310 -0
- package/tools/backends/managed-host-object-provider.mjs +155 -0
- package/tools/backends/managed-host-object-realm.mjs +797 -0
- package/tools/backends/managed-host-proxy.mjs +71 -0
- package/tools/backends/managed-host-runtime.mjs +5868 -0
- package/tools/backends/managed-host.mjs +716 -0
- package/tools/backends/managed-module-graph-legacy.mjs +308 -0
- package/tools/backends/managed-module-graph.mjs +694 -0
- package/tools/backends/managed-runtime-host-legacy.mjs +195 -0
- package/tools/backends/managed-runtime.mjs +939 -0
- package/tools/backends/managed-source-view-legacy.mjs +332 -0
- package/tools/backends/managed-source-view.mjs +959 -0
- package/tools/backends/memory-runtime.mjs +100 -0
- package/tools/backends/native-benchmark.mjs +88 -0
- package/tools/backends/native-managed-runtime.mjs +677 -0
- package/tools/backends/native-memory.mjs +768 -0
- package/tools/backends/native-node-memory.mjs +142 -0
- package/tools/backends/native-node-runner.mjs +99 -0
- package/tools/backends/native-node-watchdog.mjs +19 -0
- package/tools/backends/native-node-worker.mjs +75 -0
- package/tools/backends/stage3-targets.mjs +493 -0
- package/tools/bootstrap-command.el +13 -0
- package/tools/bootstrap-runtime.el +101 -0
- package/tools/bootstrap-seed.el +55 -0
- package/tools/project/check-cli.eli +31 -0
- package/tools/project/project-cli.eli +42 -0
- package/tools/project/project.eli +122 -0
- package/tools/runtime/unicode-case-profiles.mjs +13 -0
- package/tools/runtime/unicode-case-runtime.el +57 -0
- package/tools/testing/source-debugging-corpus-host.eli +16 -0
- package/tools/testing/source-debugging.eli +139 -0
- package/tools/testing/stdlib-bit-corpus-host.eli +21 -0
- package/tools/testing/stdlib-bit-corpus-host.mjs +118 -0
- package/tools/testing/stdlib-bit.eli +104 -0
- package/tools/testing/stdlib-bit.mjs +255 -0
- package/bin/eliscript-bootstrap +0 -15
|
@@ -0,0 +1,939 @@
|
|
|
1
|
+
// Generated by Eliscript. Do not edit.
|
|
2
|
+
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
|
+
var __eliscript_tdz_ready_0;
|
|
4
|
+
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("runtime_allocator_records"); return runtime_allocator_records; }
|
|
5
|
+
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("runtime_allocator_records"); return __eliscript_const_error(); }
|
|
6
|
+
var __eliscript_tdz_ready_1;
|
|
7
|
+
function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("readManagedModuleMetadata"); return readManagedModuleMetadata; }
|
|
8
|
+
function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("readManagedModuleMetadata"); return __eliscript_const_error(); }
|
|
9
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
10
|
+
import "eliscript/runtime/math.mjs";
|
|
11
|
+
import { c as __eliscript_at, d as __eliscript_at_direct } from "data:text/javascript;base64,dmFyIG09UmVmbGVjdC5hcHBseSx0dD1OdW1iZXIucHJvdG90eXBlLnZhbHVlT2Ysaj1OdW1iZXIucHJvdG90eXBlLnRvU3RyaW5nLFU9TnVtYmVyLG50PU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ZuIT09eiYmbiE9PU0mJm4hPT1OJiZuIT09cyYmbiE9PUUpcmV0dXJuIG87bGV0IGk9bixmPXkoZSwwKSxiPVgoZSwxKSxwPSguLi51KT0+TChpLGYsU3QoYix1KSk7VChwLHB0LHt2YWx1ZToodSk9PnUgaW5zdGFuY2VvZiBpLGNvbmZpZ3VyYWJsZTohMH0pO2xldCByPXMoRSxwLFt2b2lkIDBdKTt1dChyLGZ0KG8pKTtsZXQgbD1hdChvKTtmb3IobGV0IHU9MDt1PGwubGVuZ3RoO3UrKylUKHIsbFt1XSxsdChvLGxbdV0pKTtyZXR1cm4gcn1yZXR1cm4gcyh0LG4sZSl9fWZ1bmN0aW9uIFJ0KHQsbil7bGV0IGU9dFtuXTtyZXR1cm4oLi4ubyk9PkwoZSx0LG8pfWZ1bmN0aW9uIEF0KHQsbiwuLi5lKXtsZXQgbz10W25dO3JldHVybiBMKG8sdCxlKX1leHBvcnR7UnQgYXMgYyxBdCBhcyBkfTs=";
|
|
12
|
+
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
13
|
+
const __eliscript_number_intrinsic = globalThis.Number;
|
|
14
|
+
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
15
|
+
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
16
|
+
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
17
|
+
const __eliscript_numeric_error = globalThis.TypeError;
|
|
18
|
+
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
19
|
+
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
20
|
+
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
21
|
+
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
22
|
+
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
23
|
+
const __eliscript_numeric_primitive = (value) => {
|
|
24
|
+
if (!__eliscript_numeric_object(value)) return value;
|
|
25
|
+
const exotic = value[__eliscript_numeric_symbol];
|
|
26
|
+
if (exotic !== void 0 && exotic !== null) {
|
|
27
|
+
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
28
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
29
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
30
|
+
}
|
|
31
|
+
for (let index = 0; index < 2; index++) {
|
|
32
|
+
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
33
|
+
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
34
|
+
const result = __eliscript_numeric_apply(method, value, []);
|
|
35
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
39
|
+
};
|
|
40
|
+
const __eliscript_to_number = (value) => {
|
|
41
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
42
|
+
if (typeof primitive === "string") {
|
|
43
|
+
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
44
|
+
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
45
|
+
let first = 2;
|
|
46
|
+
while (first < text.length && text[first] === "0") first++;
|
|
47
|
+
if (first === text.length) return 0;
|
|
48
|
+
const prefix = text[1];
|
|
49
|
+
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
50
|
+
if (text.length - first > limit) return 1 / 0;
|
|
51
|
+
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
52
|
+
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return __eliscript_number_intrinsic(primitive);
|
|
56
|
+
};
|
|
57
|
+
const __eliscript_numeric = (value) => {
|
|
58
|
+
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
59
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
60
|
+
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
61
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
62
|
+
};
|
|
63
|
+
const __eliscript_implicit_number = (value) => {
|
|
64
|
+
if (typeof value === "number") return value;
|
|
65
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
66
|
+
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
67
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
68
|
+
};
|
|
69
|
+
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
70
|
+
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
71
|
+
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
72
|
+
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
73
|
+
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
74
|
+
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
75
|
+
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
76
|
+
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
77
|
+
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
78
|
+
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
79
|
+
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
80
|
+
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
81
|
+
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
82
|
+
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
83
|
+
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
84
|
+
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
85
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
86
|
+
if (operator === "<") return left < right;
|
|
87
|
+
if (operator === "<=") return left <= right;
|
|
88
|
+
if (operator === ">") return left > right;
|
|
89
|
+
return left >= right;
|
|
90
|
+
}
|
|
91
|
+
let a = __eliscript_numeric_primitive(left);
|
|
92
|
+
let b = __eliscript_numeric_primitive(right);
|
|
93
|
+
const x = typeof a, y = typeof b;
|
|
94
|
+
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
95
|
+
a = __eliscript_numeric(a);
|
|
96
|
+
b = __eliscript_numeric(b);
|
|
97
|
+
}
|
|
98
|
+
if (operator === "<") return a < b;
|
|
99
|
+
if (operator === "<=") return a <= b;
|
|
100
|
+
if (operator === ">") return a > b;
|
|
101
|
+
return a >= b;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
import {createManagedHostRuntime, createManagedHostCapabilityBridge, failManagedRuntime, validateManagedRuntimeOptions} from "./managed-host.mjs";
|
|
105
|
+
import {createManagedModuleGraph, createManagedProjectFacades, loadManagedProjectGraph, managedHostModuleEdges, observeManagedProjectRuntime, observeManagedProjectExports} from "./managed-module-graph.mjs";
|
|
106
|
+
import {createCompilerDebugMap} from "./compiler-debug.mjs";
|
|
107
|
+
import * as runtime_host from "./managed-runtime-host-legacy.mjs";
|
|
108
|
+
import {prepareManagedHostProxyClassifier} from "./managed-host-proxy.mjs";
|
|
109
|
+
async function loadManagedHostModules(descriptor, ...arguments$) {
|
|
110
|
+
await (prepareManagedHostProxyClassifier((runtime_host)["loadManagedHostModules"]));
|
|
111
|
+
return __eliscript_at(Reflect, "apply")((runtime_host)["loadManagedHostModules"], undefined, ([descriptor])["concat"](arguments$));
|
|
112
|
+
}
|
|
113
|
+
const runtime_allocator_records = new (globalThis.WeakMap)();
|
|
114
|
+
__eliscript_tdz_ready_0 = true;
|
|
115
|
+
function runtime_default(value, fallback) {
|
|
116
|
+
if ((value === undefined)) {
|
|
117
|
+
return fallback;
|
|
118
|
+
} else {
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function runtime_nullish(value, fallback) {
|
|
123
|
+
if ((value == null)) {
|
|
124
|
+
return fallback;
|
|
125
|
+
} else {
|
|
126
|
+
return value;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function runtime_optional(value, key) {
|
|
130
|
+
if ((value == null)) {
|
|
131
|
+
return undefined;
|
|
132
|
+
} else {
|
|
133
|
+
return (value)[key];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function runtime_truth(value) {
|
|
137
|
+
return globalThis.Boolean(value);
|
|
138
|
+
}
|
|
139
|
+
function runtime_instance_p(value, constructor) {
|
|
140
|
+
return __eliscript_at(constructor, (globalThis.Symbol)["hasInstance"])(value);
|
|
141
|
+
}
|
|
142
|
+
function runtime_copy(target, source) {
|
|
143
|
+
if ((!(source == null))) {
|
|
144
|
+
{
|
|
145
|
+
let object = globalThis.Object(source);
|
|
146
|
+
let keys = Reflect.ownKeys(object);
|
|
147
|
+
let index = 0;
|
|
148
|
+
while (__eliscript_numeric_relation("<", index, ((keys) ?? []).length)) {
|
|
149
|
+
{
|
|
150
|
+
let key = (keys)[index];
|
|
151
|
+
let descriptor = Object.getOwnPropertyDescriptor(object, key);
|
|
152
|
+
if (__eliscript_truthy((descriptor)["enumerable"])) {
|
|
153
|
+
Object.defineProperty(target, key, ({"value": (object)[key], "writable": true, "enumerable": true, "configurable": true}));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
((index = (index + 1)));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return target;
|
|
161
|
+
}
|
|
162
|
+
function runtime_options(arguments$) {
|
|
163
|
+
{
|
|
164
|
+
let input = runtime_default((__eliscript_numeric_relation(">", ((arguments$) ?? []).length, 0) ? (arguments$)[0] : undefined), ({}));
|
|
165
|
+
let options = runtime_copy(({}), input);
|
|
166
|
+
let seed = validateManagedRuntimeOptions(input);
|
|
167
|
+
Object.defineProperty(options, "randomSeed", ({"value": seed, "writable": true, "enumerable": true, "configurable": true}));
|
|
168
|
+
{
|
|
169
|
+
const __eliscript_value_1 = (options)["extendedHeap"];
|
|
170
|
+
{
|
|
171
|
+
let extended = __eliscript_value_1;
|
|
172
|
+
if ((!((extended === undefined) || (extended === false) || (extended === true)))) {
|
|
173
|
+
((__eliscript_value_2) => { throw __eliscript_value_2; })(new (globalThis.TypeError)("extendedHeap must be a boolean"));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return options;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function runtime_heap_exports(exports, options, record) {
|
|
181
|
+
{
|
|
182
|
+
const __eliscript_value_3 = (exports)["heap-new"];
|
|
183
|
+
{
|
|
184
|
+
let constructor = __eliscript_value_3;
|
|
185
|
+
if (((options)["extendedHeap"] === true)) {
|
|
186
|
+
((constructor = (exports)["heap-new-extended"]));
|
|
187
|
+
if ((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(constructor) === "function"))) {
|
|
188
|
+
((__eliscript_value_4) => { throw __eliscript_value_4; })(new (globalThis.TypeError)("managed runtime requires heap-new-extended for extendedHeap"));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if ((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(constructor) === "function"))) {
|
|
192
|
+
failManagedRuntime(3);
|
|
193
|
+
}
|
|
194
|
+
{
|
|
195
|
+
let descriptors = Object.getOwnPropertyDescriptors(exports);
|
|
196
|
+
let legacy = (descriptors)["heap-new"];
|
|
197
|
+
let facade = Object.create(Object.getPrototypeOf(exports));
|
|
198
|
+
if ((!__eliscript_truthy(legacy))) {
|
|
199
|
+
failManagedRuntime(3);
|
|
200
|
+
}
|
|
201
|
+
((legacy)["value"] = ((slots, initial, maximum) => {
|
|
202
|
+
{
|
|
203
|
+
const __eliscript_value_5 = __eliscript_at(Reflect, "apply")(constructor, undefined, [slots, initial, maximum]);
|
|
204
|
+
{
|
|
205
|
+
let heap = __eliscript_value_5;
|
|
206
|
+
((record)["heap"] = __eliscript_numeric_uint32(heap));
|
|
207
|
+
return heap;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}));
|
|
211
|
+
Object.defineProperties(facade, descriptors);
|
|
212
|
+
return Object.freeze(facade);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function allocator_invalid() {
|
|
218
|
+
return ((__eliscript_value_6) => { throw __eliscript_value_6; })(new (globalThis.TypeError)("unsupported or inconsistent managed allocator layout"));
|
|
219
|
+
}
|
|
220
|
+
function allocator_word(view, address) {
|
|
221
|
+
if ((!__eliscript_truthy(((__eliscript_value_7) => (__eliscript_truthy(__eliscript_value_7) ? (__eliscript_numeric_relation(">=", address, 0) && (__eliscript_numeric_rem(address, 4) === 0) && __eliscript_numeric_relation("<=", (address + 4), (view)["byteLength"])) : __eliscript_value_7))(Number.isSafeInteger(address))))) {
|
|
222
|
+
allocator_invalid();
|
|
223
|
+
}
|
|
224
|
+
return (view)["getUint32"](address, true);
|
|
225
|
+
}
|
|
226
|
+
function readManagedAllocatorSnapshot(runtime) {
|
|
227
|
+
{
|
|
228
|
+
const __eliscript_value_8 = ((__eliscript_tdz_read_0()))["get"](runtime);
|
|
229
|
+
{
|
|
230
|
+
let record = __eliscript_value_8;
|
|
231
|
+
if ((!__eliscript_truthy(record))) {
|
|
232
|
+
((__eliscript_value_9) => { throw __eliscript_value_9; })(new (globalThis.TypeError)("unknown managed runtime allocator instance"));
|
|
233
|
+
}
|
|
234
|
+
if (__eliscript_truthy((record)["closed"])) {
|
|
235
|
+
((__eliscript_value_10) => { throw __eliscript_value_10; })(new (globalThis.TypeError)("managed runtime allocator snapshot is closed"));
|
|
236
|
+
}
|
|
237
|
+
{
|
|
238
|
+
let view = ((record)["memory"])["view"]();
|
|
239
|
+
let heap = (record)["heap"];
|
|
240
|
+
let epoch = allocator_word(view, 4);
|
|
241
|
+
if ((!(__eliscript_numeric_relation(">", heap, 0) && (allocator_word(view, heap) === 3) && (allocator_word(view, (heap + 4)) === epoch) && (allocator_word(view, (heap + 8)) === 551) && (allocator_word(view, (heap + 12)) === 551)))) {
|
|
242
|
+
allocator_invalid();
|
|
243
|
+
}
|
|
244
|
+
{
|
|
245
|
+
let control = allocator_word(view, (heap + 16));
|
|
246
|
+
let _bounds = allocator_word(view, (control + __eliscript_numeric_mul(550, 4)));
|
|
247
|
+
let pool = allocator_word(view, (control + 4));
|
|
248
|
+
let max_slots = allocator_word(view, (control + 8));
|
|
249
|
+
let high_water = allocator_word(view, (control + 12));
|
|
250
|
+
let free_head = allocator_word(view, (control + 16));
|
|
251
|
+
let used = allocator_word(view, (control + 20));
|
|
252
|
+
let blocks = allocator_word(view, (control + 24));
|
|
253
|
+
let live = allocator_word(view, (control + 28));
|
|
254
|
+
let maximum = allocator_word(view, (control + 32));
|
|
255
|
+
let tree = allocator_word(view, (control + 132));
|
|
256
|
+
let free_tail = allocator_word(view, (control + 1160));
|
|
257
|
+
let bits = allocator_word(view, (control + 1164));
|
|
258
|
+
let mask = allocator_word(view, (control + 1168));
|
|
259
|
+
let generation_max = allocator_word(view, (control + 1172));
|
|
260
|
+
if ((!((allocator_word(view, control) === 1212498256) && __eliscript_numeric_relation(">=", bits, 20) && __eliscript_numeric_relation("<=", bits, 23) && (mask === __eliscript_numeric_decrement(Math.pow(2, bits))) && (generation_max === __eliscript_numeric_decrement(Math.pow(2, __eliscript_numeric_sub(32, bits)))) && __eliscript_numeric_relation(">", max_slots, 0) && __eliscript_numeric_relation("<=", max_slots, mask) && __eliscript_numeric_relation("<=", high_water, max_slots) && (allocator_word(view, pool) === 1) && (allocator_word(view, (pool + 4)) === epoch)))) {
|
|
261
|
+
allocator_invalid();
|
|
262
|
+
}
|
|
263
|
+
{
|
|
264
|
+
let base = allocator_word(view, (pool + 16));
|
|
265
|
+
let capacity = allocator_word(view, (pool + 12));
|
|
266
|
+
let table_bytes = __eliscript_numeric_mul((max_slots + 1), 24);
|
|
267
|
+
let slot = 1;
|
|
268
|
+
let scanned_live = 0;
|
|
269
|
+
let reusable = 0;
|
|
270
|
+
let retired = 0;
|
|
271
|
+
let chain_length = 0;
|
|
272
|
+
let last_free = 0;
|
|
273
|
+
let current = free_head;
|
|
274
|
+
let free_bytes = 0;
|
|
275
|
+
let largest = 0;
|
|
276
|
+
let block_count = 0;
|
|
277
|
+
let previous_end = table_bytes;
|
|
278
|
+
if ((!(__eliscript_numeric_relation(">=", used, table_bytes) && __eliscript_numeric_relation("<=", used, capacity) && __eliscript_numeric_relation("<=", capacity, maximum) && __eliscript_numeric_relation("<=", maximum, 1073741824) && __eliscript_numeric_relation("<=", (base + capacity), (view)["byteLength"])))) {
|
|
279
|
+
allocator_invalid();
|
|
280
|
+
}
|
|
281
|
+
while (__eliscript_numeric_relation("<=", slot, high_water)) {
|
|
282
|
+
{
|
|
283
|
+
let entry = (base + __eliscript_numeric_mul(slot, 24));
|
|
284
|
+
let generation = allocator_word(view, entry);
|
|
285
|
+
let flags = allocator_word(view, (entry + 4));
|
|
286
|
+
if ((!(__eliscript_numeric_relation(">", generation, 0) && __eliscript_numeric_relation("<=", generation, generation_max)))) {
|
|
287
|
+
allocator_invalid();
|
|
288
|
+
}
|
|
289
|
+
if (((__eliscript_value_11, __eliscript_value_12) => (__eliscript_value_11 !== __eliscript_value_12))(__eliscript_numeric_and(flags, 1), 0)) {
|
|
290
|
+
((scanned_live = (scanned_live + 1)));
|
|
291
|
+
} else {
|
|
292
|
+
if ((!(flags === 0))) {
|
|
293
|
+
allocator_invalid();
|
|
294
|
+
}
|
|
295
|
+
if ((generation === generation_max)) {
|
|
296
|
+
((retired = (retired + 1)));
|
|
297
|
+
} else {
|
|
298
|
+
((reusable = (reusable + 1)));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
((slot = (slot + 1)));
|
|
303
|
+
}
|
|
304
|
+
if ((!(scanned_live === live))) {
|
|
305
|
+
allocator_invalid();
|
|
306
|
+
}
|
|
307
|
+
while (((__eliscript_value_13, __eliscript_value_14) => (__eliscript_value_13 !== __eliscript_value_14))(current, 0)) {
|
|
308
|
+
if ((!(__eliscript_numeric_relation(">", current, 0) && __eliscript_numeric_relation("<=", current, high_water) && __eliscript_numeric_relation("<", chain_length, reusable)))) {
|
|
309
|
+
allocator_invalid();
|
|
310
|
+
}
|
|
311
|
+
{
|
|
312
|
+
const __eliscript_value_15 = (base + __eliscript_numeric_mul(current, 24));
|
|
313
|
+
{
|
|
314
|
+
let entry = __eliscript_value_15;
|
|
315
|
+
if ((!((allocator_word(view, (entry + 4)) === 0) && __eliscript_numeric_relation("<", allocator_word(view, entry), generation_max)))) {
|
|
316
|
+
allocator_invalid();
|
|
317
|
+
}
|
|
318
|
+
((last_free = current));
|
|
319
|
+
((current = allocator_word(view, (entry + 20))));
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
((chain_length = (chain_length + 1)));
|
|
323
|
+
}
|
|
324
|
+
if ((!((chain_length === reusable) && (last_free === free_tail)))) {
|
|
325
|
+
allocator_invalid();
|
|
326
|
+
}
|
|
327
|
+
((current = blocks));
|
|
328
|
+
while (((__eliscript_value_16, __eliscript_value_17) => (__eliscript_value_16 !== __eliscript_value_17))(current, 0)) {
|
|
329
|
+
if ((!(__eliscript_numeric_relation(">=", current, previous_end) && __eliscript_numeric_relation("<=", (current + 32), used) && (__eliscript_numeric_rem(current, 8) === 0) && __eliscript_numeric_relation("<", block_count, Math.floor(__eliscript_numeric_div(__eliscript_numeric_sub(used, table_bytes), 32)))))) {
|
|
330
|
+
allocator_invalid();
|
|
331
|
+
}
|
|
332
|
+
{
|
|
333
|
+
let address = (base + current);
|
|
334
|
+
let size = allocator_word(view, address);
|
|
335
|
+
let next = allocator_word(view, (address + 4));
|
|
336
|
+
if ((!(__eliscript_numeric_relation(">=", size, 32) && (__eliscript_numeric_rem(size, 8) === 0) && __eliscript_numeric_relation("<=", (current + size), used) && ((next === 0) || __eliscript_numeric_relation(">", next, current))))) {
|
|
337
|
+
allocator_invalid();
|
|
338
|
+
}
|
|
339
|
+
((free_bytes = (free_bytes + size)));
|
|
340
|
+
((largest = Math.max(largest, size)));
|
|
341
|
+
((previous_end = (current + size)));
|
|
342
|
+
((current = next));
|
|
343
|
+
}
|
|
344
|
+
((block_count = (block_count + 1)));
|
|
345
|
+
}
|
|
346
|
+
if ((!__eliscript_truthy(((__eliscript_value_18) => (__eliscript_truthy(__eliscript_value_18) ? ((tree === 0) ? (block_count === 0) : (__eliscript_numeric_relation(">=", tree, table_bytes) && __eliscript_numeric_relation("<=", (tree + 32), used) && (allocator_word(view, ((base + tree) + 24)) === largest))) : __eliscript_value_18))(__eliscript_numeric_relation("<=", free_bytes, __eliscript_numeric_sub(used, table_bytes)))))) {
|
|
347
|
+
allocator_invalid();
|
|
348
|
+
}
|
|
349
|
+
return Object.freeze(({"format": "eliscript-managed-allocator-snapshot", "version": 1, "maxSlots": max_slots, "highWater": high_water, "liveValues": live, "freeReusableSlots": reusable, "retiredSlots": retired, "neverAllocatedSlots": __eliscript_numeric_sub(max_slots, high_water), "availableSlots": (reusable + __eliscript_numeric_sub(max_slots, high_water)), "slotBits": bits, "slotMask": mask, "generationMax": generation_max, "slotTableBytes": table_bytes, "usedBytes": used, "capacityBytes": capacity, "maxBytes": maximum, "freeBytes": free_bytes, "largestFreeBlock": largest, "freeBlockCount": block_count, "tailCapacityBytes": __eliscript_numeric_sub(capacity, used), "byteHeadroomBytes": __eliscript_numeric_sub(maximum, used), "freeSlotsHead": free_head, "freeSlotsTail": free_tail, "freeTreeRoot": tree, "memoryByteLength": (view)["byteLength"], "rawCursorBytes": allocator_word(view, 0), "lastError": allocator_word(view, 8)}));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
function allocator_detail_field(value, key) {
|
|
357
|
+
if ((!((!(value == null)) && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "object")))) {
|
|
358
|
+
((__eliscript_value_19) => { throw __eliscript_value_19; })(new (globalThis.TypeError)("invalid managed initialization diagnostic descriptor"));
|
|
359
|
+
}
|
|
360
|
+
{
|
|
361
|
+
const __eliscript_value_20 = Object.getOwnPropertyDescriptor(value, key);
|
|
362
|
+
{
|
|
363
|
+
let descriptor = __eliscript_value_20;
|
|
364
|
+
if ((!__eliscript_truthy(((__eliscript_value_21) => (__eliscript_truthy(__eliscript_value_21) ? Object.hasOwn(descriptor, "value") : __eliscript_value_21))(descriptor)))) {
|
|
365
|
+
((__eliscript_value_22) => { throw __eliscript_value_22; })(new (globalThis.TypeError)("invalid managed initialization diagnostic descriptor"));
|
|
366
|
+
}
|
|
367
|
+
return (descriptor)["value"];
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function allocator_initialization_hint(descriptor) {
|
|
372
|
+
{
|
|
373
|
+
let module = allocator_detail_field(descriptor, "module");
|
|
374
|
+
let count = allocator_detail_field(module, "bindingCount");
|
|
375
|
+
let project = allocator_detail_field(descriptor, "project");
|
|
376
|
+
let bindings = allocator_detail_field(project, "preparedBindings");
|
|
377
|
+
if ((!__eliscript_truthy(((__eliscript_value_23) => (__eliscript_truthy(__eliscript_value_23) ? ((__eliscript_value_24) => (__eliscript_truthy(__eliscript_value_24) ? ((__eliscript_value_25) => (__eliscript_truthy(__eliscript_value_25) ? ((__eliscript_value_26) => (__eliscript_truthy(__eliscript_value_26) ? __eliscript_numeric_relation("<=", ((bindings) ?? []).length, count) : __eliscript_value_26))(Array.isArray(bindings)) : __eliscript_value_25))(__eliscript_numeric_relation("<=", count, 9586979)) : __eliscript_value_24))(__eliscript_numeric_relation(">=", count, 0)) : __eliscript_value_23))(Number.isInteger(count))))) {
|
|
378
|
+
((__eliscript_value_27) => { throw __eliscript_value_27; })(new (globalThis.TypeError)("invalid managed initialization diagnostic descriptor"));
|
|
379
|
+
}
|
|
380
|
+
{
|
|
381
|
+
const __eliscript_value_28 = [];
|
|
382
|
+
const __eliscript_value_29 = new (globalThis.Set)();
|
|
383
|
+
const __eliscript_value_30 = 0;
|
|
384
|
+
{
|
|
385
|
+
let names = __eliscript_value_28;
|
|
386
|
+
let seen = __eliscript_value_29;
|
|
387
|
+
let position = __eliscript_value_30;
|
|
388
|
+
while (__eliscript_numeric_relation("<", position, ((bindings) ?? []).length)) {
|
|
389
|
+
{
|
|
390
|
+
let item = allocator_detail_field(bindings, globalThis.String(position));
|
|
391
|
+
let index = allocator_detail_field(item, "index");
|
|
392
|
+
let name = allocator_detail_field(item, "name");
|
|
393
|
+
if ((!__eliscript_truthy(((__eliscript_value_31) => (__eliscript_truthy(__eliscript_value_31) ? (__eliscript_numeric_relation(">=", index, 0) && __eliscript_numeric_relation("<", index, count) && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(name) === "string") && (!__eliscript_truthy((seen)["has"](index)))) : __eliscript_value_31))(Number.isInteger(index))))) {
|
|
394
|
+
((__eliscript_value_32) => { throw __eliscript_value_32; })(new (globalThis.TypeError)("invalid managed initialization diagnostic descriptor"));
|
|
395
|
+
}
|
|
396
|
+
(seen)["add"](index);
|
|
397
|
+
(names)["push"](({"index": index, "name": (name)["slice"](0, 256)}));
|
|
398
|
+
}
|
|
399
|
+
((position = (position + 1)));
|
|
400
|
+
}
|
|
401
|
+
return ({"bindingCount": count, "prepared": names});
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
function allocator_module_slab_p(view, address, count) {
|
|
407
|
+
if (((count === 0) || ((__eliscript_value_33, __eliscript_value_34) => (__eliscript_value_33 !== __eliscript_value_34))(allocator_word(view, (address + 4)), __eliscript_numeric_mul(count, 7)))) {
|
|
408
|
+
return false;
|
|
409
|
+
} else {
|
|
410
|
+
{
|
|
411
|
+
const __eliscript_value_35 = 0;
|
|
412
|
+
const __eliscript_value_36 = true;
|
|
413
|
+
{
|
|
414
|
+
let index = __eliscript_value_35;
|
|
415
|
+
let valid = __eliscript_value_36;
|
|
416
|
+
while (__eliscript_truthy(((__eliscript_value_37) => (__eliscript_truthy(__eliscript_value_37) ? __eliscript_numeric_relation("<", index, count) : __eliscript_value_37))(valid))) {
|
|
417
|
+
{
|
|
418
|
+
let cell = (address + 32 + __eliscript_numeric_mul(index, 28));
|
|
419
|
+
let mutable = allocator_word(view, (cell + 4));
|
|
420
|
+
let initialized = allocator_word(view, (cell + 8));
|
|
421
|
+
let external = allocator_word(view, (cell + 12));
|
|
422
|
+
if ((!((allocator_word(view, cell) === 2) && ((mutable === 1) || (mutable === 2)) && ((initialized === 1) || (initialized === 2)) && ((external === 1) || (external === 2))))) {
|
|
423
|
+
((valid = false));
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
((index = (index + 1)));
|
|
427
|
+
}
|
|
428
|
+
return valid;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
function readManagedAllocatorValueCounts(runtime, ...arguments$) {
|
|
434
|
+
{
|
|
435
|
+
let hint = ((__eliscript_numeric_relation(">", ((arguments$) ?? []).length, 0) && (!((arguments$)[0] === undefined))) ? allocator_initialization_hint((arguments$)[0]) : null);
|
|
436
|
+
let snapshot = readManagedAllocatorSnapshot(runtime);
|
|
437
|
+
let record = ((__eliscript_tdz_read_0()))["get"](runtime);
|
|
438
|
+
let view = ((record)["memory"])["view"]();
|
|
439
|
+
let heap = (record)["heap"];
|
|
440
|
+
let control = allocator_word(view, (heap + 16));
|
|
441
|
+
let pool = allocator_word(view, (control + 4));
|
|
442
|
+
let base = allocator_word(view, (pool + 16));
|
|
443
|
+
let high_water = (snapshot)["highWater"];
|
|
444
|
+
let mask = (snapshot)["slotMask"];
|
|
445
|
+
let bits = (snapshot)["slotBits"];
|
|
446
|
+
let live_kinds = (new (globalThis.Array)(39))["fill"](0);
|
|
447
|
+
let pinned_kinds = (new (globalThis.Array)(39))["fill"](0);
|
|
448
|
+
let frame_kinds = (new (globalThis.Array)(39))["fill"](0);
|
|
449
|
+
let slot = 1;
|
|
450
|
+
let frames = 0;
|
|
451
|
+
let frame_slots = 0;
|
|
452
|
+
let frame = allocator_word(view, base);
|
|
453
|
+
let slab_count = 0;
|
|
454
|
+
let slab_address = 0;
|
|
455
|
+
while (__eliscript_numeric_relation("<=", slot, high_water)) {
|
|
456
|
+
{
|
|
457
|
+
let entry = (base + __eliscript_numeric_mul(slot, 24));
|
|
458
|
+
let flags = allocator_word(view, (entry + 4));
|
|
459
|
+
if (((__eliscript_value_38, __eliscript_value_39) => (__eliscript_value_38 !== __eliscript_value_39))(__eliscript_numeric_and(flags, 1), 0)) {
|
|
460
|
+
{
|
|
461
|
+
let offset = allocator_word(view, (entry + 8));
|
|
462
|
+
let kind = allocator_word(view, (base + offset));
|
|
463
|
+
if ((!(__eliscript_numeric_relation(">", kind, 0) && __eliscript_numeric_relation("<", kind, 39)))) {
|
|
464
|
+
allocator_invalid();
|
|
465
|
+
}
|
|
466
|
+
((live_kinds)[kind] = ((live_kinds)[kind] + 1));
|
|
467
|
+
if (__eliscript_numeric_relation(">", allocator_word(view, (entry + 16)), 0)) {
|
|
468
|
+
((pinned_kinds)[kind] = ((pinned_kinds)[kind] + 1));
|
|
469
|
+
}
|
|
470
|
+
if (__eliscript_truthy(((__eliscript_value_40) => (__eliscript_truthy(__eliscript_value_40) ? ((__eliscript_value_41) => (__eliscript_truthy(__eliscript_value_41) ? allocator_module_slab_p(view, (base + offset), (hint)["bindingCount"]) : __eliscript_value_41))((kind === 8)) : __eliscript_value_40))(hint))) {
|
|
471
|
+
((slab_count = (slab_count + 1)), (slab_address = (base + offset)));
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
((slot = (slot + 1)));
|
|
477
|
+
}
|
|
478
|
+
while (((__eliscript_value_42, __eliscript_value_43) => (__eliscript_value_42 !== __eliscript_value_43))(frame, 0)) {
|
|
479
|
+
{
|
|
480
|
+
let index = __eliscript_numeric_and(frame, mask);
|
|
481
|
+
let entry = (base + __eliscript_numeric_mul(index, 24));
|
|
482
|
+
let generation = Math.floor(__eliscript_numeric_div(frame, Math.pow(2, bits)));
|
|
483
|
+
if ((!(__eliscript_numeric_relation(">", index, 0) && __eliscript_numeric_relation("<=", index, high_water) && __eliscript_numeric_relation("<", frames, (snapshot)["liveValues"]) && (allocator_word(view, entry) === generation) && ((__eliscript_value_44, __eliscript_value_45) => (__eliscript_value_44 !== __eliscript_value_45))(__eliscript_numeric_and(allocator_word(view, (entry + 4)), 1), 0)))) {
|
|
484
|
+
allocator_invalid();
|
|
485
|
+
}
|
|
486
|
+
{
|
|
487
|
+
let address = (base + allocator_word(view, (entry + 8)));
|
|
488
|
+
let length = allocator_word(view, (address + 4));
|
|
489
|
+
let index = 0;
|
|
490
|
+
if ((!(allocator_word(view, address) === 9))) {
|
|
491
|
+
allocator_invalid();
|
|
492
|
+
}
|
|
493
|
+
((frame_slots = (frame_slots + length)));
|
|
494
|
+
while (__eliscript_numeric_relation("<", index, length)) {
|
|
495
|
+
{
|
|
496
|
+
const __eliscript_value_46 = allocator_word(view, ((address + 32) + __eliscript_numeric_mul(index, 4)));
|
|
497
|
+
{
|
|
498
|
+
let child = __eliscript_value_46;
|
|
499
|
+
if (__eliscript_numeric_relation(">", child, 3)) {
|
|
500
|
+
{
|
|
501
|
+
let child_index = __eliscript_numeric_and(child, mask);
|
|
502
|
+
let child_entry = (base + __eliscript_numeric_mul(child_index, 24));
|
|
503
|
+
if ((!(__eliscript_numeric_relation(">", child_index, 0) && __eliscript_numeric_relation("<=", child_index, high_water) && (allocator_word(view, child_entry) === Math.floor(__eliscript_numeric_div(child, Math.pow(2, bits)))) && ((__eliscript_value_47, __eliscript_value_48) => (__eliscript_value_47 !== __eliscript_value_48))(__eliscript_numeric_and(allocator_word(view, (child_entry + 4)), 1), 0)))) {
|
|
504
|
+
allocator_invalid();
|
|
505
|
+
}
|
|
506
|
+
{
|
|
507
|
+
const __eliscript_value_49 = allocator_word(view, (base + allocator_word(view, (child_entry + 8))));
|
|
508
|
+
{
|
|
509
|
+
let kind = __eliscript_value_49;
|
|
510
|
+
if ((!(__eliscript_numeric_relation(">", kind, 0) && __eliscript_numeric_relation("<", kind, 39)))) {
|
|
511
|
+
allocator_invalid();
|
|
512
|
+
}
|
|
513
|
+
((frame_kinds)[kind] = ((frame_kinds)[kind] + 1));
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
((index = (index + 1)));
|
|
521
|
+
}
|
|
522
|
+
((frame = allocator_word(view, (address + 12))));
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
((frames = (frames + 1)));
|
|
526
|
+
}
|
|
527
|
+
{
|
|
528
|
+
const __eliscript_value_50 = ({"liveKinds": Object.freeze(live_kinds), "pinnedKinds": Object.freeze(pinned_kinds), "frameRootKinds": Object.freeze(frame_kinds), "frameDepth": frames, "frameSlots": frame_slots});
|
|
529
|
+
{
|
|
530
|
+
let counts = __eliscript_value_50;
|
|
531
|
+
if (__eliscript_truthy(hint)) {
|
|
532
|
+
{
|
|
533
|
+
const __eliscript_value_51 = undefined;
|
|
534
|
+
const __eliscript_value_52 = 0;
|
|
535
|
+
const __eliscript_value_53 = 0;
|
|
536
|
+
{
|
|
537
|
+
let first = __eliscript_value_51;
|
|
538
|
+
let initialized = __eliscript_value_52;
|
|
539
|
+
let position = __eliscript_value_53;
|
|
540
|
+
if ((slab_count === 1)) {
|
|
541
|
+
while (__eliscript_numeric_relation("<", position, (((hint)["prepared"]) ?? []).length)) {
|
|
542
|
+
{
|
|
543
|
+
let binding = ((hint)["prepared"])[position];
|
|
544
|
+
let index = (binding)["index"];
|
|
545
|
+
if ((allocator_word(view, (slab_address + 40 + __eliscript_numeric_mul(index, 28))) === 2)) {
|
|
546
|
+
((initialized = (initialized + 1)));
|
|
547
|
+
} else {
|
|
548
|
+
if ((first === undefined)) {
|
|
549
|
+
((first = Object.freeze(({"index": index, "name": (binding)["name"]}))));
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
((position = (position + 1)));
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
((counts)["projectInitialization"] = Object.freeze(({"bindingCount": (hint)["bindingCount"], "matchingSlabs": slab_count, "uniqueSlab": (slab_count === 1), "initializedPreparedBindings": ((slab_count === 1) ? initialized : undefined), "firstUninitialized": first})));
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
return Object.freeze(counts);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
function module_metadata(module, name) {
|
|
566
|
+
{
|
|
567
|
+
const __eliscript_value_54 = (globalThis.WebAssembly.Module)["customSections"](module, name);
|
|
568
|
+
const __eliscript_value_55 = null;
|
|
569
|
+
{
|
|
570
|
+
let sections = __eliscript_value_54;
|
|
571
|
+
let descriptor = __eliscript_value_55;
|
|
572
|
+
if (__eliscript_numeric_relation(">", ((sections) ?? []).length, 1)) {
|
|
573
|
+
failManagedRuntime(3);
|
|
574
|
+
}
|
|
575
|
+
if (__eliscript_numeric_relation(">", ((sections) ?? []).length, 0)) {
|
|
576
|
+
{
|
|
577
|
+
const __eliscript_value_56 = new (globalThis.Uint8Array)((sections)[0]);
|
|
578
|
+
const __eliscript_value_57 = 0;
|
|
579
|
+
const __eliscript_value_58 = 0;
|
|
580
|
+
const __eliscript_value_59 = 0;
|
|
581
|
+
const __eliscript_value_60 = false;
|
|
582
|
+
{
|
|
583
|
+
let payload = __eliscript_value_56;
|
|
584
|
+
let length = __eliscript_value_57;
|
|
585
|
+
let index = __eliscript_value_58;
|
|
586
|
+
let shift = __eliscript_value_59;
|
|
587
|
+
let ended = __eliscript_value_60;
|
|
588
|
+
while ((__eliscript_numeric_relation("<", index, ((payload) ?? []).length) && __eliscript_numeric_relation("<", index, 5) && (!__eliscript_truthy(ended)))) {
|
|
589
|
+
{
|
|
590
|
+
const __eliscript_value_61 = (payload)[index];
|
|
591
|
+
{
|
|
592
|
+
let byte = __eliscript_value_61;
|
|
593
|
+
((index = (index + 1)));
|
|
594
|
+
if (((index === 5) && ((__eliscript_value_62, __eliscript_value_63) => (__eliscript_value_62 !== __eliscript_value_63))(__eliscript_numeric_and(byte, 240), 0))) {
|
|
595
|
+
failManagedRuntime(3);
|
|
596
|
+
}
|
|
597
|
+
((length = (length + __eliscript_numeric_mul(__eliscript_numeric_and(byte, 127), Math.pow(2, shift)))));
|
|
598
|
+
if ((__eliscript_numeric_and(byte, 128) === 0)) {
|
|
599
|
+
((ended = true));
|
|
600
|
+
} else {
|
|
601
|
+
((shift = (shift + 7)));
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
if ((!__eliscript_truthy(((__eliscript_value_64) => (__eliscript_truthy(__eliscript_value_64) ? ((index + length) === ((payload) ?? []).length) : __eliscript_value_64))(ended)))) {
|
|
607
|
+
failManagedRuntime(3);
|
|
608
|
+
}
|
|
609
|
+
(() => {
|
|
610
|
+
try {
|
|
611
|
+
return ((descriptor = JSON.parse((new (globalThis.TextDecoder)("utf-8", ({"fatal": true})))["decode"]((payload)["subarray"](index)))));
|
|
612
|
+
} catch (ignored) {
|
|
613
|
+
return failManagedRuntime(3);
|
|
614
|
+
}
|
|
615
|
+
})();
|
|
616
|
+
if ((descriptor === null)) {
|
|
617
|
+
failManagedRuntime(3);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
return descriptor;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
function exact_trap_exports(module, exports, options, capability_errors) {
|
|
627
|
+
{
|
|
628
|
+
const __eliscript_value_65 = module_metadata(module, "eliscript-trap-sites");
|
|
629
|
+
const __eliscript_value_66 = (exports)["__eliscript_trap_site"];
|
|
630
|
+
{
|
|
631
|
+
let document = __eliscript_value_65;
|
|
632
|
+
let global = __eliscript_value_66;
|
|
633
|
+
if ((document === null)) {
|
|
634
|
+
return exports;
|
|
635
|
+
} else {
|
|
636
|
+
if ((!__eliscript_truthy(((__eliscript_value_67) => (__eliscript_truthy(__eliscript_value_67) ? ((__eliscript_value_68) => (__eliscript_truthy(__eliscript_value_68) ? (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((global)["value"]) === "number") : __eliscript_value_68))(runtime_instance_p(global, globalThis.WebAssembly.Global)) : __eliscript_value_67))(Array.isArray(document))))) {
|
|
637
|
+
((__eliscript_value_69) => { throw __eliscript_value_69; })(new (globalThis.TypeError)("invalid WASM trap site transport"));
|
|
638
|
+
}
|
|
639
|
+
{
|
|
640
|
+
const __eliscript_value_70 = new (globalThis.Map)();
|
|
641
|
+
const __eliscript_value_71 = 0;
|
|
642
|
+
{
|
|
643
|
+
let sites = __eliscript_value_70;
|
|
644
|
+
let index = __eliscript_value_71;
|
|
645
|
+
while (__eliscript_numeric_relation("<", index, ((document) ?? []).length)) {
|
|
646
|
+
{
|
|
647
|
+
const __eliscript_value_72 = (document)[index];
|
|
648
|
+
{
|
|
649
|
+
let item = __eliscript_value_72;
|
|
650
|
+
if ((!__eliscript_truthy(((__eliscript_value_73) => (__eliscript_truthy(__eliscript_value_73) ? ((__eliscript_value_74) => (__eliscript_truthy(__eliscript_value_74) ? ((__eliscript_value_75) => (__eliscript_truthy(__eliscript_value_75) ? ((__eliscript_value_76) => (__eliscript_truthy(__eliscript_value_76) ? ((__eliscript_value_77) => (__eliscript_truthy(__eliscript_value_77) ? ((__eliscript_value_78) => (__eliscript_truthy(__eliscript_value_78) ? ((__eliscript_value_79) => (__eliscript_truthy(__eliscript_value_79) ? ((__eliscript_value_80) => (__eliscript_truthy(__eliscript_value_80) ? ((__eliscript_value_81) => (__eliscript_truthy(__eliscript_value_81) ? (__eliscript_numeric_relation(">=", (item)["functionIndex"], 0) && ((item)["returnAddress"] === false)) : __eliscript_value_81))(Number.isSafeInteger((item)["functionIndex"])) : __eliscript_value_80))(((item)["offsetBase"] === "module")) : __eliscript_value_79))(__eliscript_numeric_relation(">=", (item)["address"], 0)) : __eliscript_value_78))(Number.isSafeInteger((item)["address"])) : __eliscript_value_77))((!__eliscript_truthy((sites)["has"]((item)["site"])))) : __eliscript_value_76))(__eliscript_numeric_relation("<=", (item)["site"], 4294967295)) : __eliscript_value_75))(__eliscript_numeric_relation(">=", (item)["site"], 1)) : __eliscript_value_74))(Number.isSafeInteger((item)["site"])) : __eliscript_value_73))(runtime_truth(item))))) {
|
|
651
|
+
((__eliscript_value_82) => { throw __eliscript_value_82; })(new (globalThis.TypeError)("invalid exact WASM trap site"));
|
|
652
|
+
}
|
|
653
|
+
(sites)["set"]((item)["site"], Object.freeze(runtime_copy(({}), item)));
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
((index = (index + 1)));
|
|
657
|
+
}
|
|
658
|
+
{
|
|
659
|
+
let debug = (options)["debug"];
|
|
660
|
+
let source_map = (((debug === undefined) || (debug === false)) ? null : createCompilerDebugMap(debug));
|
|
661
|
+
let wrapped = Object.create(null);
|
|
662
|
+
let entries = Object.entries(exports);
|
|
663
|
+
let position = 0;
|
|
664
|
+
while (__eliscript_numeric_relation("<", position, ((entries) ?? []).length)) {
|
|
665
|
+
{
|
|
666
|
+
let entry = (entries)[position];
|
|
667
|
+
let name = (entry)[0];
|
|
668
|
+
let value = (entry)[1];
|
|
669
|
+
if ((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "function"))) {
|
|
670
|
+
((wrapped)[name] = value);
|
|
671
|
+
} else {
|
|
672
|
+
{
|
|
673
|
+
const __eliscript_value_83 = ((...arguments$) => {
|
|
674
|
+
{
|
|
675
|
+
const __eliscript_value_84 = (global)["value"];
|
|
676
|
+
{
|
|
677
|
+
let previous = __eliscript_value_84;
|
|
678
|
+
((global)["value"] = 0);
|
|
679
|
+
return (() => {
|
|
680
|
+
try {
|
|
681
|
+
return __eliscript_at(Reflect, "apply")(value, undefined, arguments$);
|
|
682
|
+
} catch (error) {
|
|
683
|
+
if (__eliscript_truthy(((__eliscript_value_85) => (__eliscript_truthy(__eliscript_value_85) ? ((!__eliscript_truthy((capability_errors)["has"](error))) && (!__eliscript_truthy(Object.hasOwn(error, "eliscriptFrames")))) : __eliscript_value_85))(runtime_instance_p(error, globalThis.WebAssembly.RuntimeError)))) {
|
|
684
|
+
{
|
|
685
|
+
const __eliscript_value_86 = (sites)["get"](__eliscript_numeric_uint32((global)["value"]));
|
|
686
|
+
{
|
|
687
|
+
let site = __eliscript_value_86;
|
|
688
|
+
if (__eliscript_truthy(site)) {
|
|
689
|
+
(() => {
|
|
690
|
+
try {
|
|
691
|
+
{
|
|
692
|
+
const __eliscript_value_87 = Object.freeze([Object.freeze(({"address": (site)["address"], "offsetBase": "module", "functionIndex": (site)["functionIndex"], "returnAddress": false}))]);
|
|
693
|
+
{
|
|
694
|
+
let frames = __eliscript_value_87;
|
|
695
|
+
Object.defineProperty(error, "eliscriptFrames", ({"value": frames, "enumerable": true, "configurable": true}));
|
|
696
|
+
if (__eliscript_truthy(((__eliscript_value_88) => (__eliscript_truthy(__eliscript_value_88) ? (!__eliscript_truthy(Object.hasOwn(error, "eliscriptSourceFrames"))) : __eliscript_value_88))(source_map))) {
|
|
697
|
+
return Object.defineProperty(error, "eliscriptSourceFrames", ({"value": (source_map)["mapFrames"](frames), "enumerable": true, "configurable": true}));
|
|
698
|
+
} else {
|
|
699
|
+
return null;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
} catch (ignored) {
|
|
704
|
+
return null;
|
|
705
|
+
}
|
|
706
|
+
})();
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
return ((__eliscript_value_89) => { throw __eliscript_value_89; })(error);
|
|
712
|
+
} finally {
|
|
713
|
+
((global)["value"] = previous);
|
|
714
|
+
}
|
|
715
|
+
})();
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
{
|
|
720
|
+
let invoke = __eliscript_value_83;
|
|
721
|
+
Object.defineProperties(invoke, ({"length": ({"value": (value)["length"]}), "name": ({"value": (value)["name"]})}));
|
|
722
|
+
((wrapped)[name] = invoke);
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
((position = (position + 1)));
|
|
728
|
+
}
|
|
729
|
+
return Object.freeze(wrapped);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
function instantiateManagedRuntime(bytes, ...arguments$) {
|
|
738
|
+
{
|
|
739
|
+
let options = runtime_options(arguments$);
|
|
740
|
+
let module = new (globalThis.WebAssembly.Module)(bytes);
|
|
741
|
+
let descriptor = module_metadata(module, "eliscript-managed-control");
|
|
742
|
+
let declared = runtime_nullish(runtime_optional(descriptor, "hostCapabilities"), []);
|
|
743
|
+
let required = (globalThis.WebAssembly.Module)["imports"](module);
|
|
744
|
+
if ((!__eliscript_truthy(((__eliscript_value_90) => (__eliscript_truthy(__eliscript_value_90) ? (((declared) ?? []).length === ((required) ?? []).length) : __eliscript_value_90))(Array.isArray(declared))))) {
|
|
745
|
+
((__eliscript_value_91) => { throw __eliscript_value_91; })(new (globalThis.Error)("managed imports differ from declared host capabilities"));
|
|
746
|
+
}
|
|
747
|
+
{
|
|
748
|
+
let bridge = createManagedHostCapabilityBridge(descriptor, options);
|
|
749
|
+
let imports = Object.create(null);
|
|
750
|
+
let lifecycle = ({"capabilityBridge": bridge});
|
|
751
|
+
let capability_errors = new (globalThis.WeakSet)();
|
|
752
|
+
let exports = undefined;
|
|
753
|
+
(() => {
|
|
754
|
+
try {
|
|
755
|
+
{
|
|
756
|
+
const __eliscript_value_92 = new (globalThis.Set)();
|
|
757
|
+
const __eliscript_value_93 = 0;
|
|
758
|
+
{
|
|
759
|
+
let seen = __eliscript_value_92;
|
|
760
|
+
let index = __eliscript_value_93;
|
|
761
|
+
while (__eliscript_numeric_relation("<", index, ((required) ?? []).length)) {
|
|
762
|
+
{
|
|
763
|
+
const __eliscript_value_94 = (required)[index];
|
|
764
|
+
const __eliscript_value_95 = (declared)[index];
|
|
765
|
+
{
|
|
766
|
+
let actual = __eliscript_value_94;
|
|
767
|
+
let capability = __eliscript_value_95;
|
|
768
|
+
if ((!__eliscript_truthy(((__eliscript_value_96) => (__eliscript_truthy(__eliscript_value_96) ? (((actual)["kind"] === "function") && ((actual)["module"] === "eliscript.host") && ((actual)["module"] === (capability)["module"]) && ((actual)["name"] === (capability)["name"]) && ((capability)["arity"] === 2) && ((capability)["abi"] === "managed-host-call-v1") && (!__eliscript_truthy((seen)["has"]((actual)["name"])))) : __eliscript_value_96))(runtime_truth(capability))))) {
|
|
769
|
+
((__eliscript_value_97) => { throw __eliscript_value_97; })(new (globalThis.Error)("managed import is not an allowed declared capability"));
|
|
770
|
+
}
|
|
771
|
+
(seen)["add"]((actual)["name"]);
|
|
772
|
+
if ((!__eliscript_truthy(Object.hasOwn(imports, (actual)["module"])))) {
|
|
773
|
+
((imports)[(actual)["module"]] = Object.create(null));
|
|
774
|
+
}
|
|
775
|
+
(((imports)[(actual)["module"]])[(actual)["name"]] = ((heap, argv) => {
|
|
776
|
+
return (() => {
|
|
777
|
+
try {
|
|
778
|
+
{
|
|
779
|
+
const __eliscript_value_98 = (bridge)["dispatch"]((actual)["name"], __eliscript_numeric_uint32(heap), __eliscript_numeric_uint32(argv));
|
|
780
|
+
{
|
|
781
|
+
let result = __eliscript_value_98;
|
|
782
|
+
if ((!__eliscript_truthy(((__eliscript_value_99) => (__eliscript_truthy(__eliscript_value_99) ? (__eliscript_numeric_relation(">=", result, 0) && __eliscript_numeric_relation("<=", result, 4294967295)) : __eliscript_value_99))(Number.isInteger(result))))) {
|
|
783
|
+
((__eliscript_value_100) => { throw __eliscript_value_100; })(new (globalThis.TypeError)("host capability returned an invalid managed word"));
|
|
784
|
+
}
|
|
785
|
+
return result;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
} catch (error) {
|
|
789
|
+
if (((!(error === null)) && ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(error) === "object") || (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(error) === "function")))) {
|
|
790
|
+
(capability_errors)["add"](error);
|
|
791
|
+
}
|
|
792
|
+
return ((__eliscript_value_101) => { throw __eliscript_value_101; })(error);
|
|
793
|
+
}
|
|
794
|
+
})();
|
|
795
|
+
}));
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
((index = (index + 1)));
|
|
799
|
+
}
|
|
800
|
+
((exports = exact_trap_exports(module, (new (globalThis.WebAssembly.Instance)(module, imports))["exports"], options, capability_errors)));
|
|
801
|
+
if ((!__eliscript_truthy(runtime_instance_p((exports)["memory"], globalThis.WebAssembly.Memory)))) {
|
|
802
|
+
return ((__eliscript_value_102) => { throw __eliscript_value_102; })(new (globalThis.Error)("managed runtime requires owned memory"));
|
|
803
|
+
} else {
|
|
804
|
+
return null;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
} catch (error) {
|
|
809
|
+
(() => {
|
|
810
|
+
try {
|
|
811
|
+
return (bridge)["close"]();
|
|
812
|
+
} catch (ignored) {
|
|
813
|
+
return null;
|
|
814
|
+
}
|
|
815
|
+
})();
|
|
816
|
+
return ((__eliscript_value_103) => { throw __eliscript_value_103; })(error);
|
|
817
|
+
}
|
|
818
|
+
})();
|
|
819
|
+
{
|
|
820
|
+
let memory = ({"view": (() => {
|
|
821
|
+
return new (globalThis.DataView)(((exports)["memory"])["buffer"]);
|
|
822
|
+
}), "writeBytes": ((offset, bytes) => {
|
|
823
|
+
return (new (globalThis.Uint8Array)(((exports)["memory"])["buffer"], offset, ((bytes) ?? []).length))["set"](bytes);
|
|
824
|
+
}), "readBytes": ((offset, length) => {
|
|
825
|
+
return (new (globalThis.Uint8Array)(((exports)["memory"])["buffer"], offset, length))["slice"]();
|
|
826
|
+
})});
|
|
827
|
+
let record = ({"heap": 0, "memory": memory, "closed": false});
|
|
828
|
+
return (() => {
|
|
829
|
+
try {
|
|
830
|
+
{
|
|
831
|
+
let runtime = observeManagedProjectRuntime(createManagedHostRuntime(observeManagedProjectExports(runtime_heap_exports(exports, options, record), (options)["moduleGraph"]), descriptor, memory, options, lifecycle), (options)["moduleGraph"]);
|
|
832
|
+
let dispose = (lifecycle)["dispose"];
|
|
833
|
+
((lifecycle)["dispose"] = ((...arguments$) => {
|
|
834
|
+
((record)["closed"] = true);
|
|
835
|
+
((record)["memory"] = null);
|
|
836
|
+
if (__eliscript_truthy(dispose)) {
|
|
837
|
+
return __eliscript_at(Reflect, "apply")(dispose, lifecycle, arguments$);
|
|
838
|
+
} else {
|
|
839
|
+
return null;
|
|
840
|
+
}
|
|
841
|
+
}));
|
|
842
|
+
((__eliscript_tdz_read_0()))["set"](runtime, record);
|
|
843
|
+
return runtime;
|
|
844
|
+
}
|
|
845
|
+
} catch (error) {
|
|
846
|
+
(() => {
|
|
847
|
+
try {
|
|
848
|
+
{
|
|
849
|
+
const __eliscript_value_104 = (lifecycle)["dispose"];
|
|
850
|
+
{
|
|
851
|
+
let dispose = __eliscript_value_104;
|
|
852
|
+
if (__eliscript_truthy(dispose)) {
|
|
853
|
+
return (lifecycle)["dispose"]();
|
|
854
|
+
} else {
|
|
855
|
+
return null;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
} catch (ignored) {
|
|
860
|
+
return null;
|
|
861
|
+
}
|
|
862
|
+
})();
|
|
863
|
+
(() => {
|
|
864
|
+
try {
|
|
865
|
+
return (bridge)["close"]();
|
|
866
|
+
} catch (ignored) {
|
|
867
|
+
return null;
|
|
868
|
+
}
|
|
869
|
+
})();
|
|
870
|
+
return ((__eliscript_value_105) => { throw __eliscript_value_105; })(error);
|
|
871
|
+
}
|
|
872
|
+
})();
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
async function instantiateManagedRuntimeWithHostModules(bytes, ...arguments$) {
|
|
878
|
+
return (await (async (options) => {
|
|
879
|
+
return (await (async (module) => {
|
|
880
|
+
return (await (async (descriptor) => {
|
|
881
|
+
return (__eliscript_truthy(runtime_truth(runtime_optional(descriptor, "project"))) ? (await (async (provided_graph) => {
|
|
882
|
+
return (await (async (module_graph) => {
|
|
883
|
+
return (await (async (configuration) => {
|
|
884
|
+
return (await (async (runtime) => {
|
|
885
|
+
return (await (async () => {
|
|
886
|
+
if (__eliscript_truthy(((__eliscript_value_106) => (__eliscript_truthy(__eliscript_value_106) ? __eliscript_value_106 : runtime_truth((module_graph)["attached"])))(runtime_truth((module_graph)["closed"])))) {
|
|
887
|
+
((__eliscript_value_107) => { throw __eliscript_value_107; })(new (globalThis.Error)("module graph is already attached or closed"));
|
|
888
|
+
}
|
|
889
|
+
return (await (async () => {
|
|
890
|
+
try {
|
|
891
|
+
return (await (async () => {
|
|
892
|
+
((runtime = instantiateManagedRuntime(bytes, configuration)));
|
|
893
|
+
return (((options)["initializeModule"] === false) ? (() => {
|
|
894
|
+
(module_graph)["attachRuntime"](runtime);
|
|
895
|
+
return runtime;
|
|
896
|
+
})() : (await (async () => {
|
|
897
|
+
await (loadManagedProjectGraph(runtime, descriptor, configuration));
|
|
898
|
+
return runtime;
|
|
899
|
+
})()));
|
|
900
|
+
})());
|
|
901
|
+
} catch (error) {
|
|
902
|
+
if ((!__eliscript_truthy(runtime_truth((module_graph)["closed"])))) {
|
|
903
|
+
(() => {
|
|
904
|
+
try {
|
|
905
|
+
if (__eliscript_truthy(runtime)) {
|
|
906
|
+
return (runtime)["closeModule"]();
|
|
907
|
+
} else {
|
|
908
|
+
return null;
|
|
909
|
+
}
|
|
910
|
+
} catch (ignored) {
|
|
911
|
+
return null;
|
|
912
|
+
}
|
|
913
|
+
})();
|
|
914
|
+
(() => {
|
|
915
|
+
try {
|
|
916
|
+
return (module_graph)["close"]();
|
|
917
|
+
} catch (ignored) {
|
|
918
|
+
return null;
|
|
919
|
+
}
|
|
920
|
+
})();
|
|
921
|
+
}
|
|
922
|
+
return ((__eliscript_value_108) => { throw __eliscript_value_108; })(error);
|
|
923
|
+
}
|
|
924
|
+
})());
|
|
925
|
+
})());
|
|
926
|
+
})(undefined));
|
|
927
|
+
})(runtime_copy(runtime_copy(({}), options), ({"moduleGraph": module_graph, "hostModules": (module_graph)["hostModules"], "initializeModule": false}))));
|
|
928
|
+
})(((provided_graph == null) ? createManagedModuleGraph(descriptor) : provided_graph)));
|
|
929
|
+
})((options)["moduleGraph"])) : ((host_modules) => {
|
|
930
|
+
return instantiateManagedRuntime(bytes, runtime_copy(runtime_copy(({}), options), ({"hostModules": host_modules})));
|
|
931
|
+
})(await (loadManagedHostModules(descriptor, options))));
|
|
932
|
+
})(module_metadata(module, "eliscript-managed-control")));
|
|
933
|
+
})(new (globalThis.WebAssembly.Module)(bytes)));
|
|
934
|
+
})(runtime_options(arguments$)));
|
|
935
|
+
}
|
|
936
|
+
const readManagedModuleMetadata = module_metadata;
|
|
937
|
+
__eliscript_tdz_ready_1 = true;
|
|
938
|
+
export {instantiateManagedRuntime, instantiateManagedRuntimeWithHostModules, loadManagedHostModules, readManagedAllocatorSnapshot, readManagedAllocatorValueCounts, readManagedModuleMetadata, createManagedModuleGraph, createManagedProjectFacades, loadManagedProjectGraph};
|
|
939
|
+
//# sourceMappingURL=managed-runtime.mjs.map
|