diff --git a/doc/ext_jit.html b/doc/ext_jit.html
index d621476b..0d056b35 100644
--- a/doc/ext_jit.html
+++ b/doc/ext_jit.html
@@ -127,9 +127,16 @@ Contains the version number of the LuaJIT core. Version xx.yy.zz
is represented by the decimal number xxyyzz.
+jit.os
+
+Contains the target OS name:
+"Windows", "Linux", "OSX", "BSD", "Posix" or "Other".
+
+
jit.arch
-Contains the target architecture name (CPU and optional ABI).
+Contains the target architecture name:
+"x86", "x64" or "ppcspe".
jit.opt.* — JIT compiler optimization control
diff --git a/src/lib_jit.c b/src/lib_jit.c
index 57b50749..7b2eaf44 100644
--- a/src/lib_jit.c
+++ b/src/lib_jit.c
@@ -133,6 +133,7 @@ LJLIB_CF(jit_attach)
return 0;
}
+LJLIB_PUSH(top-5) LJLIB_SET(os)
LJLIB_PUSH(top-4) LJLIB_SET(arch)
LJLIB_PUSH(top-3) LJLIB_SET(version_num)
LJLIB_PUSH(top-2) LJLIB_SET(version)
@@ -584,6 +585,7 @@ static void jit_init(lua_State *L)
LUALIB_API int luaopen_jit(lua_State *L)
{
+ lua_pushliteral(L, LJ_OS_NAME);
lua_pushliteral(L, LJ_ARCH_NAME);
lua_pushinteger(L, LUAJIT_VERSION_NUM);
lua_pushliteral(L, LUAJIT_VERSION);