changeset 10783:c7ef664f8649

8184762: ZapStackSegments should use optimized memset Reviewed-by: rkennke, mgerdin
author shade
date Tue, 18 Jul 2017 09:53:54 +0200
parents 7b3ade0882f4
children d64fa7b92b5b
files src/share/vm/utilities/globalDefinitions.hpp src/share/vm/utilities/stack.inline.hpp
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/utilities/globalDefinitions.hpp	Fri Mar 01 10:00:03 2019 -0800
+++ b/src/share/vm/utilities/globalDefinitions.hpp	Tue Jul 18 09:53:54 2017 +0200
@@ -1058,6 +1058,7 @@
 const intptr_t badAddressVal    = -2;                       // generic "bad address" value
 const intptr_t badOopVal        = -1;                       // generic "bad oop" value
 const intptr_t badHeapOopVal    = (intptr_t) CONST64(0x2BAD4B0BBAADBABE); // value used to zap heap after GC
+const int      badStackSegVal   = 0xCA;                     // value used to zap stack segments
 const int      badHandleValue   = 0xBC;                     // value used to zap vm handle area
 const int      badResourceValue = 0xAB;                     // value used to zap resource area
 const int      freeBlockPad     = 0xBA;                     // value used to pad freed blocks.
--- a/src/share/vm/utilities/stack.inline.hpp	Fri Mar 01 10:00:03 2019 -0800
+++ b/src/share/vm/utilities/stack.inline.hpp	Tue Jul 18 09:53:54 2017 +0200
@@ -26,6 +26,7 @@
 #define SHARE_VM_UTILITIES_STACK_INLINE_HPP
 
 #include "utilities/stack.hpp"
+#include "utilities/copy.hpp"
 
 template <MEMFLAGS F> StackBase<F>::StackBase(size_t segment_size, size_t max_cache_size,
                      size_t max_size):
@@ -227,11 +228,7 @@
 {
   if (!ZapStackSegments) return;
   const size_t zap_bytes = segment_bytes() - (zap_link_field ? 0 : sizeof(E*));
-  uint32_t* cur = (uint32_t*)seg;
-  const uint32_t* end = cur + zap_bytes / sizeof(uint32_t);
-  while (cur < end) {
-    *cur++ = 0xfadfaded;
-  }
+  Copy::fill_to_bytes(seg, zap_bytes, badStackSegVal);
 }
 #endif