From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 690B7440F3C for ; Tue, 19 Nov 2019 14:01:31 +0300 (MSK) From: Olga Arkhangelskaia Message-ID: <496cc305-1743-f47f-2014-90dc2da91143@tarantool.org> Date: Tue, 19 Nov 2019 14:01:30 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: ru Subject: [Tarantool-patches] [PATCH] luajit: adde flag of partial comp. with Lua 5.2 List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, gorcunov@tarantool.org --mail delivery test Although we do not turn on full compatibility with Lua 5.2 we do need some of its features (eg. __pairs/__ipairs).This functionality brakes existing code. However, if the necessity is very high or is strongly demanded we should have possibility to use it. We introduce LUAJIT_ENABLE_LUA52COMPAT_PART flag. Some of the Lua 5.2's features that are likely to break existing code can be turned on under this flag. At the moment it is pirs/ipairs metmethod. ---  src/Makefile    | 4 ++++  src/lib_base.c  | 4 ++--  src/lj_arch.h   | 6 ++++++  src/lj_obj.h    | 2 +-  src/vm_x86.dasc | 4 ++--  5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index 827d4a4..e8fd91a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -101,6 +101,10 @@ XCFLAGS=  # Note: this does not provide full compatibility with Lua 5.2 at this time.  #XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT  # +#Features from Lua 5.2 that was demanded more than once or are essential for +#for the project. At the moment only pairs/ipairs can be enabled via this flag. +#XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT_PART +#  # Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter.  #XCFLAGS+= -DLUAJIT_DISABLE_JIT  # diff --git a/src/lib_base.c b/src/lib_base.c index 3a75787..6cc0fcc 100644 --- a/src/lib_base.c +++ b/src/lib_base.c @@ -81,12 +81,12 @@ LJLIB_ASM(next)    return FFH_UNREACHABLE;  }