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.

fix routing for upval classifier

+8 -7
+8 -7
src/silver/swarm.c
··· 888 888 else has_local = true; 889 889 } 890 890 891 - if (has_param && !has_local && !has_inherited) return JIT_CHILD_PARAM_ONLY; 892 - if (has_local && !has_param && !has_inherited) return JIT_CHILD_LOCAL_ONLY; 893 - if (has_inherited && !has_param && !has_local) return JIT_CHILD_INHERITED_ONLY; 891 + if (!has_param && !has_local) return has_inherited ? JIT_CHILD_INHERITED_ONLY : JIT_CHILD_PLAIN; 892 + if (has_param && !has_local) return JIT_CHILD_PARAM_ONLY; 893 + if (has_local && !has_param) return JIT_CHILD_LOCAL_ONLY; 894 + 894 895 return JIT_CHILD_MIXED; 895 896 } 896 897 ··· 2427 2428 for (int i = 0; i < n_locals; i++) 2428 2429 if (captured_locals[i]) { has_captures = true; break; } 2429 2430 } 2430 - bool has_captured_slots = has_captured_params; 2431 + bool has_captured_slots = has_captured_params || has_captures; 2431 2432 bool use_unified_slotbuf = has_captured_slots && has_captures; 2432 2433 int slotbuf_count = use_unified_slotbuf ? (param_count + n_locals) : param_count; 2433 2434 ··· 2685 2686 case OP_GET_ARG: { 2686 2687 uint16_t idx = sv_get_u16(ip + 1); 2687 2688 MIR_reg_t dst = vstack_push(&vs); 2688 - if (has_captured_slots && idx < (uint16_t)param_count) { 2689 + if (has_captured_params && captured_params && idx < (uint16_t)param_count && captured_params[idx]) { 2689 2690 MIR_append_insn(ctx, jit_func, 2690 2691 MIR_new_insn(ctx, MIR_MOV, 2691 2692 MIR_new_reg_op(ctx, dst), ··· 2719 2720 uint16_t idx = sv_get_u16(ip + 1); 2720 2721 vstack_ensure_boxed(&vs, vs.sp - 1, ctx, jit_func, r_d_slot); 2721 2722 MIR_reg_t val = vstack_top(&vs); 2722 - if (has_captured_slots && idx < (uint16_t)param_count) { 2723 + if (has_captured_params && captured_params && idx < (uint16_t)param_count && captured_params[idx]) { 2723 2724 MIR_append_insn(ctx, jit_func, 2724 2725 MIR_new_insn(ctx, MIR_MOV, 2725 2726 MIR_new_mem_op(ctx, MIR_JSVAL, ··· 4938 4939 (MIR_disp_t)(i * (int)sizeof(ant_value_t)), r_lbuf, 0, 1), 4939 4940 MIR_new_reg_op(ctx, local_regs[i]))); 4940 4941 } 4941 - if (has_captured_slots && idx < (uint16_t)param_count) 4942 + if (has_captured_params && idx < (uint16_t)param_count) 4942 4943 mir_emit_close_marked_slots(ctx, jit_func, 4943 4944 close_upval_proto, imp_close_upval, 4944 4945 r_vm, r_slotbuf, captured_params, (int)idx, param_count);