< prev index next >

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Print this page

        

@@ -10933,10 +10933,43 @@
   jcc(Assembler::notZero, copy_chars_loop);
 
   bind(done);
 }
 
+void MacroAssembler::cache_wb(Address line)
+{
+  // 64 bit cpus always support clflush
+  assert(VM_Version::supports_clflush(), "should not reach here on 32-bit");
+  bool optimized = VM_Version::supports_clflushopt();
+  bool no_evict = VM_Version::supports_clwb();
+
+  // pick the correct implementation
+
+  if (optimized) {
+    if (no_evict) {
+      clwb(line);
+    } else {
+      clflushopt(line);
+    }
+  } else {
+    // no need for fence when using CLFLUSH
+    clflush(line);
+  }    
+}
+
+
+void MacroAssembler::cache_wbsync(bool isPre)
+{
+  assert(VM_Version::supports_clflush(), "should not reach here on 32-bit");
+  bool optimized = VM_Version::supports_clflushopt();
+  bool no_evict = VM_Version::supports_clwb();
+
+  // always need an mfence for pre or post flush even with clflush
+  // TODO true for pre-sync but check if we can ignore a post sync
+  mfence();
+}
+
 Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) {
   switch (cond) {
     // Note some conditions are synonyms for others
     case Assembler::zero:         return Assembler::notZero;
     case Assembler::notZero:      return Assembler::zero;
< prev index next >