Dibyendu Majumdar 4 years ago
parent 4e445f46bf
commit 2e748fcefc

@ -12,7 +12,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
# By default JIT is OFF
option(LLVM_JIT "Controls whether LLVM JIT compilation will be enabled, default is OFF" OFF)
option(OMR_JIT "Controls whether NanoJIT compilation will be enabled, default is OFF" OFF)
option(MIR_JIT "Controls whether MIR JIT compilation will be enabled, default is OFF" ON)
option(MIR_JIT "Controls whether MIR JIT compilation will be enabled, default is OFF" OFF)
option(STATIC_BUILD "Build static version of Ravi, default is OFF" OFF)
option(COMPUTED_GOTO "Controls whether the interpreter switch will use computed gotos on gcc/clang, default is ON" ON)
option(ASM_VM "Controls whether to use the new VM (not ready yet! so don't turn on)" OFF)
@ -29,8 +29,12 @@ if (LLVM_JIT OR OMR_JIT OR MIR_JIT)
endif ()
if (MIR_JIT)
if (MSVC OR WIN32)
message(FATAL_ERROR "MIR_JIT is not supported when using MSVC and/or WIN32")
endif()
set(LLVM_JIT OFF)
set(OMR_JIT OFF)
set(STATIC_BUILD ON)
endif()
if (ASM_VM)
@ -81,10 +85,6 @@ if (COMPUTED_GOTO AND MSVC)
message(WARNING "Computed goto is not available with MSVC")
endif ()
if (NOT LLVM_JIT AND NOT OMR_JIT)
message(WARNING "LLVM will not be enabled; specify -DLLVM_JIT=ON to enable")
endif ()
if (MSVC)
set(CMAKE_C_FLAGS_DEBUG "/Od /D_DEBUG /MDd /Zi /RTC1 /EHsc")
set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /MD /EHsc")
@ -380,6 +380,8 @@ endif ()
if (NOT STATIC_BUILD)
set(LIBRAVI_BUILD_TYPE SHARED)
else()
set(LIBRAVI_BUILD_TYPE STATIC)
endif ()
if (LLVM_JIT)
@ -388,7 +390,6 @@ elseif (OMR_JIT)
set(LIBRAVI_NAME libravilomr)
elseif (MIR_JIT)
set(LIBRAVI_NAME libravimir)
set(LIBRAVI_BUILD_TYPE STATIC)
else ()
set(LIBRAVI_NAME libravinojit)
endif ()
@ -436,6 +437,12 @@ add_executable(ravi src/lua.c)
if (LLVM_JIT)
set_target_properties(ravi PROPERTIES COMPILE_DEFINITIONS "USE_LLVM=1")
endif ()
if (OMR_JIT)
set_target_properties(ravi PROPERTIES COMPILE_DEFINITIONS "USE_OMRJIT=1")
endif ()
if (MIR_JIT)
set_target_properties(ravi PROPERTIES COMPILE_DEFINITIONS "USE_MIRJIT=1")
endif ()
if (EMBEDDED_DMRC)
set_target_properties(ravi PROPERTIES COMPILE_DEFINITIONS "USE_DMR_C=1")
endif ()

@ -50,6 +50,8 @@
#define RAVI_OPTION_STRING3 " LLVM-" LLVM_VERSION_STRING " ORC=" ravi_xstringify(USE_ORC_JIT) " v2=" ravi_xstringify(USE_ORCv2_JIT)
#elif USE_OMRJIT
#define RAVI_OPTION_STRING3 " omrjit"
#elif USE_MIRJIT
#define RAVI_OPTION_STRING3 " mirjit"
#else
#define RAVI_OPTION_STRING3 " nojit"
#endif

@ -93,6 +93,8 @@ static int ravi_compile_n(lua_State *L) {
}
ravi_compile_options_t options = {0, 0, 0, RAVI_CODEGEN_NONE};
options.manual_request = 1;
options.inline_lua_arithmetic_operators = 1;
options.omit_array_get_range_check = 1;
if (lua_istable(L, 2)) {
lua_Integer ival;
l_table_get_integer(L, 2, "omitArrayGetRangeCheck",

Loading…
Cancel
Save