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 redundant GC code

+9 -22
+1 -1
meson/version/meson.build
··· 4 4 timestamp_opt = get_option('build_timestamp') 5 5 timestamp = timestamp_opt != '' ? timestamp_opt : run_command('date', '+%s', check: true).stdout().strip() 6 6 7 - ant_version = '0.5.1.' + timestamp + '-g' + git_hash 7 + ant_version = '0.5.2.' + timestamp + '-g' + git_hash 8 8 cmd_cc = meson.get_compiler('c') 9 9 10 10 target_triple = run_command(cmd_cc.cmd_array(), '-dumpmachine', check: true).stdout().strip()
+2 -1
src/ant.c
··· 20922 20922 js->errmsg_size = 4096; 20923 20923 js->errmsg = (char *)malloc(js->errmsg_size); 20924 20924 if (js->errmsg) js->errmsg[0] = '\0'; 20925 - js->gc_suppress = true; 20925 + js->gc_suppress = false; 20926 20926 20927 20927 #ifdef _WIN32 20928 20928 js->stack_limit = 512 * 1024; ··· 21998 21998 if (js->needs_gc && js->eval_depth == 1 && !js->gc_suppress) { 21999 21999 js->needs_gc = false; 22000 22000 js_gc_compact(js); 22001 + js->gc_alloc_since = 0; 22001 22002 } 22002 22003 if (js->flags & F_RETURN) break; 22003 22004 }
+6 -20
src/gc.c
··· 375 375 } 376 376 377 377 jsoff_t parent_off = gc_loadoff(ctx->js->mem, old_off + sizeof(jsoff_t)); 378 - if (parent_off != 0 && parent_off < ctx->js->brk) { 378 + if (parent_off < ctx->js->brk) { 379 379 jsoff_t new_parent = gc_reserve_object(ctx, parent_off); 380 380 gc_saveoff(ctx->new_mem, new_off + sizeof(jsoff_t), new_parent); 381 381 } ··· 571 571 if ((header_at_0 & 3) == T_OBJ) gc_reserve_object(&ctx, 0); 572 572 } 573 573 574 - jsoff_t scope_off = (jsoff_t)gc_vdata(js->scope); 575 - if (scope_off < js->brk) { 576 - (void)gc_reserve_object(&ctx, scope_off); 577 - } 578 - 579 - (void)gc_update_val(&ctx, js->this_val); 580 - (void)gc_update_val(&ctx, js->module_ns); 581 - (void)gc_update_val(&ctx, js->current_func); 582 - (void)gc_update_val(&ctx, js->thrown_value); 583 - (void)gc_update_val(&ctx, js->tval); 584 - 585 574 js_gc_reserve_roots( 586 575 js, 587 576 gc_fwd_off_callback, ··· 597 586 fwd_free(&ctx.fwd); 598 587 return 0; 599 588 } 600 - 601 - js->scope = gc_apply_val(&ctx, js->scope); 602 - js->this_val = gc_apply_val(&ctx, js->this_val); 603 - js->module_ns = gc_apply_val(&ctx, js->module_ns); 604 - js->current_func = gc_apply_val(&ctx, js->current_func); 605 - js->thrown_value = gc_apply_val(&ctx, js->thrown_value); 606 - js->tval = gc_apply_val(&ctx, js->tval); 607 - js_gc_update_roots(js, gc_apply_off_callback, gc_apply_val_callback, &ctx); 589 + 590 + js_gc_update_roots(js, 591 + gc_apply_off_callback, 592 + gc_apply_val_callback, 593 + &ctx); 608 594 609 595 memcpy(js->mem, new_mem, ctx.new_brk); 610 596 js->brk = ctx.new_brk;