Thu, 22 Sep 2016 07:41:28 -0400
Fix a bug while copying oops in the heap with -XX:-ReduceInitialCardMarks.
The following test runs OK after this patch.
${JDK}/bin/java \
${JVM_ARGS} \
-XX:-ReduceInitialCardMarks \
-XX:CompileCommand='compileonly,com/sun/tools/javac/jvm/Code.addLocalVar' \
-XX:+PrintCompilation \
-jar SPECjvm2008.jar -ikv -coe -ict compiler.compiler
src/cpu/mips/vm/templateTable_mips_64.cpp | file | annotate | diff | comparison | revisions | |
src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/mips/vm/templateTable_mips_64.cpp Sun Sep 18 13:43:10 2016 +0800 1.2 +++ b/src/cpu/mips/vm/templateTable_mips_64.cpp Thu Sep 22 07:41:28 2016 -0400 1.3 @@ -633,6 +633,11 @@ 1.4 // check array 1.5 __ null_check(array, arrayOopDesc::length_offset_in_bytes()); 1.6 1.7 +#ifdef _LP64 1.8 + // sign extend since tos (index) might contain garbage in upper bits 1.9 + __ sll(index, index, 0); 1.10 +#endif // _LP64 1.11 + 1.12 // check index 1.13 Label ok; 1.14 __ lw(AT, array, arrayOopDesc::length_offset_in_bytes());
2.1 --- a/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp Sun Sep 18 13:43:10 2016 +0800 2.2 +++ b/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp Thu Sep 22 07:41:28 2016 -0400 2.3 @@ -167,8 +167,12 @@ 2.4 2.5 static void pd_conjoint_oops_atomic(oop* from, oop* to, size_t count) { 2.6 assert(HeapWordSize == BytesPerOop, "heapwords and oops must be the same size"); 2.7 - // pd_conjoint_words is word-atomic in this implementation. 2.8 - pd_conjoint_words((HeapWord*)from, (HeapWord*)to, count); 2.9 + if(UseCompressedOops) { 2.10 + copy_conjoint_atomic<jint>((jint*)from, (jint*)to, count); 2.11 + } else { 2.12 + // pd_conjoint_words is word-atomic in this implementation. 2.13 + pd_conjoint_words((HeapWord*)from, (HeapWord*)to, count); 2.14 + } 2.15 } 2.16 2.17 static void pd_arrayof_conjoint_bytes(HeapWord* from, HeapWord* to, size_t count) {