author | jwilhelm |
Sun, 25 Feb 2018 04:59:43 +0100 | |
changeset 49067 | c153e9daadce |
parent 49041 | 44122f767467 |
child 50728 | 9375184cec98 |
permissions | -rw-r--r-- |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
1 |
/* |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
4 |
* |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
8 |
* |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
13 |
* accompanied this code). |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
14 |
* |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
18 |
* |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
21 |
* questions. |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
22 |
* |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
23 |
*/ |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
24 |
|
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
25 |
#ifndef SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
26 |
#define SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
27 |
|
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47216
diff
changeset
|
28 |
#include "oops/access.inline.hpp" |
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
29 |
#include "oops/arrayOop.inline.hpp" |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
30 |
#include "oops/objArrayOop.hpp" |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
31 |
#include "oops/oop.inline.hpp" |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
32 |
#include "runtime/globals.hpp" |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
33 |
|
49041
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
34 |
inline HeapWord* objArrayOopDesc::base() const { return (HeapWord*) arrayOopDesc::base(T_OBJECT); } |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
35 |
inline HeapWord* objArrayOopDesc::base_raw() const { return (HeapWord*) arrayOopDesc::base_raw(T_OBJECT); } |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
36 |
|
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
37 |
template <class T> T* objArrayOopDesc::obj_at_addr(int index) const { |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
38 |
assert(is_within_bounds(index), "index out of bounds"); |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
39 |
return &((T*)base())[index]; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
40 |
} |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
41 |
|
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
42 |
template <class T> T* objArrayOopDesc::obj_at_addr_raw(int index) const { |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
43 |
assert(is_within_bounds(index), "index out of bounds"); |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
44 |
return &((T*)base_raw())[index]; |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
45 |
} |
44122f767467
8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents:
47998
diff
changeset
|
46 |
|
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
47 |
inline oop objArrayOopDesc::obj_at(int index) const { |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47216
diff
changeset
|
48 |
ptrdiff_t offset = UseCompressedOops ? obj_at_offset<narrowOop>(index) : obj_at_offset<oop>(index); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47216
diff
changeset
|
49 |
return HeapAccess<IN_HEAP_ARRAY>::oop_load_at(as_oop(), offset); |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
50 |
} |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
51 |
|
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47216
diff
changeset
|
52 |
inline void objArrayOopDesc::obj_at_put(int index, oop value) { |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47216
diff
changeset
|
53 |
ptrdiff_t offset = UseCompressedOops ? obj_at_offset<narrowOop>(index) : obj_at_offset<oop>(index); |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47216
diff
changeset
|
54 |
HeapAccess<IN_HEAP_ARRAY>::oop_store_at(as_oop(), offset, value); |
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
29081
diff
changeset
|
55 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
29081
diff
changeset
|
56 |
|
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
57 |
#endif // SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP |