aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/services/memSnapshot.cpp
diff options
context:
space:
mode:
authorzgu <none@none>2012-08-14 13:56:46 -0400
committerzgu <none@none>2012-08-14 13:56:46 -0400
commita9263a07da799bb5be24a953200111c8a1d6df4c (patch)
treedcba319ddd5ec90874858779a6486734f7d528e7 /src/share/vm/services/memSnapshot.cpp
parent441ff63e82fab72e744a71ee8cbb875f22dbd094 (diff)
7191124: Optimized build is broken due to inconsistent use of DEBUG_ONLY and NOT_PRODUCT macros in NMT
Summary: Updated all related variables and methods to use NOT_PRODUCT macros Reviewed-by: coleenp, acorn, kvn
Diffstat (limited to 'src/share/vm/services/memSnapshot.cpp')
-rw-r--r--src/share/vm/services/memSnapshot.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/share/vm/services/memSnapshot.cpp b/src/share/vm/services/memSnapshot.cpp
index 81d35d871..5186bd214 100644
--- a/src/share/vm/services/memSnapshot.cpp
+++ b/src/share/vm/services/memSnapshot.cpp
@@ -338,15 +338,13 @@ void MemSnapshot::promote() {
vm_itr.insert_after(cur_vm);
}
} else {
-#ifdef ASSERT
// In theory, we should assert without conditions. However, in case of native
// thread stack, NMT explicitly releases the thread stack in Thread's destructor,
// due to platform dependent behaviors. On some platforms, we see uncommit/release
// native thread stack, but some, we don't.
- if (!cur_vm->is_uncommit_record() && !cur_vm->is_deallocation_record()) {
- fatal(err_msg("Should not reach here, pointer flags = [%x]", cur_vm->flags()));
- }
-#endif
+ assert(cur_vm->is_uncommit_record() || cur_vm->is_deallocation_record(),
+ err_msg("Should not reach here, pointer addr = [" INTPTR_FORMAT "], flags = [%x]",
+ cur_vm->addr(), cur_vm->flags()));
}
}
} else {
@@ -406,7 +404,7 @@ void MemSnapshot::promote() {
}
-#ifdef ASSERT
+#ifndef PRODUCT
void MemSnapshot::print_snapshot_stats(outputStream* st) {
st->print_cr("Snapshot:");
st->print_cr("\tMalloced: %d/%d [%5.2f%%] %dKB", _alloc_ptrs->length(), _alloc_ptrs->capacity(),
@@ -434,6 +432,20 @@ void MemSnapshot::check_malloc_pointers() {
}
}
+bool MemSnapshot::has_allocation_record(address addr) {
+ MemPointerArrayIteratorImpl itr(_staging_area);
+ MemPointerRecord* cur = (MemPointerRecord*)itr.current();
+ while (cur != NULL) {
+ if (cur->addr() == addr && cur->is_allocation_record()) {
+ return true;
+ }
+ cur = (MemPointerRecord*)itr.next();
+ }
+ return false;
+}
+#endif // PRODUCT
+
+#ifdef ASSERT
void MemSnapshot::check_staging_data() {
MemPointerArrayIteratorImpl itr(_staging_area);
MemPointerRecord* cur = (MemPointerRecord*)itr.current();
@@ -447,17 +459,5 @@ void MemSnapshot::check_staging_data() {
next = (MemPointerRecord*)itr.next();
}
}
+#endif // ASSERT
-bool MemSnapshot::has_allocation_record(address addr) {
- MemPointerArrayIteratorImpl itr(_staging_area);
- MemPointerRecord* cur = (MemPointerRecord*)itr.current();
- while (cur != NULL) {
- if (cur->addr() == addr && cur->is_allocation_record()) {
- return true;
- }
- cur = (MemPointerRecord*)itr.next();
- }
- return false;
-}
-
-#endif