8184762: ZapStackSegments should use optimized memset

Tue, 18 Jul 2017 09:53:54 +0200

author
shade
date
Tue, 18 Jul 2017 09:53:54 +0200
changeset 9997
c7ef664f8649
parent 9996
7b3ade0882f4
child 9998
d64fa7b92b5b

8184762: ZapStackSegments should use optimized memset
Reviewed-by: rkennke, mgerdin

src/share/vm/utilities/globalDefinitions.hpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/stack.inline.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/utilities/globalDefinitions.hpp	Fri Mar 01 10:00:03 2019 -0800
     1.2 +++ b/src/share/vm/utilities/globalDefinitions.hpp	Tue Jul 18 09:53:54 2017 +0200
     1.3 @@ -1058,6 +1058,7 @@
     1.4  const intptr_t badAddressVal    = -2;                       // generic "bad address" value
     1.5  const intptr_t badOopVal        = -1;                       // generic "bad oop" value
     1.6  const intptr_t badHeapOopVal    = (intptr_t) CONST64(0x2BAD4B0BBAADBABE); // value used to zap heap after GC
     1.7 +const int      badStackSegVal   = 0xCA;                     // value used to zap stack segments
     1.8  const int      badHandleValue   = 0xBC;                     // value used to zap vm handle area
     1.9  const int      badResourceValue = 0xAB;                     // value used to zap resource area
    1.10  const int      freeBlockPad     = 0xBA;                     // value used to pad freed blocks.
     2.1 --- a/src/share/vm/utilities/stack.inline.hpp	Fri Mar 01 10:00:03 2019 -0800
     2.2 +++ b/src/share/vm/utilities/stack.inline.hpp	Tue Jul 18 09:53:54 2017 +0200
     2.3 @@ -26,6 +26,7 @@
     2.4  #define SHARE_VM_UTILITIES_STACK_INLINE_HPP
     2.5  
     2.6  #include "utilities/stack.hpp"
     2.7 +#include "utilities/copy.hpp"
     2.8  
     2.9  template <MEMFLAGS F> StackBase<F>::StackBase(size_t segment_size, size_t max_cache_size,
    2.10                       size_t max_size):
    2.11 @@ -227,11 +228,7 @@
    2.12  {
    2.13    if (!ZapStackSegments) return;
    2.14    const size_t zap_bytes = segment_bytes() - (zap_link_field ? 0 : sizeof(E*));
    2.15 -  uint32_t* cur = (uint32_t*)seg;
    2.16 -  const uint32_t* end = cur + zap_bytes / sizeof(uint32_t);
    2.17 -  while (cur < end) {
    2.18 -    *cur++ = 0xfadfaded;
    2.19 -  }
    2.20 +  Copy::fill_to_bytes(seg, zap_bytes, badStackSegVal);
    2.21  }
    2.22  #endif
    2.23  

mercurial