src/cpu/x86/vm/stubGenerator_x86_32.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/cpu/x86/vm/stubGenerator_x86_32.cpp Mon Feb 28 18:56:37 2011
--- new/src/cpu/x86/vm/stubGenerator_x86_32.cpp Mon Feb 28 18:56:37 2011
*** 731,747 ****
--- 731,748 ----
// Generate pre-barrier for array stores
//
// Input:
// start - starting address
// count - element count
! void gen_write_ref_array_pre_barrier(Register start, Register count, bool uninitialized_target) {
assert_different_registers(start, count);
BarrierSet* bs = Universe::heap()->barrier_set();
switch (bs->kind()) {
case BarrierSet::G1SATBCT:
case BarrierSet::G1SATBCTLogging:
{
+ // With G1, don't generate the call if we statically know that the target in uninitialized
+ if (!uninitialized_target) {
__ pusha(); // push registers
__ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre),
start, count);
__ popa();
}
*** 921,931 ****
--- 922,933 ----
__ emms();
}
address generate_disjoint_copy(BasicType t, bool aligned,
Address::ScaleFactor sf,
! address* entry, const char *name) {
! address* entry, const char *name,
+ bool dest_uninitialized = false) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
Label L_0_count, L_exit, L_skip_align1, L_skip_align2, L_copy_byte;
*** 952,962 ****
--- 954,964 ----
}
if (t == T_OBJECT) {
__ testl(count, count);
__ jcc(Assembler::zero, L_0_count);
! gen_write_ref_array_pre_barrier(to, count, dest_uninitialized);
__ mov(saved_to, to); // save 'to'
}
__ subptr(to, from); // to --> to_from
__ cmpl(count, 2<<shift); // Short arrays (< 8 bytes) copy by element
*** 1086,1096 ****
--- 1088,1099 ----
}
address generate_conjoint_copy(BasicType t, bool aligned,
Address::ScaleFactor sf,
address nooverlap_target,
! address* entry, const char *name) {
! address* entry, const char *name,
+ bool dest_uninitialized = false) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
Label L_0_count, L_exit, L_skip_align1, L_skip_align2, L_copy_byte;
*** 1130,1140 ****
--- 1133,1143 ----
__ jump_cc(Assembler::aboveEqual, nooverlap);
if (t == T_OBJECT) {
__ testl(count, count);
__ jcc(Assembler::zero, L_0_count);
! gen_write_ref_array_pre_barrier(dst, count);
! gen_write_ref_array_pre_barrier(dst, count, dest_uninitialized);
}
// copy from high to low
__ cmpl(count, 2<<shift); // Short arrays (< 8 bytes) copy by element
__ jcc(Assembler::below, L_copy_4_bytes); // use unsigned cmp
*** 1417,1427 ****
--- 1420,1430 ----
//
// Output:
// rax, == 0 - success
// rax, == -1^K - failure, where K is partial transfer count
//
! address generate_checkcast_copy(const char *name, address* entry, bool dest_uninitialized = false) {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", name);
address start = __ pc();
Label L_load_element, L_store_element, L_do_card_marks, L_done;
*** 1478,1488 ****
--- 1481,1491 ----
Address from_element_addr(end_from, count, Address::times_ptr, 0);
Address to_element_addr(end_to, count, Address::times_ptr, 0);
Address elem_klass_addr(elem, oopDesc::klass_offset_in_bytes());
// Copy from low to high addresses, indexed from the end of each array.
! gen_write_ref_array_pre_barrier(to, count, dest_uninitialized);
__ lea(end_from, end_from_addr);
__ lea(end_to, end_to_addr);
assert(length == count, ""); // else fix next line:
__ negptr(count); // negate and test the length
__ jccb(Assembler::notZero, L_load_element);
*** 2041,2050 ****
--- 2044,2062 ----
"oop_disjoint_arraycopy");
StubRoutines::_oop_arraycopy =
generate_conjoint_copy(T_OBJECT, true, Address::times_ptr, entry,
&entry_oop_arraycopy, "oop_arraycopy");
+ StubRoutines::_oop_disjoint_arraycopy_uninit =
+ generate_disjoint_copy(T_OBJECT, true, Address::times_ptr, &entry,
+ "oop_disjoint_arraycopy_uninit",
+ /*dest_uninitialized*/true);
+ StubRoutines::_oop_arraycopy_uninit =
+ generate_conjoint_copy(T_OBJECT, true, Address::times_ptr, entry,
+ NULL, "oop_arraycopy_uninit",
+ /*dest_uninitialized*/true);
+
StubRoutines::_jlong_disjoint_arraycopy =
generate_disjoint_long_copy(&entry, "jlong_disjoint_arraycopy");
StubRoutines::_jlong_arraycopy =
generate_conjoint_long_copy(entry, &entry_jlong_arraycopy,
"jlong_arraycopy");
*** 2054,2077 ****
--- 2066,2089 ----
StubRoutines::_jint_fill = generate_fill(T_INT, false, "jint_fill");
StubRoutines::_arrayof_jbyte_fill = generate_fill(T_BYTE, true, "arrayof_jbyte_fill");
StubRoutines::_arrayof_jshort_fill = generate_fill(T_SHORT, true, "arrayof_jshort_fill");
StubRoutines::_arrayof_jint_fill = generate_fill(T_INT, true, "arrayof_jint_fill");
! StubRoutines::_arrayof_jint_disjoint_arraycopy = StubRoutines::_jint_disjoint_arraycopy;
! StubRoutines::_jint_disjoint_arraycopy;
! StubRoutines::_arrayof_oop_disjoint_arraycopy =
! StubRoutines::_oop_disjoint_arraycopy;
StubRoutines::_arrayof_jlong_disjoint_arraycopy =
StubRoutines::_jlong_disjoint_arraycopy;
! StubRoutines::_arrayof_oop_disjoint_arraycopy = StubRoutines::_oop_disjoint_arraycopy;
! StubRoutines::_arrayof_oop_disjoint_arraycopy_uninit = StubRoutines::_oop_disjoint_arraycopy_uninit;
! StubRoutines::_arrayof_jlong_disjoint_arraycopy = StubRoutines::_jlong_disjoint_arraycopy;
StubRoutines::_arrayof_jint_arraycopy = StubRoutines::_jint_arraycopy;
StubRoutines::_arrayof_oop_arraycopy = StubRoutines::_oop_arraycopy;
+ StubRoutines::_arrayof_oop_arraycopy_uninit = StubRoutines::_oop_arraycopy_uninit;
StubRoutines::_arrayof_jlong_arraycopy = StubRoutines::_jlong_arraycopy;
StubRoutines::_checkcast_arraycopy =
! generate_checkcast_copy("checkcast_arraycopy", &entry_checkcast_arraycopy);
&entry_checkcast_arraycopy);
+ StubRoutines::_checkcast_arraycopy_uninit =
+ generate_checkcast_copy("checkcast_arraycopy_uninit", NULL, /*dest_uninitialized*/true);
StubRoutines::_unsafe_arraycopy =
generate_unsafe_copy("unsafe_arraycopy",
entry_jbyte_arraycopy,
entry_jshort_arraycopy,
src/cpu/x86/vm/stubGenerator_x86_32.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File