equal
deleted
inserted
replaced
450 OopMapCacheEntry* OopMapCache::entry_at(int i) const { |
450 OopMapCacheEntry* OopMapCache::entry_at(int i) const { |
451 return Atomic::load_acquire(&(_array[i % _size])); |
451 return Atomic::load_acquire(&(_array[i % _size])); |
452 } |
452 } |
453 |
453 |
454 bool OopMapCache::put_at(int i, OopMapCacheEntry* entry, OopMapCacheEntry* old) { |
454 bool OopMapCache::put_at(int i, OopMapCacheEntry* entry, OopMapCacheEntry* old) { |
455 return Atomic::cmpxchg(entry, &_array[i % _size], old) == old; |
455 return Atomic::cmpxchg(&_array[i % _size], old, entry) == old; |
456 } |
456 } |
457 |
457 |
458 void OopMapCache::flush() { |
458 void OopMapCache::flush() { |
459 for (int i = 0; i < _size; i++) { |
459 for (int i = 0; i < _size; i++) { |
460 OopMapCacheEntry* entry = _array[i]; |
460 OopMapCacheEntry* entry = _array[i]; |
562 bool success = false; |
562 bool success = false; |
563 OopMapCacheEntry* head; |
563 OopMapCacheEntry* head; |
564 do { |
564 do { |
565 head = _old_entries; |
565 head = _old_entries; |
566 entry->_next = head; |
566 entry->_next = head; |
567 success = Atomic::cmpxchg(entry, &_old_entries, head) == head; |
567 success = Atomic::cmpxchg(&_old_entries, head, entry) == head; |
568 } while (!success); |
568 } while (!success); |
569 |
569 |
570 if (log_is_enabled(Debug, interpreter, oopmap)) { |
570 if (log_is_enabled(Debug, interpreter, oopmap)) { |
571 ResourceMark rm; |
571 ResourceMark rm; |
572 log_debug(interpreter, oopmap)("enqueue %s at bci %d for cleanup", |
572 log_debug(interpreter, oopmap)("enqueue %s at bci %d for cleanup", |