< prev index next >

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

Print this page
@@ -31,10 +31,11 @@
  #include "gc/shared/tlab_globals.hpp"
  #include "memory/universe.hpp"
  #include "oops/arrayOop.hpp"
  #include "oops/oop.inline.hpp"
  #include "prims/jvmtiExport.hpp"
+ #include "runtime/arguments.hpp"
  #include "runtime/continuationJavaClasses.inline.hpp"
  #include "runtime/handles.inline.hpp"
  #include "runtime/javaThread.hpp"
  #include "runtime/sharedRuntime.hpp"
  #include "services/lowMemoryDetector.hpp"

@@ -378,11 +379,15 @@
    // 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());
+     if (Arguments::is_valhalla_enabled()) {
+       oopDesc::set_mark(mem, _klass->prototype_header());
+     } else {
+       oopDesc::set_mark(mem, markWord::prototype());
+     }
      oopDesc::release_set_klass(mem, _klass);
    }
    return cast_to_oop(mem);
  }
  
< prev index next >