[Tarantool-patches] [PATCH luajit] ARM64: Fix {AHUV}LOAD specialized to nil/false/true.

Maxim Kokryashkin m.kokryashkin at tarantool.org
Mon Mar 6 18:29:51 MSK 2023


Hi!
Thanks for the fixes!
LGTM
 
>
>> >>+-- Those `rn` variables before and after `main_payload` are
>> >>+-- required to generate enough register pressure (for GPR). Amount
>> >>+-- of repeats is empirical.
>> >>+-- Additional `test_f(...)` wrapper is needed for IR_VLOAD usage,
>> >>+-- when `main_payload` is just `...`.
>> >>+local function generate_payload(n_fillers, main_payload)
>> >>+ local code_chunk = 'local function test_f(...)\n'
>> >>+ code_chunk = code_chunk .. 'local r\n'
>> >>+ for i = 1, n_fillers do
>> >>+ code_chunk = code_chunk .. ('local rup%d\n'):format(i)
>> >>+ end
>> >>+ code_chunk = code_chunk .. 'for _ = 1, 4 do\n'
>> >>+ for i = 1, n_fillers do
>> >>+ code_chunk = code_chunk ..
>> >>+ ('local r%d = ffi.cast("int", %d)\n'):format(i, i)
>> >>+ end
>> >>+ code_chunk = code_chunk .. 'r = ' .. main_payload .. '\n'
>> >>+ for i = 1, n_fillers do
>> >>+ code_chunk = code_chunk .. ('rup%d = r%d\n'):format(i, i)
>> >>+ end
>> >>+ code_chunk = code_chunk .. 'end\nend\n'
>> >>+ code_chunk = code_chunk .. 'return test_f'
>> >>+ local f, err = loadstring(code_chunk, 'test_function')
>> >>+ assert(type(f) == 'function', err)
>> >>+ f = f()
>> >>+ assert(type(f) == 'function', 'returned generated value is not a function')
>> >>+ return f
>> >>+end
>> >That section is really hard to read, is there any way to make it more
>> >readable? I believe even slight reformatting might help.
>
>I've add the additional empty lines to separate cycle's body
>generation.
>Does it help?
Yes, that is way better, thanks.
--
Best regards,
Maxim Kokryashkin
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20230306/ec7f3422/attachment.htm>


More information about the Tarantool-patches mailing list