282 return is_virtual_memory_commit_record(_flags); 283 } 284 285 // if this record records a virtual memory 'uncommit' call 286 inline bool is_uncommit_record() const { 287 return is_virtual_memory_uncommit_record(_flags); 288 } 289 290 // if this record is a tagging record of a virtual memory block 291 inline bool is_type_tagging_record() const { 292 return is_virtual_memory_type_record(_flags); 293 } 294 295 // if the two memory pointer records actually represent the same 296 // memory block 297 inline bool is_same_region(const MemPointerRecord* other) const { 298 return (addr() == other->addr() && size() == other->size()); 299 } 300 301 // if this memory region fully contains another one 302 inline bool contains_region(const MemPointerRecord* other) const { 303 return contains_region(other->addr(), other->size()); 304 } 305 306 // if this memory region fully contains specified memory range 307 inline bool contains_region(address add, size_t sz) const { 308 return (addr() <= add && addr() + size() >= add + sz); 309 } 310 311 inline bool contains_address(address add) const { 312 return (addr() <= add && addr() + size() > add); 313 } 314 }; 315 316 // MemPointerRecordEx also records callsite pc, from where 317 // the memory block is allocated 318 class MemPointerRecordEx : public MemPointerRecord { 319 private: 320 address _pc; // callsite pc 321 322 public: 323 MemPointerRecordEx(): _pc(0) { } 324 325 MemPointerRecordEx(address addr, MEMFLAGS memflags, size_t size = 0, address pc = 0): 326 MemPointerRecord(addr, memflags, size), _pc(pc) {} 327 328 MemPointerRecordEx(const MemPointerRecordEx& copy_from): 329 MemPointerRecord(copy_from), _pc(copy_from.pc()) {} 330 331 inline address pc() const { return _pc; } 332 333 void init(const MemPointerRecordEx* mpe) { | 282 return is_virtual_memory_commit_record(_flags); 283 } 284 285 // if this record records a virtual memory 'uncommit' call 286 inline bool is_uncommit_record() const { 287 return is_virtual_memory_uncommit_record(_flags); 288 } 289 290 // if this record is a tagging record of a virtual memory block 291 inline bool is_type_tagging_record() const { 292 return is_virtual_memory_type_record(_flags); 293 } 294 295 // if the two memory pointer records actually represent the same 296 // memory block 297 inline bool is_same_region(const MemPointerRecord* other) const { 298 return (addr() == other->addr() && size() == other->size()); 299 } 300 301 // if this memory region fully contains another one 302 inline bool contain_region(const MemPointerRecord* other) const { 303 return contain_region(other->addr(), other->size()); 304 } 305 306 // if this memory region fully contains specified memory range 307 inline bool contain_region(address add, size_t sz) const { 308 return (addr() <= add && addr() + size() >= add + sz); 309 } 310 311 inline bool contain_address(address add) const { 312 return (addr() <= add && addr() + size() > add); 313 } 314 315 // if this memory region overlaps another region 316 inline bool overlap_region(const MemPointerRecord* other) const { 317 assert(other != NULL, "Just check"); 318 assert(size() > 0 && other->size() > 0, "empty range"); 319 return contain_address(other->addr()) || 320 contain_address(other->addr() + other->size() - 1) || // exclude end address 321 other->contain_address(addr()) || 322 other->contain_address(addr() + size() - 1); // exclude end address 323 } 324 325 }; 326 327 // MemPointerRecordEx also records callsite pc, from where 328 // the memory block is allocated 329 class MemPointerRecordEx : public MemPointerRecord { 330 private: 331 address _pc; // callsite pc 332 333 public: 334 MemPointerRecordEx(): _pc(0) { } 335 336 MemPointerRecordEx(address addr, MEMFLAGS memflags, size_t size = 0, address pc = 0): 337 MemPointerRecord(addr, memflags, size), _pc(pc) {} 338 339 MemPointerRecordEx(const MemPointerRecordEx& copy_from): 340 MemPointerRecord(copy_from), _pc(copy_from.pc()) {} 341 342 inline address pc() const { return _pc; } 343 344 void init(const MemPointerRecordEx* mpe) { |