73 private:
74 friend class JvmtiTagMap;
75
76 oop _object; // tagged object
77 jlong _tag; // the tag
78 JvmtiTagHashmapEntry* _next; // next on the list
79
80 inline void init(oop object, jlong tag) {
81 _object = object;
82 _tag = tag;
83 _next = NULL;
84 }
85
86 // constructor
87 JvmtiTagHashmapEntry(oop object, jlong tag) { init(object, tag); }
88
89 public:
90
91 // accessor methods
92 inline oop* object_addr() { return &_object; }
93 inline oop object() { return RootAccess<ON_PHANTOM_OOP_REF>::oop_load(object_addr()); }
94 // Peek at the object without keeping it alive. The returned object must be
95 // kept alive using a normal access if it leaks out of a thread transition from VM.
96 inline oop object_peek() {
97 return RootAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(object_addr());
98 }
99 inline jlong tag() const { return _tag; }
100
101 inline void set_tag(jlong tag) {
102 assert(tag != 0, "can't be zero");
103 _tag = tag;
104 }
105
106 inline bool equals(oop object) {
107 return object == object_peek();
108 }
109
110 inline JvmtiTagHashmapEntry* next() const { return _next; }
111 inline void set_next(JvmtiTagHashmapEntry* next) { _next = next; }
112 };
113
114
115 // JvmtiTagHashmap
116 //
117 // A hashmap is essentially a table of pointers to entries. Entries
|
73 private:
74 friend class JvmtiTagMap;
75
76 oop _object; // tagged object
77 jlong _tag; // the tag
78 JvmtiTagHashmapEntry* _next; // next on the list
79
80 inline void init(oop object, jlong tag) {
81 _object = object;
82 _tag = tag;
83 _next = NULL;
84 }
85
86 // constructor
87 JvmtiTagHashmapEntry(oop object, jlong tag) { init(object, tag); }
88
89 public:
90
91 // accessor methods
92 inline oop* object_addr() { return &_object; }
93 inline oop object() { return NativeAccess<ON_PHANTOM_OOP_REF>::oop_load(object_addr()); }
94 // Peek at the object without keeping it alive. The returned object must be
95 // kept alive using a normal access if it leaks out of a thread transition from VM.
96 inline oop object_peek() {
97 return NativeAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(object_addr());
98 }
99 inline jlong tag() const { return _tag; }
100
101 inline void set_tag(jlong tag) {
102 assert(tag != 0, "can't be zero");
103 _tag = tag;
104 }
105
106 inline bool equals(oop object) {
107 return object == object_peek();
108 }
109
110 inline JvmtiTagHashmapEntry* next() const { return _next; }
111 inline void set_next(JvmtiTagHashmapEntry* next) { _next = next; }
112 };
113
114
115 // JvmtiTagHashmap
116 //
117 // A hashmap is essentially a table of pointers to entries. Entries
|