From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id B26E324C43B; Wed, 15 Feb 2023 01:33:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B26E324C43B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1676413985; bh=ixRkp/T3FlceqDmt7Dx79KOqc2eXjjIbYGH6rDXP6+U=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=pdbYL6r2w0VSMYMLhoSwfafBMdsM83Hnvrr9X5zYM7aE4NUeorfXJNK3bYOEGQaxt vWcwRhunMuZLmCWqv4b80en87Gt+FYvavO6hwGDdm+Y20pApVsQEecMN5qiwBJIVtv 4oh6DokRvq/zDq/WkEOdOWtB1E4iUtJ7hBdqG32w= Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 8E63624C43C for ; Wed, 15 Feb 2023 01:30:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8E63624C43C Received: by mail-lj1-f181.google.com with SMTP id b16so20090511ljr.11 for ; Tue, 14 Feb 2023 14:30:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=goJtWsQ1nISDT+cGs0L9aGmrCOp2I2sYJQGtuDJcELQ=; b=BFHjZwVYeRHy/09wSOIkKjlbGMWcZQ2GPdAZsnL6kNX08KsXcpTuQmEPeW+65jsFOK t456j/dscjGsRO9Z/v6SwojdcrSPy8sY29KfaCxqrvr5JKywbH91gUZDwGM4Lt/lMbi1 bJk/iBwlPMkQBlACakSnDcKr+he+56CR/EBx3zzEVkD2JyWAqZSTZncapGM6kSoVUj6C lrHSYgIgWUmQo291LlDgirv83SmCNhjrMaPSMxj/Q2IDyvLKTp08KGN8FyCTCk49yHDC 3cMGI379HpQijfoSia2r2xZo/BQZuebRMgPpJGBUMxSb2Mo1dYNQn8lWNlaEWhbcSobj EVmw== X-Gm-Message-State: AO0yUKWA+yNDawFpJ+38N7rP0puntFJvzQCkOYmetqwaWjFzrvYBV99Y mybb2mAjqmq/RvSFWOydW8Qyg/x8hVA= X-Google-Smtp-Source: AK7set9Fwj1xtRGTjgqsFWrMD96uGdGnpYRjIrR3fChrfhpD4OT2AUbZBtI8sN7qMHIP4IYrTKXAOw== X-Received: by 2002:a2e:920d:0:b0:293:4906:d419 with SMTP id k13-20020a2e920d000000b002934906d419mr1563205ljg.20.1676413848712; Tue, 14 Feb 2023 14:30:48 -0800 (PST) Received: from localhost.localdomain (128-69-253-162.broadband.corbina.ru. [128.69.253.162]) by smtp.gmail.com with ESMTPSA id e19-20020a2eb1d3000000b00293536083cesm413756lja.105.2023.02.14.14.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:30:48 -0800 (PST) X-Google-Original-From: Maxim Kokryashkin To: tarantool-patches@dev.tarantool.org, skaplun@tarantool.org, sergos@tarantool.org Date: Wed, 15 Feb 2023 01:30:27 +0300 Message-Id: X-Mailer: git-send-email 2.39.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit 5/5] Fix IR_RENAME snapshot number. Follow-up fix for a32aeadc. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Mike Pall Reported by Victor Bombi, analyzed by XmiliaH. Thanks! (cherry-picked from commit bf51d3535109c4745bfbbe19a5587a9eac00259a) If the `snapalloc` flag is set, then the allocation hasn't occurred yet, meaning that rename is applied to the next snapshot. Otherwise, refs are already allocated and rename is applied to current applied to current snapshot. Maxim Kokryashkin: * added the description for the problem Part of tarantool/tarantool#7745 --- src/lj_asm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lj_asm.c b/src/lj_asm.c index adfaf286..929a6da6 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c @@ -682,7 +682,14 @@ static void ra_rename(ASMState *as, Reg down, Reg up) RA_DBGX((as, "rename $f $r $r", regcost_ref(as->cost[up]), down, up)); emit_movrr(as, ir, down, up); /* Backwards codegen needs inverse move. */ if (!ra_hasspill(IR(ref)->s)) { /* Add the rename to the IR. */ - ra_addrename(as, down, ref, as->snapno); + /* + ** The rename is effective at the subsequent (already emitted) exit + ** branch. This is for the current snapshot (as->snapno). Except if we + ** haven't yet allocated any refs for the snapshot (as->snapalloc == 1), + ** then it belongs to the next snapshot. + ** See also the discussion at asm_snap_checkrename(). + */ + ra_addrename(as, down, ref, as->snapno + as->snapalloc); } } -- 2.39.0