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


C++ oop::is_string方法代码示例

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


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

示例1: switch_pointers

void stringTable::switch_pointers(oop from, oop to) {
  if (! from->is_string()) return;
  assert(to->is_string(),
         "cannot replace a string with a non-string");

  findSlotCache.clear();
  stringTableEntry* e;
  FOR_ALL_ENTRIES(e) {
    stringOop* addr;
    FOR_ALL_STRING_ADDR(e, addr, SWITCH_POINTERS_TEMPLATE(addr));
  }
}
开发者ID:AaronNGray,项目名称:self,代码行数:12,代码来源:stringTable.cpp

示例2: change_slot

oop slotsMap::change_slot(oop obj,
                          slotDesc* slot,
                          slotType type, 
                          oop contents,
                          oop anno,
                          bool mustAllocate) {
  assert(slot != NULL, "cannot change the contents of a non-existent slot");
  assert(!obj->is_string(), "cannot clone strings!");
  assert_slots(obj, "object isn't a slotsOop");

  slotsOop new_obj= slotsOop(obj->clone(mustAllocate));
  if (oop(new_obj) == failedAllocationOop) return failedAllocationOop;
  switch (slot->type->slot_type()) {
   case obj_slot_type:
    assert(NakedMethods || !contents->has_code() || slot->type->is_vm_slot(),
           "adding an assignable slot with code");
    assert_smi(slot->data, "data slot contents isn't an offset");
    new_obj->at_put(smiOop(slot->data)->value(), contents);
    break;
   case map_slot_type:
    break;
   case arg_slot_type:
    assert_smi(contents, "argument index isn't a smiOop");
    break;
   default:
    ShouldNotReachHere(); // unexpected slot type
  }

  if (    slot->data == contents
      &&  slot->type == type
      &&  slot->get_annotation() == anno) {
    // no change (to the map, at least)!
    return new_obj;
  }
  
  // create a new map for this object
  slotsMap* new_map= copy_for_changing(mustAllocate);
  if (new_map == NULL) return failedAllocationOop;
  slot = slot->shift(this, new_map);
  slot->type = type;
  slot->set_annotation(anno);
  if (!slot->is_obj_slot()) {
    Memory->store(&slot->data, contents);
  }

  new_obj->set_canonical_map(new_map);
  
  return new_obj;
}
开发者ID:AdamSpitz,项目名称:self,代码行数:49,代码来源:slotsMap.cpp

示例3: check_selector_string

void abstract_interpreter::check_selector_string(abstract_interpreter *ai, oop s) {
  if ( s->is_string() ) return;
  ai->set_error_msg( "selector must be a string");
}
开发者ID:AaronNGray,项目名称:self,代码行数:4,代码来源:abstract_interpreter.cpp


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