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.

add LTO and strip options to Meson build configuration

+22 -8
+4 -2
meson.build
··· 1 1 project('ant', 'c', default_options: [ 2 2 'optimization=2', 3 3 'c_std=gnu23', 4 - 'default_library=static' 4 + 'default_library=static', 5 + 'b_lto=true', 6 + 'strip=true' 5 7 ]) 6 8 7 9 cmake = import('cmake') ··· 74 76 build_date = run_command('date', '+%Y-%m-%d', check: true).stdout().strip() 75 77 76 78 version_conf = configuration_data() 77 - version_conf.set('ANT_VERSION', '0.2.2.1') 79 + version_conf.set('ANT_VERSION', '0.2.2.2') 78 80 version_conf.set('ANT_GIT_HASH', git_hash) 79 81 version_conf.set('ANT_BUILD_DATE', build_date) 80 82
+18 -6
src/ant.c
··· 255 255 } intern_prop_cache_entry_t; 256 256 static intern_prop_cache_entry_t intern_prop_cache[INTERN_PROP_CACHE_SIZE]; 257 257 258 - 259 - 260 258 typedef struct map_entry { 261 259 char *key; 262 260 jsval_t value; ··· 571 569 return mkval(T_PROPREF, PROPREF_STACK_FLAG | (uint64_t)idx); 572 570 } 573 571 574 - static bool is_err(jsval_t v) { 572 + static inline bool is_err(jsval_t v) { 575 573 return vtype(v) == T_ERR; 574 + } 575 + 576 + static inline bool is_null(jsval_t v) { 577 + return vtype(v) == T_NULL; 578 + } 579 + 580 + static inline bool is_undefined(jsval_t v) { 581 + return vtype(v) == T_UNDEF; 576 582 } 577 583 578 584 static uint8_t unhex(uint8_t c) { ··· 13913 13919 static jsval_t builtin_object_isPrototypeOf(struct js *js, jsval_t *args, int nargs) { 13914 13920 if (nargs < 1) return mkval(T_BOOL, 0); 13915 13921 13916 - jsval_t proto_obj = js->this_val; 13922 + jsval_t proto_obj = resolveprop(js, js->this_val); 13917 13923 jsval_t obj = args[0]; 13918 13924 13919 13925 uint8_t obj_type = vtype(obj); 13920 13926 if (obj_type != T_OBJ && obj_type != T_ARR && obj_type != T_FUNC) return mkval(T_BOOL, 0); 13927 + 13928 + uint8_t proto_type = vtype(proto_obj); 13929 + if (proto_type != T_OBJ && proto_type != T_ARR && proto_type != T_FUNC) return mkval(T_BOOL, 0); 13930 + jsoff_t proto_data = vdata(proto_obj); 13921 13931 13922 13932 jsval_t current = get_proto(js, obj); 13923 - while (vtype(current) == T_OBJ) { 13924 - if (vdata(current) == vdata(proto_obj)) return mkval(T_BOOL, 1); 13933 + while (!is_undefined(current) && !is_null(current)) { 13934 + uint8_t cur_type = vtype(current); 13935 + if (cur_type != T_OBJ && cur_type != T_ARR && cur_type != T_FUNC) break; 13936 + if (vdata(current) == proto_data) return mkval(T_BOOL, 1); 13925 13937 current = get_proto(js, current); 13926 13938 } 13927 13939