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 C37CB187AE3; Tue, 6 Dec 2022 11:52:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C37CB187AE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1670316744; bh=T7PpaD6CRv/6vnq9u1Xy1AXBBb6gp9xV5VYvCyHkG7A=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=wbOktqmbUk4iNHVek49M19/yuDdMdqftIoorvGdLR45Ke9um9J3/lXy6gmBpPKxUt YyDLQw+bhgzzGFOpoP0hiM13RUsrxJmVGznRvvYi2S17NzJnxCAebieE1iJSPrJWrO Z5m49VGYSTtNyqEfE8rsB0BBsZ5wCD1C+2fFgoWE= Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [217.69.128.36]) (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 8AE64152E39 for ; Tue, 6 Dec 2022 11:52:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8AE64152E39 Received: by smtp56.i.mail.ru with esmtpa (envelope-from ) id 1p2Tgc-0002zk-Mz; Tue, 06 Dec 2022 11:52:23 +0300 Date: Tue, 6 Dec 2022 11:49:08 +0300 To: Maxim Kokryashkin Message-ID: References: <20221202084220.23122-1-skaplun@tarantool.org> <1670310532.819331928@f211.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1670310532.819331928@f211.i.mail.ru> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD908190A22B884CF14AB7A44B281FF59334C8EFCA778AA0724182A05F538085040D4017B1FF2E3C2CE1DE7788DD8F0A93DA20C0D937C03BF83B5044D2AE8739851 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75012335B19220D49EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D7C7E03580C3DB018638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8B51DBF615805255C5EC73EA973CAC977117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520437C869540D2AB0FBDFBBEFFF4125B51D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EEC24E1E72F37C03A0EA93887B71B66F2BD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE34E7D9683544204AF040F9FF01DFDA4A8C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637B8F435DEDE9E76EBEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348CDF4129B2EA8560C9E5B2D41C37D16D3FD836A6B1EE8E77C1079B1CFC5C0F62CEEA011E061989521D7E09C32AA3244CB62867FFEFB44AD2C2F26EDF2B6E0C028580396430872480FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj0NDJWmbmL/Dif+4OOy3V4g== X-Mailru-Sender: F16D9CAFEEA6770E7B6EAD4ADB3BCAF04EAE943A8E2F56F15E767D2731E403097DE46340900E582FF2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A84198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] x64/LJ_GC64: Fix type-check-only variant of SLOAD. 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" Hi, Maxim! Thanks for the review! Fixed you comments. On 06.12.22, Maxim Kokryashkin wrote: > > Hi, Sergey! > Thanks for the patch! > Please consider my comments below. > >  > >>--- > >> > >>Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-350-fix-sload-typecheck-full-ci > >>Issues: > >>* https://github.com/tarantool/tarantool/issues/7230 > >>* https://github.com/LuaJIT/LuaJIT/pull/350 > >>Tarantool PR: https://github.com/tarantool/tarantool/pull/7995 > >> > >> src/lj_asm_x86.h | 2 +- > >> .../lj-350-sload-typecheck.test.lua | 42 +++++++++++++++++++ > >> .../lj-408-tonumber-cdata-record.test.lua | 10 ----- > >> 3 files changed, 43 insertions(+), 11 deletions(-) > >> create mode 100644 test/tarantool-tests/lj-350-sload-typecheck.test.lua > >> > >>diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h > >>index 8a4d4025..8efda8e5 100644 > >>--- a/src/lj_asm_x86.h > >>+++ b/src/lj_asm_x86.h > >>diff --git a/test/tarantool-tests/lj-350-sload-typecheck.test.lua b/test/tarantool-tests/lj-350-sload-typecheck.test.lua > >>new file mode 100644 > >>index 00000000..6ffc61fb > >>--- /dev/null > >>+++ b/test/tarantool-tests/lj-350-sload-typecheck.test.lua > >>@@ -0,0 +1,42 @@ > >>+local tap = require('tap') > >>+local traceinfo = require('jit.util').traceinfo > >>+ > >>+-- Test file to demonstrate the incorrect GC64 JIT asembling > >>+-- `IR_SLOAD`. > >>+-- See also https://github.com/LuaJIT/LuaJIT/pull/350 . > >>+local test = tap.test('lj-350-sload-typecheck') > >>+ > >>+test:plan(1) > >>+ > >>+-- Contains only IR_SLOAD after recording. > >>+local function sload(arg) > >>+ return arg > >>+end > >>+ > >>+local tab_arg = {} > >>+ > >>+-- Reset JIT, remove any other traces. > >>+jit.off() > >>+jit.flush() > >>+ > >>+assert(not traceinfo(1), 'no traces compiled after flush') > >>+ > >>+-- Try to executed compiled trace wiht IR_SLOAD, if emitted mcode > >Typo: s/to executed/to execute > >Typo: s/wiht/with > >Typo: s/if emitted/if the emmited Fixed. > >>+-- is incorrect, assertion guard type check will failed even for > >Typo: s/failed/fail > >Typo: s/for/ for the Fixed. See the iterative patch below: =================================================================== diff --git a/test/tarantool-tests/lj-350-sload-typecheck.test.lua b/test/tarantool-tests/lj-350-sload-typecheck.test.lua index 6ffc61fb..33794943 100644 --- a/test/tarantool-tests/lj-350-sload-typecheck.test.lua +++ b/test/tarantool-tests/lj-350-sload-typecheck.test.lua @@ -21,9 +21,9 @@ jit.flush() assert(not traceinfo(1), 'no traces compiled after flush') --- Try to executed compiled trace wiht IR_SLOAD, if emitted mcode --- is incorrect, assertion guard type check will failed even for --- correct type of argument and a new trace is recorded. +-- Try to execute the compiled trace with IR_SLOAD, if the emitted +-- mcode is incorrect, assertion guard type check will fail even +-- for the correct type of argument and a new trace is recorded. jit.opt.start('hotloop=1', 'hotexit=1') jit.on() =================================================================== Branch is force-pushed. > >>+-- correct type of argument and a new trace is recorded. > >>+jit.opt.start('hotloop=1', 'hotexit=1') > >>+ > >>+jit.on() > >>+ > >>+-- Make the function hot. > >>+sload(tab_arg) > >>+-- Compile the trace. > >>+sload(tab_arg) > >>+-- Execute trace and try to compile a trace from the side exit. > >>+sload(tab_arg) > >>+ > >>+jit.off() > >>+ > >>+test:ok(not traceinfo(2), 'the second trace should not be compiled') > >>+ > >>+os.exit(test:check() and 0 or 1) > >Also, that test passes even without the patch on Linux x86_64 GC64: OFF Yes, because patch fixes the behaviour only for GC64 as mentioned in the commit message. > >>diff --git a/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua b/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua > >>index bf9e8e46..a8235e93 100644 > >>--- a/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua > >>+++ b/test/tarantool-tests/lj-408-tonumber-cdata-record.test.lua > >>2.34.1 > >-- > >Best regards, > >Maxim Kokryashkin -- Best regards, Sergey Kaplun