MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

remove unused T_FFI

+19 -36
-3
include/ant.h
··· 198 198 ant_value_t js_mktypedarray(void *data); 199 199 void *js_gettypedarray(ant_value_t val); 200 200 201 - ant_value_t js_mkffi(unsigned int index); 202 - int js_getffi(ant_value_t val); 203 - 204 201 void js_check_unhandled_rejections(ant_t *js); 205 202 void js_setup_import_meta(ant_t *js, const char *filename); 206 203 void js_process_promise_handlers(ant_t *js, ant_value_t promise);
-1
include/gc/modules.h
··· 7 7 8 8 void gc_mark_timers(ant_t *js, gc_mark_fn mark); 9 9 void gc_mark_atomics(ant_t *js, gc_mark_fn mark); 10 - void gc_mark_ffi(ant_t *js, gc_mark_fn mark); 11 10 void gc_mark_fetch(ant_t *js, gc_mark_fn mark); 12 11 void gc_mark_fs(ant_t *js, gc_mark_fn mark); 13 12 void gc_mark_child_process(ant_t *js, gc_mark_fn mark);
-1
include/internal.h
··· 112 112 // internal 113 113 T_ERR, 114 114 T_TYPEDARRAY, 115 - T_FFI, 116 115 T_NTARG, 117 116 118 117 // collections
+1 -1
include/silver/engine.h
··· 639 639 return js_mkundef(); 640 640 } 641 641 642 - if (vtype(func) == T_CFUNC || vtype(func) == T_FFI) { 642 + if (vtype(func) == T_CFUNC) { 643 643 plan->ctx.this_val = sv_call_normalize_this(js, this_val, mode); 644 644 if (out_this) *out_this = plan->ctx.this_val; 645 645 return js_mkundef();
+17 -19
src/ant.c
··· 59 59 #include "modules/bigint.h" 60 60 #include "modules/timer.h" 61 61 #include "modules/symbol.h" 62 - #include "modules/ffi.h" 63 62 #include "modules/date.h" 64 63 #include "modules/buffer.h" 65 64 #include "modules/blob.h" ··· 440 439 441 440 const char *typestr(uint8_t t) { 442 441 static const char *names[] = { 443 - [T_UNDEF] = "undefined", [T_NULL] = "object", [T_BOOL] = "boolean", 444 - [T_NUM] = "number", [T_BIGINT] = "bigint", [T_STR] = "string", 445 - [T_SYMBOL] = "symbol", [T_OBJ] = "object", [T_ARR] = "object", 446 - [T_FUNC] = "function", [T_CFUNC] = "function", 447 - [T_PROMISE] = "object", [T_GENERATOR] = "object", 448 - [T_ERR] = "err", [T_TYPEDARRAY] = "typedarray", 449 - [T_FFI] = "ffi", [T_NTARG] = "ntarg" 442 + [T_UNDEF] = "undefined", 443 + [T_NULL] = "object", 444 + [T_BOOL] = "boolean", 445 + [T_NUM] = "number", 446 + [T_BIGINT] = "bigint", 447 + [T_STR] = "string", 448 + [T_SYMBOL] = "symbol", 449 + [T_OBJ] = "object", 450 + [T_ARR] = "object", 451 + [T_FUNC] = "function", 452 + [T_CFUNC] = "function", 453 + [T_PROMISE] = "object", 454 + [T_GENERATOR] = "object", 455 + [T_TYPEDARRAY] = "typedarray", 456 + [T_ERR] = "err", 457 + [T_NTARG] = "ntarg" 450 458 }; 451 459 452 460 return (t < sizeof(names) / sizeof(names[0])) ? names[t] : "??"; ··· 506 514 507 515 ant_value_t js_get_slot(ant_value_t obj, internal_slot_t slot) { 508 516 return get_slot(js_as_obj(obj), slot); 509 - } 510 - 511 - ant_value_t js_mkffi(unsigned int index) { 512 - return mkval(T_FFI, (uint64_t)index); 513 - } 514 - 515 - int js_getffi(ant_value_t val) { 516 - if (vtype(val) != T_FFI) return -1; 517 - return (int)vdata(val); 518 517 } 519 518 520 519 typedef enum { ··· 2405 2404 case T_PROMISE: return strpromise(js, value, buf, len); 2406 2405 case T_FUNC: return strfunc(js, value, buf, len); 2407 2406 case T_CFUNC: return strcfunc(js, value, buf, len); 2408 - case T_FFI: return ANT_COPY(buf, len, "[native code (ffi)]"); 2409 2407 2410 2408 case T_ERR: { 2411 2409 uint64_t data = vdata(value); ··· 2531 2529 [T_ERR] = &&L_DEFAULT, [T_ARR] = &&L_OBJ, 2532 2530 [T_PROMISE] = &&L_DEFAULT, [T_TYPEDARRAY] = &&L_DEFAULT, 2533 2531 [T_BIGINT] = &&L_BIGINT, [T_SYMBOL] = &&L_DEFAULT, 2534 - [T_GENERATOR] = &&L_DEFAULT, [T_FFI] = &&L_DEFAULT 2532 + [T_GENERATOR] = &&L_DEFAULT 2535 2533 }; 2536 2534 2537 2535 if (t < sizeof(jump_table) / sizeof(jump_table[0])) goto *jump_table[t];
+1 -2
src/core/ant.ts
··· 21 21 T_NUM: 'number', 22 22 T_BIGINT: 'bigint', 23 23 T_SYMBOL: 'symbol', 24 - T_ERR: 'err', 25 24 T_TYPEDARRAY: 'typedarray', 26 - T_FFI: 'ffi', 25 + T_ERR: 'err', 27 26 T_NTARG: 'ntarg' 28 27 } as const; 29 28
-1
src/errors.c
··· 217 217 [T_BOOL] = &&l_type_default, 218 218 [T_SYMBOL] = &&l_type_default, 219 219 [T_CFUNC] = &&l_type_default, 220 - [T_FFI] = &&l_type_default, 221 220 [T_TYPEDARRAY] = &&l_type_default, 222 221 [T_ERR] = &&l_type_default, 223 222 [T_UNDEF] = &&l_type_default,
-1
src/gc/objects.c
··· 489 489 gc_visit_roots(js, gc_mark_value); 490 490 gc_mark_timers(js, gc_mark_value); 491 491 gc_mark_atomics(js, gc_mark_value); 492 - gc_mark_ffi(js, gc_mark_value); 493 492 gc_mark_fetch(js, gc_mark_value); 494 493 gc_mark_fs(js, gc_mark_value); 495 494 gc_mark_child_process(js, gc_mark_value);
-6
src/modules/ffi.c
··· 21 21 #include "ant.h" 22 22 #include "ptr.h" 23 23 #include "errors.h" 24 - #include "gc/modules.h" 25 24 #include "internal.h" 26 25 #include "silver/engine.h" 27 26 ··· 1470 1469 1471 1470 return ffi_obj; 1472 1471 } 1473 - 1474 - void gc_mark_ffi(ant_t *js, gc_mark_fn mark) { 1475 - (void)js; 1476 - (void)mark; 1477 - }
-1
src/modules/io.c
··· 789 789 [T_SYMBOL] = "symbol", 790 790 [T_ERR] = "error", 791 791 [T_TYPEDARRAY] = "TypedArray", 792 - [T_FFI] = "ffi", 793 792 [T_NTARG] = "ntarg", 794 793 [T_MAP] = "map", 795 794 [T_SET] = "set",