1 /*
2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 // Implementation of all inlined member functions defined in oop.hpp
26 // We need a separate file to avoid circular references
27
28 inline void oopDesc::release_set_mark(markOop m) {
29 OrderAccess::release_store_ptr(&_mark, m);
30 }
31
32 inline markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) {
33 return (markOop) Atomic::cmpxchg_ptr(new_mark, &_mark, old_mark);
34 }
35
36 inline klassOop oopDesc::klass() const {
37 if (UseCompressedOops) {
38 return (klassOop)decode_heap_oop_not_null(_metadata._compressed_klass);
39 } else {
40 return _metadata._klass;
41 }
42 }
43
44 inline klassOop oopDesc::klass_or_null() const volatile {
729 inline int oopDesc::oop_iterate_backwards(OopClosureType* blk) { \
730 SpecializationStats::record_call(); \
731 return blueprint()->oop_oop_iterate_backwards##nv_suffix(this, blk); \
732 }
733
734 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DEFN)
735 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DEFN)
736 #endif // !SERIALGC
737
738 inline bool oopDesc::is_shared() const {
739 return CompactingPermGenGen::is_shared(this);
740 }
741
742 inline bool oopDesc::is_shared_readonly() const {
743 return CompactingPermGenGen::is_shared_readonly(this);
744 }
745
746 inline bool oopDesc::is_shared_readwrite() const {
747 return CompactingPermGenGen::is_shared_readwrite(this);
748 }
|
1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_OOPS_OOP_INLINE_HPP
26 #define SHARE_VM_OOPS_OOP_INLINE_HPP
27
28 #include "gc_implementation/shared/ageTable.hpp"
29 #include "gc_implementation/shared/markSweep.inline.hpp"
30 #include "gc_interface/collectedHeap.inline.hpp"
31 #include "memory/barrierSet.inline.hpp"
32 #include "memory/cardTableModRefBS.hpp"
33 #include "memory/compactingPermGenGen.hpp"
34 #include "memory/genCollectedHeap.hpp"
35 #include "memory/generation.hpp"
36 #include "memory/permGen.hpp"
37 #include "memory/specialized_oop_closures.hpp"
38 #include "oops/arrayKlass.hpp"
39 #include "oops/arrayOop.hpp"
40 #include "oops/klass.hpp"
41 #include "oops/klassOop.hpp"
42 #include "oops/markOop.inline.hpp"
43 #include "oops/oop.hpp"
44 #include "runtime/atomic.hpp"
45 #include "runtime/os.hpp"
46 #ifdef TARGET_ARCH_x86
47 # include "bytes_x86.hpp"
48 #endif
49 #ifdef TARGET_ARCH_sparc
50 # include "bytes_sparc.hpp"
51 #endif
52 #ifdef TARGET_ARCH_zero
53 # include "bytes_zero.hpp"
54 #endif
55
56 // Implementation of all inlined member functions defined in oop.hpp
57 // We need a separate file to avoid circular references
58
59 inline void oopDesc::release_set_mark(markOop m) {
60 OrderAccess::release_store_ptr(&_mark, m);
61 }
62
63 inline markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) {
64 return (markOop) Atomic::cmpxchg_ptr(new_mark, &_mark, old_mark);
65 }
66
67 inline klassOop oopDesc::klass() const {
68 if (UseCompressedOops) {
69 return (klassOop)decode_heap_oop_not_null(_metadata._compressed_klass);
70 } else {
71 return _metadata._klass;
72 }
73 }
74
75 inline klassOop oopDesc::klass_or_null() const volatile {
760 inline int oopDesc::oop_iterate_backwards(OopClosureType* blk) { \
761 SpecializationStats::record_call(); \
762 return blueprint()->oop_oop_iterate_backwards##nv_suffix(this, blk); \
763 }
764
765 ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DEFN)
766 ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DEFN)
767 #endif // !SERIALGC
768
769 inline bool oopDesc::is_shared() const {
770 return CompactingPermGenGen::is_shared(this);
771 }
772
773 inline bool oopDesc::is_shared_readonly() const {
774 return CompactingPermGenGen::is_shared_readonly(this);
775 }
776
777 inline bool oopDesc::is_shared_readwrite() const {
778 return CompactingPermGenGen::is_shared_readwrite(this);
779 }
780
781 #endif // SHARE_VM_OOPS_OOP_INLINE_HPP
|