# HG changeset patch # User eosterlund # Date 1499679765 -7200 # Node ID 527ce5a7c7379ea5c581a1870593430471dd2c8a # Parent 634dc786bf96832c6fdbaba90c9fc2ae42ee8f86 8183575: Runtime1::oop_arraycopy is unused and should be removed Summary: Runtime1::oop_arraycopy and its friend Runtime1::primitive_arraycopy are no longer used and this changeset removes them. Reviewed-by: kvn, tschatzl diff -r 634dc786bf96 -r 527ce5a7c737 hotspot/src/share/vm/c1/c1_Runtime1.cpp --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp Mon Jul 10 23:28:25 2017 +0200 +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp Mon Jul 10 11:42:45 2017 +0200 @@ -104,8 +104,6 @@ #ifndef PRODUCT // statistics int Runtime1::_generic_arraycopy_cnt = 0; -int Runtime1::_primitive_arraycopy_cnt = 0; -int Runtime1::_oop_arraycopy_cnt = 0; int Runtime1::_generic_arraycopystub_cnt = 0; int Runtime1::_arraycopy_slowcase_cnt = 0; int Runtime1::_arraycopy_checkcast_cnt = 0; @@ -1443,37 +1441,6 @@ JRT_END -JRT_LEAF(void, Runtime1::primitive_arraycopy(HeapWord* src, HeapWord* dst, int length)) -#ifndef PRODUCT - _primitive_arraycopy_cnt++; -#endif - - if (length == 0) return; - // Not guaranteed to be word atomic, but that doesn't matter - // for anything but an oop array, which is covered by oop_arraycopy. - Copy::conjoint_jbytes(src, dst, length); -JRT_END - -JRT_LEAF(void, Runtime1::oop_arraycopy(HeapWord* src, HeapWord* dst, int num)) -#ifndef PRODUCT - _oop_arraycopy_cnt++; -#endif - - if (num == 0) return; - BarrierSet* bs = Universe::heap()->barrier_set(); - assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt"); - assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well."); - if (UseCompressedOops) { - bs->write_ref_array_pre((narrowOop*)dst, num); - Copy::conjoint_oops_atomic((narrowOop*) src, (narrowOop*) dst, num); - } else { - bs->write_ref_array_pre((oop*)dst, num); - Copy::conjoint_oops_atomic((oop*) src, (oop*) dst, num); - } - bs->write_ref_array(dst, num); -JRT_END - - JRT_LEAF(int, Runtime1::is_instance_of(oopDesc* mirror, oopDesc* obj)) // had to return int instead of bool, otherwise there may be a mismatch // between the C calling convention and the Java one. @@ -1545,9 +1512,7 @@ tty->print_cr(" _short_arraycopy_cnt: %d", _short_arraycopy_stub_cnt); tty->print_cr(" _int_arraycopy_cnt: %d", _int_arraycopy_stub_cnt); tty->print_cr(" _long_arraycopy_cnt: %d", _long_arraycopy_stub_cnt); - tty->print_cr(" _primitive_arraycopy_cnt: %d", _primitive_arraycopy_cnt); - tty->print_cr(" _oop_arraycopy_cnt (C): %d", Runtime1::_oop_arraycopy_cnt); - tty->print_cr(" _oop_arraycopy_cnt (stub): %d", _oop_arraycopy_stub_cnt); + tty->print_cr(" _oop_arraycopy_cnt: %d", _oop_arraycopy_stub_cnt); tty->print_cr(" _arraycopy_slowcase_cnt: %d", _arraycopy_slowcase_cnt); tty->print_cr(" _arraycopy_checkcast_cnt: %d", _arraycopy_checkcast_cnt); tty->print_cr(" _arraycopy_checkcast_attempt_cnt:%d", _arraycopy_checkcast_attempt_cnt); diff -r 634dc786bf96 -r 527ce5a7c737 hotspot/src/share/vm/c1/c1_Runtime1.hpp --- a/hotspot/src/share/vm/c1/c1_Runtime1.hpp Mon Jul 10 23:28:25 2017 +0200 +++ b/hotspot/src/share/vm/c1/c1_Runtime1.hpp Mon Jul 10 11:42:45 2017 +0200 @@ -95,8 +95,6 @@ static int _handle_wrong_method_cnt; static int _ic_miss_cnt; static int _generic_arraycopy_cnt; - static int _primitive_arraycopy_cnt; - static int _oop_arraycopy_cnt; static int _generic_arraycopystub_cnt; static int _arraycopy_slowcase_cnt; static int _arraycopy_checkcast_cnt; @@ -189,8 +187,6 @@ // directly accessible leaf routine static int arraycopy(oopDesc* src, int src_pos, oopDesc* dst, int dst_pos, int length); - static void primitive_arraycopy(HeapWord* src, HeapWord* dst, int length); - static void oop_arraycopy(HeapWord* src, HeapWord* dst, int length); static int is_instance_of(oopDesc* mirror, oopDesc* obj); static void predicate_failed_trap(JavaThread* thread);