mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-04-18 21:19:19 +00:00
Mirror of the LuaJIT git repository
![]() JIT recording semantics assumes FFI calls are leaf regarding the LuaJIT VM: if the execution exited Lua world through FFI machinery it is not re-entering Lua world again. However, there is a way to break this assumption via FFI: one can re-enter LuaJIT VM via Lua C API used within the particular C routine called via FFI. As a result the following host stack mix is created: | Lua-FFI -> C routine -> Lua-C API -> Lua VM This sort of re-entrancy is not supported by LuaJIT tracing compiler. @mraleph named such kind of the call stack an "FFI sandwich" in the tarantool/tarantool#4427. This changeset introduces the mechanism for Lua-C API callbacks similar to the one implemented for Lua-FFI: trace recording is aborted when the execution re-enters LuaJIT VM. If re-enter is detected while running the particular mcode, the runtime finishes its execution with EXIT_FAILURE code and calls panic routine prior to the exit. Co-authored-by: Vyacheslav Egorov <vegorov@google.com> Co-authored-by: Sergey Ostanevich <sergos@tarantool.org> Signed-off-by: Igor Munkin <imun@cpan.org> |
||
---|---|---|
doc | ||
dynasm | ||
etc | ||
src | ||
.gitattributes | ||
.gitignore | ||
.relver | ||
COPYRIGHT | ||
Makefile | ||
README |
README for LuaJIT 2.1 --------------------- LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. Project Homepage: https://luajit.org/ LuaJIT is Copyright (C) 2005-2023 Mike Pall. LuaJIT is free software, released under the MIT license. See full Copyright Notice in the COPYRIGHT file or in luajit.h. Documentation for LuaJIT is available in HTML format. Please point your favorite browser to: doc/luajit.html