--- old/src/share/vm/utilities/globalDefinitions.hpp 2017-07-17 21:41:11.285120194 +0200 +++ new/src/share/vm/utilities/globalDefinitions.hpp 2017-07-17 21:41:11.169120424 +0200 @@ -949,6 +949,7 @@ const long badAddressVal = -2; // generic "bad address" value const long 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. --- old/src/share/vm/utilities/stack.inline.hpp 2017-07-17 21:41:11.773119231 +0200 +++ new/src/share/vm/utilities/stack.inline.hpp 2017-07-17 21:41:11.649119475 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2017, 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 @@ -27,6 +27,7 @@ #include "utilities/align.hpp" #include "utilities/stack.hpp" +#include "utilities/copy.hpp" template StackBase::StackBase(size_t segment_size, size_t max_cache_size, size_t max_size): @@ -233,11 +234,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