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_MEMORY_DEFNEWGENERATION_INLINE_HPP
26 #define SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
27
28 #include "memory/cardTableRS.hpp"
29 #include "memory/defNewGeneration.hpp"
30 #include "memory/genCollectedHeap.hpp"
31 #include "memory/genOopClosures.inline.hpp"
32 #include "memory/space.hpp"
33
34 // Methods of protected closure types
35
36 template <class T>
37 inline void DefNewGeneration::KeepAliveClosure::do_oop_work(T* p) {
38 #ifdef ASSERT
39 {
40 // We never expect to see a null reference being processed
41 // as a weak reference.
42 assert (!oopDesc::is_null(*p), "expected non-null ref");
43 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
44 assert (obj->is_oop(), "expected an oop while scanning weak refs");
45 }
46 #endif // ASSERT
47
48 _cl->do_oop_nv(p);
49
50 // Card marking is trickier for weak refs.
51 // This oop is a 'next' field which was filled in while we
52 // were discovering weak references. While we might not need
72 {
73 // We never expect to see a null reference being processed
74 // as a weak reference.
75 assert (!oopDesc::is_null(*p), "expected non-null ref");
76 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
77 assert (obj->is_oop(), "expected an oop while scanning weak refs");
78 }
79 #endif // ASSERT
80
81 _cl->do_oop_nv(p);
82
83 // Optimized for Defnew generation if it's the youngest generation:
84 // we set a younger_gen card if we have an older->youngest
85 // generation pointer.
86 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
87 if (((HeapWord*)obj < _boundary) && GenCollectedHeap::heap()->is_in_reserved(p)) {
88 _rs->inline_write_ref_field_gc(p, obj);
89 }
90 }
91
92 #endif // SHARE_VM_MEMORY_DEFNEWGENERATION_INLINE_HPP
|
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_GC_SERIAL_DEFNEWGENERATION_INLINE_HPP
26 #define SHARE_VM_GC_SERIAL_DEFNEWGENERATION_INLINE_HPP
27
28 #include "gc/serial/defNewGeneration.hpp"
29 #include "gc/shared/cardTableRS.hpp"
30 #include "gc/shared/genCollectedHeap.hpp"
31 #include "gc/shared/genOopClosures.inline.hpp"
32 #include "gc/shared/space.hpp"
33
34 // Methods of protected closure types
35
36 template <class T>
37 inline void DefNewGeneration::KeepAliveClosure::do_oop_work(T* p) {
38 #ifdef ASSERT
39 {
40 // We never expect to see a null reference being processed
41 // as a weak reference.
42 assert (!oopDesc::is_null(*p), "expected non-null ref");
43 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
44 assert (obj->is_oop(), "expected an oop while scanning weak refs");
45 }
46 #endif // ASSERT
47
48 _cl->do_oop_nv(p);
49
50 // Card marking is trickier for weak refs.
51 // This oop is a 'next' field which was filled in while we
52 // were discovering weak references. While we might not need
72 {
73 // We never expect to see a null reference being processed
74 // as a weak reference.
75 assert (!oopDesc::is_null(*p), "expected non-null ref");
76 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
77 assert (obj->is_oop(), "expected an oop while scanning weak refs");
78 }
79 #endif // ASSERT
80
81 _cl->do_oop_nv(p);
82
83 // Optimized for Defnew generation if it's the youngest generation:
84 // we set a younger_gen card if we have an older->youngest
85 // generation pointer.
86 oop obj = oopDesc::load_decode_heap_oop_not_null(p);
87 if (((HeapWord*)obj < _boundary) && GenCollectedHeap::heap()->is_in_reserved(p)) {
88 _rs->inline_write_ref_field_gc(p, obj);
89 }
90 }
91
92 #endif // SHARE_VM_GC_SERIAL_DEFNEWGENERATION_INLINE_HPP
|