gccjit-ravi534
Dibyendu Majumdar 8 years ago
parent 80feef445e
commit 2fcea1cce2

@ -277,11 +277,12 @@ if (NOT LLVM_JIT AND NOT GCC_JIT)
target_link_libraries(ravidebug libravistatic)
set(RAVI_DEBUGGER_TARGET ravidebug)
set(RAVI_STATIC_LIBRARY_TARGET libravistatic)
endif()
install(FILES ${LUA_HEADERS}
DESTINATION include/ravi)
install(TARGETS libravi ravi ${RAVI_DEBUGGER_TARGET}
install(TARGETS libravi ravi ${RAVI_DEBUGGER_TARGET} ${RAVI_STATIC_LIBRARY_TARGET}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)

@ -249,6 +249,7 @@ struct LuaLLVMTypes {
llvm::FunctionType *luaV_executeT;
llvm::FunctionType *luaV_gettableT;
llvm::FunctionType *luaV_settableT;
llvm::FunctionType *luaV_finishgetT;
// Following are functions that handle specific bytecodes
// We cheat for these bytecodes by calling the function that
@ -619,6 +620,7 @@ struct RaviFunctionDef {
llvm::Function *luaH_getstrF;
llvm::Function *luaH_getintF;
llvm::Function *luaH_setintF;
llvm::Function *luaV_finishgetF;
// Some cheats - these correspond to OPCODEs that
// are not inlined as of now

@ -1205,6 +1205,7 @@ function event_test()
end
event_test();
compile(event_test)
--ravi.dumpllvm(event_test)
event_test();
print 'Test 51 OK'

@ -1099,6 +1099,9 @@ void RaviCodeGenerator::emit_extern_declarations(RaviFunctionDef *def) {
def->luaH_getstrF = def->raviF->addExternFunction(
def->types->luaH_getstrT, reinterpret_cast<void *>(&luaH_getstr),
"luaH_getstr");
def->luaV_finishgetF = def->raviF->addExternFunction(
def->types->luaV_finishgetT, reinterpret_cast<void *>(&luaV_finishget),
"luaV_finishget");
def->raviV_op_loadnilF = def->raviF->addExternFunction(
def->types->raviV_op_loadnilT,

@ -218,7 +218,8 @@ void RaviCodeGenerator::emit_finish_GETTABLE(RaviFunctionDef *def, llvm::Value *
// If value is nil Lua requires that an index event be
// generated - so we fall back on slow path for that
CreateCall4(def->builder, def->raviV_finishgetF, def->L, rb, rc, ra);
//CreateCall4(def->builder, def->raviV_finishgetF, def->L, rb, rc, ra);
CreateCall5(def->builder, def->luaV_finishgetF, def->L, rb, rc, ra, phi);
def->builder->CreateBr(if_end_block);
// Merge results from the two branches above

@ -800,6 +800,11 @@ LuaLLVMTypes::LuaLLVMTypes(llvm::LLVMContext &context) : mdbuilder(context) {
// void raviV_finishget(lua_State *L, const TValue *t, TValue *key, StkId val);
raviV_finishgetT =
llvm::FunctionType::get(llvm::Type::getVoidTy(context), elements, false);
// void luaV_finishget (lua_State *L, const TValue *t, TValue *key,
// StkId val, const TValue *slot);
elements.push_back(pTValueT);
luaV_finishgetT =
llvm::FunctionType::get(llvm::Type::getVoidTy(context), elements, false);
// void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
// StkId res, TMS event);

Loading…
Cancel
Save