本文整理汇总了C++中CompiledMethod::scope方法的典型用法代码示例。如果您正苦于以下问题:C++ CompiledMethod::scope方法的具体用法?C++ CompiledMethod::scope怎么用?C++ CompiledMethod::scope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompiledMethod
的用法示例。
在下文中一共展示了CompiledMethod::scope方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rbx_create_block
Object* rbx_create_block(STATE, CallFrame* call_frame, int index) {
Object* _lit = call_frame->cm->literals()->at(state, index);
CompiledMethod* cm = as<CompiledMethod>(_lit);
// TODO: We don't need to be doing this everytime.
if(cm->scope()->nil_p()) {
cm->scope(state, call_frame->static_scope());
}
VMMethod* vmm = call_frame->cm->backend_method();
return BlockEnvironment::under_call_frame(state, cm, vmm,
call_frame, index);
}
示例2:
void CompiledMethod::Info::show(STATE, Object* self, int level) {
CompiledMethod* cm = as<CompiledMethod>(self);
class_header(state, self);
indent_attribute(++level, "file"); cm->file()->show(state, level);
indent_attribute(level, "iseq"); cm->iseq()->show(state, level);
indent_attribute(level, "lines"); cm->lines()->show_simple(state, level);
indent_attribute(level, "literals"); cm->literals()->show_simple(state, level);
indent_attribute(level, "local_count"); cm->local_count()->show(state, level);
indent_attribute(level, "local_names"); cm->local_names()->show_simple(state, level);
indent_attribute(level, "name"); cm->name()->show(state, level);
indent_attribute(level, "required_args"); cm->required_args()->show(state, level);
indent_attribute(level, "scope"); cm->scope()->show(state, level);
indent_attribute(level, "splat"); cm->splat()->show(state, level);
indent_attribute(level, "stack_size"); cm->stack_size()->show(state, level);
indent_attribute(level, "total_args"); cm->total_args()->show(state, level);
#ifdef ENABLE_LLVM
if(cm->backend_method_ && cm->backend_method_->jitted()) {
llvm::outs() << "<LLVM>\n"
<< *cm->backend_method_->llvm_function()
<< "</LLVM>\n<MachineCode>\n";
LLVMState::show_machine_code(
cm->backend_method_->jitted_impl(),
cm->backend_method_->jitted_bytes());
llvm::outs() << "</MachineCode>\n";
}
#endif
close_body(level);
}
示例3:
void CompiledMethod::Info::show(STATE, Object* self, int level) {
CompiledMethod* cm = as<CompiledMethod>(self);
class_header(state, self);
indent_attribute(++level, "file"); cm->file()->show(state, level);
indent_attribute(level, "iseq"); cm->iseq()->show(state, level);
indent_attribute(level, "lines"); cm->lines()->show_simple(state, level);
indent_attribute(level, "literals"); cm->literals()->show_simple(state, level);
indent_attribute(level, "local_count"); cm->local_count()->show(state, level);
indent_attribute(level, "local_names"); cm->local_names()->show_simple(state, level);
indent_attribute(level, "name"); cm->name()->show(state, level);
indent_attribute(level, "required_args"); cm->required_args()->show(state, level);
indent_attribute(level, "scope"); cm->scope()->show(state, level);
indent_attribute(level, "splat"); cm->splat()->show(state, level);
indent_attribute(level, "stack_size"); cm->stack_size()->show(state, level);
indent_attribute(level, "total_args"); cm->total_args()->show(state, level);
indent_attribute(level, "internalized");
if(!cm->backend_method_) {
std::cout << "no\n";
} else {
std::cout << "yes\n";
#ifdef ENABLE_LLVM
VMMethod* v = cm->backend_method();
for(int i = 0; i < VMMethod::cMaxSpecializations; i++) {
if(!v->specializations[i].jit_data) continue;
llvm::Function* func = v->specializations[i].jit_data->llvm_function();
llvm::outs() << "<LLVM>\n"
<< *func
<< "</LLVM>\n<MachineCode>\n";
LLVMState::show_machine_code(
v->specializations[i].jit_data->native_func(),
v->specializations[i].jit_data->native_size());
llvm::outs() << "</MachineCode>\n";
}
#endif
}
close_body(level);
}
示例4: generate_tramp
CompiledMethod* CompiledMethod::generate_tramp(STATE, size_t stack_size) {
CompiledMethod* cm = CompiledMethod::create(state);
cm->stack_size(state, Fixnum::from(stack_size));
cm->required_args(state, Fixnum::from(0));
cm->total_args(state, cm->required_args());
cm->name(state, state->symbol("__halt__"));
cm->iseq(state, InstructionSequence::create(state, 1));
cm->iseq()->opcodes()->put(state, 0, Fixnum::from(InstructionSequence::insn_halt));
StaticScope* ss = StaticScope::create(state);
ss->module(state, G(object));
cm->scope(state, ss);
cm->formalize(state, false);
return cm;
}
示例5:
void CompiledMethod::Info::show(STATE, Object* self, int level) {
CompiledMethod* cm = as<CompiledMethod>(self);
class_header(state, self);
indent_attribute(++level, "exceptions"); cm->exceptions()->show_simple(state, level);
indent_attribute(level, "file"); cm->file()->show(state, level);
indent_attribute(level, "iseq"); cm->iseq()->show(state, level);
indent_attribute(level, "lines"); cm->lines()->show_simple(state, level);
indent_attribute(level, "literals"); cm->literals()->show_simple(state, level);
indent_attribute(level, "local_count"); cm->local_count()->show(state, level);
indent_attribute(level, "local_names"); cm->local_names()->show_simple(state, level);
indent_attribute(level, "name"); cm->name()->show(state, level);
indent_attribute(level, "required_args"); cm->required_args()->show(state, level);
indent_attribute(level, "scope"); cm->scope()->show(state, level);
indent_attribute(level, "splat"); cm->splat()->show(state, level);
indent_attribute(level, "stack_size"); cm->stack_size()->show(state, level);
indent_attribute(level, "total_args"); cm->total_args()->show(state, level);
close_body(level);
}
示例6: static_scope
StaticScope* static_scope() {
if(custom_static_scope_p()) return static_scope_;
return cm->scope();
}