< prev index next >
src/cpu/x86/vm/stubGenerator_x86_64.cpp
Print this page
*** 36,49 ****
--- 36,53 ----
#include "runtime/handles.inline.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubCodeGenerator.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
+ #include "utilities/macros.hpp"
#include "utilities/top.hpp"
#ifdef COMPILER2
#include "opto/runtime.hpp"
#endif
+ #if INCLUDE_ALL_GCS
+ #include "shenandoahBarrierSetAssembler_x86.hpp"
+ #endif
// Declaration and definition of StubGenerator (no .hpp file).
// For a more detailed description of the stub routine structure
// see the comment in stubRoutines.hpp
*** 1176,1186 ****
// count - element count
// tmp - scratch register
//
// Destroy no registers!
//
! void gen_write_ref_array_pre_barrier(Register addr, Register count, bool dest_uninitialized) {
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
--- 1180,1190 ----
// count - element count
// tmp - scratch register
//
// Destroy no registers!
//
! void gen_write_ref_array_pre_barrier(Register src, Register addr, Register count, bool dest_uninitialized) {
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
*** 1204,1213 ****
--- 1208,1222 ----
break;
case BarrierSet::CardTableModRef:
case BarrierSet::CardTableExtension:
case BarrierSet::ModRef:
break;
+ #if INCLUDE_ALL_GCS
+ case BarrierSet::ShenandoahBarrierSet:
+ ShenandoahBarrierSetAssembler::bsasm()->arraycopy_prologue(_masm, dest_uninitialized, src, addr, count);
+ break;
+ #endif
default:
ShouldNotReachHere();
}
}
*** 1265,1274 ****
--- 1274,1287 ----
__ movb(Address(start, count, Address::times_1), 0);
__ decrement(count);
__ jcc(Assembler::greaterEqual, L_loop);
}
break;
+ #if INCLUDE_ALL_GCS
+ case BarrierSet::ShenandoahBarrierSet:
+ break;
+ #endif
default:
ShouldNotReachHere();
}
}
*** 1882,1892 ****
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);
! gen_write_ref_array_pre_barrier(to, count, dest_uninitialized);
}
// 'from', 'to' and 'count' are now valid
__ movptr(dword_count, count);
__ shrptr(count, 1); // count => qword_count
--- 1895,1905 ----
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);
! gen_write_ref_array_pre_barrier(from, to, count, dest_uninitialized);
}
// 'from', 'to' and 'count' are now valid
__ movptr(dword_count, count);
__ shrptr(count, 1); // count => qword_count
*** 1970,1980 ****
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
// r9 and r10 may be used to save non-volatile registers
if (is_oop) {
// no registers are destroyed by this call
! gen_write_ref_array_pre_barrier(to, count, dest_uninitialized);
}
assert_clean_int(count, rax); // Make sure 'count' is clean int.
// 'from', 'to' and 'count' are now valid
__ movptr(dword_count, count);
--- 1983,1993 ----
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
// r9 and r10 may be used to save non-volatile registers
if (is_oop) {
// no registers are destroyed by this call
! gen_write_ref_array_pre_barrier(from, to, count, dest_uninitialized);
}
assert_clean_int(count, rax); // Make sure 'count' is clean int.
// 'from', 'to' and 'count' are now valid
__ movptr(dword_count, count);
*** 2068,2078 ****
// 'from', 'to' and 'qword_count' are now valid
if (is_oop) {
// Save to and count for store barrier
__ movptr(saved_count, qword_count);
// no registers are destroyed by this call
! gen_write_ref_array_pre_barrier(to, qword_count, dest_uninitialized);
}
// Copy from low to high addresses. Use 'to' as scratch.
__ lea(end_from, Address(from, qword_count, Address::times_8, -8));
__ lea(end_to, Address(to, qword_count, Address::times_8, -8));
--- 2081,2091 ----
// 'from', 'to' and 'qword_count' are now valid
if (is_oop) {
// Save to and count for store barrier
__ movptr(saved_count, qword_count);
// no registers are destroyed by this call
! gen_write_ref_array_pre_barrier(from, to, qword_count, dest_uninitialized);
}
// Copy from low to high addresses. Use 'to' as scratch.
__ lea(end_from, Address(from, qword_count, Address::times_8, -8));
__ lea(end_to, Address(to, qword_count, Address::times_8, -8));
*** 2155,2165 ****
// 'from', 'to' and 'qword_count' are now valid
if (is_oop) {
// Save to and count for store barrier
__ movptr(saved_count, qword_count);
// No registers are destroyed by this call
! gen_write_ref_array_pre_barrier(to, saved_count, dest_uninitialized);
}
__ jmp(L_copy_bytes);
// Copy trailing qwords
--- 2168,2178 ----
// 'from', 'to' and 'qword_count' are now valid
if (is_oop) {
// Save to and count for store barrier
__ movptr(saved_count, qword_count);
// No registers are destroyed by this call
! gen_write_ref_array_pre_barrier(from, to, saved_count, dest_uninitialized);
}
__ jmp(L_copy_bytes);
// Copy trailing qwords
*** 2329,2339 ****
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);
! gen_write_ref_array_pre_barrier(to, count, dest_uninitialized);
// 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
--- 2342,2352 ----
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);
! gen_write_ref_array_pre_barrier(from, to, count, dest_uninitialized);
// 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
< prev index next >