src/cpu/x86/vm/stubGenerator_x86_64.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Thu Feb 24 12:43:03 2011
--- new/src/cpu/x86/vm/stubGenerator_x86_64.cpp	Thu Feb 24 12:43:03 2011

*** 1767,1777 **** --- 1767,1778 ---- // // Side Effects: // disjoint_int_copy_entry is set to the no-overlap entry point // used by generate_conjoint_int_oop_copy(). // - address generate_disjoint_int_oop_copy(bool aligned, bool is_oop, address* entry, const char *name) { + const char *name, bool need_pre_barrier = true) { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", name); address start = __ pc(); Label L_copy_32_bytes, L_copy_8_bytes, L_copy_4_bytes, L_exit;
*** 1797,1808 **** --- 1798,1811 ---- setup_arg_regs(); // from => rdi, to => rsi, count => rdx // r9 and r10 may be used to save non-volatile registers if (is_oop) { __ movq(saved_to, to); + if (need_pre_barrier) { gen_write_ref_array_pre_barrier(to, count); } + } // 'from', 'to' and 'count' are now valid __ movptr(dword_count, count); __ shrptr(count, 1); // count => qword_count
*** 1858,1868 **** --- 1861,1872 ---- // If 'from' and/or 'to' are aligned on 4-byte boundaries, we let // the hardware handle it. The two dwords within qwords that span // cache line boundaries will still be loaded and stored atomicly. // address generate_conjoint_int_oop_copy(bool aligned, bool is_oop, address nooverlap_target, ! address *entry, const char *name) { ! address *entry, const char *name, + bool need_pre_barrier = true) { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", name); address start = __ pc(); Label L_copy_32_bytes, L_copy_8_bytes, L_copy_2_bytes, L_exit;
*** 1883,1893 **** --- 1887,1897 ---- array_overlap_test(nooverlap_target, Address::times_4); setup_arg_regs(); // from => rdi, to => rsi, count => rdx // r9 and r10 may be used to save non-volatile registers ! if (is_oop && need_pre_barrier) { // no registers are destroyed by this call gen_write_ref_array_pre_barrier(to, count); } assert_clean_int(count, rax); // Make sure 'count' is clean int.
*** 1951,1961 **** --- 1955,1966 ---- // // Side Effects: // disjoint_oop_copy_entry or disjoint_long_copy_entry is set to the // no-overlap entry point used by generate_conjoint_long_oop_copy(). // - address generate_disjoint_long_oop_copy(bool aligned, bool is_oop, address *entry, const char *name) { + const char *name, bool need_pre_barrier = true) { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", name); address start = __ pc(); Label L_copy_32_bytes, L_copy_8_bytes, L_exit;
*** 1979,1989 **** --- 1984,1994 ---- } setup_arg_regs(); // from => rdi, to => rsi, count => rdx // r9 and r10 may be used to save non-volatile registers // 'from', 'to' and 'qword_count' are now valid ! if (is_oop && need_pre_barrier) { // no registers are destroyed by this call gen_write_ref_array_pre_barrier(to, qword_count); } // Copy from low to high addresses. Use 'to' as scratch.
*** 2036,2047 **** --- 2041,2053 ---- // Inputs: // c_rarg0 - source array address // c_rarg1 - destination array address // c_rarg2 - element count, treated as ssize_t, can be zero // - address generate_conjoint_long_oop_copy(bool aligned, bool is_oop, address nooverlap_target, ! address *entry, const char *name) { ! address nooverlap_target, address *entry, + const char *name, bool need_pre_barrier = true) { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", name); address start = __ pc(); Label L_copy_32_bytes, L_copy_8_bytes, L_exit;
*** 2064,2076 **** --- 2070,2084 ---- // r9 and r10 may be used to save non-volatile registers // 'from', 'to' and 'qword_count' are now valid if (is_oop) { // Save to and count for store barrier __ movptr(saved_count, qword_count); + if (need_pre_barrier) { // No registers are destroyed by this call gen_write_ref_array_pre_barrier(to, saved_count); } + } __ jmp(L_copy_32_bytes); // Copy trailing qwords __ BIND(L_copy_8_bytes);
*** 2144,2154 **** --- 2152,2162 ---- // // Output: // rax == 0 - success // rax == -1^K - failure, where K is partial transfer count // ! address generate_checkcast_copy(const char *name, address *entry, bool need_pre_barrier = true) { Label L_load_element, L_store_element, L_do_card_marks, L_done; // Input registers (after setup_arg_regs) const Register from = rdi; // source array address
*** 2238,2248 **** --- 2246,2258 ---- Address end_to_addr(to, length, TIMES_OOP, 0); // Loop-variant addresses. They assume post-incremented count < 0. Address from_element_addr(end_from, count, TIMES_OOP, 0); Address to_element_addr(end_to, count, TIMES_OOP, 0); + if (need_pre_barrier) { gen_write_ref_array_pre_barrier(to, count); + } // Copy from low to high addresses, indexed from the end of each array. __ lea(end_from, end_from_addr); __ lea(end_to, end_to_addr); __ movptr(r14_length, length); // save a copy of the length
*** 2748,2765 **** --- 2758,2785 ---- if (UseCompressedOops) { StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_int_oop_copy(false, true, &entry, "oop_disjoint_arraycopy"); StubRoutines::_oop_arraycopy = generate_conjoint_int_oop_copy(false, true, entry, &entry_oop_arraycopy, "oop_arraycopy"); + StubRoutines::_oop_disjoint_arraycopy_no_pre = generate_disjoint_int_oop_copy(false, true, &entry, + "oop_disjoint_arraycopy_no_pre", false); + StubRoutines::_oop_arraycopy_no_pre = generate_conjoint_int_oop_copy(false, true, entry, + NULL, "oop_arraycopy_no_pre", false); } else { StubRoutines::_oop_disjoint_arraycopy = generate_disjoint_long_oop_copy(false, true, &entry, "oop_disjoint_arraycopy"); StubRoutines::_oop_arraycopy = generate_conjoint_long_oop_copy(false, true, entry, &entry_oop_arraycopy, "oop_arraycopy"); + StubRoutines::_oop_disjoint_arraycopy_no_pre = generate_disjoint_long_oop_copy(false, true, &entry, + "oop_disjoint_arraycopy_no_pre", false); + StubRoutines::_oop_arraycopy_no_pre = generate_conjoint_long_oop_copy(false, true, entry, + NULL, "oop_arraycopy_no_pre", false); } StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy", &entry_checkcast_arraycopy); + StubRoutines::_checkcast_arraycopy_no_pre = generate_checkcast_copy("checkcast_arraycopy_no_pre", NULL, false); + StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy", entry_jbyte_arraycopy, entry_jshort_arraycopy, entry_jint_arraycopy, entry_jlong_arraycopy);
*** 2792,2801 **** --- 2812,2824 ---- StubRoutines::_arrayof_jlong_disjoint_arraycopy = StubRoutines::_jlong_disjoint_arraycopy; StubRoutines::_arrayof_jlong_arraycopy = StubRoutines::_jlong_arraycopy; StubRoutines::_arrayof_oop_disjoint_arraycopy = StubRoutines::_oop_disjoint_arraycopy; StubRoutines::_arrayof_oop_arraycopy = StubRoutines::_oop_arraycopy; + + StubRoutines::_arrayof_oop_disjoint_arraycopy_no_pre = StubRoutines::_oop_disjoint_arraycopy_no_pre; + StubRoutines::_arrayof_oop_arraycopy_no_pre = StubRoutines::_oop_arraycopy_no_pre; } void generate_math_stubs() { { StubCodeMark mark(this, "StubRoutines", "log");

src/cpu/x86/vm/stubGenerator_x86_64.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File