void Compiler::compile_method(LLVMState* ls, BackgroundCompileRequest* req) { CompiledCode* cm = req->method(); if(ls->config().jit_inline_debug) { struct timeval tv; gettimeofday(&tv, NULL); ls->log() << "JIT: compiling " << ls->enclosure_name(cm) << "#" << ls->symbol_debug_str(cm->name()) << " (" << tv.tv_sec << "." << tv.tv_usec << ")\n"; } JITMethodInfo info(ctx_, cm, cm->backend_method()); info.is_block = false; if(Class* cls = req->receiver_class()) { info.set_self_class(cls); } ctx_.set_root(&info); jit::MethodBuilder work(ls, info); work.setup(); compile_builder(ctx_, ls, info, work); ctx_.set_root(NULL); }
void calculate_ip(void** pos) { ip_ = pos - cm->backend_method()->addresses; }