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 51A8A6D609A; Tue, 7 Nov 2023 13:58:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 51A8A6D609A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1699354732; bh=9vnx+3xt3dlQDzbT7EFCFcSnRbkzZArOOA8m8blGe9I=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ZRnJnwCyvy0uOntLInt8yYJAtqTKJDVXHtEa2cI+4jQCRQDHsUzNBvJejWZD5kBKn LYMUjODSbANPaOxlB7f5CSnpE8upaK/8aLhP3R0B5KT6wJadiFU4iAOFvwed2qsZ/F 6pEEKmlvPUGCugNQS4vCqwprXjLjEN2XRKkI01oA= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5F25C69961B for ; Tue, 7 Nov 2023 13:58:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5F25C69961B Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1r0JnG-0002Nt-E7; Tue, 07 Nov 2023 13:58:50 +0300 To: Maxim Kokryashkin , Igor Munkin Date: Tue, 7 Nov 2023 13:54:18 +0300 Message-ID: <20231107105418.18356-1-skaplun@tarantool.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9DD83A8ACFE753175B8A28EDCF715C5879F9C6D104AE42C4400894C459B0CD1B9D811D6163C5079E1A22BD333DBCA0AA30F4A0A16A8D977FD67A9CA496E58B691 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72AC9FB60380F23AEEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637629A2DB6D7098C1B8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D83C2995C8F46AE5466EA0E7721621048C117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCC908CD1B87A134A2A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10FF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE33AC447995A7AD183FC91FA280E0CE3D3A03B725D353964B1D471462564A2E1935872C767BF85DA227C277FBC8AE2E8B374CE26A9E38610E75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A5CF07B3F71B4AB174577623028245B7277B6587303B0D22F3F87CCE6106E1FC07E67D4AC08A07B9B0735DFC8FA7AC12079C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A091D471462564A2E19CB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF77DD89D51EBB7742D3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFA0FB67655B83FFDF26FE6DEE4827A3DA4FBB52AA681772FB74E82CB75785182D124E09ADABDE41742B33B16BC67043E02C850F1AB029C679CCE76FF29B8BEDA6A74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojoiosMWyUVRdMoVpqlzaTJA== X-DA7885C5: 677A0D5D045F96638FDC569CAFC0F7AE8C9020F89B6596AED0DD134534ADC702262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE33675D3495E51D1F087F964DCE1925B5DC0FBE9A32752B8C9C2AA642CC12EC09F1FB559BB5D741EB962F61BD320559CF1EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit] x64: Properly fix __call metamethod return dispatch. 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: Sergey Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Mike Pall Reported by Sergey Kaplun. (cherry-picked from commit d133d67c881f363f0b5584ebd21a965eb3435aa1) This patch is the follow-up for the commit 1672bdc0ffbee9f32fadb6943909d6af7eb9a7b1 ("x64: Fix __call metamethod return dispatch."). This patch uses the incorrect macro x64 (which is undefined in dasm) instead of X64. `KBASE` (r15d) is still compared against `BASE` (edx) instead of `KBASEa` (r15) against rdx. This patch fixes the typo, so the correct registers are chosen. Sergey Kaplun: * added the description for the problem Part of tarantool/tarantool#9145 --- The test is omitted for the same reason as it was omitted in the 1672bdc commit: it is too hard (or even impossible) to create the test case. Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-1110-x64-return-dispatch Tarantool PR: https://github.com/tarantool/tarantool/pull/9335 Relate issues and PRs: * https://github.com/LuaJIT/LuaJIT/pull/636 * https://github.com/LuaJIT/LuaJIT/issues/1110 * https://github.com/tarantool/tarantool/issues/9145 src/vm_x86.dasc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vm_x86.dasc b/src/vm_x86.dasc index 9fa9a3f7..6a353796 100644 --- a/src/vm_x86.dasc +++ b/src/vm_x86.dasc @@ -1451,7 +1451,7 @@ static void build_subroutines(BuildCtx *ctx) | mov LFUNC:RB, [RA-8] | add NARGS:RD, 1 | // This is fragile. L->base must not move, KBASE must always be defined. - |.if x64 + |.if X64 | cmp KBASEa, rdx // Continue with CALLT if flag set. |.else | cmp KBASE, BASE // Continue with CALLT if flag set. -- 2.42.0