本文整理汇总了C++中BackgroundCompileRequest::vmmethod方法的典型用法代码示例。如果您正苦于以下问题:C++ BackgroundCompileRequest::vmmethod方法的具体用法?C++ BackgroundCompileRequest::vmmethod怎么用?C++ BackgroundCompileRequest::vmmethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BackgroundCompileRequest
的用法示例。
在下文中一共展示了BackgroundCompileRequest::vmmethod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: perform
//.........这里部分代码省略.........
// running while we're building the IR.
ls_->shared().gc_dependent(ls_);
// mutex now unlock, allowing others to push more requests
//
current_req_ = req;
jit::Compiler jit(ls_);
current_compiler_ = &jit;
int spec_id = 0;
if(Class* cls = req->receiver_class()) {
spec_id = cls->class_id();
}
void* func = 0;
{
timer::Running<1000000> timer(ls_->shared().stats.jit_time_spent);
jit.compile(ls_, req);
func = jit.generate_function(ls_);
}
// We were unable to compile this function, likely
// because it's got something we don't support.
if(!func) {
if(ls_->config().jit_show_compiling) {
llvm::outs() << "[[[ JIT error in background compiling ]]]\n";
}
// If someone was waiting on this, wake them up.
if(thread::Condition* cond = req->waiter()) {
cond->signal();
}
current_req_ = 0;
current_compiler_ = 0;
pending_requests_.pop_front();
delete req;
// We don't depend on the GC here, so let it run independent
// of us.
ls_->shared().gc_independent(ls_);
continue;
}
if(show_machine_code_) {
jit.show_machine_code();
}
// If the method has had jit'ing request disabled since we started
// JIT'ing it, discard our work.
if(!req->vmmethod()->jit_disabled()) {
jit::RuntimeDataHolder* rd = jit.context().runtime_data_holder();
ls_->start_method_update();
if(!req->is_block()) {
if(spec_id) {
req->method()->add_specialized(spec_id, reinterpret_cast<executor>(func), rd);
} else {
req->method()->set_unspecialized(reinterpret_cast<executor>(func), rd);
}
} else {
req->method()->set_unspecialized(reinterpret_cast<executor>(func), rd);
}
assert(req->method()->jit_data());
ls_->end_method_update();
rd->run_write_barrier(ls_->write_barrier(), req->method());
ls_->shared().stats.jitted_methods++;
if(ls_->config().jit_show_compiling) {
llvm::outs() << "[[[ JIT finished background compiling "
<< (req->is_block() ? " (block)" : " (method)")
<< " ]]]\n";
}
}
// If someone was waiting on this, wake them up.
if(thread::Condition* cond = req->waiter()) {
cond->signal();
}
current_req_ = 0;
current_compiler_ = 0;
pending_requests_.pop_front();
delete req;
// We don't depend on the GC here, so let it run independent
// of us.
ls_->shared().gc_independent(ls_);
}
}