< prev index next >

src/hotspot/share/gc/shared/memAllocator.cpp

Print this page
*** 370,23 ***
    assert(mem != nullptr, "null object pointer");
    // Need a release store to ensure array/class length, mark word, and
    // object zeroing are visible before setting the klass non-null, for
    // concurrent collectors.
    if (UseCompactObjectHeaders) {
!     oopDesc::release_set_mark(mem, _klass->prototype_header());
    } else {
!     oopDesc::set_mark(mem, markWord::prototype());
      oopDesc::release_set_klass(mem, _klass);
    }
    return cast_to_oop(mem);
  }
  
  oop ObjAllocator::initialize(HeapWord* mem) const {
    mem_clear(mem);
    return finish(mem);
  }
  
  oop ObjArrayAllocator::initialize(HeapWord* mem) const {
    // Set array length before setting the _klass field because a
    // non-null klass field indicates that the object is parsable by
    // concurrent GC.
    assert(_length >= 0, "length should be non-negative");
--- 370,33 ---
    assert(mem != nullptr, "null object pointer");
    // Need a release store to ensure array/class length, mark word, and
    // object zeroing are visible before setting the klass non-null, for
    // concurrent collectors.
    if (UseCompactObjectHeaders) {
!     oopDesc::release_set_mark(mem, Klass::default_prototype_header(_klass));
    } else {
!     if (EnableValhalla) {
+       oopDesc::set_mark(mem, Klass::default_prototype_header(_klass));
+     } else {
+       oopDesc::set_mark(mem, markWord::prototype());
+     }
      oopDesc::release_set_klass(mem, _klass);
    }
    return cast_to_oop(mem);
  }
  
  oop ObjAllocator::initialize(HeapWord* mem) const {
    mem_clear(mem);
    return finish(mem);
  }
  
+ oop ObjBufferAllocator::initialize(HeapWord* mem) const {
+   mem_clear(mem);
+   return finish(mem);
+ }
+ 
+ 
  oop ObjArrayAllocator::initialize(HeapWord* mem) const {
    // Set array length before setting the _klass field because a
    // non-null klass field indicates that the object is parsable by
    // concurrent GC.
    assert(_length >= 0, "length should be non-negative");
< prev index next >