< prev index next >

src/cpu/aarch64/vm/macroAssembler_aarch64.cpp

Print this page

        

@@ -3271,19 +3271,30 @@
 void MacroAssembler::load_prototype_header(Register dst, Register src) {
   load_klass(dst, src);
   ldr(dst, Address(dst, Klass::prototype_header_offset()));
 }
 
-void MacroAssembler::store_klass(Register dst, Register src) {
-  // FIXME: Should this be a store release?  concurrent gcs assumes
-  // klass length is valid if klass field is not null.
+void MacroAssembler::store_klass(Register dst, Register src, Register tmp) {
+  // concurrent gcs assumes klass length is valid if klass field is not null.
+  bool is_concurrentGC = UseG1GC || UseConcMarkSweepGC;
+
+  if (is_concurrentGC) {
+    add(tmp, dst, oopDesc::klass_offset_in_bytes());
+    if (UseCompressedClassPointers) {
+      encode_klass_not_null(src);
+      stlrw(src, tmp);
+    } else {
+      stlr(src, tmp);
+    }
+  } else {
   if (UseCompressedClassPointers) {
     encode_klass_not_null(src);
     strw(src, Address(dst, oopDesc::klass_offset_in_bytes()));
   } else {
     str(src, Address(dst, oopDesc::klass_offset_in_bytes()));
   }
+  }
 }
 
 void MacroAssembler::store_klass_gap(Register dst, Register src) {
   if (UseCompressedClassPointers) {
     // Store to klass gap in destination

@@ -3905,11 +3916,11 @@
          offset);
     ldr(t1, Address(rscratch1, offset));
   }
   // store klass last.  concurrent gcs assumes klass length is valid if
   // klass field is not null.
-  store_klass(top, t1);
+  store_klass(top, t1, rscratch1);
 
   mov(t1, top);
   ldr(rscratch1, Address(rthread, in_bytes(JavaThread::tlab_start_offset())));
   sub(t1, t1, rscratch1);
   incr_allocated_bytes(rthread, t1, 0, rscratch1);
< prev index next >