当前位置: 首页>>代码示例>>C++>>正文


C++ CompiledMethod::scope方法代码示例

本文整理汇总了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);
  }
开发者ID:jefflembeck,项目名称:rubinius,代码行数:13,代码来源:jit_util.cpp

示例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);
  }
开发者ID:rdp,项目名称:rubinius,代码行数:31,代码来源:compiledmethod.cpp

示例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);
  }
开发者ID:Gonzih,项目名称:rubinius,代码行数:45,代码来源:compiledmethod.cpp

示例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;
  }
开发者ID:soaexpert,项目名称:rubinius,代码行数:19,代码来源:compiledmethod.cpp

示例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);
  }
开发者ID:soaexpert,项目名称:rubinius,代码行数:19,代码来源:compiledmethod.cpp

示例6: static_scope

 StaticScope* static_scope() {
   if(custom_static_scope_p()) return static_scope_;
   return cm->scope();
 }
开发者ID:vasco,项目名称:rubinius,代码行数:4,代码来源:call_frame.hpp


注:本文中的CompiledMethod::scope方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。