equal
deleted
inserted
replaced
670 // generated hashCode values: |
670 // generated hashCode values: |
671 |
671 |
672 static inline intptr_t get_next_hash(Thread * Self, oop obj) { |
672 static inline intptr_t get_next_hash(Thread * Self, oop obj) { |
673 intptr_t value = 0; |
673 intptr_t value = 0; |
674 if (hashCode == 0) { |
674 if (hashCode == 0) { |
675 // This form uses an unguarded global Park-Miller RNG, |
675 // This form uses global Park-Miller RNG. |
676 // so it's possible for two threads to race and generate the same RNG. |
|
677 // On MP system we'll have lots of RW access to a global, so the |
676 // On MP system we'll have lots of RW access to a global, so the |
678 // mechanism induces lots of coherency traffic. |
677 // mechanism induces lots of coherency traffic. |
679 value = os::random(); |
678 value = os::random(); |
680 } else if (hashCode == 1) { |
679 } else if (hashCode == 1) { |
681 // This variation has the property of being stable (idempotent) |
680 // This variation has the property of being stable (idempotent) |