substrate-lang 0.9.4 → 0.10.1
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 +1 -1
- package/build/compiler/{binary.cdd2ffb408dd@0+0.wasm → binary.2d43b43d1600@0+0.wasm} +0 -0
- package/build/compiler/checker.4dd4556dd421@0+0.wasm +0 -0
- package/build/compiler/{compile.da85f9bc4478@0+0.wasm → compile.5d8f6407af2a@0+0.wasm} +0 -0
- package/build/compiler/{core.0410ffbdc488@0+0.wasm → core.f2defb75e00b@0+0.wasm} +0 -0
- package/build/compiler/expander.967ce443d379@0+0.wasm +0 -0
- package/build/compiler/fs.01b8aab4a9a8@0+0.wasm +0 -0
- package/build/compiler/{leb128.ba77430f659f@0+0.wasm → leb128.15d814b7b4f2@0+0.wasm} +0 -0
- package/build/compiler/{link.be6e641afa93@0+0.wasm → link.b826ea7c8f17@0+0.wasm} +0 -0
- package/build/compiler/{macros.b695763c0ca3@0+0.wasm → macros.b269e0c42784@0+0.wasm} +0 -0
- package/build/compiler/{main.cbbdf42e34c2@0+0.wasm → main.4fc52f204d54@0+0.wasm} +0 -0
- package/build/compiler/{ops.324f0a665fab@0+0.wasm → ops.515b5e05f646@0+0.wasm} +0 -0
- package/build/compiler/{path.1b5fd988b6f3@0+0.wasm → path.5a6286472cd4@0+0.wasm} +0 -0
- package/build/compiler/program +21 -21
- package/build/compiler/{prune.29dde307bdee@0+0.wasm → prune.406215c3e4f8@0+0.wasm} +0 -0
- package/build/compiler/reader.694b03770bf0@0+0.wasm +0 -0
- package/build/compiler/roots.cefd10e93684@0+0.wasm +0 -0
- package/build/compiler/{running.b99787c2d180@0+0.wasm → running.0d25dbaec018@0+0.wasm} +0 -0
- package/build/compiler/serialize.b0d82f3d63d2@0+0.wasm +0 -0
- package/build/compiler/{sha256.f6c742932dde@0+0.wasm → sha256.a6c32b04d799@0+0.wasm} +0 -0
- package/build/compiler/substrate.5ee5d0b4d3e7@0+0.wasm +0 -0
- package/build/compiler/{syntax.fadc832db29f@0+0.wasm → syntax.32f3e40b61c7@0+0.wasm} +0 -0
- package/build/compiler/{writer.550227768eb9@0+0.wasm → writer.00b7802cbe39@0+0.wasm} +0 -0
- package/build/sub/{base64.454b045156d2@0+0.wasm → base64.a26bdcf60a2d@0+0.wasm} +0 -0
- package/build/sub/build.459c5b9412bd@0+0.wasm +0 -0
- package/build/sub/chromium.3d5818f2707d@0+0.wasm +0 -0
- package/build/sub/common.1edc613607a0@0+0.wasm +0 -0
- package/build/sub/deflate.23f7c4679260@0+0.wasm +0 -0
- package/build/sub/doc.0775df5de6fe@0+0.wasm +0 -0
- package/build/sub/{doc.f18ad14060e9@0+0.wasm → doc.ef9965d5d402@0+0.wasm} +0 -0
- package/build/sub/env.e5451da6e747@0+0.wasm +0 -0
- package/build/sub/events.bf5473ebf220@0+0.wasm +0 -0
- package/build/sub/fetch.7790d4943758@0+0.wasm +0 -0
- package/build/sub/fetch.96b2d10f025e@0+0.wasm +0 -0
- package/build/sub/files.ad0469fdf6fa@0+0.wasm +0 -0
- package/build/sub/fs.01b8aab4a9a8@0+0.wasm +0 -0
- package/build/sub/git.dc4c0e757ebe@0+0.wasm +0 -0
- package/build/sub/grants.c54776c0d7e3@0+0.wasm +0 -0
- package/build/sub/gzip.16e372eda1cf@0+0.wasm +0 -0
- package/build/sub/hash.660682e4f491@0+0.wasm +0 -0
- package/build/sub/{html.0b0362932a75@0+0.wasm → html.a23126eb949a@0+0.wasm} +0 -0
- package/build/sub/{html.3b3c8d7d9971@0+0.wasm → html.e9ed37f34977@0+0.wasm} +0 -0
- package/build/sub/{inflate.3cfa17586072@0+0.wasm → inflate.59bb61f14001@0+0.wasm} +0 -0
- package/build/sub/json.55590d2f518a@0+0.wasm +0 -0
- package/build/sub/manifest.ef317480deb0@0+0.wasm +0 -0
- package/build/sub/{map.e582eae03ec2@0+0.wasm → map.f455cca6a42a@0+0.wasm} +0 -0
- package/build/sub/pack.e02836264f6a@0+0.wasm +0 -0
- package/build/sub/{path.1b5fd988b6f3@0+0.wasm → path.5a6286472cd4@0+0.wasm} +0 -0
- package/build/sub/path.6891ffea73ca@0+0.wasm +0 -0
- package/build/sub/process.7106571fa723@0+0.wasm +0 -0
- package/build/sub/program +48 -48
- package/build/sub/read.0b93933d62a2@0+0.wasm +0 -0
- package/build/sub/{reader.d256e69e09e2@0+0.wasm → reader.694b03770bf0@0+0.wasm} +0 -0
- package/build/sub/{root.02141d04d568@0+0.wasm → root.f10a4906f460@0+0.wasm} +0 -0
- package/build/sub/{roots.e366210c01d6@0+0.wasm → roots.cefd10e93684@0+0.wasm} +0 -0
- package/build/sub/{sha256.f6c742932dde@0+0.wasm → sha256.a6c32b04d799@0+0.wasm} +0 -0
- package/build/sub/{sha512.9fee24e95460@0+0.wasm → sha512.c24a792d7891@0+0.wasm} +0 -0
- package/build/sub/site.1732b58ec0e8@0+0.wasm +0 -0
- package/build/sub/site.ae3913b0b0f4@0+0.wasm +0 -0
- package/build/sub/store.a24d7a25daa6@0+0.wasm +0 -0
- package/build/sub/stream.126e3bd5d626@0+0.wasm +0 -0
- package/build/sub/sub.2e3092140706@0+0.wasm +0 -0
- package/build/sub/substrate.5ee5d0b4d3e7@0+0.wasm +0 -0
- package/build/sub/{syntax.fadc832db29f@0+0.wasm → syntax.32f3e40b61c7@0+0.wasm} +0 -0
- package/build/sub/tar.2a633861e654@0+0.wasm +0 -0
- package/build/sub/test.9bd59c73f65e@0+0.wasm +0 -0
- package/build/sub/{text.8ff142d72fd7@0+0.wasm → text.1bc90482bd43@0+0.wasm} +0 -0
- package/build/sub/{timer.d3454726b3bf@0+0.wasm → timer.f35eb62ae446@0+0.wasm} +0 -0
- package/build/sub/upgrade.39ee449b00d5@0+0.wasm +0 -0
- package/build/sub/{utf8.e82afeb9e953@0+0.wasm → utf8.e7216bd054e1@0+0.wasm} +0 -0
- package/build/sub/worker.762a9d642af0@0+0.wasm +0 -0
- package/build/sub/writer.00b7802cbe39@0+0.wasm +0 -0
- package/package.json +1 -1
- package/std/archive/tar.sub +30 -23
- package/std/browser/chromium.sub +5 -4
- package/std/browser/devtools.sub +24 -19
- package/std/compress/gzip.sub +18 -16
- package/std/compress/inflate.sub +7 -4
- package/std/crypto/password.sub +3 -3
- package/std/doc/doc.sub +2 -2
- package/std/encoding/json.sub +20 -8
- package/std/encoding/wire.sub +9 -7
- package/std/http/form.sub +2 -2
- package/std/http/multipart.sub +8 -10
- package/std/http/route.sub +9 -4
- package/std/http/server.sub +14 -11
- package/std/http/session.sub +2 -2
- package/std/http/static.sub +5 -5
- package/std/meta/derive.sub +0 -2
- package/std/meta/method.sub +41 -0
- package/std/meta/type-info.sub +30 -37
- package/std/package/files.sub +24 -25
- package/std/package/git.sub +26 -33
- package/std/package/hash.sub +8 -8
- package/std/package/manifest.sub +67 -42
- package/std/package/map.sub +1 -1
- package/std/package/pack.sub +13 -13
- package/std/package/read.sub +7 -6
- package/std/package/site.sub +7 -7
- package/std/package/store.sub +16 -12
- package/std/package.sub +7 -6
- package/std/test/browser.sub +9 -8
- package/std/test/build.sub +2 -2
- package/std/test/page.sub +31 -26
- package/std/test/run.sub +8 -7
- package/std/test/test.sub +12 -13
- package/std/vector/vector.sub +75 -0
- package/std/web/canvas.sub +3 -3
- package/std/web/dom.sub +45 -11
- package/std/web/gpu-commands.sub +439 -0
- package/std/web/gpu.sub +17 -424
- package/std/web/patches.sub +45 -10
- package/substrate/VERSION +1 -1
- package/substrate/compiler/checker.sub +40 -212
- package/substrate/compiler/compile.sub +3 -3
- package/substrate/compiler/expander.sub +32 -50
- package/substrate/compiler/main.sub +9 -9
- package/substrate/compiler/reader.sub +4 -4
- package/substrate/compiler/roots.sub +8 -8
- package/substrate/compiler/running.sub +1 -1
- package/substrate/compiler/serialize.sub +56 -49
- package/substrate/compiler/substrate.sub +53 -11
- package/substrate/host/errors.mjs +3 -2
- package/substrate/host/events.sub +3 -16
- package/substrate/host/fs.mjs +5 -4
- package/substrate/host/fs.sub +135 -102
- package/substrate/host/grants.mjs +1 -1
- package/substrate/host/grants.sub +8 -7
- package/substrate/host/modules/fake.mjs +1 -1
- package/substrate/host/modules/websocket.mjs +4 -4
- package/substrate/host/modules/websocket.sub +8 -6
- package/substrate/host/node/env.mjs +12 -6
- package/substrate/host/node/env.sub +21 -16
- package/substrate/host/node/fs.mjs +1 -1
- package/substrate/host/node/net.mjs +2 -2
- package/substrate/host/node/net.sub +13 -6
- package/substrate/host/node/process.mjs +4 -4
- package/substrate/host/node/process.sub +25 -24
- package/substrate/host/node/signal.mjs +3 -2
- package/substrate/host/node/signal.sub +9 -6
- package/substrate/host/node/watch.mjs +1 -1
- package/substrate/host/node/watch.sub +11 -9
- package/substrate/host/stream.sub +2 -0
- package/substrate/host/subhost-core.mjs +9 -1
- package/substrate/host/web/audio.mjs +17 -9
- package/substrate/host/web/audio.sub +9 -3
- package/substrate/host/web/clipboard.mjs +2 -2
- package/substrate/host/web/clipboard.sub +10 -3
- package/substrate/host/web/dom.mjs +165 -64
- package/substrate/host/web/dom.sub +9 -27
- package/substrate/host/web/files.mjs +2 -2
- package/substrate/host/web/files.sub +6 -2
- package/substrate/host/web/fs.mjs +3 -3
- package/substrate/host/web/gpu.mjs +63 -25
- package/substrate/host/web/gpu.sub +18 -4
- package/substrate/host/web/location.mjs +18 -2
- package/substrate/host/web/location.sub +19 -7
- package/substrate/host/worker-side.mjs +3 -1
- package/substrate/host/worker.mjs +6 -5
- package/substrate/host/worker.sub +10 -10
- package/build/compiler/checker.2b0ea87ed311@0+0.wasm +0 -0
- package/build/compiler/expander.80707e1666d6@0+0.wasm +0 -0
- package/build/compiler/fs.5017b627cbd2@0+0.wasm +0 -0
- package/build/compiler/reader.d256e69e09e2@0+0.wasm +0 -0
- package/build/compiler/roots.e366210c01d6@0+0.wasm +0 -0
- package/build/compiler/serialize.a12536bbbe9a@0+0.wasm +0 -0
- package/build/compiler/substrate.728c690187f2@0+0.wasm +0 -0
- package/build/sub/build.115aeefc15e8@0+0.wasm +0 -0
- package/build/sub/chromium.fc0bfea0fbe6@0+0.wasm +0 -0
- package/build/sub/common.997c21b0b8cf@0+0.wasm +0 -0
- package/build/sub/deflate.3138a38325a1@0+0.wasm +0 -0
- package/build/sub/doc.e3f9a998cd91@0+0.wasm +0 -0
- package/build/sub/env.861d55fff974@0+0.wasm +0 -0
- package/build/sub/events.2c981f6f1ec7@0+0.wasm +0 -0
- package/build/sub/fetch.b0ce8f8b3da8@0+0.wasm +0 -0
- package/build/sub/fetch.d62aa5fc9623@0+0.wasm +0 -0
- package/build/sub/files.1706cc0941c0@0+0.wasm +0 -0
- package/build/sub/fs.5017b627cbd2@0+0.wasm +0 -0
- package/build/sub/git.1c5791236e35@0+0.wasm +0 -0
- package/build/sub/grants.cd99dff2854e@0+0.wasm +0 -0
- package/build/sub/gzip.9ebea150f218@0+0.wasm +0 -0
- package/build/sub/hash.ba8330dad9ff@0+0.wasm +0 -0
- package/build/sub/json.af2e0ae20084@0+0.wasm +0 -0
- package/build/sub/manifest.6e014ac19e5d@0+0.wasm +0 -0
- package/build/sub/pack.4295e4f5bdbd@0+0.wasm +0 -0
- package/build/sub/path.de22f6659534@0+0.wasm +0 -0
- package/build/sub/process.ca10ac0b8a62@0+0.wasm +0 -0
- package/build/sub/read.279fafcda508@0+0.wasm +0 -0
- package/build/sub/site.76aa8286c257@0+0.wasm +0 -0
- package/build/sub/site.e6e415bc3170@0+0.wasm +0 -0
- package/build/sub/store.c48db3345968@0+0.wasm +0 -0
- package/build/sub/stream.27fd2fe858e1@0+0.wasm +0 -0
- package/build/sub/sub.c0fb7310de12@0+0.wasm +0 -0
- package/build/sub/substrate.728c690187f2@0+0.wasm +0 -0
- package/build/sub/tar.692c0e8827cd@0+0.wasm +0 -0
- package/build/sub/test.1fd2ff8123bf@0+0.wasm +0 -0
- package/build/sub/upgrade.2a9219e6a45d@0+0.wasm +0 -0
- package/build/sub/worker.ea1e11f8f5e2@0+0.wasm +0 -0
- package/build/sub/writer.550227768eb9@0+0.wasm +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// The host module "location" (location.sub).
|
|
2
|
+
import { errorOf } from '../errors.mjs';
|
|
3
|
+
|
|
2
4
|
const utf8 = new TextEncoder();
|
|
3
5
|
|
|
4
6
|
const SOURCE = 12;
|
|
@@ -6,14 +8,19 @@ const CHANGED = 1;
|
|
|
6
8
|
|
|
7
9
|
export function locationModule() {
|
|
8
10
|
return (caller) => {
|
|
9
|
-
const
|
|
11
|
+
const listeners = new Map();
|
|
12
|
+
let next = 1;
|
|
13
|
+
const popped = () => {
|
|
14
|
+
const url = utf8.encode(globalThis.location.href);
|
|
15
|
+
for (const [id, tag] of listeners) caller.event(CHANGED, id, tag, 0, url);
|
|
16
|
+
};
|
|
10
17
|
addEventListener('popstate', popped);
|
|
11
18
|
const move = (go, ptr, len, err) => {
|
|
12
19
|
try {
|
|
13
20
|
go(caller.string(ptr, len));
|
|
14
21
|
return 0;
|
|
15
22
|
} catch (e) {
|
|
16
|
-
caller.fail(err, e.message);
|
|
23
|
+
caller.fail(err, e.message, errorOf(e));
|
|
17
24
|
return -1;
|
|
18
25
|
}
|
|
19
26
|
};
|
|
@@ -28,6 +35,15 @@ export function locationModule() {
|
|
|
28
35
|
back() {
|
|
29
36
|
history.back();
|
|
30
37
|
},
|
|
38
|
+
listen(tag) {
|
|
39
|
+
const id = next++;
|
|
40
|
+
listeners.set(id, tag);
|
|
41
|
+
return id;
|
|
42
|
+
},
|
|
43
|
+
unlisten(id) {
|
|
44
|
+
listeners.delete(id);
|
|
45
|
+
caller.forget(id);
|
|
46
|
+
},
|
|
31
47
|
};
|
|
32
48
|
};
|
|
33
49
|
}
|
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
;; The page's URL and history: the host module "location". When the user goes back or forward,
|
|
2
|
-
;; event
|
|
3
|
-
|
|
1
|
+
;; The page's URL and history: the host module "location". When the user goes back or forward, each listener's tag
|
|
2
|
+
;; gets a changed event with the URL as its bytes. location-listen gives the listener's number, and location-unlisten
|
|
3
|
+
;; takes it.
|
|
4
|
+
(provide location-source location-changed location-get location-push location-replace location-back location-listen
|
|
5
|
+
location-unlisten)
|
|
4
6
|
|
|
5
7
|
(import get "location" "get" (i32 -> i32))
|
|
6
8
|
(import push "location" "push" (i32 i32 i32 -> i32))
|
|
7
9
|
(import replace "location" "replace" (i32 i32 i32 -> i32))
|
|
8
10
|
(import back "location" "back" (->))
|
|
11
|
+
(import listen "location" "listen" (i32 -> i32))
|
|
12
|
+
(import unlisten "location" "unlisten" (i32 ->))
|
|
9
13
|
|
|
10
14
|
(const location-source u32 12)
|
|
11
15
|
(const location-changed u32 1)
|
|
12
16
|
|
|
13
17
|
(define (location-get) -> string (let* ([n u32 0] [p (get (cast i32 (& n)))]) (cast string (slice (cast (ptr u8) p) n))))
|
|
14
18
|
|
|
15
|
-
(define (location-push [url string] [err (ptr
|
|
16
|
-
(
|
|
19
|
+
(define (location-push [url string] [err (ptr error)]) -> bool
|
|
20
|
+
(let ([why string])
|
|
21
|
+
(or (== (push (cast i32 (-> url bytes)) (cast i32 (-> url length)) (cast i32 (& why))) 0)
|
|
22
|
+
(host-failed! (& why) err))))
|
|
17
23
|
|
|
18
|
-
(define (location-replace [url string] [err (ptr
|
|
19
|
-
(
|
|
24
|
+
(define (location-replace [url string] [err (ptr error)]) -> bool
|
|
25
|
+
(let ([why string])
|
|
26
|
+
(or (== (replace (cast i32 (-> url bytes)) (cast i32 (-> url length)) (cast i32 (& why))) 0)
|
|
27
|
+
(host-failed! (& why) err))))
|
|
20
28
|
|
|
21
29
|
(define (location-back) (back))
|
|
30
|
+
|
|
31
|
+
(define (location-listen [tag (ptr void)]) -> u32 (cast u32 (listen (cast i32 tag))))
|
|
32
|
+
|
|
33
|
+
(define (location-unlisten [id u32]) (unlisten (cast i32 id)))
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// The worker module's side inside a worker, in a browser or on Node. It batches output, delivers the parent's
|
|
2
2
|
// messages as events, and reports back.
|
|
3
|
+
import { errors } from './errors.mjs';
|
|
4
|
+
|
|
3
5
|
const utf8 = new TextEncoder();
|
|
4
6
|
|
|
5
7
|
const SOURCE = 3;
|
|
@@ -72,7 +74,7 @@ export function workerSide(post) {
|
|
|
72
74
|
const worker = (caller) => ({
|
|
73
75
|
source: SOURCE,
|
|
74
76
|
start(f, bp, bl, time, size, heard, tag, gp, gl, err) {
|
|
75
|
-
caller.fail(err, 'worker.start: a worker cannot start workers');
|
|
77
|
+
caller.fail(err, 'worker.start: a worker cannot start workers', errors.invalid);
|
|
76
78
|
return 0;
|
|
77
79
|
},
|
|
78
80
|
send(w, ptr, length) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// The host module "worker" (worker.sub). The browser and Node each give spawn, their way of starting a thread.
|
|
2
2
|
import { entries } from './entries.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { errors, errorOf } from './errors.mjs';
|
|
4
|
+
import { askedOf, mayTree, notGranted, within } from './grants.mjs';
|
|
4
5
|
|
|
5
6
|
const utf8 = new TextEncoder();
|
|
6
7
|
|
|
@@ -69,7 +70,7 @@ export function workerModule({ spawn }) {
|
|
|
69
70
|
thread = spawn({ modules, compiled, entry, argument, grants, names: caller.moduleNames(), pages, heard, ...setup },
|
|
70
71
|
app);
|
|
71
72
|
} catch (e) {
|
|
72
|
-
caller.fail(err, e.message);
|
|
73
|
+
caller.fail(err, e.message, errorOf(e));
|
|
73
74
|
return 0;
|
|
74
75
|
}
|
|
75
76
|
const w = nextNumber++;
|
|
@@ -100,7 +101,7 @@ export function workerModule({ spawn }) {
|
|
|
100
101
|
start(f, bp, bl, time, size, heard, tag, gp, gl, err, ends, ap, al) {
|
|
101
102
|
const entry = caller.named(f >>> 0);
|
|
102
103
|
if (!entry) {
|
|
103
|
-
caller.fail(err, 'worker.start: a function of code the program loaded');
|
|
104
|
+
caller.fail(err, 'worker.start: a function of code the program loaded', errors.invalid);
|
|
104
105
|
return 0;
|
|
105
106
|
}
|
|
106
107
|
const pages = Math.ceil((size >>> 0) / 65536);
|
|
@@ -113,11 +114,11 @@ export function workerModule({ spawn }) {
|
|
|
113
114
|
const parent = caller.grants();
|
|
114
115
|
const files = caller.parseGrants(read.flatMap((file) => ['read', file])).grants.read.items;
|
|
115
116
|
for (const file of files) {
|
|
116
|
-
if (!mayTree(parent.read, file)) throw
|
|
117
|
+
if (!mayTree(parent.read, file)) throw notGranted(`read ${file} reaches beyond the parent's grants`);
|
|
117
118
|
}
|
|
118
119
|
grants = within(askedOf(request, parent), parent);
|
|
119
120
|
} catch (e) {
|
|
120
|
-
caller.fail(err, `worker.start: ${e.message}
|
|
121
|
+
caller.fail(err, `worker.start: ${e.message}`, errorOf(e));
|
|
121
122
|
return 0;
|
|
122
123
|
}
|
|
123
124
|
const args = al > 0 ? entries(string(ap, al)) : null;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
;; Workers: functions of this program, each running on its own thread and sharing only messages. worker-start runs one
|
|
2
|
-
;; of the program's own functions with the bytes as its argument 0
|
|
3
|
-
;; reason at err. Its options:
|
|
2
|
+
;; of the program's own functions with the bytes as its argument 0. Its options:
|
|
4
3
|
;; time, memory limits in ms for each stretch of work and in bytes, or 0 for none
|
|
5
4
|
;; output the worker's stdout and stderr come as events
|
|
6
5
|
;; grants the worker's grants (grants.sub), within the parent's and by default the parent's own
|
|
@@ -41,22 +40,23 @@
|
|
|
41
40
|
(set! (-> o grants) (make-grants))
|
|
42
41
|
(grants-inherit! (& (-> o grants))))
|
|
43
42
|
|
|
44
|
-
(define (worker-start [function (fn ())] [argument (slice u8)] [o (ptr worker-options)] [tag (ptr void)]
|
|
45
|
-
[err (ptr
|
|
46
|
-
(let ([defaults worker-options] [p o] [entries (make-buffer)] [args (make-buffer)] [
|
|
43
|
+
(define (worker-start [function (fn ())] [argument (slice u8)] [o (ptr worker-options)] [tag (ptr void)] [id (ptr u32)]
|
|
44
|
+
[err (ptr error)]) -> bool
|
|
45
|
+
(let ([defaults worker-options] [p o] [entries (make-buffer)] [args (make-buffer)] [why string] [n u32 0])
|
|
47
46
|
(when (== p 0)
|
|
48
47
|
(worker-options-init! (& defaults))
|
|
49
48
|
(set! p (& defaults)))
|
|
50
49
|
(grants-entries! (& entries) (& (-> p grants)))
|
|
51
50
|
(buffer-add-entries! (& args) (-> p args))
|
|
52
|
-
(set!
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
(set! n (cast u32 (start (cast i32 function) (cast i32 (-> argument items)) (cast i32 (-> argument length))
|
|
52
|
+
(cast i32 (-> p time)) (cast i32 (-> p memory)) (-> p output) (cast i32 tag)
|
|
53
|
+
(cast i32 (-> entries bytes)) (cast i32 (-> entries length)) (cast i32 (& why))
|
|
54
|
+
(-> p ends) (cast i32 (-> args bytes)) (cast i32 (-> args length)))))
|
|
56
55
|
(buffer-free! (& entries))
|
|
57
56
|
(buffer-free! (& args))
|
|
58
57
|
(when (== o 0) (buffer-free! (& (-> defaults grants list))))
|
|
59
|
-
id))
|
|
58
|
+
(unless (== id 0) (set! (@ id) n))
|
|
59
|
+
(or (!= n 0) (host-failed! (& why) err))))
|
|
60
60
|
|
|
61
61
|
(define (worker-send [w u32] [b (slice u8)]) -> i32 (send (cast i32 w) (cast i32 (-> b items)) (cast i32 (-> b length))))
|
|
62
62
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|