• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GUARANTEE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GUARANTEE函数的典型用法代码示例。如果您正苦于以下问题:C++ GUARANTEE函数的具体用法?C++ GUARANTEE怎么用?C++ GUARANTEE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: base_offset

void MemoryAddress::prepare_preindexed_address(jint address_offset,
                                               Assembler::Register& reg,
                                               jint& offset){
  offset = 0;

  if (!has_address_register()) {
    // Try to do direct access
    jint fixed_offset;
    if (has_fixed_offset(fixed_offset)) {
      offset = fixed_offset + base_offset() + address_offset;
      reg = fixed_register();
      return;
    }
    create_and_initialize_address_register();
  }

  GUARANTEE(has_address_register(), "We must have address register by now");

  reg = address_register();

  int xbase_offset =            // base_offset or 0
    address_register_includes_base_offset() ? 0 : base_offset();
  if (address_offset == 0 && xbase_offset != 0) {
    // Update the address_register so that it includes the base_offset
    set_address_register_includes_base_offset();
    code_generator()->add(address_register(), address_register(), xbase_offset);
    offset = 0;
  } else {
    offset = (address_offset + xbase_offset);
  }
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:31,代码来源:Addressing_thumb2.cpp


示例2: check_virtual

  void check_virtual(int index JVM_TRAPS) {
    UsingFastOops level1;
    ConstantPool::Fast cp = method()->constants();
    InstanceClass::Fast klass;
    ClassInfo::Fast info;
    Method::Fast m;

    if (cp().tag_at(index).is_resolved_virtual_method()) {
      int class_id, vtable_index;
      cp().resolved_virtual_method_at(index, vtable_index, class_id);
      klass = Universe::class_from_id(class_id);
      info = klass().class_info();
      m = info().vtable_method_at(vtable_index);

      _owner->add_method(&m JVM_NO_CHECK_AT_BOTTOM);
    } else {
      // This could be an element we failed to resolve 
      // when ROMizing an application.
      if (!PostponeErrorsUntilRuntime) {
        SHOULD_NOT_REACH_HERE();
      } else {
        //The following GUARANTEE could trigger if the class is a bogus
        // TCK class and we want to postpone the error until runtime so
        // we have commented it out.
        // GUARANTEE(cp.tag_at(index).is_method(), "Sanity");
        // The class must be marked as unverified or non-optimizable, 
        // since it contains an unresolved entry at this point.
#ifdef AZZERT
        klass = method()->holder();
        GUARANTEE(!klass().is_verified() || !klass().is_optimizable(), "Sanity");
#endif
      }
    }
  }
开发者ID:hbao,项目名称:phonemefeaturedevices,代码行数:34,代码来源:MethodInvocationClosure.cpp


示例3: getClass

CLASS getClass(const char *name) {
  GUARANTEE(_in_kvm_native_method, "sanity");

  OopDesc *mirror_obj = NULL;
  KNI_FindClass(name, (jclass)&mirror_obj);
  return mirror_obj;
}
开发者ID:jiangxilong,项目名称:yari,代码行数:7,代码来源:kvmcompat.cpp


示例4: offset_from_checked_index

jint ConstantPool::name_and_type_at(int index JVM_TRAPS) const {
  int offset = offset_from_checked_index(index JVM_ZCHECK_0(offset));
  cp_check_0(ConstantTag::is_name_and_type(tag_value_at(index)));
  int result = int_field(offset);
  GUARANTEE(result != 0, "sanity for JVM_ZCHECK");
  return result;
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:7,代码来源:ConstantPool.cpp


示例5: do_oop

void Thread::stack_oops_do(void do_oop(OopDesc**)) {
  if (this->task_id() == Task::INVALID_TASK_ID) {
    // If we continue we'll break JVMTaskGCContext with a -1 task id
    GUARANTEE(!last_java_frame_exists(), "thread is already dead");
    return;
  }

  // See Scheduler.cpp threads_do_list() for the
  // reason why we do this.
  const TaskGCContext tmp(this->task_id());

  // Java frames
  if (last_java_frame_exists()) {
    Frame fr(this);
    while (true) {
      if (fr.is_entry_frame()) {
        fr.as_EntryFrame().oops_do(do_oop);
        if (fr.as_EntryFrame().is_first_frame()) {
          break;
        }
        fr.as_EntryFrame().caller_is(fr);
      } else {
        fr.as_JavaFrame().oops_do(do_oop);
        fr.as_JavaFrame().caller_is(fr);
      }
    }
  }
}
开发者ID:hbao,项目名称:phonemefeaturedevices,代码行数:28,代码来源:Thread.cpp


示例6: KNI_GetThisPointer

KNIEXPORT void KNI_GetThisPointer(jobject toHandle) {
  GUARANTEE(!_in_kvm_native_method, "sanity");
#ifdef AZZERT
  if (!_jvm_in_quick_native_method) {
    if (!ObjectHeap::is_finalizing()) {
      JavaFrame frame(Thread::current());
      Method::Raw method = frame.method();
      GUARANTEE(!method().is_static(), "static method has no 'this' pointer");
    }
  } else {
    // IMPL_NOTE: we don't have current method info ... this should be fixed to
    // make it possible to do the GUARANTEE as above.
  }
#endif
  KNI_GetParameterAsObject(0, toHandle);
}
开发者ID:hbao,项目名称:phonemefeaturedevices,代码行数:16,代码来源:kni.cpp


示例7: print_comment_for

void CompiledMethod::print_code_on(Stream* st) {
  int end_offset = RelocationReader::code_length(this);
  for (int offset = 0; offset < end_offset; offset += 2) { 
    short* instruction_start = (short*) (entry() + offset);

    print_comment_for(offset, st);

    bool is_oop = false;
    for (RelocationReader stream(this); !stream.at_end(); stream.advance()) {
      if (stream.code_offset() == offset) { 
        if (stream.is_oop() || stream.is_rom_oop()) { 
          is_oop = true;
          break;
        }
      }
    }
    st->print(" %4d: ", offset);
    if (VerbosePointers) {
      st->print("0x%08x: ", instruction_start);
    }
    if (!is_oop) { 
      decode_instruction(st, instruction_start, offset);
    } else { 
      GUARANTEE(((int)instruction_start & 0x3) == 0, 
                "Disassembler: Invalid embedded Oop");
      Oop o = (OopDesc*)*(int*)instruction_start;
      if (VerbosePointers) {
        st->print("0x%08x:", *(int*)instruction_start);
      }
      o.print_value_on(st);
      offset += 2;
    }
    st->cr();
  }
}
开发者ID:jiangxilong,项目名称:yari,代码行数:35,代码来源:CompiledMethod_thumb.cpp


示例8: GUARANTEE

void Value::set_double(jdouble value) {
  GUARANTEE(type() == T_DOUBLE, "check type");
  destroy();
  set_where(T_IMMEDIATE);
  *(double *)(&_low) = value;

}
开发者ID:jiangxilong,项目名称:yari,代码行数:7,代码来源:Value.cpp


示例9: ForAllHandles

/* 
 * Verifies that this oop is a unique handle to its obj, i.e. no other Oop on
 * the chain refences its obj.
 */
void LinkedBasicOop::handle_uniqueness_verification() {
  if (not_null()) {
    ForAllHandles( handle ) {
      GUARANTEE(handle == this || handle->obj() != obj(), "Non-unique handle");
    }
  }
}
开发者ID:sfsy1989,项目名称:j2me,代码行数:11,代码来源:Oop.cpp


示例10: is_value

void ExtendedValue::set_obj(Oop* value) {
  if (value->is_null()) {
    is_value(T_OBJECT);
    this->value().set_obj(value);
  } else {
    // IMPL_NOTE:  Can we merge the code below with Value::set_value() ??
    set_oop(value);
    if (!ObjectHeap::contains_moveable(value->obj())) {
      _value.set_not_on_heap();
    }
#if ENABLE_COMPILER_TYPE_INFO
    FarClass::Raw value_class = value->blueprint();
    GUARANTEE(value_class.not_null(), "Sanity");
    if (value_class.is_java_class()) {
      JavaClass::Raw java_class = value_class.obj();
      _value.set_class_id(java_class().class_id());
      _value.set_is_exact_type();
    }
#else
    if (value->is_string()) {
      _value.set_is_string();
    }
#endif
    _value.set_must_be_nonnull();
  }
}
开发者ID:jiangxilong,项目名称:yari,代码行数:26,代码来源:Value.cpp


示例11: destroy

void Value::set_registers(Assembler::Register low, Assembler::Register high) {
  destroy();
  GUARANTEE(use_two_registers(), "tag_check");
  set_where(T_REGISTER);
  _low  = (int) low;
  _high = (int) high;
}
开发者ID:jiangxilong,项目名称:yari,代码行数:7,代码来源:Value.cpp


示例12: byte_size_for

int byte_size_for(BasicType type) {
  static const jubyte table[] = {
    /* unused      =  0: */ 0,
    /* unused      =  1: */ 0,
    /* unused      =  2: */ 0,
    /* unused      =  3: */ 0,
    /* T_BOOLEAN   =  4: */ T_BOOLEAN_byte_size,
    /* T_CHAR      =  5: */ T_CHAR_byte_size,
    /* T_FLOAT     =  6: */ T_FLOAT_byte_size,
    /* T_DOUBLE    =  7: */ T_DOUBLE_byte_size,
    /* T_BYTE      =  8: */ T_BYTE_byte_size,
    /* T_SHORT     =  9: */ T_SHORT_byte_size,
    /* T_INT       = 10: */ T_INT_byte_size,
    /* T_LONG      = 11: */ T_LONG_byte_size,
    /* T_OBJECT    = 12: */ T_OBJECT_byte_size,
    /* T_ARRAY     = 13: */ T_OBJECT_byte_size,
    /* T_VOID      = 14: */ T_VOID_byte_size,
#if ENABLE_ROM_GENERATOR
    /* T_SYMBOLIC  = 15: */ T_SYMBOLIC_byte_size,
#endif
  };

#ifdef AZZERT
#if ENABLE_ROM_GENERATOR
  const int max = T_SYMBOLIC;
#else
  const int max = T_VOID;
#endif
  GUARANTEE(type >= T_BOOLEAN && type <= max, "sanity");
#endif

  return table[(int)type];
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:33,代码来源:GlobalDefinitions.cpp


示例13: GUARANTEE

void GPTableGenerator::define_zeros(int size) {
  if (!GenerateGPTableOnly) {
    SourceMacros::define_zeros(size);
  } else {
    if (GenerateGNUCode) {
#ifdef SPARC
      GUARANTEE((size % 4) == 0, "sanity");
      for (int i=0; i<size; i+=4) {
        stream()->print_cr("\t.long\t0");
      }
#else
      stream()->print_cr("\t%s\t%d", ".space", size);
#endif
    } else {
      // generating the GP table on Win32 for MASM
      if ((size % 4) == 0) {
        for (int i=0; i<size; i+=4) {
          stream()->print_cr("\tDWORD 0; %d bytes", i+4);
        }
      } else {
        // We support only define_zero of bytes divisible by 4!
        UNIMPLEMENTED();
      }
    }
  }
}
开发者ID:Sektor,项目名称:phoneme-qtopia,代码行数:26,代码来源:GPTableGenerator_arm.cpp


示例14: OsMemory_adjust_chunk

// Expand or shrink a chunk returned by allocate_chunk().
// The chunk is never moved.
//
// Returns 0 if fail to expand (shrink will always succeed). Returns old
// size if successful.
size_t OsMemory_adjust_chunk(address chunk_ptr, size_t new_committed_size) {
  ChunkInfo* ci = get_chunk_info(chunk_ptr);

  size_t old_size = ci->size;
  size_t new_size = page_align_up(new_committed_size);

  if (new_size <= ci->mmaped_size) {
    int rv;
    if (new_size < old_size) {
      rv = protect_area(chunk_ptr + new_size, old_size - new_size);
    } else {
      rv = unprotect_area(chunk_ptr, new_size);
    }
    GUARANTEE(rv == 0, "mprotect must succeed");

    ci->size = new_size;

    return old_size;
  }

  new_size = page_align_up(new_size - ci->mmaped_size);
  if (anon_mmap(chunk_ptr + ci->mmaped_size, new_size) == NULL) {
    return 0;
  }

  ci->mmaped_size += new_size; 
  ci->size = ci->mmaped_size;
  unprotect_area(chunk_ptr, ci->size);
  
  return old_size;
}
开发者ID:jiangxilong,项目名称:yari,代码行数:36,代码来源:OsMemory_linux.cpp


示例15: sizeof

int SourceAssembler::find_gp_offset(const char *name) {
#if !ENABLE_THUMB_GP_TABLE
  int offset = 256 * sizeof(OopDesc*); // skip the bytecode table
  if (ENABLE_DISPATCH_TABLE_PADDING) {
    offset += 8 * sizeof(OopDesc*);    // 8 extra bytecodes.
  }
#else
  int offset = 1 * sizeof(OopDesc*); // skip the nop bytecode
#endif

  static const GPTemplate gp_templates[] = {
    GP_SYMBOLS_DO(DEFINE_GP_POINTER, DEFINE_GP_VALUE)
    {NULL, 0, 0, 0}
  };

  for (const GPTemplate* tmpl = gp_templates; tmpl->name; tmpl++) {
    if (jvm_strcmp(name, tmpl->name) == 0) {
      return offset;
    }
    offset += tmpl->size;
    GUARANTEE((offset % 4) == 0, "must be word aligned");
  }

  SHOULD_NOT_REACH_HERE();
  return 0;
}
开发者ID:sfsy1989,项目名称:j2me,代码行数:26,代码来源:SourceAssembler_arm.cpp


示例16: blueprint

bool OopDesc::is_type_array(void) const { 
  const jint instance_size = blueprint()->instance_size_as_jint();
  GUARANTEE(InstanceSize::size_type_array_8 < InstanceSize::size_type_array_1, 
            "sanity check");
  return instance_size >= InstanceSize::size_type_array_8
      && instance_size <= InstanceSize::size_type_array_1;
}
开发者ID:sfsy1989,项目名称:j2me,代码行数:7,代码来源:OopDesc.inline.hpp


示例17: itable_interface_at_put

  void itable_interface_at_put(int index, int class_id) {
#ifdef AZZERT
    Oop cls = Universe::class_from_id(class_id);
    GUARANTEE(!cls.is_null(), "sanity");
#endif
    int_field_put(itable_offset_from_index(index), class_id);
  }
开发者ID:jiangxilong,项目名称:yari,代码行数:7,代码来源:ClassInfo.hpp


示例18: check_imm

  static void check_imm(int imm, int size) {
    if(!has_room_for_imm(imm, size)) {
       tty->print_cr("size %d too big for %d bits", imm, size);

    }
    GUARANTEE(has_room_for_imm(imm, size), "illegal immediate value");
  }
开发者ID:jiangxilong,项目名称:yari,代码行数:7,代码来源:Assembler_arm.hpp


示例19: GUARANTEE

// This function fixes the dummy object allocated by FileDescriptor::allocate()
// before the Universe was fully initialized.
void JarFileParser::fix_bootstrap() {
  const int max = MAX_CACHED_PARSERS < MaxCachedJarParsers ?
                  MAX_CACHED_PARSERS : MaxCachedJarParsers;

  for (int i=0; i<max; i++) {
    int ref = _cached_parsers[0];
    if (ref >= 0) {
      JarFileParser::Raw parser = ObjectHeap::get_global_ref_object(ref);
      GUARANTEE(parser.not_null(), "must not be GC'ed yet!");
      OopDesc** desc = (OopDesc**)parser().file_descriptor();
      OopDesc* n = Universe::file_descriptor_class()->prototypical_near();

      // Make it a real FileDescriptor object.
      oop_write_barrier(desc, n);

      // This line tests that n is now really a FileDescriptor.
      FileDescriptor::Raw try_it = parser().file_descriptor();
      (void)try_it;
    }
  }

  // We still haven't put the fixed up FileDescriptor into the list of
  // finalizable objects yet. It's easier just to flush the cache now
  // and close the FileDescriptors now ... this code is used only in
  // non-product mode, so there's no need to make it fancy.
  flush_caches();
}
开发者ID:hbao,项目名称:phonemefeaturedevices,代码行数:29,代码来源:JarFileParser.cpp


示例20: while

// this is method of the great fun: we update list of thread stacks 
// with value in old_stack, by replacing pointers to old_stack
// with pointers to new_stack and also fixing new_stack->_next_stack
// to actually point where it should point to
void ExecutionStackDesc::update_list(ExecutionStackDesc* old_stack,
				     ExecutionStackDesc* old_stack_next,
				     ExecutionStackDesc* new_stack) {
  ExecutionStackDesc *this_stack = _stack_list;

  // if replacing list head - give it a special treatment
  if (old_stack == _stack_list) {
    _stack_list = new_stack;
    new_stack->_next_stack = old_stack_next;
    return;
  }
  
  // find element just before one we want to replace and patch here
  while (this_stack != NULL) {
    ExecutionStackDesc *next_stack = this_stack->_next_stack;

    if (next_stack == old_stack) {      
      this_stack->_next_stack = new_stack;
      new_stack->_next_stack = old_stack_next;
      break;
    }
    this_stack = next_stack;
  }
  
  GUARANTEE(new_stack->_next_stack == old_stack_next, "must be updated");
}
开发者ID:jiangxilong,项目名称:yari,代码行数:30,代码来源:ExecutionStackDesc.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GUIDEMO_Delay函数代码示例发布时间:2022-05-30
下一篇:
C++ GT_setFailureReason函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap