hotspot/src/share/vm/c1/c1_Runtime1.cpp
changeset 46648 527ce5a7c737
parent 46379 43ec76e10184
child 46727 6e4a84748e2c
equal deleted inserted replaced
46647:634dc786bf96 46648:527ce5a7c737
   102 };
   102 };
   103 
   103 
   104 #ifndef PRODUCT
   104 #ifndef PRODUCT
   105 // statistics
   105 // statistics
   106 int Runtime1::_generic_arraycopy_cnt = 0;
   106 int Runtime1::_generic_arraycopy_cnt = 0;
   107 int Runtime1::_primitive_arraycopy_cnt = 0;
       
   108 int Runtime1::_oop_arraycopy_cnt = 0;
       
   109 int Runtime1::_generic_arraycopystub_cnt = 0;
   107 int Runtime1::_generic_arraycopystub_cnt = 0;
   110 int Runtime1::_arraycopy_slowcase_cnt = 0;
   108 int Runtime1::_arraycopy_slowcase_cnt = 0;
   111 int Runtime1::_arraycopy_checkcast_cnt = 0;
   109 int Runtime1::_arraycopy_checkcast_cnt = 0;
   112 int Runtime1::_arraycopy_checkcast_attempt_cnt = 0;
   110 int Runtime1::_arraycopy_checkcast_attempt_cnt = 0;
   113 int Runtime1::_new_type_array_slowcase_cnt = 0;
   111 int Runtime1::_new_type_array_slowcase_cnt = 0;
  1441   }
  1439   }
  1442   return ac_failed;
  1440   return ac_failed;
  1443 JRT_END
  1441 JRT_END
  1444 
  1442 
  1445 
  1443 
  1446 JRT_LEAF(void, Runtime1::primitive_arraycopy(HeapWord* src, HeapWord* dst, int length))
       
  1447 #ifndef PRODUCT
       
  1448   _primitive_arraycopy_cnt++;
       
  1449 #endif
       
  1450 
       
  1451   if (length == 0) return;
       
  1452   // Not guaranteed to be word atomic, but that doesn't matter
       
  1453   // for anything but an oop array, which is covered by oop_arraycopy.
       
  1454   Copy::conjoint_jbytes(src, dst, length);
       
  1455 JRT_END
       
  1456 
       
  1457 JRT_LEAF(void, Runtime1::oop_arraycopy(HeapWord* src, HeapWord* dst, int num))
       
  1458 #ifndef PRODUCT
       
  1459   _oop_arraycopy_cnt++;
       
  1460 #endif
       
  1461 
       
  1462   if (num == 0) return;
       
  1463   BarrierSet* bs = Universe::heap()->barrier_set();
       
  1464   assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt");
       
  1465   assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well.");
       
  1466   if (UseCompressedOops) {
       
  1467     bs->write_ref_array_pre((narrowOop*)dst, num);
       
  1468     Copy::conjoint_oops_atomic((narrowOop*) src, (narrowOop*) dst, num);
       
  1469   } else {
       
  1470     bs->write_ref_array_pre((oop*)dst, num);
       
  1471     Copy::conjoint_oops_atomic((oop*) src, (oop*) dst, num);
       
  1472   }
       
  1473   bs->write_ref_array(dst, num);
       
  1474 JRT_END
       
  1475 
       
  1476 
       
  1477 JRT_LEAF(int, Runtime1::is_instance_of(oopDesc* mirror, oopDesc* obj))
  1444 JRT_LEAF(int, Runtime1::is_instance_of(oopDesc* mirror, oopDesc* obj))
  1478   // had to return int instead of bool, otherwise there may be a mismatch
  1445   // had to return int instead of bool, otherwise there may be a mismatch
  1479   // between the C calling convention and the Java one.
  1446   // between the C calling convention and the Java one.
  1480   // e.g., on x86, GCC may clear only %al when returning a bool false, but
  1447   // e.g., on x86, GCC may clear only %al when returning a bool false, but
  1481   // JVM takes the whole %eax as the return value, which may misinterpret
  1448   // JVM takes the whole %eax as the return value, which may misinterpret
  1543   tty->print_cr(" _generic_arraycopystub_cnt:      %d", _generic_arraycopystub_cnt);
  1510   tty->print_cr(" _generic_arraycopystub_cnt:      %d", _generic_arraycopystub_cnt);
  1544   tty->print_cr(" _byte_arraycopy_cnt:             %d", _byte_arraycopy_stub_cnt);
  1511   tty->print_cr(" _byte_arraycopy_cnt:             %d", _byte_arraycopy_stub_cnt);
  1545   tty->print_cr(" _short_arraycopy_cnt:            %d", _short_arraycopy_stub_cnt);
  1512   tty->print_cr(" _short_arraycopy_cnt:            %d", _short_arraycopy_stub_cnt);
  1546   tty->print_cr(" _int_arraycopy_cnt:              %d", _int_arraycopy_stub_cnt);
  1513   tty->print_cr(" _int_arraycopy_cnt:              %d", _int_arraycopy_stub_cnt);
  1547   tty->print_cr(" _long_arraycopy_cnt:             %d", _long_arraycopy_stub_cnt);
  1514   tty->print_cr(" _long_arraycopy_cnt:             %d", _long_arraycopy_stub_cnt);
  1548   tty->print_cr(" _primitive_arraycopy_cnt:        %d", _primitive_arraycopy_cnt);
  1515   tty->print_cr(" _oop_arraycopy_cnt:              %d", _oop_arraycopy_stub_cnt);
  1549   tty->print_cr(" _oop_arraycopy_cnt (C):          %d", Runtime1::_oop_arraycopy_cnt);
       
  1550   tty->print_cr(" _oop_arraycopy_cnt (stub):       %d", _oop_arraycopy_stub_cnt);
       
  1551   tty->print_cr(" _arraycopy_slowcase_cnt:         %d", _arraycopy_slowcase_cnt);
  1516   tty->print_cr(" _arraycopy_slowcase_cnt:         %d", _arraycopy_slowcase_cnt);
  1552   tty->print_cr(" _arraycopy_checkcast_cnt:        %d", _arraycopy_checkcast_cnt);
  1517   tty->print_cr(" _arraycopy_checkcast_cnt:        %d", _arraycopy_checkcast_cnt);
  1553   tty->print_cr(" _arraycopy_checkcast_attempt_cnt:%d", _arraycopy_checkcast_attempt_cnt);
  1518   tty->print_cr(" _arraycopy_checkcast_attempt_cnt:%d", _arraycopy_checkcast_attempt_cnt);
  1554 
  1519 
  1555   tty->print_cr(" _new_type_array_slowcase_cnt:    %d", _new_type_array_slowcase_cnt);
  1520   tty->print_cr(" _new_type_array_slowcase_cnt:    %d", _new_type_array_slowcase_cnt);