< prev index next >

src/hotspot/share/gc/shared/preservedMarks.inline.hpp

Print this page

37 
38 inline void PreservedMarks::push(oop obj, markWord m) {
39   assert(should_preserve_mark(obj, m), "pre-condition");
40   OopAndMarkWord elem(obj, m);
41   _stack.push(elem);
42 }
43 
44 inline void PreservedMarks::push_if_necessary(oop obj, markWord m) {
45   if (should_preserve_mark(obj, m)) {
46     push(obj, m);
47   }
48 }
49 
50 inline void PreservedMarks::push_always(oop obj, markWord m) {
51   assert(!m.is_marked(), "precondition");
52   OopAndMarkWord elem(obj, m);
53   _stack.push(elem);
54 }
55 
56 inline void PreservedMarks::init_forwarded_mark(oop obj) {
57   obj->init_mark();
58 }
59 
60 inline PreservedMarks::PreservedMarks()
61     : _stack(OopAndMarkWordStack::default_segment_size(),
62              // This stack should be used very infrequently so there's
63              // no point in caching stack segments (there will be a
64              // waste of space most of the time). So we set the max
65              // cache size to 0.
66              0 /* max_cache_size */) { }
67 
68 void PreservedMarks::OopAndMarkWord::set_mark() const {
69   _o->set_mark(_m);
70 }
71 
72 #endif // SHARE_GC_SHARED_PRESERVEDMARKS_INLINE_HPP

37 
38 inline void PreservedMarks::push(oop obj, markWord m) {
39   assert(should_preserve_mark(obj, m), "pre-condition");
40   OopAndMarkWord elem(obj, m);
41   _stack.push(elem);
42 }
43 
44 inline void PreservedMarks::push_if_necessary(oop obj, markWord m) {
45   if (should_preserve_mark(obj, m)) {
46     push(obj, m);
47   }
48 }
49 
50 inline void PreservedMarks::push_always(oop obj, markWord m) {
51   assert(!m.is_marked(), "precondition");
52   OopAndMarkWord elem(obj, m);
53   _stack.push(elem);
54 }
55 
56 inline void PreservedMarks::init_forwarded_mark(oop obj) {
57   obj->forward_safe_init_mark();
58 }
59 
60 inline PreservedMarks::PreservedMarks()
61     : _stack(OopAndMarkWordStack::default_segment_size(),
62              // This stack should be used very infrequently so there's
63              // no point in caching stack segments (there will be a
64              // waste of space most of the time). So we set the max
65              // cache size to 0.
66              0 /* max_cache_size */) { }
67 
68 void PreservedMarks::OopAndMarkWord::set_mark() const {
69   _o->set_mark(_m);
70 }
71 
72 #endif // SHARE_GC_SHARED_PRESERVEDMARKS_INLINE_HPP
< prev index next >