mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
Reviewed-by: pliden, rkennke
This commit is contained in:
parent
b8ab854bdc
commit
432a71e564
39 changed files with 338 additions and 197 deletions
|
@ -26,10 +26,24 @@
|
|||
#define SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
|
||||
|
||||
#include "oops/access.inline.hpp"
|
||||
#include "oops/arrayOop.inline.hpp"
|
||||
#include "oops/objArrayOop.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/globals.hpp"
|
||||
|
||||
inline HeapWord* objArrayOopDesc::base() const { return (HeapWord*) arrayOopDesc::base(T_OBJECT); }
|
||||
inline HeapWord* objArrayOopDesc::base_raw() const { return (HeapWord*) arrayOopDesc::base_raw(T_OBJECT); }
|
||||
|
||||
template <class T> T* objArrayOopDesc::obj_at_addr(int index) const {
|
||||
assert(is_within_bounds(index), "index out of bounds");
|
||||
return &((T*)base())[index];
|
||||
}
|
||||
|
||||
template <class T> T* objArrayOopDesc::obj_at_addr_raw(int index) const {
|
||||
assert(is_within_bounds(index), "index out of bounds");
|
||||
return &((T*)base_raw())[index];
|
||||
}
|
||||
|
||||
inline oop objArrayOopDesc::obj_at(int index) const {
|
||||
ptrdiff_t offset = UseCompressedOops ? obj_at_offset<narrowOop>(index) : obj_at_offset<oop>(index);
|
||||
return HeapAccess<IN_HEAP_ARRAY>::oop_load_at(as_oop(), offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue