< prev index next >
src/hotspot/share/interpreter/oopMapCache.cpp
Print this page
*** 446,460 ****
// Deallocate array
FREE_C_HEAP_ARRAY(OopMapCacheEntry*, _array);
}
OopMapCacheEntry* OopMapCache::entry_at(int i) const {
! return (OopMapCacheEntry*)OrderAccess::load_ptr_acquire(&(_array[i % _size]));
}
bool OopMapCache::put_at(int i, OopMapCacheEntry* entry, OopMapCacheEntry* old) {
! return Atomic::cmpxchg_ptr (entry, &_array[i % _size], old) == old;
}
void OopMapCache::flush() {
for (int i = 0; i < _size; i++) {
OopMapCacheEntry* entry = _array[i];
--- 446,460 ----
// Deallocate array
FREE_C_HEAP_ARRAY(OopMapCacheEntry*, _array);
}
OopMapCacheEntry* OopMapCache::entry_at(int i) const {
! return OrderAccess::load_acquire(&(_array[i % _size]));
}
bool OopMapCache::put_at(int i, OopMapCacheEntry* entry, OopMapCacheEntry* old) {
! return Atomic::cmpxchg(entry, &_array[i % _size], old) == old;
}
void OopMapCache::flush() {
for (int i = 0; i < _size; i++) {
OopMapCacheEntry* entry = _array[i];
*** 562,572 ****
bool success = false;
OopMapCacheEntry* head;
do {
head = _old_entries;
entry->_next = head;
! success = Atomic::cmpxchg_ptr (entry, &_old_entries, head) == head;
} while (!success);
if (log_is_enabled(Debug, interpreter, oopmap)) {
ResourceMark rm;
log_debug(interpreter, oopmap)("enqueue %s at bci %d for cleanup",
--- 562,572 ----
bool success = false;
OopMapCacheEntry* head;
do {
head = _old_entries;
entry->_next = head;
! success = Atomic::cmpxchg(entry, &_old_entries, head) == head;
} while (!success);
if (log_is_enabled(Debug, interpreter, oopmap)) {
ResourceMark rm;
log_debug(interpreter, oopmap)("enqueue %s at bci %d for cleanup",
< prev index next >