/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#ifndef SERIALGC
#include "gc_implementation/shared/mutableSpace.hpp"
#include "gc_implementation/shared/spaceDecorator.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/thread.hpp"
#endif
"Space should be aligned");
_mangler = new MutableSpaceMangler(this);
}
MutableSpace::~MutableSpace() {
delete _mangler;
}
if (clear_space) {
// Prefer page reallocation to migration.
}
}
}
}
char t = *p; *p = t;
}
}
bool clear_space,
bool mangle_space,
bool setup_pages) {
"invalid space boundaries");
// We'd like to enforce the desired page placement.
if (last_setup_region().is_empty()) {
// If it's the first initialization don't limit the amount of work.
} else {
// Is there an intersection with the address space?
if (intersection.is_empty()) {
}
// All the sizes below are in words.
}
}
// Limit the amount of page manipulation if necessary.
if (NUMASpaceResizeRate > 0 && !AlwaysPreTouch) {
}
}
if (UseNUMA) {
}
if (AlwaysPreTouch) {
}
// Remember where we stopped so that we can continue later.
}
if (clear_space) {
}
}
if (ZapUnusedHeapArea && mangle_space) {
}
}
#ifndef PRODUCT
}
}
// Mangle only the unused space that has not previously
// been mangled and that has not been allocated since being
// mangled.
mangler()->mangle_unused_area();
}
}
}
mangler()->set_top_for_allocations(v);
}
}
#endif
// This version requires locking. */
"not locked");
"checking alignment");
return obj;
} else {
return NULL;
}
}
// This version is lock-free.
do {
// result can be one of two:
// the old top value: the exchange succeeded
// otherwise: the new value of the top is returned.
continue; // another thread beat us to the allocation, try again
}
"checking alignment");
return obj;
} else {
return NULL;
}
} while (true);
}
// Try to deallocate previous allocation. Returns true upon success.
}
// Could call objects iterate, but this is easier.
while (obj_addr < t) {
}
}
while (p < top()) {
}
}
}
}
while (p < t) {
prev_p = p;
}
}