< prev index next >
src/cpu/x86/vm/macroAssembler_x86.cpp
Print this page
rev 13993 : [mq]: refactor-acmp.patch
@@ -24,16 +24,18 @@
#include "precompiled.hpp"
#include "asm/assembler.hpp"
#include "asm/assembler.inline.hpp"
#include "compiler/disassembler.hpp"
+#include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTableModRefBS.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
#include "interpreter/interpreter.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/klass.inline.hpp"
+#include "oops/oop.hpp"
#include "prims/jvm.h"
#include "prims/methodHandles.hpp"
#include "runtime/biasedLocking.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/objectMonitor.hpp"
@@ -8777,12 +8779,11 @@
int length_offset = arrayOopDesc::length_offset_in_bytes();
int base_offset = arrayOopDesc::base_offset_in_bytes(is_char ? T_CHAR : T_BYTE);
if (is_array_equ) {
// Check the input args
- cmpptr(ary1, ary2);
- oopDesc::bs()->asm_acmp_barrier(this, ary1, ary2);
+ cmpoopptr(ary1, ary2);
jcc(Assembler::equal, TRUE_LABEL);
// Need additional checks for arrays_equals.
testptr(ary1, ary1);
jcc(Assembler::zero, FALSE_LABEL);
@@ -11796,5 +11797,23 @@
}
}
#endif
}
}
+
+void MacroAssembler::cmpoopptr(Register src1, Register src2) {
+ cmpptr(src1, src2);
+ oopDesc::bs()->asm_acmp_barrier(this, src1, src2);
+}
+
+void MacroAssembler::cmpoopptr(Register src1, Address src2) {
+ cmpptr(src1, src2);
+ if (UseShenandoahGC && ShenandoahAcmpBarrier) {
+ Label done;
+ jccb(Assembler::equal, done);
+ movptr(rscratch2, src2);
+ oopDesc::bs()->interpreter_read_barrier(this, src1);
+ oopDesc::bs()->interpreter_read_barrier(this, rscratch2);
+ cmpptr(src1, rscratch2);
+ bind(done);
+ }
+}
< prev index next >