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 D23175FC8FA; Fri, 29 Sep 2023 09:20:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D23175FC8FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1695968452; bh=SAi405V9zlwrGE4o43cKGIix+YZ+90Hcg8zCYRqWRhs=; 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=XXDSz/K449cgG9mTs+QYFvvyuUQEluay8EnNq746+0FyXcEbhKdqKOWHbbYX956gU Ai3wEDYTB3/IL3FcZVaZvuUIU5kjuxdcm68KINXPZbnu8t6PzgtV739NkYHoXUYJEx Y2nJhy3ihHUWq+jEL2p/eauGwtH0B2uPQBRPNUXE= Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 3DB295FC8F6 for ; Fri, 29 Sep 2023 09:20:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3DB295FC8F6 Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2bffa8578feso228055211fa.2 for ; Thu, 28 Sep 2023 23:20:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695968422; x=1696573222; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LyaSJ6ziMQ97D/0gfttfHxJcWuxdUeQ6qp8b0hQdT2g=; b=EjVjhZSOhhCExIJ8VgayKU0A2e8SmyPtE5pLriixtziUOIyKa21Exjamo6llPJwiub nL9za3+knTEnMUyboxUKmJbwMHj5hpShqnazhL1RRvAPuuu+672nqihj/gpJvXpUlwk9 a2hh0HA6YXOjwQ8awn3YTlE43pr+RSIww4vv2FgaD9vo6ip5np1ggN8JcmHsvdK0CvkH ePrG3G5YpHCCCeY6mNq2JsdQRux1fqXfrj3OfheYel9+M6Kh2Byq6b9xe6Kxz17GeKxl pSY1taJEi1iU2AfHFyPMf6YRtEsXrLfBwPPWvWfQug4vkC7HRRf9DWkKxw8PKs9nQBTy sHZw== X-Gm-Message-State: AOJu0Yxhes9CisXqo58xJgQ9NPeJd3KMJWSta8ssAZlCz1Nb3uOMkkGr 7BQ2bDoJDhuF0wePGjurpIX1k1DyZYM= X-Google-Smtp-Source: AGHT+IFVkq5RTD+gWoPjUcgRe1z1GaFE5ei95Thll23pJ2pCOXb7OPD/gwdqZrh8gmrOAuAmyAFPIQ== X-Received: by 2002:ac2:5b5b:0:b0:500:90d1:90a6 with SMTP id i27-20020ac25b5b000000b0050090d190a6mr2754279lfp.63.1695968422201; Thu, 28 Sep 2023 23:20:22 -0700 (PDT) Received: from localhost.localdomain ([93.175.28.59]) by smtp.gmail.com with ESMTPSA id c14-20020a056512238e00b0050485bad4b4sm917717lfv.222.2023.09.28.23.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 23:20:21 -0700 (PDT) X-Google-Original-From: Maxim Kokryashkin To: tarantool-patches@dev.tarantool.org, skaplun@tarantool.org, sergeyb@tarantool.org Date: Fri, 29 Sep 2023 09:20:10 +0300 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit v2 1/5] Revert "Fix cur_L tracking on exceptional path" 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" This reverts commit 97699d9ee2467389b6aea21a098e38aff3469b5f. As was mentioned in tarantool/tarantool#6189, throwing an error not on the currently executed coroutine is a violation of the Lua/C API. This patch is a part of the patchset that supports this violation and is reverted because of it. Part of tarantool/tarantool#6323 --- src/vm_x64.dasc | 9 ++++----- src/vm_x86.dasc | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/vm_x64.dasc b/src/vm_x64.dasc index 09bf67e5..116716ac 100644 --- a/src/vm_x64.dasc +++ b/src/vm_x64.dasc @@ -533,11 +533,11 @@ static void build_subroutines(BuildCtx *ctx) | mov eax, CARG2d // Error return status for vm_pcall. | mov rsp, CARG1 |->vm_unwind_c_eh: // Landing pad for external unwinder. - | mov L:DISPATCH, SAVE_L - | mov GL:RB, L:DISPATCH->glref - | mov GL:RB->cur_L, L:DISPATCH + | mov L:RB, SAVE_L + | mov GL:RB, L:RB->glref + | mov [GL:RB->cur_L], L:RB | mov dword GL:RB->vmstate, ~LJ_VMST_CFUNC - | mov DISPATCH, L:DISPATCH->glref // Setup pointer to dispatch table. + | mov DISPATCH, GL:RB // Setup pointer to dispatch table. | add DISPATCH, GG_G2DISP | jmp ->vm_leave_unw | @@ -561,7 +561,6 @@ static void build_subroutines(BuildCtx *ctx) | add DISPATCH, GG_G2DISP | mov PC, [BASE-8] // Fetch PC of previous frame. | mov_false RA - | mov [DISPATCH+DISPATCH_GL(cur_L)], L:RB | mov RB, [BASE] | mov [BASE-16], RA // Prepend false to error message. | mov [BASE-8], RB diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc index f16ade1a..e3fbf751 100644 --- a/src/vm_x86.dasc +++ b/src/vm_x86.dasc @@ -681,11 +681,11 @@ static void build_subroutines(BuildCtx *ctx) |.endif |.endif |->vm_unwind_c_eh: // Landing pad for external unwinder. - | mov L:DISPATCH, SAVE_L - | mov GL:RB, L:DISPATCH->glref - | mov dword GL:RB->cur_L, L:DISPATCH + | mov L:RB, SAVE_L + | mov GL:RB, L:RB->glref + | mov dword GL:RB->cur_L, L:RB | mov dword GL:RB->vmstate, ~LJ_VMST_CFUNC - | mov DISPATCH, L:DISPATCH->glref // Setup pointer to dispatch table. + | mov DISPATCH, GL:RB // Setup pointer to dispatch table. | add DISPATCH, GG_G2DISP | jmp ->vm_leave_unw | -- 2.42.0