src/hotspot/share/gc/z/zNMethodTableIteration.cpp
changeset 59249 29b0d0b61615
parent 53893 ad56513c7e07
equal deleted inserted replaced
59248:e92153ed8bdc 59249:29b0d0b61615
    56 void ZNMethodTableIteration::nmethods_do(NMethodClosure* cl) {
    56 void ZNMethodTableIteration::nmethods_do(NMethodClosure* cl) {
    57   for (;;) {
    57   for (;;) {
    58     // Claim table partition. Each partition is currently sized to span
    58     // Claim table partition. Each partition is currently sized to span
    59     // two cache lines. This number is just a guess, but seems to work well.
    59     // two cache lines. This number is just a guess, but seems to work well.
    60     const size_t partition_size = (ZCacheLineSize * 2) / sizeof(ZNMethodTableEntry);
    60     const size_t partition_size = (ZCacheLineSize * 2) / sizeof(ZNMethodTableEntry);
    61     const size_t partition_start = MIN2(Atomic::add(partition_size, &_claimed) - partition_size, _size);
    61     const size_t partition_start = MIN2(Atomic::add(&_claimed, partition_size) - partition_size, _size);
    62     const size_t partition_end = MIN2(partition_start + partition_size, _size);
    62     const size_t partition_end = MIN2(partition_start + partition_size, _size);
    63     if (partition_start == partition_end) {
    63     if (partition_start == partition_end) {
    64       // End of table
    64       // End of table
    65       break;
    65       break;
    66     }
    66     }