< prev index next >

src/hotspot/share/oops/stackChunkOop.inline.hpp

Print this page

239 inline void* stackChunkOopDesc::gc_data() const {
240   int stack_sz = stack_size();
241   assert(stack_sz != 0, "stack should not be empty");
242 
243   // The gc data is located after the stack.
244   return start_of_stack() + stack_sz;
245 }
246 
247 inline BitMapView stackChunkOopDesc::bitmap() const {
248   HeapWord* bitmap_addr = static_cast<HeapWord*>(gc_data());
249   int stack_sz = stack_size();
250   size_t bitmap_size_in_bits = InstanceStackChunkKlass::bitmap_size_in_bits(stack_sz);
251 
252   BitMapView bitmap((BitMap::bm_word_t*)bitmap_addr, bitmap_size_in_bits);
253 
254   DEBUG_ONLY(bitmap.verify_range(bit_index_for(start_address()), bit_index_for(end_address()));)
255 
256   return bitmap;
257 }
258 
259 inline BitMap::idx_t stackChunkOopDesc::bit_index_for(intptr_t* p) const {
260   return UseCompressedOops ? bit_index_for((narrowOop*)p) : bit_index_for((oop*)p);
261 }
262 
263 template <typename OopT>
264 inline BitMap::idx_t stackChunkOopDesc::bit_index_for(OopT* p) const {

265   assert(p >= (OopT*)start_address(), "Address not in chunk");
266   return p - (OopT*)start_address();
267 }
268 
269 inline intptr_t* stackChunkOopDesc::address_for_bit(BitMap::idx_t index) const {
270   return UseCompressedOops ? (intptr_t*)address_for_bit<narrowOop>(index) : (intptr_t*)address_for_bit<oop>(index);
271 }
272 
273 template <typename OopT>
274 inline OopT* stackChunkOopDesc::address_for_bit(BitMap::idx_t index) const {
275   return (OopT*)start_address() + index;
276 }
277 
278 inline MemRegion stackChunkOopDesc::range() {
279   return MemRegion((HeapWord*)this, size());
280 }
281 
282 inline int stackChunkOopDesc::relativize_usp_offset(const frame& fr, const int usp_offset_in_bytes) const {
283   assert(fr.is_compiled_frame() || fr.cb()->is_safepoint_stub(), "");
284   assert(is_in_chunk(fr.unextended_sp()), "");

239 inline void* stackChunkOopDesc::gc_data() const {
240   int stack_sz = stack_size();
241   assert(stack_sz != 0, "stack should not be empty");
242 
243   // The gc data is located after the stack.
244   return start_of_stack() + stack_sz;
245 }
246 
247 inline BitMapView stackChunkOopDesc::bitmap() const {
248   HeapWord* bitmap_addr = static_cast<HeapWord*>(gc_data());
249   int stack_sz = stack_size();
250   size_t bitmap_size_in_bits = InstanceStackChunkKlass::bitmap_size_in_bits(stack_sz);
251 
252   BitMapView bitmap((BitMap::bm_word_t*)bitmap_addr, bitmap_size_in_bits);
253 
254   DEBUG_ONLY(bitmap.verify_range(bit_index_for(start_address()), bit_index_for(end_address()));)
255 
256   return bitmap;
257 }
258 
259 inline BitMap::idx_t stackChunkOopDesc::bit_index_for(address p) const {
260   return UseCompressedOops ? bit_index_for((narrowOop*)p) : bit_index_for((oop*)p);
261 }
262 
263 template <typename OopT>
264 inline BitMap::idx_t stackChunkOopDesc::bit_index_for(OopT* p) const {
265   assert(is_aligned(p, alignof(OopT)), "should be aligned: " PTR_FORMAT, p2i(p));
266   assert(p >= (OopT*)start_address(), "Address not in chunk");
267   return p - (OopT*)start_address();
268 }
269 
270 inline intptr_t* stackChunkOopDesc::address_for_bit(BitMap::idx_t index) const {
271   return UseCompressedOops ? (intptr_t*)address_for_bit<narrowOop>(index) : (intptr_t*)address_for_bit<oop>(index);
272 }
273 
274 template <typename OopT>
275 inline OopT* stackChunkOopDesc::address_for_bit(BitMap::idx_t index) const {
276   return (OopT*)start_address() + index;
277 }
278 
279 inline MemRegion stackChunkOopDesc::range() {
280   return MemRegion((HeapWord*)this, size());
281 }
282 
283 inline int stackChunkOopDesc::relativize_usp_offset(const frame& fr, const int usp_offset_in_bytes) const {
284   assert(fr.is_compiled_frame() || fr.cb()->is_safepoint_stub(), "");
285   assert(is_in_chunk(fr.unextended_sp()), "");
< prev index next >