82 assert(NMT_TrackingStackDepth > 1, "At least one tracking stack"); |
82 assert(NMT_TrackingStackDepth > 1, "At least one tracking stack"); |
83 |
83 |
84 // Create pseudo call stack for hashtable entry allocation |
84 // Create pseudo call stack for hashtable entry allocation |
85 address pc[3]; |
85 address pc[3]; |
86 if (NMT_TrackingStackDepth >= 3) { |
86 if (NMT_TrackingStackDepth >= 3) { |
87 pc[2] = (address)MallocSiteTable::allocation_at; |
87 uintx *fp = (uintx*)MallocSiteTable::allocation_at; |
|
88 // On ppc64, 'fp' is a pointer to a function descriptor which is a struct of |
|
89 // three native pointers where the first pointer is the real function address. |
|
90 // See: http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#FUNC-DES |
|
91 pc[2] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0]))); |
88 } |
92 } |
89 if (NMT_TrackingStackDepth >= 2) { |
93 if (NMT_TrackingStackDepth >= 2) { |
90 pc[1] = (address)MallocSiteTable::lookup_or_add; |
94 uintx *fp = (uintx*)MallocSiteTable::lookup_or_add; |
91 } |
95 pc[1] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0]))); |
92 pc[0] = (address)MallocSiteTable::new_entry; |
96 } |
|
97 uintx *fp = (uintx*)MallocSiteTable::new_entry; |
|
98 pc[0] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0]))); |
93 |
99 |
94 // Instantiate NativeCallStack object, have to use placement new operator. (see comments above) |
100 // Instantiate NativeCallStack object, have to use placement new operator. (see comments above) |
95 NativeCallStack* stack = ::new ((void*)_hash_entry_allocation_stack) |
101 NativeCallStack* stack = ::new ((void*)_hash_entry_allocation_stack) |
96 NativeCallStack(pc, MIN2(((int)(sizeof(pc) / sizeof(address))), ((int)NMT_TrackingStackDepth))); |
102 NativeCallStack(pc, MIN2(((int)(sizeof(pc) / sizeof(address))), ((int)NMT_TrackingStackDepth))); |
97 |
103 |