< prev index next >

src/cpu/x86/vm/templateInterpreter_x86_32.cpp

Print this page

        

@@ -744,10 +744,25 @@
     __ jcc(Assembler::notEqual, notChar);
     __ load_unsigned_short(rax, field_address);
     __ jmp(xreturn_path);
 
     __ bind(notChar);
+
+#if INCLUDE_ALL_GCS
+    if (UseShenandoahGC) {
+      Label notObj;
+
+      // Needs GC barriers
+      __ cmpl(rdx, atos);
+      __ jcc(Assembler::notEqual, notObj);
+      __ load_heap_oop(rax, field_address);
+      __ jmp(xreturn_path);
+
+      __ bind(notObj);
+    }
+#endif
+
 #ifdef ASSERT
     Label okay;
     __ cmpl(rdx, atos);
     __ jcc(Assembler::equal, okay);
     __ cmpl(rdx, itos);

@@ -812,11 +827,11 @@
   address entry = __ pc();
 
   const int referent_offset = java_lang_ref_Reference::referent_offset;
   guarantee(referent_offset > 0, "referent offset not initialized");
 
-  if (UseG1GC) {
+  if (UseG1GC || UseShenandoahGC) {
     Label slow_path;
 
     // Check if local 0 != NULL
     // If the receiver is null then it is OK to jump to the slow path.
     __ movptr(rax, Address(rsp, wordSize));

@@ -836,21 +851,29 @@
     // calls the runtime
     __ push(rsi);
 
     // Load the value of the referent field.
     const Address field_address(rax, referent_offset);
+#if INCLUDE_ALL_GCS
+    if (UseShenandoahGC) {
+      // Needs GC barriers
+      __ load_heap_oop(rax, field_address);
+    } else
+#endif
     __ movptr(rax, field_address);
 
     // Generate the G1 pre-barrier code to log the value of
     // the referent field in an SATB buffer.
+    if (!UseShenandoahGC || ShenandoahSATBBarrier) {
     __ get_thread(rcx);
     __ g1_write_barrier_pre(noreg /* obj */,
                             rax /* pre_val */,
                             rcx /* thread */,
                             rbx /* tmp */,
                             true /* tosca_save */,
                             true /* expand_call */);
+    }
 
     // _areturn
     __ pop(rsi);                // get sender sp
     __ pop(rdi);                // get return address
     __ mov(rsp, rsi);           // set sp to sender sp
< prev index next >