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 73B23BCF065; Mon, 1 Jul 2024 11:36:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 73B23BCF065 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1719822970; bh=+Bjdg7CEEUnhsVUwaDWXtgXeNpCbRuGZ/+C552JYXsw=; 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=wPuzomF7F0/D6aMpFfZ/IMh+p1OWbxMjZKDarOuXiO8Eig5oLg3PI/lI6uTQsaw/0 zBYXasc2BgwWezzDvEZ2iG2FXchbQAEj5ZkOqY6QRp6U47kVMW6tJyIPw7K+vBbuTC 8DKy2R4IkvcgcSG0zGyCc4ehSPBVsJyAdl74au4U= Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [95.163.41.90]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 2B197BCF040 for ; Mon, 1 Jul 2024 11:36:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2B197BCF040 Received: by smtp53.i.mail.ru with esmtpa (envelope-from ) id 1sOCW8-00000007mfK-18Of; Mon, 01 Jul 2024 11:36:08 +0300 Date: Mon, 1 Jul 2024 11:36:06 +0300 To: Sergey Kaplun Message-ID: References: <20240626083721.11596-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240626083721.11596-1-skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD92EE09148F40C54462D3C0C63B8D99A59DC0716F43F683FD3182A05F53808504045BCA0A384FE5BCA91417EB218679B8275F1B29919C041D0A1210943435FF214EFDB812A93E8900B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7D63A32B630C59AACEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E565730CA785C4918638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D85D9A91CBED5F8CDC29C75EBA53A07B0CF4D7C97736D1AFFACC7F00164DA146DAFE8445B8C89999728AA50765F7900637D0FEED2715E18529389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8B861051D4BA689FCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CCEBC872EF0A1BB659735652A29929C6C4AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C365E2844F79EE3F05BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CFED8438A78DFE0A9E1DD303D21008E298D5E8D9A59859A8B6957A4DEDD2346B4275ECD9A6C639B01B78DA827A17800CE73D397B70C671C943731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A519670CA54188F34B5002B1117B3ED69679175501F2D255983D2BBC1EF78EDEBE823CB91A9FED034534781492E4B8EEADEEA082C9A12FE455BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF9B99B0E9D41F30B83125602661A3E1AC0D30F385B699BED8EBFA771A37A346144F3A61774D94DB0C9DF1169A732047E3F7F06674AD6C7CF076F2969135250620DBFAF759D75BD04A5F4332CA8FE04980913E6812662D5F2A54F6898A6FDCBDC72A617DFBE5FEC2C6383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojn+1t2APtxW+rzGoll+p1tg== X-Mailru-Sender: 7940E2A4EB16C99705E36C42C2C7747C2DF20A4552DC977F23F61C94D917FE4B062D117CBD5CB51228C44B9C631FF20DE747D2BC1AD30F01FB559BB5D741EB9612EB40C6FA10D71EFD657A8799238ED55FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] Show name of NYI bytecode in -jv and -jdump. 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the patch! LGTM, except for two nits below. On Wed, Jun 26, 2024 at 11:37:21AM GMT, Sergey Kaplun wrote: > From: Mike Pall > > Suggested by Sergey Kaplun. > > (cherry picked from commit d2fe2a6d465a3e4c74c9876db94ae606f9c6983b) > > This patch replaces the number of NYI bytecodes that can't be compiled I guess `numeric value` is a bit better than `number`, but feel free to ignore. > with their names in the `jit.dump()` and -jv outputs. Since the > functionality is the same, only `jit.dump()` is tested as most popular. > > Sergey Kaplun: > * added the description and the test for the feature > > Part of tarantool/tarantool#9924 > --- > > Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-567-1176-print-nyi-names > Related Issues: > * https://github.com/tarantool/tarantool/issues/9924 > * https://github.com/LuaJIT/LuaJIT/pull/567 > * https://github.com/LuaJIT/LuaJIT/issues/1176 > > src/jit/dump.lua | 7 +- > src/jit/v.lua | 9 +- > src/lj_traceerr.h | 2 +- > .../lj-567-1176-print-nyi-names.test.lua | 82 +++++++++++++++++++ > 4 files changed, 96 insertions(+), 4 deletions(-) > create mode 100644 test/tarantool-tests/lj-567-1176-print-nyi-names.test.lua > > diff --git a/src/jit/dump.lua b/src/jit/dump.lua > index 84fe0044..e7f05253 100644 > --- a/src/jit/dump.lua > +++ b/src/jit/dump.lua > diff --git a/src/jit/v.lua b/src/jit/v.lua > index 934de985..ff4e9c7c 100644 > --- a/src/jit/v.lua > +++ b/src/jit/v.lua > diff --git a/src/lj_traceerr.h b/src/lj_traceerr.h > index 1363c4f3..beecbd8c 100644 > --- a/src/lj_traceerr.h > +++ b/src/lj_traceerr.h > diff --git a/test/tarantool-tests/lj-567-1176-print-nyi-names.test.lua b/test/tarantool-tests/lj-567-1176-print-nyi-names.test.lua > new file mode 100644 > index 00000000..38829d2c > --- /dev/null > +++ b/test/tarantool-tests/lj-567-1176-print-nyi-names.test.lua > @@ -0,0 +1,82 @@ > +local tap = require('tap') > + > +-- Test dumping of names of NYI bytecodes to be compiled instead > +-- of their numbers. See also: > +-- * https://github.com/LuaJIT/LuaJIT/pull/567, > +-- * https://github.com/LuaJIT/LuaJIT/issues/1176. > + > +local test = tap.test('lj-567-1176-print-nyi-names'):skipcond({ > + ['Test requires JIT enabled'] = not jit.status(), > + ['Disabled on *BSD due to #4819'] = jit.os == 'BSD', > +}) > + > +local jparse = require('utils').jit.parse > + > +test:plan(3) > + > +local function reset_jit() > + -- Remove all previous traces. > + jit.off() > + jit.flush() > + jit.on() > + jit.opt.start('hotloop=1') > +end > + > +local function nop() end > +local function test_varg(...) > + for _ = 1, 4 do nop(...) end > +end > + > +local function test_uv() > + do > + -- luacheck: ignore > + local uclo > + goto close_uv > + local function _() > + return uclo > + end > + end > + ::close_uv:: > +end > + > +-- We only need the abort reason in the test. > +jparse.start('t') > +reset_jit() > + > +test_varg() > + > +local _, aborted_traces = jparse.finish() > +assert(aborted_traces and aborted_traces[1], > + 'aborted trace with VARG is persisted') > + > +-- We tried to compile only one trace. > +local reason = aborted_traces[1][1].abort_reason > +test:like(reason, 'NYI: bytecode VARG', 'bytecode VARG name') > + > +jparse.start('t') > +reset_jit() > + > +for _ = 1, 4 do > + local _ = function() end > +end Maybe it would be better to create a separate function for FNEW too, just for the uniformity, but that's not a big deal. Feel free to ignore. > +_, aborted_traces = jparse.finish() > +assert(aborted_traces and aborted_traces[1], > + 'aborted trace with FNEW is persisted') > + > +reason = aborted_traces[1][1].abort_reason > +test:like(reason, 'NYI: bytecode FNEW', 'bytecode FNEW name') > + > +jparse.start('t') > +reset_jit() > + > +test_uv() > +test_uv() > + > +_, aborted_traces = jparse.finish() > +assert(aborted_traces and aborted_traces[1], > + 'aborted trace with UCLO is persisted') > + > +reason = aborted_traces[1][1].abort_reason > +test:like(reason, 'NYI: bytecode UCLO', 'bytecode UCLO name') > + > +test:done(true) > -- > 2.45.1 >