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


C++ Transport::obj方法代码示例

本文整理汇总了C++中Transport::obj方法的典型用法代码示例。如果您正苦于以下问题:C++ Transport::obj方法的具体用法?C++ Transport::obj怎么用?C++ Transport::obj使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Transport的用法示例。


在下文中一共展示了Transport::obj方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: create_event_request

void VMEvent::create_event_request(PacketInputStream *in, 
                                   PacketOutputStream *out, jbyte event_kind)
{

  UsingFastOops fast_oops;
  VMEvent::Fast ep;
  int i;
  bool error = false;
  VMEventModifier::Fast current_modifier_slot, new_modifier, event_modifier;
 
  ep = create_vm_event_request();
    
  ep().set_event_kind(event_kind);
  ep().set_suspend_policy(in->read_byte());
  ep().set_num_modifiers(in->read_int());
  Transport *transport = in->transport();
  ep().set_transport(transport);
#if ENABLE_ISOLATES
  ep().set_task_id(transport->task_id());
  TaskGCContext tmp(transport->task_id());
#endif
  for (i=0; i < ep().num_modifiers(); i++) {

    new_modifier = VMEventModifier::new_modifier(in, out, error);

    if (error) {
      // some sort of error happened
      if (out->error() != 0) {
        out->send_packet();
      }
      return;
    }
    if (new_modifier.is_null()) {
      // Most likely we don't support this modifier
      continue;
    }
    if (event_kind == JDWP_EventKind_BREAKPOINT &&
        new_modifier().mod_kind() ==
        JDWP_EventRequest_Set_Out_modifiers_Modifier_LocationOnly) {
      UsingFastOops fastoops2;
      LocationModifier *lmp = (LocationModifier *)&new_modifier;
      VMEvent::Fast epb = VMEvent::find_breakpoint_event(lmp,
                                                         transport->task_id());
      if (epb.not_null()) {
        out->write_int(epb().event_id());
        out->send_packet();
        //        out->send_error(JDWP_Error_NOT_IMPLEMENTED);
        // there's a breakpoint here already, don't bother installing another
        return;
      }
#if ENABLE_ISOLATES
      InstanceClass::Raw ic = JavaDebugger::get_object_by_id(new_modifier().clazz_id());
      if (ic().class_id() < ROM::number_of_system_classes()) {
        // breakpoint in system class, allow in any task
        ep().set_task_id(-1);
      }
      // See if any other task already has a breakpoint here.
      epb = find_breakpoint_event(lmp);
      if (!epb.is_null()) {
        // Has to be some other task since we haven't linked in this event
        GUARANTEE(epb().task_id() != transport->task_id(),
                  "Breakpoint already inserted");
        LocationModifier::Raw lmod = get_modifier(&epb,
                   JDWP_EventRequest_Set_Out_modifiers_Modifier_LocationOnly);
        GUARANTEE(!lmod.is_null(),"Breakpoint event has no location modifier");
        lmp->set_save_opcode(lmod().save_opcode());
      } else {
#endif
        /* Return an error back to the debugger if 
         * the breakpoint could not be installed.
         */
        lmp->unlink_method();
        lmp->save_method_entry();
        if (lmp->set_method_opcode(Bytecodes::_breakpoint, true) ==
            false){
          out->send_error(JDWP_Error_INVALID_LOCATION);
          return;
        }
#if ENABLE_ISOLATES
      }
#endif
    }
    // insert the mod at the end of the list of modifiers
    event_modifier = ep().mods();
    if (event_modifier.is_null()) {
      ep().set_mods(&new_modifier);
      current_modifier_slot = ep().mods();
    } else {
      current_modifier_slot().set_next(&new_modifier);
      current_modifier_slot = new_modifier;
    }
  }
#ifdef AZZERT
  if (TraceDebugger) {
    tty->print_cr("Create Event: xprt = 0x%x, ep = 0x%lx, id = 0x%x, kind = 0x%lx, suspend = 0x%lx, num mods = 0x%lx",
                  transport->obj(),
                  ep.obj(), 
                  ep().event_id(),
                  ep().event_kind(), 
                  ep().suspend_policy(), 
//.........这里部分代码省略.........
开发者ID:jiangxilong,项目名称:yari,代码行数:101,代码来源:VMEvent.cpp


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