fix JIT compilation issue with the change in ttistable()

gccjit-ravi534
Dibyendu Majumdar 8 years ago
parent 434afa8dd1
commit d6ed6c150f

@ -0,0 +1,5 @@
mkdir llvm32d
cd llvm32d
rem cmake -DCMAKE_INSTALL_PREFIX=\d\ravi32 -G "Visual Studio 14" -DLLVM_JIT=ON -DLLVM_DIR=\d\LLVM37_32\share\llvm\cmake ..
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=\d\ravi32 -G "Visual Studio 14" -DLLVM_JIT=ON -DLLVM_DIR=\d\LLVM39D_32\lib\cmake\llvm -DSTATIC_BUILD=ON ..
cd ..

@ -1,4 +1,5 @@
mkdir llvm64d
cd llvm64d
cmake -DCMAKE_INSTALL_PREFIX=c:\ravi64llvmd -G "Visual Studio 14 Win64" -DLLVM_JIT=ON -DLLVM_DIR=c:\LLVM37debug\share\llvm\cmake ..
rem cmake -DCMAKE_INSTALL_PREFIX=c:\ravi64llvmd -G "Visual Studio 14 Win64" -DLLVM_JIT=ON -DLLVM_DIR=c:\LLVM37debug\share\llvm\cmake ..
cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=c:\d\ravi64llvmd -G "Visual Studio 14 Win64" -DLLVM_JIT=ON -DLLVM_DIR=c:\d\LLVM39D64\lib\cmake\llvm ..
cd ..

@ -771,6 +771,16 @@ class RaviCodeGenerator {
RaviFunctionDef *def, llvm::Value *value_type, LuaTypeCode lua_typecode,
const char *varname = "value.not.typeof");
// Test if value type is NOT of specific Lua type class
// i.e. variants are ignore
// Value_type should have been obtained by emit_load_type()
// The Lua typecode to check must be in lua_typecode
// The return value is a boolean type as a result of
// integer comparison result which is i1 in LLVM
llvm::Value *emit_is_not_value_of_type_class(
RaviFunctionDef *def, llvm::Value *value_type, LuaTypeCode lua_typecode,
const char *varname = "value.not.typeof");
// emit code for (LClosure *)ci->func->value_.gc
llvm::Instruction *emit_gep_ci_func_value_gc_asLClosure(RaviFunctionDef *def);

@ -514,6 +514,15 @@ llvm::Value *RaviCodeGenerator::emit_is_not_value_of_type(
varname);
}
llvm::Value *RaviCodeGenerator::emit_is_not_value_of_type_class(
RaviFunctionDef *def, llvm::Value *value_type, LuaTypeCode lua_type,
const char *varname) {
llvm::Value *novariant_type = def->builder->CreateAnd(value_type, def->types->kInt[0x0F]);
return def->builder->CreateICmpNE(novariant_type, def->types->kInt[int(lua_type)],
varname);
}
llvm::Instruction *RaviCodeGenerator::emit_load_ravi_arraytype(
RaviFunctionDef *def, llvm::Value *value) {
llvm::Value *tt_ptr = emit_gep(def, "raviarray.type_ptr", value, 0, 11, 3);

@ -956,7 +956,7 @@ void RaviCodeGenerator::emit_TOARRAY(RaviFunctionDef *def, int A,
// type != LUA_TTABLE ?
llvm::Value *cmp1 =
emit_is_not_value_of_type(def, type, LUA__TTABLE, "is.not.table");
emit_is_not_value_of_type_class(def, type, LUA__TTABLE, "is.not.table");
llvm::BasicBlock *raise_error = llvm::BasicBlock::Create(
def->jitState->context(), "if.not.table", def->f);

Loading…
Cancel
Save