hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
|
#include <jitcc.H>
Classes | |
struct | Constant |
struct | Global |
struct | UCF |
Public Types | |
typedef std::vector< uint8_t > | bytes |
Public Member Functions | |
jitcc () | |
~jitcc () | |
llvm::IRBuilder * | builder () const |
llvm::Module * | module () |
void * | getSymbolAddress (const std::string &) |
void | dump () const |
void | defineGlobal (const std::string &vname, const ExprPtr &unsweetExp) |
void | bindGlobal (const std::string &vn, const MonoTypePtr &ty, void *v) |
bool | isDefined (const std::string &) const |
llvm::Value * | compile (const ExprPtr &exp) |
llvm::Value * | compile (const std::string &vname, const ExprPtr &exp) |
llvm::Value * | compileAtGlobalScope (const ExprPtr &exp) |
llvm::Function * | compileFunction (const std::string &name, const str::seq &argns, const MonoTypes &argtys, const ExprPtr &exp) |
void | compileFunctions (const LetRec::Bindings &, std::vector< llvm::Function *> *result) |
void | compileFunctions (const LetRec::Bindings &) |
llvm::Value * | compileAllocStmt (size_t sz, llvm::Type *mty, bool zeroMem=false) |
llvm::Value * | compileAllocStmt (llvm::Value *sz, llvm::Type *mty, bool zeroMem=false) |
llvm::Function * | allocFunction (const std::string &fname, const MonoTypes &argl, const MonoTypePtr &rty) |
void | pushScope () |
void | bindScope (const std::string &vn, llvm::Value *v) |
void | popScope () |
void * | reifyMachineCodeForFn (const MonoTypePtr &reqTy, const str::seq &names, const MonoTypes &tys, const ExprPtr &exp) |
void | releaseMachineCode (void *) |
void | bindInstruction (const std::string &, op *) |
op * | lookupOp (const std::string &) const |
llvm::Value * | lookupVar (const std::string &, const MonoTypePtr &) |
llvm::Function * | lookupFunction (const std::string &) |
llvm::GlobalVariable * | lookupVarRef (const std::string &) |
llvm::Value * | internConstString (const std::string &) |
bytes | machineCodeForExpr (const ExprPtr &) |
ExprPtr | inlineGlobals (const ExprPtr &) |
Private Types | |
typedef std::vector< llvm::Module * > | Modules |
typedef std::map< std::string, op * > | FuncEnv |
typedef std::map< std::string, llvm::Value * > | VarBindings |
typedef std::vector< VarBindings > | VarBindingStack |
typedef std::vector< UCF > | UCFS |
typedef std::map< std::string, Global > | Globals |
typedef std::map< std::string, Constant > | Constants |
typedef std::unordered_map< std::string, std::string > | InternConstVars |
typedef std::map< std::string, ExprPtr > | GlobalExprs |
Private Member Functions | |
void * | getMachineCode (llvm::Function *, llvm::JITEventListener *listener=0) |
void | unsafeCompileFunctions (UCFS *) |
size_t | pushGlobalRegion () |
void | popGlobalRegion (size_t x) |
llvm::Value * | loadConstant (const std::string &) |
llvm::GlobalVariable * | maybeRefGlobal (const std::string &) |
llvm::GlobalVariable * | refGlobal (const std::string &, llvm::GlobalVariable *) |
llvm::Value * | maybeRefGlobalV (llvm::Value *) |
Private Attributes | |
llvm::Module * | currentModule |
Modules | modules |
llvm::IRBuilder * | irbuilder |
FuncEnv | fenv |
VarBindingStack | vtenv |
bool | ignoreLocalScope |
Globals | globals |
region | globalData |
Constants | constants |
InternConstVars | internConstVars |
GlobalExprs | globalExprs |
typedef std::vector<uint8_t> hobbes::jitcc::bytes |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
hobbes::jitcc::jitcc | ( | ) |
hobbes::jitcc::~jitcc | ( | ) |
llvm::Function * hobbes::jitcc::allocFunction | ( | const std::string & | fname, |
const MonoTypes & | argl, | ||
const MonoTypePtr & | rty | ||
) |
void hobbes::jitcc::bindGlobal | ( | const std::string & | vn, |
const MonoTypePtr & | ty, | ||
void * | v | ||
) |
void hobbes::jitcc::bindInstruction | ( | const std::string & | vn, |
op * | f | ||
) |
void hobbes::jitcc::bindScope | ( | const std::string & | vn, |
llvm::Value * | v | ||
) |
llvm::IRBuilder * hobbes::jitcc::builder | ( | ) | const |
llvm::Value * hobbes::jitcc::compile | ( | const ExprPtr & | exp | ) |
llvm::Value * hobbes::jitcc::compile | ( | const std::string & | vname, |
const ExprPtr & | exp | ||
) |
llvm::Value * hobbes::jitcc::compileAllocStmt | ( | size_t | sz, |
llvm::Type * | mty, | ||
bool | zeroMem = false |
||
) |
llvm::Value * hobbes::jitcc::compileAllocStmt | ( | llvm::Value * | sz, |
llvm::Type * | mty, | ||
bool | zeroMem = false |
||
) |
llvm::Value * hobbes::jitcc::compileAtGlobalScope | ( | const ExprPtr & | exp | ) |
llvm::Function * hobbes::jitcc::compileFunction | ( | const std::string & | name, |
const str::seq & | argns, | ||
const MonoTypes & | argtys, | ||
const ExprPtr & | exp | ||
) |
void hobbes::jitcc::compileFunctions | ( | const LetRec::Bindings & | bs, |
std::vector< llvm::Function *> * | result | ||
) |
void hobbes::jitcc::compileFunctions | ( | const LetRec::Bindings & | bs | ) |
void hobbes::jitcc::defineGlobal | ( | const std::string & | vname, |
const ExprPtr & | unsweetExp | ||
) |
void hobbes::jitcc::dump | ( | ) | const |
|
private |
void * hobbes::jitcc::getSymbolAddress | ( | const std::string & | vn | ) |
llvm::Value * hobbes::jitcc::internConstString | ( | const std::string & | x | ) |
bool hobbes::jitcc::isDefined | ( | const std::string & | vn | ) | const |
|
private |
llvm::Function * hobbes::jitcc::lookupFunction | ( | const std::string & | fn | ) |
op * hobbes::jitcc::lookupOp | ( | const std::string & | vn | ) | const |
llvm::Value * hobbes::jitcc::lookupVar | ( | const std::string & | vn, |
const MonoTypePtr & | vty | ||
) |
llvm::GlobalVariable * hobbes::jitcc::lookupVarRef | ( | const std::string & | vn | ) |
jitcc::bytes hobbes::jitcc::machineCodeForExpr | ( | const ExprPtr & | e | ) |
|
private |
|
private |
llvm::Module * hobbes::jitcc::module | ( | ) |
|
private |
void hobbes::jitcc::popScope | ( | ) |
|
private |
void hobbes::jitcc::pushScope | ( | ) |
|
private |
void * hobbes::jitcc::reifyMachineCodeForFn | ( | const MonoTypePtr & | reqTy, |
const str::seq & | names, | ||
const MonoTypes & | tys, | ||
const ExprPtr & | exp | ||
) |
void hobbes::jitcc::releaseMachineCode | ( | void * | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |