128 template <class T> inline T* obj_field_addr_raw(int offset) const;
129
130 inline static bool is_null(oop obj) { return obj == NULL; }
131 inline static bool is_null(narrowOop obj) { return obj == 0; }
132
133 // Standard compare function returns negative value if o1 < o2
134 // 0 if o1 == o2
135 // positive value if o1 > o2
136 inline static int compare(oop o1, oop o2) {
137 void* o1_addr = (void*)o1;
138 void* o2_addr = (void*)o2;
139 if (o1_addr < o2_addr) {
140 return -1;
141 } else if (o1_addr > o2_addr) {
142 return 1;
143 } else {
144 return 0;
145 }
146 }
147
148 // Decode an oop pointer from a narrowOop if compressed.
149 // These are overloaded for oop and narrowOop as are the other functions
150 // below so that they can be called in template functions.
151 static inline oop decode_heap_oop_not_null(oop v) { return v; }
152 static inline oop decode_heap_oop_not_null(narrowOop v);
153 static inline oop decode_heap_oop(oop v) { return v; }
154 static inline oop decode_heap_oop(narrowOop v);
155
156 // Encode an oop pointer to a narrow oop. The or_null versions accept
157 // null oop pointer, others do not in order to eliminate the
158 // null checking branches.
159 static inline narrowOop encode_heap_oop_not_null(oop v);
160 static inline narrowOop encode_heap_oop(oop v);
161
162 // Load an oop out of the Java heap as is without decoding.
163 // Called by GC to check for null before decoding.
164 static inline narrowOop load_heap_oop(narrowOop* p);
165 static inline oop load_heap_oop(oop* p);
166
167 // Load an oop out of Java heap and decode it to an uncompressed oop.
|
128 template <class T> inline T* obj_field_addr_raw(int offset) const;
129
130 inline static bool is_null(oop obj) { return obj == NULL; }
131 inline static bool is_null(narrowOop obj) { return obj == 0; }
132
133 // Standard compare function returns negative value if o1 < o2
134 // 0 if o1 == o2
135 // positive value if o1 > o2
136 inline static int compare(oop o1, oop o2) {
137 void* o1_addr = (void*)o1;
138 void* o2_addr = (void*)o2;
139 if (o1_addr < o2_addr) {
140 return -1;
141 } else if (o1_addr > o2_addr) {
142 return 1;
143 } else {
144 return 0;
145 }
146 }
147
148 static bool equals(oop o1, oop o2);
149
150 // Decode an oop pointer from a narrowOop if compressed.
151 // These are overloaded for oop and narrowOop as are the other functions
152 // below so that they can be called in template functions.
153 static inline oop decode_heap_oop_not_null(oop v) { return v; }
154 static inline oop decode_heap_oop_not_null(narrowOop v);
155 static inline oop decode_heap_oop(oop v) { return v; }
156 static inline oop decode_heap_oop(narrowOop v);
157
158 // Encode an oop pointer to a narrow oop. The or_null versions accept
159 // null oop pointer, others do not in order to eliminate the
160 // null checking branches.
161 static inline narrowOop encode_heap_oop_not_null(oop v);
162 static inline narrowOop encode_heap_oop(oop v);
163
164 // Load an oop out of the Java heap as is without decoding.
165 // Called by GC to check for null before decoding.
166 static inline narrowOop load_heap_oop(narrowOop* p);
167 static inline oop load_heap_oop(oop* p);
168
169 // Load an oop out of Java heap and decode it to an uncompressed oop.
|