From 2319bba43b14b53fc99d72cd825c819d391e4479 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Tue, 29 Mar 2022 19:41:59 +0200 Subject: [PATCH] Replace callsite_drop/insert pairs with callsite_replace Saves some code and allocations. --- src/spesh/disp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/spesh/disp.c b/src/spesh/disp.c index a4968f19d3..1af6cb6fe5 100644 --- a/src/spesh/disp.c +++ b/src/spesh/disp.c @@ -1241,8 +1241,7 @@ static int translate_dispatch_program(MVMThreadContext *tc, MVMSpeshGraph *g, rw_operands[j] = MVM_spesh_manipulate_get_temp_reg(tc, g, MVM_reg_int64); emit_bi_op(tc, g, bb, &insert_after, MVM_OP_decont_i, rw_operands[j], var); - callsite = MVM_callsite_drop_positional(tc, callsite, j); - callsite = MVM_callsite_insert_positional(tc, callsite, j, MVM_CALLSITE_ARG_INT); + callsite = MVM_callsite_replace_positional(tc, callsite, j, MVM_CALLSITE_ARG_INT); MVM_callsite_intern(tc, &callsite, 1, 0); if (has_return_value && var.reg.orig == rb_ins->operands[0].reg.orig) { @@ -1262,8 +1261,7 @@ static int translate_dispatch_program(MVMThreadContext *tc, MVMSpeshGraph *g, rw_operands[j] = MVM_spesh_manipulate_get_temp_reg(tc, g, MVM_reg_uint64); emit_bi_op(tc, g, bb, &insert_after, MVM_OP_decont_u, rw_operands[j], var); - callsite = MVM_callsite_drop_positional(tc, callsite, j); - callsite = MVM_callsite_insert_positional(tc, callsite, j, MVM_CALLSITE_ARG_UINT); + callsite = MVM_callsite_replace_positional(tc, callsite, j, MVM_CALLSITE_ARG_UINT); MVM_callsite_intern(tc, &callsite, 1, 0); if (has_return_value && var.reg.orig == rb_ins->operands[0].reg.orig) {