< prev index next >
src/hotspot/share/oops/array.hpp
Print this page
*** 25,35 ****
#ifndef SHARE_OOPS_ARRAY_HPP
#define SHARE_OOPS_ARRAY_HPP
#include "memory/allocation.hpp"
#include "memory/metaspace.hpp"
! #include "runtime/orderAccess.hpp"
#include "utilities/align.hpp"
// Array for metadata allocation
template <typename T>
--- 25,35 ----
#ifndef SHARE_OOPS_ARRAY_HPP
#define SHARE_OOPS_ARRAY_HPP
#include "memory/allocation.hpp"
#include "memory/metaspace.hpp"
! #include "runtime/atomic.hpp"
#include "utilities/align.hpp"
// Array for metadata allocation
template <typename T>
*** 120,131 ****
T at(int i) const { assert(i >= 0 && i< _length, "oob: 0 <= %d < %d", i, _length); return _data[i]; }
void at_put(const int i, const T& x) { assert(i >= 0 && i< _length, "oob: 0 <= %d < %d", i, _length); _data[i] = x; }
T* adr_at(const int i) { assert(i >= 0 && i< _length, "oob: 0 <= %d < %d", i, _length); return &_data[i]; }
int find(const T& x) { return index_of(x); }
! T at_acquire(const int i) { return OrderAccess::load_acquire(adr_at(i)); }
! void release_at_put(int i, T x) { OrderAccess::release_store(adr_at(i), x); }
static int size(int length) {
size_t bytes = align_up(byte_sizeof(length), BytesPerWord);
size_t words = bytes / BytesPerWord;
--- 120,131 ----
T at(int i) const { assert(i >= 0 && i< _length, "oob: 0 <= %d < %d", i, _length); return _data[i]; }
void at_put(const int i, const T& x) { assert(i >= 0 && i< _length, "oob: 0 <= %d < %d", i, _length); _data[i] = x; }
T* adr_at(const int i) { assert(i >= 0 && i< _length, "oob: 0 <= %d < %d", i, _length); return &_data[i]; }
int find(const T& x) { return index_of(x); }
! T at_acquire(const int i) { return Atomic::load_acquire(adr_at(i)); }
! void release_at_put(int i, T x) { Atomic::release_store(adr_at(i), x); }
static int size(int length) {
size_t bytes = align_up(byte_sizeof(length), BytesPerWord);
size_t words = bytes / BytesPerWord;
< prev index next >