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 096189A9EDD; Mon, 12 Feb 2024 10:40:19 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 096189A9EDD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1707723619; bh=asYKG3jwKSNA/Qxxto99WDX39ZALm1aYbD/RuusOWOc=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=BmzTkhlw6hH1ovwh+Y+2oZm6v/BBS0l2d9iU1K3vs9nr/ACmDi579LYnDm0fqGA/s MvPz8JsL2okBFm5gUD3foM/Fn3mvBO6YA8UVbfP5tngRkMi+Y/7fWjvNem+i1uxmlw 97eoX7CKkT3n3QgM6Z1r/DdTSNkc9y+LKqIzRp9Q= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [95.163.41.81]) (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 813CD5590DA for ; Mon, 12 Feb 2024 10:40:17 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 813CD5590DA Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1rZQvI-0000000Fdrh-0lBG; Mon, 12 Feb 2024 10:40:16 +0300 Date: Mon, 12 Feb 2024 10:36:16 +0300 To: Sergey Bronnikov , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org Message-ID: References: <8d9d59bf865fe5764a3c91d5a363f7e2bc78a348.1697115768.git.sergeyb@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD96201AD55A1C8F7DB5A31E9AEE8B5F0394B927B47A2BB9941182A05F5380850405C2F2AF721E978F2411046492FDDF80698A9B09AAA44427D45857271347CFB7191EC18E1A088A184 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B114C2C2C20B7E62EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637D19071B5A26B4BDC8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D82D237D599958079C1A77666C1828B4F3E650A4044FB558C9CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F3E38EE449E3E2AE389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D2DCF9CF1F528DBCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE33AC447995A7AD181150BA43C84913FC3A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7352686C055BC15B7FBC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5D72F86674D9897865002B1117B3ED696D48D312AFC7BB4C3219207EC0A953D2C823CB91A9FED034534781492E4B8EEAD09122B91796FF21FBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF687A1571E2FEBD5B5CDB8171210E0B042CCFBA66078013AD20EF3E7A7D11D55835D9E4C97941E9B1233AFEF422F2DFF95DD433B467A7B1D180F8F8C74C83C6C3C0B31CB810784A655F4332CA8FE04980913E6812662D5F2A5EAB5682573093F7837F15F2B5E4A70B33F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj1UUEhvrYbM129vCApfH24Q== X-DA7885C5: 24B238311782FA2CF255D290C0D534F9FC1D84612CF60310E8171752B5D335C7318382D64E8A68775B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393590D8C940224AE33C6B1E6741057A98A6C4137A3F53CD3CE01398654C930FCABE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] LJ_GC64: Always snapshot functions for non-base frames. 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, folks! I've added several comments to the test I was bothered about. See them on the branch: https://github.com/tarantool/luajit/tree/skaplun/lj-611-always-snapshot-functions-for-non-base-frames Also, I rebased it on the tarantool/master branch. =================================================================== diff --git a/test/tarantool-tests/lj-611-gc64-inherit-frame-slot.test.lua b/test/tarantool-tests/lj-611-gc64-inherit-frame-slot.test.lua index 8fc5b663..b7347267 100644 --- a/test/tarantool-tests/lj-611-gc64-inherit-frame-slot.test.lua +++ b/test/tarantool-tests/lj-611-gc64-inherit-frame-slot.test.lua @@ -3,8 +3,9 @@ local test = tap.test('lj-611-gc64-inherit-frame-slot'):skipcond({ ['Test requires JIT enabled'] = not jit.status(), }) --- GC64: Function missing in snapshot for non-base frame --- https://github.com/LuaJIT/LuaJIT/issues/611 +-- GC64: Function missing in snapshot for non-base frame. +-- The reproducer is generated from the fuzzer. +-- https://github.com/LuaJIT/LuaJIT/issues/611. test:plan(1) @@ -13,7 +14,9 @@ jit.opt.start('hotloop=1', 'hotexit=1') local inner_counter = 0 local SIDE_START = 1 -- Lower frame to return from `inner()` function side trace. --- TODO: Give a reason for vararg func. +-- XXX: Use a vararg frame to prevent compilation of the function. +-- The FNEW bytecode is NIY for now, so this helps to avoid trace +-- blacklisting. local function lower_frame(...) local inner = function() if inner_counter > SIDE_START then @@ -21,10 +24,18 @@ local function lower_frame(...) end inner_counter = inner_counter + 1 end + -- XXX: We need to return to the lower frame (to the same + -- function) several times to produce the necessary side traces. + -- See `jit.dump()` for the details. inner(..., inner(inner())) end -- Compile `inner()` function. +-- XXX: We need at least 3 calls to create several function +-- objects from the prototype of the `inner()` function and hit +-- the `PROTO_CLC_POLY` limit, so the side traces stop spawning. +-- See also: +-- https://github.com/tarantool/tarantool/wiki/LuaJIT-function-inlining. lower_frame() lower_frame() -- Compile hotexit. =================================================================== Can you please verify that these changes are OK for you, so we can proceed with the backporting of the patch? -- Best regards, Sergey Kaplun