@effekt-lang/effekt 0.46.0 → 0.48.0
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/bin/effekt +0 -0
- package/libraries/chez/common/immutable/cslist.effekt +6 -6
- package/libraries/chez/common/mutable/dict.effekt +7 -7
- package/libraries/common/args.effekt +10 -10
- package/libraries/common/array.effekt +57 -4
- package/libraries/common/bench.effekt +2 -2
- package/libraries/common/buffer.effekt +5 -5
- package/libraries/common/bytearray.effekt +69 -7
- package/libraries/common/char.effekt +95 -8
- package/libraries/common/effekt.effekt +74 -71
- package/libraries/common/exception.effekt +1 -1
- package/libraries/common/io/console.effekt +4 -4
- package/libraries/common/io/error.effekt +12 -1
- package/libraries/common/io/filesystem.effekt +78 -16
- package/libraries/common/io/network.effekt +97 -65
- package/libraries/common/io/time.effekt +1 -1
- package/libraries/common/io.effekt +7 -8
- package/libraries/common/json.effekt +5 -5
- package/libraries/common/list.effekt +154 -18
- package/libraries/common/map.effekt +35 -1
- package/libraries/common/process.effekt +1 -1
- package/libraries/common/queue.effekt +3 -3
- package/libraries/common/random.effekt +1 -0
- package/libraries/common/ref.effekt +8 -4
- package/libraries/common/regex.effekt +4 -4
- package/libraries/common/seq.effekt +1 -1
- package/libraries/common/set.effekt +24 -1
- package/libraries/common/stream.effekt +2 -360
- package/libraries/common/string.effekt +35 -5
- package/libraries/common/stringbuffer.effekt +1 -0
- package/libraries/js/mutable/map.effekt +5 -5
- package/libraries/js/web/dom.effekt +11 -11
- package/libraries/llvm/io.c +281 -8
- package/libraries/llvm/main.c +1 -2
- package/libraries/llvm/rts.ll +14 -7
- package/libraries/llvm/types.c +3 -3
- package/licenses/eclipse public license, version 2.0 - epl-2.0.html +2 -2
- package/licenses/mit license - mit-license.html +48 -48
- package/licenses/the bsd license - bsd-license.html +50 -50
- package/licenses/the mit license - mit.html +48 -48
- package/package.json +1 -1
|
@@ -5,13 +5,13 @@ import array
|
|
|
5
5
|
// A mutable map, backed by a JavaScript Map.
|
|
6
6
|
extern type Map[K, V]
|
|
7
7
|
|
|
8
|
-
extern
|
|
8
|
+
extern def emptyMap[K, V]() at {}: Map[K, V] =
|
|
9
9
|
js "new Map()"
|
|
10
10
|
|
|
11
11
|
def get[K, V](m: Map[K, V], key: K): Option[V] =
|
|
12
12
|
undefinedToOption(m.unsafeGet(key))
|
|
13
13
|
|
|
14
|
-
extern
|
|
14
|
+
extern def unsafeGet[K, V](m: Map[K, V], key: K) at {}: V =
|
|
15
15
|
js "${m}.get(${key})"
|
|
16
16
|
|
|
17
17
|
extern js """
|
|
@@ -21,11 +21,11 @@ function map$update(m, key, value) {
|
|
|
21
21
|
}
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
-
extern
|
|
24
|
+
extern def update[K, V](m: Map[K, V], key: K, value: V) at io: Unit =
|
|
25
25
|
js "map$update(${m}, ${key}, ${value})"
|
|
26
26
|
|
|
27
|
-
extern
|
|
27
|
+
extern def values[K, V](map: Map[K, V]) at {}: Array[V] =
|
|
28
28
|
js "Array.from(${map}.values())"
|
|
29
29
|
|
|
30
|
-
extern
|
|
30
|
+
extern def keys[K, V](map: Map[K, V]) at {}: Array[K] =
|
|
31
31
|
js "Array.from(${map}.keys())"
|
|
@@ -3,40 +3,40 @@ module web/dom
|
|
|
3
3
|
extern type Node
|
|
4
4
|
|
|
5
5
|
// can be null
|
|
6
|
-
extern
|
|
6
|
+
extern def getElementById(id: String) at {}: Node =
|
|
7
7
|
js "document.getElementById(${id})"
|
|
8
8
|
|
|
9
|
-
extern
|
|
9
|
+
extern def createElement(tag: String) at {}: Node =
|
|
10
10
|
js "document.createElement(${tag})"
|
|
11
11
|
|
|
12
|
-
extern
|
|
12
|
+
extern def createTextNode(text: String) at {}: Node =
|
|
13
13
|
js "document.createTextNode(${text})"
|
|
14
14
|
|
|
15
|
-
extern
|
|
15
|
+
extern def setAttribute(node: Node, key: String, value: String) at {}: Node =
|
|
16
16
|
js "${node}.setAttribute(${key}, ${value})"
|
|
17
17
|
|
|
18
18
|
// the string return type is wrong here...
|
|
19
|
-
extern
|
|
19
|
+
extern def getAttribute(node: Node, key: String) at {}: String =
|
|
20
20
|
js "${node}.getAttribute(${key})"
|
|
21
21
|
|
|
22
|
-
extern
|
|
22
|
+
extern def appendChild(node: Node, child: Node) at {}: Node =
|
|
23
23
|
js "${node}.appendChild(${child})"
|
|
24
24
|
|
|
25
|
-
extern
|
|
25
|
+
extern def innerHTML(node: Node, contents: String) at {}: Node =
|
|
26
26
|
js "(function() { ${node}.innerHTML = ${contents}; return ${node} })()"
|
|
27
27
|
|
|
28
28
|
extern type IdleDeadline
|
|
29
29
|
|
|
30
|
-
extern
|
|
30
|
+
extern def requestIdleCallback(callback: (IdleDeadline) => Unit at io) at {}: Unit =
|
|
31
31
|
js "window.requestIdleCallback(deadline => ${callback}(deadline).run())"
|
|
32
32
|
|
|
33
|
-
extern
|
|
33
|
+
extern def didDimeout(deadline: IdleDeadline) at {}: Bool =
|
|
34
34
|
js "${deadline}.didTimeout"
|
|
35
35
|
|
|
36
|
-
extern
|
|
36
|
+
extern def timeRemaining(deadline: IdleDeadline) at {}: Double =
|
|
37
37
|
js "${deadline}.timeRemaining()"
|
|
38
38
|
|
|
39
|
-
extern
|
|
39
|
+
extern def onClick(node: Node, handler: () => Unit at io) at {}: Node =
|
|
40
40
|
js "(function() { ${node}.onclick = () => ${handler}().run(); return ${node} })()"
|
|
41
41
|
|
|
42
42
|
extern def sleep(n: Int): Unit =
|
package/libraries/llvm/io.c
CHANGED
|
@@ -58,6 +58,11 @@ String c_io_readln() {
|
|
|
58
58
|
// TODO
|
|
59
59
|
// - pooling of request objects (benchmark first!)
|
|
60
60
|
|
|
61
|
+
typedef struct {
|
|
62
|
+
Stack stack;
|
|
63
|
+
struct Pos buffer;
|
|
64
|
+
size_t offset;
|
|
65
|
+
} io_closure_t;
|
|
61
66
|
|
|
62
67
|
void c_resume_int_fs(uv_fs_t* request) {
|
|
63
68
|
int64_t result = (int64_t)request->result;
|
|
@@ -81,6 +86,7 @@ void c_fs_open(String path, int flags, Stack stack) {
|
|
|
81
86
|
int result = uv_fs_open(uv_default_loop(), request, path_str, flags, 0777, c_resume_int_fs);
|
|
82
87
|
|
|
83
88
|
if (result < 0) {
|
|
89
|
+
// TODO free path_str?
|
|
84
90
|
uv_fs_req_cleanup(request);
|
|
85
91
|
free(request);
|
|
86
92
|
resume_Int(stack, result);
|
|
@@ -104,39 +110,60 @@ void c_fs_open_appending(String path, Stack stack) {
|
|
|
104
110
|
c_fs_open(path, UV_FS_O_WRONLY | UV_FS_O_CREAT | UV_FS_O_APPEND, stack);
|
|
105
111
|
}
|
|
106
112
|
|
|
113
|
+
void c_fs_cb(uv_fs_t* request) {
|
|
114
|
+
io_closure_t* closure = (io_closure_t*)request->data;
|
|
115
|
+
Stack stack = closure->stack;
|
|
116
|
+
int64_t result = (int64_t)request->result;
|
|
117
|
+
|
|
118
|
+
uv_fs_req_cleanup(request);
|
|
119
|
+
free(request);
|
|
120
|
+
erasePositive(closure->buffer);
|
|
121
|
+
free(closure);
|
|
122
|
+
resume_Int(stack, result);
|
|
123
|
+
}
|
|
124
|
+
|
|
107
125
|
void c_fs_read(Int file, struct Pos buffer, Int offset, Int size, Int position, Stack stack) {
|
|
108
126
|
|
|
109
127
|
uv_buf_t buf = uv_buf_init((char*)(c_bytearray_data(buffer) + offset), size);
|
|
110
|
-
|
|
111
|
-
|
|
128
|
+
|
|
129
|
+
io_closure_t* read_closure = malloc(sizeof(io_closure_t));
|
|
130
|
+
read_closure->stack = stack;
|
|
131
|
+
read_closure->buffer = buffer;
|
|
132
|
+
read_closure->offset = offset;
|
|
112
133
|
|
|
113
134
|
uv_fs_t* request = malloc(sizeof(uv_fs_t));
|
|
114
|
-
request->data =
|
|
135
|
+
request->data = read_closure;
|
|
115
136
|
|
|
116
|
-
int result = uv_fs_read(uv_default_loop(), request, file, &buf, 1, position,
|
|
137
|
+
int result = uv_fs_read(uv_default_loop(), request, file, &buf, 1, position, c_fs_cb);
|
|
117
138
|
|
|
118
139
|
if (result < 0) {
|
|
119
140
|
uv_fs_req_cleanup(request);
|
|
120
141
|
free(request);
|
|
121
142
|
resume_Int(stack, result);
|
|
143
|
+
free(read_closure);
|
|
122
144
|
}
|
|
123
145
|
}
|
|
124
146
|
|
|
125
147
|
void c_fs_write(Int file, struct Pos buffer, Int offset, Int size, Int position, Stack stack) {
|
|
148
|
+
(void)size;
|
|
126
149
|
|
|
127
150
|
uv_buf_t buf = uv_buf_init((char*)(c_bytearray_data(buffer) + offset), size);
|
|
128
|
-
|
|
129
|
-
|
|
151
|
+
|
|
152
|
+
io_closure_t* write_closure = malloc(sizeof(io_closure_t));
|
|
153
|
+
write_closure->stack = stack;
|
|
154
|
+
write_closure->buffer = buffer;
|
|
155
|
+
write_closure->offset = offset;
|
|
130
156
|
|
|
131
157
|
uv_fs_t* request = malloc(sizeof(uv_fs_t));
|
|
132
|
-
request->data =
|
|
158
|
+
request->data = write_closure;
|
|
133
159
|
|
|
134
|
-
int result = uv_fs_write(uv_default_loop(), request, file, &buf, 1, position,
|
|
160
|
+
int result = uv_fs_write(uv_default_loop(), request, file, &buf, 1, position, c_fs_cb);
|
|
135
161
|
|
|
136
162
|
if (result < 0) {
|
|
137
163
|
uv_fs_req_cleanup(request);
|
|
138
164
|
free(request);
|
|
139
165
|
resume_Int(stack, result);
|
|
166
|
+
free(write_closure);
|
|
140
167
|
}
|
|
141
168
|
}
|
|
142
169
|
|
|
@@ -178,6 +205,252 @@ void c_fs_mkdir(String path, Stack stack) {
|
|
|
178
205
|
return;
|
|
179
206
|
}
|
|
180
207
|
|
|
208
|
+
// Network
|
|
209
|
+
// -------
|
|
210
|
+
|
|
211
|
+
void c_tcp_connect_cb(uv_connect_t* request, int status) {
|
|
212
|
+
Stack stack = (Stack)request->data;
|
|
213
|
+
|
|
214
|
+
if (status < 0) {
|
|
215
|
+
uv_close((uv_handle_t*)request->handle, (uv_close_cb)free);
|
|
216
|
+
free(request);
|
|
217
|
+
resume_Int(stack, status);
|
|
218
|
+
} else {
|
|
219
|
+
int64_t handle = (int64_t)request->handle;
|
|
220
|
+
free(request);
|
|
221
|
+
resume_Int(stack, handle);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
void c_tcp_connect(String host, Int port, Stack stack) {
|
|
226
|
+
char* host_str = c_bytearray_into_nullterminated_string(host);
|
|
227
|
+
erasePositive(host);
|
|
228
|
+
|
|
229
|
+
uv_tcp_t* tcp_handle = malloc(sizeof(uv_tcp_t));
|
|
230
|
+
int result = uv_tcp_init(uv_default_loop(), tcp_handle);
|
|
231
|
+
|
|
232
|
+
if (result < 0) {
|
|
233
|
+
free(tcp_handle);
|
|
234
|
+
free(host_str);
|
|
235
|
+
resume_Int(stack, result);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
uv_connect_t* connect_req = malloc(sizeof(uv_connect_t));
|
|
240
|
+
connect_req->data = stack;
|
|
241
|
+
|
|
242
|
+
struct sockaddr_in addr;
|
|
243
|
+
result = uv_ip4_addr(host_str, port, &addr);
|
|
244
|
+
free(host_str);
|
|
245
|
+
|
|
246
|
+
if (result < 0) {
|
|
247
|
+
free(tcp_handle);
|
|
248
|
+
free(connect_req);
|
|
249
|
+
resume_Int(stack, result);
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
result = uv_tcp_connect(connect_req, tcp_handle, (const struct sockaddr*)&addr, c_tcp_connect_cb);
|
|
254
|
+
|
|
255
|
+
if (result < 0) {
|
|
256
|
+
free(tcp_handle);
|
|
257
|
+
free(connect_req);
|
|
258
|
+
resume_Int(stack, result);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
void c_tcp_read_cb(uv_stream_t* stream, ssize_t bytes_read, const uv_buf_t* buf) {
|
|
264
|
+
(void)(buf);
|
|
265
|
+
io_closure_t* read_closure = (io_closure_t*)stream->data;
|
|
266
|
+
Stack stack = read_closure->stack;
|
|
267
|
+
|
|
268
|
+
uv_read_stop(stream);
|
|
269
|
+
erasePositive(read_closure->buffer);
|
|
270
|
+
free(read_closure);
|
|
271
|
+
|
|
272
|
+
resume_Int(stack, (int64_t)bytes_read);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
void c_tcp_read_alloc_cb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) {
|
|
276
|
+
(void)(suggested_size);
|
|
277
|
+
io_closure_t* read_closure = (io_closure_t*)handle->data;
|
|
278
|
+
buf->base = (char*)c_bytearray_data(read_closure->buffer) + read_closure->offset;
|
|
279
|
+
// TODO c_bytearray_size also erases
|
|
280
|
+
buf->len = read_closure->buffer.tag;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
void c_tcp_read(Int handle, struct Pos buffer, Int offset, Int size, Stack stack) {
|
|
284
|
+
(void)size;
|
|
285
|
+
uv_stream_t* stream = (uv_stream_t*)handle;
|
|
286
|
+
|
|
287
|
+
io_closure_t* read_closure = malloc(sizeof(io_closure_t));
|
|
288
|
+
read_closure->stack = stack;
|
|
289
|
+
read_closure->buffer = buffer;
|
|
290
|
+
read_closure->offset = offset;
|
|
291
|
+
stream->data = read_closure;
|
|
292
|
+
|
|
293
|
+
int result = uv_read_start(stream, c_tcp_read_alloc_cb, c_tcp_read_cb);
|
|
294
|
+
|
|
295
|
+
if (result < 0) {
|
|
296
|
+
free(read_closure);
|
|
297
|
+
stream->data = NULL;
|
|
298
|
+
resume_Int(stack, result);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
void c_tcp_write_cb(uv_write_t* request, int status) {
|
|
303
|
+
io_closure_t* write_closure = (io_closure_t*)request->data;
|
|
304
|
+
free(request);
|
|
305
|
+
erasePositive(write_closure->buffer);
|
|
306
|
+
Stack stack = write_closure->stack;
|
|
307
|
+
free(write_closure);
|
|
308
|
+
resume_Int(stack, (int64_t)status);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
void c_tcp_write(Int handle, struct Pos buffer, Int offset, Int size, Stack stack) {
|
|
312
|
+
uv_stream_t* stream = (uv_stream_t*)handle;
|
|
313
|
+
|
|
314
|
+
uv_buf_t buf = uv_buf_init((char*)(c_bytearray_data(buffer) + offset), size);
|
|
315
|
+
|
|
316
|
+
io_closure_t* write_closure = malloc(sizeof(io_closure_t));
|
|
317
|
+
write_closure->stack = stack;
|
|
318
|
+
write_closure->buffer = buffer;
|
|
319
|
+
write_closure->offset = offset;
|
|
320
|
+
|
|
321
|
+
uv_write_t* request = malloc(sizeof(uv_write_t));
|
|
322
|
+
request->data = write_closure;
|
|
323
|
+
|
|
324
|
+
int result = uv_write(request, stream, &buf, 1, c_tcp_write_cb);
|
|
325
|
+
|
|
326
|
+
if (result < 0) {
|
|
327
|
+
free(request);
|
|
328
|
+
resume_Int(stack, result);
|
|
329
|
+
free(write_closure);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
void c_tcp_close_cb(uv_handle_t* handle) {
|
|
334
|
+
Stack stack = (Stack)handle->data;
|
|
335
|
+
free(handle);
|
|
336
|
+
resume_Pos(stack, Unit);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
void c_tcp_close(Int handle, Stack stack) {
|
|
340
|
+
uv_handle_t* uv_handle = (uv_handle_t*)handle;
|
|
341
|
+
uv_handle->data = stack;
|
|
342
|
+
uv_close(uv_handle, c_tcp_close_cb);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
Int c_tcp_bind(String host, Int port) {
|
|
346
|
+
char* host_str = c_bytearray_into_nullterminated_string(host);
|
|
347
|
+
erasePositive(host);
|
|
348
|
+
|
|
349
|
+
uv_tcp_t* tcp_handle = malloc(sizeof(uv_tcp_t));
|
|
350
|
+
int result = uv_tcp_init(uv_default_loop(), tcp_handle);
|
|
351
|
+
|
|
352
|
+
if (result < 0) {
|
|
353
|
+
free(tcp_handle);
|
|
354
|
+
free(host_str);
|
|
355
|
+
return result;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
struct sockaddr_in addr;
|
|
359
|
+
result = uv_ip4_addr(host_str, port, &addr);
|
|
360
|
+
free(host_str);
|
|
361
|
+
|
|
362
|
+
if (result < 0) {
|
|
363
|
+
uv_close((uv_handle_t*)tcp_handle, (uv_close_cb)free);
|
|
364
|
+
return result;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
result = uv_tcp_bind(tcp_handle, (const struct sockaddr*)&addr, 0);
|
|
368
|
+
if (result < 0) {
|
|
369
|
+
uv_close((uv_handle_t*)tcp_handle, (uv_close_cb)free);
|
|
370
|
+
return result;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
return (int64_t)tcp_handle;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
typedef struct {
|
|
377
|
+
Stack stack;
|
|
378
|
+
struct Pos handler;
|
|
379
|
+
} tcp_listen_closure_t;
|
|
380
|
+
|
|
381
|
+
void c_tcp_listen_cb(uv_stream_t* server, int status) {
|
|
382
|
+
tcp_listen_closure_t* listen_closure = (tcp_listen_closure_t*)server->data;
|
|
383
|
+
Stack closure_stack = listen_closure->stack;
|
|
384
|
+
struct Pos closure_handler = listen_closure->handler;
|
|
385
|
+
|
|
386
|
+
if (status < 0) {
|
|
387
|
+
server->data = NULL;
|
|
388
|
+
free(listen_closure);
|
|
389
|
+
erasePositive(closure_handler);
|
|
390
|
+
resume_Int(closure_stack, status);
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
uv_tcp_t* client = malloc(sizeof(uv_tcp_t));
|
|
395
|
+
int result = uv_tcp_init(uv_default_loop(), client);
|
|
396
|
+
|
|
397
|
+
if (result < 0) {
|
|
398
|
+
free(client);
|
|
399
|
+
server->data = NULL;
|
|
400
|
+
free(listen_closure);
|
|
401
|
+
erasePositive(closure_handler);
|
|
402
|
+
resume_Int(closure_stack, result);
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
result = uv_accept(server, (uv_stream_t*)client);
|
|
407
|
+
if (result < 0) {
|
|
408
|
+
uv_close((uv_handle_t*)client, (uv_close_cb)free);
|
|
409
|
+
server->data = NULL;
|
|
410
|
+
free(listen_closure);
|
|
411
|
+
erasePositive(closure_handler);
|
|
412
|
+
resume_Int(closure_stack, result);
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
sharePositive(closure_handler);
|
|
417
|
+
run_Int(closure_handler, (int64_t)client);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
void c_tcp_listen(Int listener, struct Pos handler, Stack stack) {
|
|
421
|
+
uv_stream_t* server = (uv_stream_t*)listener;
|
|
422
|
+
|
|
423
|
+
tcp_listen_closure_t* listen_closure = malloc(sizeof(tcp_listen_closure_t));
|
|
424
|
+
listen_closure->stack = stack;
|
|
425
|
+
listen_closure->handler = handler;
|
|
426
|
+
server->data = listen_closure;
|
|
427
|
+
|
|
428
|
+
int result = uv_listen(server, SOMAXCONN, c_tcp_listen_cb);
|
|
429
|
+
if (result < 0) {
|
|
430
|
+
free(listen_closure);
|
|
431
|
+
erasePositive(handler);
|
|
432
|
+
resume_Int(stack, result);
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
void c_tcp_shutdown(Int handle, Stack stack) {
|
|
438
|
+
uv_handle_t* uv_handle = (uv_handle_t*)handle;
|
|
439
|
+
tcp_listen_closure_t* listen_closure = (tcp_listen_closure_t*)uv_handle->data;
|
|
440
|
+
|
|
441
|
+
uv_handle->data = stack;
|
|
442
|
+
uv_close(uv_handle, c_tcp_close_cb);
|
|
443
|
+
|
|
444
|
+
if (listen_closure) {
|
|
445
|
+
Stack closure_stack = listen_closure->stack;
|
|
446
|
+
struct Pos closure_handler = listen_closure->handler;
|
|
447
|
+
free(listen_closure);
|
|
448
|
+
erasePositive(closure_handler);
|
|
449
|
+
resume_Int(closure_stack, 0);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
|
|
181
454
|
/**
|
|
182
455
|
* Maps the libuv error code to a stable (platform independent) numeric value.
|
|
183
456
|
*
|
package/libraries/llvm/main.c
CHANGED
package/libraries/llvm/rts.ll
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
; Run-Time System
|
|
2
2
|
|
|
3
|
-
%Evidence = type i64
|
|
4
|
-
|
|
5
3
|
; Basic types
|
|
6
4
|
|
|
7
5
|
%Environment = type ptr
|
|
@@ -708,7 +706,10 @@ define void @resume_Pos(%Stack %stack, %Pos %argument) {
|
|
|
708
706
|
ret void
|
|
709
707
|
}
|
|
710
708
|
|
|
711
|
-
define void @run(%
|
|
709
|
+
define void @run(%Pos %boxed) {
|
|
710
|
+
; unbox
|
|
711
|
+
%f = call %Neg @coercePosNeg(%Pos %boxed)
|
|
712
|
+
|
|
712
713
|
; fresh stack
|
|
713
714
|
%stack = call %Stack @withEmptyStack()
|
|
714
715
|
|
|
@@ -723,7 +724,10 @@ define void @run(%Neg %f) {
|
|
|
723
724
|
ret void
|
|
724
725
|
}
|
|
725
726
|
|
|
726
|
-
define void @run_Int(%
|
|
727
|
+
define void @run_Int(%Pos %boxed, i64 %argument) {
|
|
728
|
+
; unbox
|
|
729
|
+
%f = call %Neg @coercePosNeg(%Pos %boxed)
|
|
730
|
+
|
|
727
731
|
; fresh stack
|
|
728
732
|
%stack = call %Stack @withEmptyStack()
|
|
729
733
|
|
|
@@ -734,11 +738,14 @@ define void @run_Int(%Neg %f, i64 %argument) {
|
|
|
734
738
|
%functionPointer = load ptr, ptr %functionPointerPointer, !alias.scope !15, !noalias !25
|
|
735
739
|
|
|
736
740
|
; call
|
|
737
|
-
tail call tailcc %Pos %functionPointer(%Object %object,
|
|
741
|
+
tail call tailcc %Pos %functionPointer(%Object %object, i64 %argument, %Stack %stack)
|
|
738
742
|
ret void
|
|
739
743
|
}
|
|
740
744
|
|
|
741
|
-
define void @run_Pos(%
|
|
745
|
+
define void @run_Pos(%Pos %boxed, %Pos %argument) {
|
|
746
|
+
; unbox
|
|
747
|
+
%f = call %Neg @coercePosNeg(%Pos %boxed)
|
|
748
|
+
|
|
742
749
|
; fresh stack
|
|
743
750
|
%stack = call %Stack @withEmptyStack()
|
|
744
751
|
|
|
@@ -749,7 +756,7 @@ define void @run_Pos(%Neg %f, %Pos %argument) {
|
|
|
749
756
|
%functionPointer = load ptr, ptr %functionPointerPointer, !alias.scope !15, !noalias !25
|
|
750
757
|
|
|
751
758
|
; call
|
|
752
|
-
tail call tailcc %Pos %functionPointer(%Object %object, %
|
|
759
|
+
tail call tailcc %Pos %functionPointer(%Object %object, %Pos %argument, %Stack %stack)
|
|
753
760
|
ret void
|
|
754
761
|
}
|
|
755
762
|
|
package/libraries/llvm/types.c
CHANGED
|
@@ -37,9 +37,9 @@ typedef struct StackValue* Stack;
|
|
|
37
37
|
extern void resume_Int(Stack, Int);
|
|
38
38
|
extern void resume_Pos(Stack, struct Pos);
|
|
39
39
|
|
|
40
|
-
extern void run(struct
|
|
41
|
-
extern void run_Int(struct
|
|
42
|
-
extern void run_Pos(struct
|
|
40
|
+
extern void run(struct Pos);
|
|
41
|
+
extern void run_Int(struct Pos, Int);
|
|
42
|
+
extern void run_Pos(struct Pos, struct Pos);
|
|
43
43
|
|
|
44
44
|
// Reference counting primitives defined in LLVM
|
|
45
45
|
extern void eraseNegative(struct Neg);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!doctype html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><title>Eclipse Public License 2.0 (EPL) | The Eclipse Foundation</title>
|
|
2
|
-
<meta property="og:title" content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=twitter:title content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta property="og:description" content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=twitter:description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=author content="Wayne Beaton"><link href=/favicon.ico rel=icon type=image/x-icon><meta property="og:image" content="https://www.eclipse.org/images/og-image.jpg"><meta name=twitter:image content="https://www.eclipse.org/images/og-image.jpg"><meta name=twitter:card content="summary"><meta name=twitter:site content="@eclipsefdn"><meta name=twitter:creator content="@eclipsefdn"><meta property="og:url" content="https://www.eclipse.org/legal/epl-2.0/"><meta property="og:type" content="website"><meta property="og:site_name" content="Eclipse Foundation"><meta name=keywords content="epl,epl-2.0,legal,foundation,eclipse,eclipse public license,license,licenses"><meta name=generator content="Hugo 0.144.2"><link rel=canonical href=https://www.eclipse.org/legal/epl-2.0/><link rel=alternate href=/legal/epl-2.0/index.xml type=application/rss+xml title><link rel=stylesheet href="/public/css/styles.css?v=
|
|
2
|
+
<meta property="og:title" content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=twitter:title content="Eclipse Public License 2.0 (EPL) | The Eclipse Foundation"><meta name=description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta property="og:description" content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=twitter:description content="The Eclipse Foundation provides our global community of individuals and organisations with a mature, scalable, and business-friendly environment for open source …"><meta name=author content="Wayne Beaton"><link href=/favicon.ico rel=icon type=image/x-icon><meta property="og:image" content="https://www.eclipse.org/images/og-image.jpg"><meta name=twitter:image content="https://www.eclipse.org/images/og-image.jpg"><meta name=twitter:card content="summary"><meta name=twitter:site content="@eclipsefdn"><meta name=twitter:creator content="@eclipsefdn"><meta property="og:url" content="https://www.eclipse.org/legal/epl-2.0/"><meta property="og:type" content="website"><meta property="og:site_name" content="Eclipse Foundation"><meta name=keywords content="epl,epl-2.0,legal,foundation,eclipse,eclipse public license,license,licenses"><meta name=generator content="Hugo 0.144.2"><link rel=canonical href=https://www.eclipse.org/legal/epl-2.0/><link rel=alternate href=/legal/epl-2.0/index.xml type=application/rss+xml title><link rel=stylesheet href="/public/css/styles.css?v=1759688174"><script>(function(e,t,n,s,o){e[s]=e[s]||[],e[s].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var a=t.getElementsByTagName(n)[0],i=t.createElement(n),r=s!="dataLayer"?"&l="+s:"";i.async=!0,i.src="https://www.googletagmanager.com/gtm.js?id="+o+r,a.parentNode.insertBefore(i,a)})(window,document,"script","dataLayer","GTM-5WLCZXC")</script><script>var tableClasses="table"</script><link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel=stylesheet type=text/css></head><body><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5WLCZXC" height=0 width=0 style=display:none;visibility:hidden></iframe></noscript><a class=sr-only href=#content>Skip to main content</a><header class="header-wrapper header-wrapper" id=header><div class=header-toolbar><div class=container><div class=header-toolbar-row><div class="toolbar-btn toolbar-search-btn dropdown"><button class=dropdown-toggle id=toolbar-search type=button data-toggle=dropdown tabindex=0 aria-label=Search>
|
|
3
3
|
<i class="fa fa-search fa-lg" aria-role=none></i></button><div class="toolbar-search-bar-wrapper dropdown-menu dropdown-menu-right" aria-labelledby=toolbar-search><form action=https://www.eclipse.org/home/search method=get><div class=search-bar><input class=search-bar-input name=q placeholder=Search>
|
|
4
4
|
<button>
|
|
5
5
|
<i class="fa fa-search" type=submit></i></button></div></form></div></div><div class="toolbar-btn toolbar-user-menu-btn dropdown"><button class=dropdown-toggle id=toolbar-user-menu type=button data-toggle=dropdown tabindex=0 aria-label="User Menu">
|
|
@@ -64,4 +64,4 @@ open source software collaboration and innovation.</p></div><div class=mega-menu
|
|
|
64
64
|
<i class="fa-brands fa-linkedin-in fa-stack-1x fa-inverse" aria-hidden=true></i>
|
|
65
65
|
<span class=sr-only>LinkedIn account</span></span></a></li></ul></div></div><div class="footer-sections row equal-height-md font-bold"><div class=col-md-15><div class=row><section id=footer-eclipse-foundation class="footer-section col-sm-8"><div class=menu-heading>Eclipse Foundation</div><ul class=nav><li><a href=https://www.eclipse.org/org/>About</a></li><li><a href=https://projects.eclipse.org/>Projects</a></li><li><a href=https://www.eclipse.org/collaborations/>Collaborations</a></li><li><a href=https://www.eclipse.org/membership/>Membership</a></li><li><a href=https://www.eclipse.org/sponsor/>Sponsor</a></li></ul></section><section id=footer-legal class="footer-section col-sm-8"><div class=menu-heading>Legal</div><ul class=nav><li><a href=https://www.eclipse.org/legal/privacy/>Privacy Policy</a></li><li><a href=https://www.eclipse.org/legal/terms-of-use/>Terms of Use</a></li><li><a href=https://www.eclipse.org/legal/compliance/>Compliance</a></li><li><a href=https://www.eclipse.org/org/documents/Community_Code_of_Conduct.php>Code of Conduct</a></li><li><a href=https://www.eclipse.org/legal/>Legal Resources</a></li><li><a class=toolbar-manage-cookies href=# onclick=event.preventDefault()>Manage Cookies</a></li></ul></section><section id=footer-more class="footer-section col-sm-8"><div class=menu-heading>More</div><ul class=nav><li><a href=https://www.eclipse.org/security/>Report a Vulnerability</a></li><li><a href=https://status.eclipse.org/>Service Status</a></li><li><a href=https://www.eclipse.org/org/foundation/contact.php>Contact Us</a></li><li><a href=https://www.eclipse.org/projects/support/>Support</a></li></ul></section></div></div><div id=footer-end class="footer-section col-md-8 col-md-offset-1 col-sm-24"><div class=footer-end-newsletter><form id=mc-embedded-subscribe-form action="https://eclipse.us6.list-manage.com/subscribe/post?u=eaf9e1f06f194eadc66788a85&id=e7538485cd&f_id=00f9c2e1f0" method=post novalidate target=_blank><label class=footer-end-newsletter-label for=email>Subscribe to our Newsletter</label><div class=footer-end-newsletter-input-wrapper><input class=footer-end-newsletter-input type=email id=email name=EMAIL autocomplete=email placeholder="Enter your email address">
|
|
66
66
|
<button class="footer-end-newsletter-submit btn btn-link" id=mc-embedded-subscribe type=submit name=subscribe>
|
|
67
|
-
<i class="fa fa-solid fa-envelope fa-lg" aria-hidden=true></i></button></div></form></div></div></div><div class="col-sm-24 margin-top-20"><div class=row><div id=copyright class=col-sm-16><p id=copyright-text>Copyright © Eclipse Foundation AISBL. All Rights Reserved.</p></div></div></div><a href=# class=scrollup>Back to the top</a></div></footer><div id=footer-js><script src="/public/js/main.js?v1.0?v=
|
|
67
|
+
<i class="fa fa-solid fa-envelope fa-lg" aria-hidden=true></i></button></div></form></div></div></div><div class="col-sm-24 margin-top-20"><div class=row><div id=copyright class=col-sm-16><p id=copyright-text>Copyright © Eclipse Foundation AISBL. All Rights Reserved.</p></div></div></div><a href=# class=scrollup>Back to the top</a></div></footer><div id=footer-js><script src="/public/js/main.js?v1.0?v=1759688174"></script><script>(function(){})(jQuery,document)</script></div></body></html>
|