[Tarantool-patches] [PATCH] luajit: adde flag of partial comp. with Lua 5.2

Olga Arkhangelskaia arkholga at tarantool.org
Tue Nov 19 14:01:30 MSK 2019


--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;
  }



More information about the Tarantool-patches mailing list