8189871: Refactor GC barriers to use declarative semantics

Reviewed-by: pliden, rkennke, coleenp, dholmes, kbarrett, stefank
This commit is contained in:
Erik Österlund 2017-11-20 13:07:44 +01:00
parent 63122ba705
commit 3e5e2f03b1
45 changed files with 3458 additions and 806 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,26 +25,19 @@
#ifndef SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
#define SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP
#include "oops/access.inline.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/globals.hpp"
inline oop objArrayOopDesc::obj_at(int index) const {
// With UseCompressedOops decode the narrow oop in the objArray to an
// uncompressed oop. Otherwise this is simply a "*" operator.
if (UseCompressedOops) {
return load_decode_heap_oop(obj_at_addr<narrowOop>(index));
} else {
return load_decode_heap_oop(obj_at_addr<oop>(index));
}
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);
}
void objArrayOopDesc::obj_at_put(int index, oop value) {
if (UseCompressedOops) {
oop_store(obj_at_addr<narrowOop>(index), value);
} else {
oop_store(obj_at_addr<oop>(index), value);
}
inline void objArrayOopDesc::obj_at_put(int index, oop value) {
ptrdiff_t offset = UseCompressedOops ? obj_at_offset<narrowOop>(index) : obj_at_offset<oop>(index);
HeapAccess<IN_HEAP_ARRAY>::oop_store_at(as_oop(), offset, value);
}
#endif // SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP