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.

re-enable gc during jit (phase 1)

+7 -17
+4 -8
src/ant.c
··· 418 418 } 419 419 420 420 static ant_object_t *obj_alloc(ant_t *js, uint8_t type_tag, uint8_t inobj_limit) { 421 - #ifdef ANT_JIT 422 - if (__builtin_expect(js->jit_active_depth == 0, 1)) 423 - #endif 424 - { 425 - size_t threshold = GC_HEAP_GROWTH(js->gc_last_live); 426 - if (threshold < 2048) threshold = 2048; 427 - if (js->obj_arena.live_count >= threshold) gc_run(js); 428 - } 421 + size_t threshold = GC_HEAP_GROWTH(js->gc_last_live); 422 + 423 + if (threshold < 2048) threshold = 2048; 424 + if (js->obj_arena.live_count >= threshold) gc_run(js); 429 425 430 426 ant_object_t *obj = (ant_object_t *)fixed_arena_alloc(&js->obj_arena); 431 427 if (!obj) return NULL;
+2 -4
src/gc/gc.c
··· 122 122 123 123 void gc_maybe(ant_t *js) { 124 124 if (__builtin_expect(gc_disabled, 0)) return; 125 - #ifdef ANT_JIT 126 - if (__builtin_expect(js->jit_active_depth > 0, 0)) return; 127 - #endif 128 125 if (++gc_tick < GC_MIN_TICK) return; 126 + 129 127 size_t live = js->obj_arena.live_count; 130 - 131 128 size_t young_count = live > js->old_live_count ? live - js->old_live_count : 0; 129 + 132 130 if (young_count >= gc_nursery_threshold) { 133 131 gc_tick = 0; 134 132 gc_run_minor(js);
+1 -5
src/pool.c
··· 173 173 size_t pool_threshold = GC_HEAP_GROWTH(js->gc_pool_last_live); 174 174 175 175 if (pool_threshold < (4u * 1024u * 1024u)) pool_threshold = 4u * 1024u * 1024u; 176 - #ifdef ANT_JIT 177 - if (__builtin_expect(js->jit_active_depth > 0, 0)) { /* suppress GC during JIT */ } 178 - else 179 - #endif 180 - { if (js->gc_pool_alloc >= pool_threshold) gc_run(js); } 176 + if (js->gc_pool_alloc >= pool_threshold) gc_run(js); 181 177 182 178 ant_pool_t *pool = pool_for_kind(js, kind); 183 179 if (pool->block_size == 0) pool->block_size = pool_default_block_size(kind);