[Tarantool-patches] [PATCH luajit 02/19] test: introduce mcode generator for tests
Sergey Bronnikov
sergeyb at tarantool.org
Wed Aug 16 19:08:23 MSK 2023
Ok, thanks.
LGTM now
On 8/16/23 18:20, Sergey Kaplun wrote:
> Hi, Sergey!
> Thanks for the review!
>
> On 16.08.23, Sergey Bronnikov wrote:
>> Hi, Sergey
>>
>>
>> Thanks for the patch!
>>
>> Sergey
>>
>> On 8/9/23 18:35, Sergey Kaplun wrote:
>>
>> <snipped>
>>
>>
>>> 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.
> Unfortunately, there is no any real sources for these constants,
> but the code is similar to the <src/jit/bc.lua>. But, I don't sure
> that is worth to be mentioned.
>
>> <snipped>
>>
More information about the Tarantool-patches
mailing list