aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/services/mallocSiteTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/share/vm/services/mallocSiteTable.cpp')
-rw-r--r--src/share/vm/services/mallocSiteTable.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/share/vm/services/mallocSiteTable.cpp b/src/share/vm/services/mallocSiteTable.cpp
index 94fe1b96f..cb80b3e18 100644
--- a/src/share/vm/services/mallocSiteTable.cpp
+++ b/src/share/vm/services/mallocSiteTable.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -84,12 +84,18 @@ bool MallocSiteTable::initialize() {
// Create pseudo call stack for hashtable entry allocation
address pc[3];
if (NMT_TrackingStackDepth >= 3) {
- pc[2] = (address)MallocSiteTable::allocation_at;
+ uintx *fp = (uintx*)MallocSiteTable::allocation_at;
+ // On ppc64, 'fp' is a pointer to a function descriptor which is a struct of
+ // three native pointers where the first pointer is the real function address.
+ // See: http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#FUNC-DES
+ pc[2] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0])));
}
if (NMT_TrackingStackDepth >= 2) {
- pc[1] = (address)MallocSiteTable::lookup_or_add;
+ uintx *fp = (uintx*)MallocSiteTable::lookup_or_add;
+ pc[1] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0])));
}
- pc[0] = (address)MallocSiteTable::new_entry;
+ uintx *fp = (uintx*)MallocSiteTable::new_entry;
+ pc[0] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0])));
// Instantiate NativeCallStack object, have to use placement new operator. (see comments above)
NativeCallStack* stack = ::new ((void*)_hash_entry_allocation_stack)
@@ -158,7 +164,7 @@ MallocSite* MallocSiteTable::lookup_or_add(const NativeCallStack& key, size_t* b
MallocSiteHashtableEntry* head = _table[index];
while (head != NULL && (*pos_idx) <= MAX_BUCKET_LENGTH) {
MallocSite* site = head->data();
- if (site->flags() == flags && site->equals(key)) {
+ if (site->flag() == flags && site->equals(key)) {
return head->data();
}