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); }
void vframeMap::dummy_initialize(oop obj, oop filler) { assert( obj->is_vframe(), "a vframeOop is expected"); vframeOop(obj)->set_next(NULL); vframeOop(obj)->set_method(filler); vframeOop(obj)->set_locals(NULL); vframeOop(obj)->set_process(NULL); vframeOop(obj)->set_descOffset(0); }
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; }