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 ED10B171250; Thu, 15 Dec 2022 18:49:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org ED10B171250 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1671119400; bh=fDRccR+fEjd14VW1RWef0Gks6S80sQp7GYALjqdK84s=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=n+2Lzia88NyO87yMVLYLhqQh+paal2B5sVAGDwf35ImlWLf8+rWLXeSXIObRGu000 hPmfPGM4SsxbRcOVU9mboHHuq1wTHsepvMCfVtzRoFMRv3HlVWU3EmmPcfLxkv5vSF 6djACSTijvO6vH3Kshdl122aZadwVSik93encJuY= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [95.163.41.81]) (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 2C0F2171250 for ; Thu, 15 Dec 2022 18:49:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2C0F2171250 Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1p5qUg-000Dny-8K; Thu, 15 Dec 2022 18:49:58 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) In-Reply-To: Date: Thu, 15 Dec 2022 18:49:47 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <5F75F00A-7ABB-43F0-86C0-2C91F2AAF78E@tarantool.org> References: <20221202084220.23122-1-skaplun@tarantool.org> <1670310532.819331928@f211.i.mail.ru> To: Sergey Kaplun X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD90D1502B3BE350FE420345CBC5A180DD43DEA314B30AECAB400894C459B0CD1B95528F9BDD7C9E9D6BB00EB55AE8957E0CF58CD50F0245C771A3BE929C6DF5677 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B2CE06D3E4B8AFEBEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063748424D8FCCA3295D8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84C76D85133350DA1B284113AA76ED053117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520599709FD55CB46A6618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE902A1BE408319B29B78CF848AE20165DD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE34E7D9683544204AF2D242C3BD2E3F4C6C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637BC468E7E89D8C5D6EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344EF254DC71474AA392CFC71570A3CE40E0D862D20143D375EA5FAEC702DF23EB62EF86EDD6D9D2CE1D7E09C32AA3244CBB1B1A3C4F26DEACFCCE135440EC9F2455E75C8D0ED9F6EEFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojP137QGfWHIwyepZIFWmtfw== X-Mailru-Sender: 5AA3D5B9D8C486464BD4402E82A444E3F66B65EB0FECD34F95F397705F2D33101BC436F6C3BC0E4819381EE24192DF5555834048F03EF5D4C9A814A92B2E3B1BA4250FC3964EA4964198E0F3ECE9B5443453F38A29522196 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: sergos via Tarantool-patches Reply-To: sergos Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the patch! LGTM with fixes after Max=E2=80=99s review.=20 Although, as we discussed earlier I would prefer the test has `skipcond(not ffi.abi('gc64=E2=80=99), 'test is GC64 only')` regards, Sergos > On 6 Dec 2022, at 11:49, Sergey Kaplun wrote: >=20 > Hi, Maxim! >=20 > Thanks for the review! >=20 > Fixed you comments. >=20 > On 06.12.22, Maxim Kokryashkin wrote: >>=20 >> Hi, Sergey! >> Thanks for the patch! >> Please consider my comments below. >>> =20 >=20 > >=20 >>>> --- >>>>=20 >>>> Branch: = https://github.com/tarantool/luajit/tree/skaplun/lj-350-fix-sload-typechec= k-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 >>>>=20 >>>> 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 >>>>=20 >>>> 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 >=20 > >=20 >>>> 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 =3D require('tap') >>>> +local traceinfo =3D 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 =3D 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 =3D {} >>>> + >>>> +-- 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 >=20 > Fixed. >=20 >>>> +-- is incorrect, assertion guard type check will failed even for >>> Typo: s/failed/fail >>> Typo: s/for/ for the >=20 > Fixed. >=20 > See the iterative patch below: >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 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() >=20 > assert(not traceinfo(1), 'no traces compiled after flush') >=20 > --- 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=3D1', 'hotexit=3D1') >=20 > jit.on() > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Branch is force-pushed. >=20 >>>> +-- correct type of argument and a new trace is recorded. >>>> +jit.opt.start('hotloop=3D1', 'hotexit=3D1') >>>> + >>>> +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 >=20 > Yes, because patch fixes the behaviour only for GC64 as mentioned in = the > commit message. >=20 >>>> 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 >=20 > >=20 >>>> 2.34.1 >>> -- >>> Best regards, >>> Maxim Kokryashkin >=20 > --=20 > Best regards, > Sergey Kaplun