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 81E81580F50; Wed, 16 Aug 2023 17:32:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 81E81580F50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1692196362; bh=Fd+LOW+01G0zYCbD80f6X9G/LSBsA2TTB1P8fDJdc4M=; 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=P/Mx9D4xCA8/sUl24Kl1fWyYpE47LXNjKWK+hp+r50Pn5hDiu5Pr7r+ojrlH7xJf6 iJTxHI4E02AGDao7pedcbrDb2DidDRXmnHC2A+Riw0aZZYRHRpUpfZvZR6M/dIXu13 elfVgYoP9q8+wwq0lTksG7I6fLgW/ZHEFQdl+to8= Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [95.163.41.98]) (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 DB6AD532601 for ; Wed, 16 Aug 2023 17:32:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DB6AD532601 Received: by smtp60.i.mail.ru with esmtpa (envelope-from ) id 1qWHZg-00CQjq-2o; Wed, 16 Aug 2023 17:32:41 +0300 Message-ID: Date: Wed, 16 Aug 2023 17:32:40 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Sergey Kaplun , Igor Munkin References: <67642b3989e440fb554bf60db140828653c59659.1691592488.git.skaplun@tarantool.org> In-Reply-To: <67642b3989e440fb554bf60db140828653c59659.1691592488.git.skaplun@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9700E0DCE2907754D1F9D5B7CD6B34A186ED0A35A424B74BD182A05F538085040CBE2B753C70D913FA6E6D24F4A0E6B59903943DCE092388FC14D24F84066D502 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78E8764B5BC580342EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063737452AF4BFD067BF8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8788AD1D347EEDB89B2B242DF53282E0D117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC990B2EB4F061288CA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FCB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE140C956E756FBB7A4782AAF36435267CD8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE313BDA61BF53F5E1DBA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166176DF2183F8FC7C0E4A630A5B664A4FF725E5C173C3A84C3CD42BCEBB57B85E635872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A52BC29EDEB95BBBD64A59C3174C13BD1FF4A407CEE9E0D4C6F87CCE6106E1FC07E67D4AC08A07B9B06A1CB4668A9CA5FACB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFF695B14EC995EAC62FDB6286B6AEC0AAF8B6BF3877A952CE0B934E1A93EF1012AFE07996864E0BE224F7434E9608BF9FEDC9E4A88DC7A1D748403BB50C2797AAA74DFFEFA5DC0E7F02C26D483E81D6BE0DBAE6F56676BC7117BB6831D7356A2DEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojHVl7ekwB6hjn1myya2FC9g== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F2588458AC281BCF36A61ECF62DE2F544A6C7F61C255BFBEEFE9B2B4282EC151BADDC1D3523A6D01B4765B2DFB59E2DDD9FE06B14FA522850F29BC30B0DAF586E7D11B3E67EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 02/19] test: introduce mcode generator for tests 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey Thanks for the patch! Sergey On 8/9/23 18:35, Sergey Kaplun wrote: > ls/frontend.lua b/test/tarantool-tests/utils/frontend.lua > index 2afebbb2..414257fd 100644 > --- a/test/tarantool-tests/utils/frontend.lua > +++ b/test/tarantool-tests/utils/frontend.lua > @@ -1,6 +1,10 @@ > local M = {} > > local bc = require('jit.bc') > +local jutil = require('jit.util') > +local vmdef = require('jit.vmdef') > +local bcnames = vmdef.bcnames > +local band, rshift = bit.band, bit.rshift > > function M.hasbc(f, bytecode) > assert(type(f) == 'function', 'argument #1 should be a function') > @@ -22,4 +26,24 @@ function M.hasbc(f, bytecode) > return hasbc > end > > +-- Get traceno of the trace assotiated for the given function. > +function M.gettraceno(func) > + assert(type(func) == 'function', 'argument #1 should be a function') > + > + -- The 0th BC is the header. > + local func_ins = jutil.funcbc(func, 0) > + local BC_NAME_LENGTH = 6 > + local RD_SHIFT = 16 Nit: AFAIK usually we left a comment with a source of constants.