int associationKlass::oop_scavenge_contents(oop obj) { int size = non_indexable_size(); // header + instance variables memOop(obj)->scavenge_header(); memOop(obj)->scavenge_body(memOopDesc::header_size(), size); return size; }
oop doubleByteArrayKlass::allocateObjectSize(int size, bool permit_scavenge, bool tenured) { klassOop k = as_klassOop(); int ni_size = non_indexable_size(); int obj_size = ni_size + 1 + roundTo(size * 2, oopSize) / oopSize; // allocate oop* result = tenured ? Universe::allocate_tenured(obj_size, permit_scavenge) : Universe::allocate(obj_size, (memOop*)&k, permit_scavenge); if (result == NULL) return NULL; doubleByteArrayOop obj = as_doubleByteArrayOop(result); // header memOop(obj)->initialize_header(true, k); // instance variables memOop(obj)->initialize_body(memOopDesc::header_size(), ni_size); // indexables oop* base = (oop*) obj->addr(); oop* end = base + obj_size; // %optimized 'obj->set_length(size)' base[ni_size] = as_smiOop(size); // %optimized 'for (int index = 1; index <= size; index++) // obj->doubleByte_at_put(index, 0)' base = &base[ni_size+1]; while (base < end) *base++ = (oop) 0; return obj; }
int memOopKlass::oop_scavenge_tenured_contents(oop obj) { int size = non_indexable_size(); // header memOop(obj)->scavenge_tenured_header(); // instance variables memOop(obj)->scavenge_tenured_body(memOopDesc::header_size(), size); return size; }
void associationKlass::oop_oop_iterate(oop obj, OopClosure* blk) { // header memOop(obj)->oop_iterate_header(blk); associationOop assoc = associationOop(obj); blk->do_oop((oop*) &assoc->addr()->_key); blk->do_oop((oop*) &assoc->addr()->_value); blk->do_oop((oop*) &assoc->addr()->_is_constant); // instance variables memOop(obj)->oop_iterate_body(blk, associationOopDesc::header_size(), non_indexable_size()); }
void weakArrayKlass::oop_follow_contents(oop obj) { // indexables if (!WeakArrayRegister::mark_sweep_register(weakArrayOop(obj), non_indexable_size())){ oop* base = weakArrayOop(obj)->objs(1); oop* end = base + weakArrayOop(obj)->length(); while (base <= end) MarkSweep::reverse_and_follow(base++); } // header + instance variables memOopKlass::oop_follow_contents(obj); }
oop memOopKlass::allocateObject() { klassOop k = as_klassOop(); int size = non_indexable_size(); // allocate memOop obj = as_memOop(Universe::allocate(size, (memOop*)&k)); // header obj->initialize_header(has_untagged_contents(), k); // instance variables obj->initialize_body(memOopDesc::header_size(), size); return obj; }
void mixinKlass::oop_layout_iterate(oop obj, ObjectLayoutClosure* blk) { // header memOop(obj)->layout_iterate_header(blk); blk->do_oop("methods", (oop*)&mixinOop(obj)->addr()->_methods); blk->do_oop("instVars", (oop*)&mixinOop(obj)->addr()->_inst_vars); blk->do_oop("classVars", (oop*)&mixinOop(obj)->addr()->_class_vars); blk->do_oop("primary invocation", (oop*)&mixinOop(obj)->addr()->_primary_invocation); blk->do_oop("class mixin", (oop*)&mixinOop(obj)->addr()->_class_mixin); // instance variables memOop(obj)->layout_iterate_body(blk, mixinOopDesc::header_size(), non_indexable_size()); }
oop memOopKlass::allocateObject(bool permit_scavenge, bool tenured) { klassOop k = as_klassOop(); int size = non_indexable_size(); oop* result = basicAllocate(size, &k, permit_scavenge, tenured); if (!result) return NULL; // allocate memOop obj = as_memOop(result); // header obj->initialize_header(has_untagged_contents(), k); // instance variables obj->initialize_body(memOopDesc::header_size(), size); return obj; }
oop associationKlass::allocateObject(bool permit_scavenge, bool tenured) { klassOop k = as_klassOop(); int size = non_indexable_size(); // allocate oop* result = Universe::allocate_tenured(size, permit_scavenge); if (result == NULL && !permit_scavenge) return NULL; associationOop obj = as_associationOop(result); // header memOop(obj)->initialize_header(has_untagged_contents(), k); obj->set_key(symbolOop(nilObj)); obj->set_value(nilObj); obj->set_is_constant(false); // instance variables obj->initialize_body(associationOopDesc::header_size(), size); return obj; }
oop objArrayKlass::allocateObjectSize(int size) { klassOop k = as_klassOop(); int ni_size = non_indexable_size(); int obj_size = ni_size + 1 + size; // allocate objArrayOop obj = as_objArrayOop(Universe::allocate(obj_size, (memOop*)&k)); // header memOop(obj)->initialize_header(has_untagged_contents(), k); // instance variables memOop(obj)->initialize_body(memOopDesc::header_size(), ni_size); // indexables oop* base = (oop*) obj->addr(); oop* end = base + obj_size; // %optimized 'obj->set_length(size)' base[ni_size] = as_smiOop(size); memOop(obj)->initialize_body(ni_size+1, obj_size); return obj; }
oop mixinKlass::allocateObject(bool permit_scavenge, bool tenured) { klassOop k = as_klassOop(); int size = non_indexable_size(); // allocate oop* result = basicAllocate(size, &k, permit_scavenge, tenured); if (result == NULL) return NULL; mixinOop obj = as_mixinOop(result); // header + instance variables memOop(obj)->initialize_header(true, k); memOop(obj)->initialize_body(memOopDesc::header_size(), size); objArrayOop filler = oopFactory::new_objArray(0); obj->set_methods(filler); obj->set_instVars(filler); obj->set_classVars(filler); obj->set_installed(falseObj); return obj; }
oop byteArrayKlass::allocateObjectSize(int size) { klassOop k = as_klassOop(); int ni_size = non_indexable_size(); int obj_size = ni_size + 1 + roundTo(size, oopSize) / oopSize; // allocate byteArrayOop obj = as_byteArrayOop(Universe::allocate(obj_size, (memOop*)&k)); // header memOop(obj)->initialize_header(true, k); // instance variables memOop(obj)->initialize_body(memOopDesc::header_size(), ni_size); // indexables oop* base = (oop*) obj->addr(); oop* end = base + obj_size; // %optimized 'obj->set_length(size)' base[ni_size] = as_smiOop(size); // %optimized 'for (int index = 1; index <= size; index++) // obj->byte_at_put(index, '\000')' base = &base[ni_size+1]; while (base < end) *base++ = (oop) 0; return obj; }
void associationKlass::oop_follow_contents(oop obj) { // header + instance variables memOop(obj)->follow_header(); memOop(obj)->follow_body(memOopDesc::header_size(), non_indexable_size()); }
// Return the oop size for a doubleValueArrayOop int object_size(int number_of_doubleValues) const { return non_indexable_size() + 1 + roundTo(number_of_doubleValues * sizeof(double), oopSize) / oopSize; }
int object_size(int size_of_codes) const { return non_indexable_size() + size_of_codes + 1; }
void memOopKlass::oop_oop_iterate(oop obj, OopClosure* blk) { // header memOop(obj)->oop_iterate_header(blk); // instance variables memOop(obj)->oop_iterate_body(blk, memOopDesc::header_size(), non_indexable_size()); }