Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Maxim Kokryashkin <max.kokryashkin@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit v4 2/3] Don't compile math.modf() anymore.
Date: Thu, 14 Apr 2022 11:53:36 +0300	[thread overview]
Message-ID: <YlfhEKNyJ8HKWDb6@root> (raw)
In-Reply-To: <316197b3f4c529a0a5249e69e8f352fef25e0ab8.1648597663.git.m.kokryashkin@tarantool.org>

Hi, Maxim!

Thanks for the patch.
It generally LGTM, except the following concerns:
1) The tests kinda useless since they check that `modf()` just not compiled
   instead checking incorrect behaviour of `modf()` -- the reason for
   disabling compilation.
2) These tests are not related to min/max functions, so they should be
   moved to the separate test file.

On 30.03.22, Maxim Kokryashkin wrote:
> From: Mike Pall <mike>
> 
> This commit disables compilation for the `math.modf` function since it's
> rarely used and properly compiling it would be difficult.
> 
> Part of tarantool/tarantool#6163
> ---
>  src/lib_math.c                                |  2 +-
>  src/lj_ffrecord.c                             | 16 -------------
>  .../gh-6163-jit-min-max.test.lua              | 23 +++++++++++++++----
>  3 files changed, 20 insertions(+), 21 deletions(-)
> 
> diff --git a/src/lib_math.c b/src/lib_math.c
> index ef9dda2d..4e6d2458 100644
> --- a/src/lib_math.c
> +++ b/src/lib_math.c

<snipped>

> diff --git a/test/tarantool-tests/gh-6163-jit-min-max.test.lua b/test/tarantool-tests/gh-6163-jit-min-max.test.lua
> index d6eb3f3b..4594b968 100644
> --- a/test/tarantool-tests/gh-6163-jit-min-max.test.lua
> +++ b/test/tarantool-tests/gh-6163-jit-min-max.test.lua
> @@ -1,12 +1,12 @@
>  local tap = require('tap')
> +local jutil = require('jit.util')
>  jit.off()
>  jit.flush()
>  
>  local test = tap.test("gh-6163-jit-min-max")
> -test:plan(2)
> ---
> --- gh-6163: math.min/math.max success with no args
> ---
> +test:plan(6)
> +
> +-- `math.min`/`math.max` success with no args.
>  local pcall = pcall
>  
>  jit.opt.start(0, 'hotloop=1')
> @@ -17,4 +17,19 @@ test:ok(false == r)
>  r, _ = pcall(function() math.min() end)
>  test:ok(false == r)
>  
> +jit.off()
> +jit.flush()
> +jit.on()
> +
> +-- `math.modf` shouldn't be compiled.
> +for _ = 1, 3 do math.modf(5.32) end
> +
> +local tr1_info = jutil.traceinfo(1)
> +local tr2_info = jutil.traceinfo(2)
> +
> +test:ok(tr1_info ~= nil)
> +test:ok(tr2_info ~= nil)
> +test:ok(tr1_info.link == 2)
> +test:ok(tr1_info.linktype == "stitch")
> +
>  os.exit(test:check() and 0 or 1)
> -- 
> 2.35.1
> 

-- 
Best regards,
Sergey Kaplun

  reply	other threads:[~2022-04-14  8:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 23:48 [Tarantool-patches] [PATCH luajit v4 0/3] fix math.min/max inconsistencies Maxim Kokryashkin via Tarantool-patches
2022-03-29 23:48 ` [Tarantool-patches] [PATCH luajit v4 1/3] Fix math.min()/math.max() inconsistencies Maxim Kokryashkin via Tarantool-patches
2022-04-14  8:55   ` Sergey Kaplun via Tarantool-patches
2022-03-29 23:48 ` [Tarantool-patches] [PATCH luajit v4 2/3] Don't compile math.modf() anymore Maxim Kokryashkin via Tarantool-patches
2022-04-14  8:53   ` Sergey Kaplun via Tarantool-patches [this message]
2022-03-29 23:48 ` [Tarantool-patches] [PATCH luajit v4 3/3] Cleanup math function compilation and fix inconsistencies Maxim Kokryashkin via Tarantool-patches
2022-04-14  8:53   ` Sergey Kaplun via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YlfhEKNyJ8HKWDb6@root \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=max.kokryashkin@gmail.com \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit v4 2/3] Don'\''t compile math.modf() anymore.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox