本文整理汇总了C++中oop::is_assignment方法的典型用法代码示例。如果您正苦于以下问题:C++ oop::is_assignment方法的具体用法?C++ oop::is_assignment怎么用?C++ oop::is_assignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oop
的用法示例。
在下文中一共展示了oop::is_assignment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copy_add_slot
oop slotsMap::copy_add_slot(oop obj,
stringOop name,
slotType type,
oop contents,
oop anno,
bool mustAllocate) {
if (!type->is_vm_slot())
if ( !obj->is_programmable_slots() // cannot add slot to some objects
|| contents->is_vframe()) // cannot put vframe in a slot
return ErrorCodes::vmString_prim_error(BADTYPEERROR);
else if (type->is_parent() && contents->is_method_like())
return ErrorCodes::vmString_prim_error(PARENTERROR);
slotsOop sobj = slotsOop(obj);
if ( type->is_arg_slot() )
return copy_add_argument_slot(sobj, name, type, contents, anno,
mustAllocate);
if (contents->is_assignment())
return copy_add_assignment_slot(sobj, name, type, anno, mustAllocate);
if (contents->is_method_like())
return copy_add_method_slot(sobj, name, type, contents, anno,
mustAllocate);
return copy_add_data_slot( sobj, name, type, contents, anno,
mustAllocate);
}
示例2: copy_remove_slot
oop slotsMap::copy_remove_slot(oop obj, stringOop name, bool mustAllocate) {
if ( obj->is_vframe()
|| obj->is_assignment()
|| !obj->is_programmable_slots()) {
return ErrorCodes::vmString_prim_error(BADTYPEERROR);
}
slotsOop sobj = slotsOop(obj);
slotDesc* d= find_slot(name);
if (d == NULL || d->is_vm_slot()) {
return ErrorCodes::vmString_prim_error(BADSLOTNAMEERROR);
}
slotsOop result;
if (d->is_assignment_slot_name(name)) {
// remove data slot then add in as map slot
result= copy_remove_one_slot(sobj, d, mustAllocate);
if (oop(result) == failedAllocationOop) return failedAllocationOop;
// add data slot back in as map slot
result = (slotsOop)
result->copy_add_slot(d->name, MAP_SLOT(d->type), sobj->get_slot(d),
d->get_annotation(), mustAllocate);
if (oop(result) == failedAllocationOop) return failedAllocationOop;
assert(result->is_slots(), "should not fail");
} else {
// remove slot
result= copy_remove_one_slot(sobj, d, mustAllocate);
}
return result;
}