comparison src/share/vm/memory/threadLocalAllocBuffer.inline.hpp @ 1165:2dd52dea6d28

6902115: G1:assert(ignore_max_completed||thread->is_Java_thread()||SafepointSynchronize::is_at_safepoint()) Summary: Remove invalid assert and mangle filler objects in TLABs that are being retired. Reviewed-by: ysr, jmasa
author johnc
date Tue, 12 Jan 2010 14:56:46 -0800
parents a61af66fc99e
children c18cbe5936b8 2d127394260e
comparison
equal deleted inserted replaced
1149:0579c695832f 1165:2dd52dea6d28
1 /* 1 /*
2 * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
25 inline HeapWord* ThreadLocalAllocBuffer::allocate(size_t size) { 25 inline HeapWord* ThreadLocalAllocBuffer::allocate(size_t size) {
26 invariants(); 26 invariants();
27 HeapWord* obj = top(); 27 HeapWord* obj = top();
28 if (pointer_delta(end(), obj) >= size) { 28 if (pointer_delta(end(), obj) >= size) {
29 // successful thread-local allocation 29 // successful thread-local allocation
30 30 #ifdef ASSERT
31 DEBUG_ONLY(Copy::fill_to_words(obj, size, badHeapWordVal)); 31 // Skip mangling the space corresponding to the object header to
32 // ensure that the returned space is not considered parsable by
33 // any concurrent GC thread.
34 size_t hdr_size = CollectedHeap::min_fill_size();
35 Copy::fill_to_words(obj + hdr_size, size - hdr_size, badHeapWordVal);
36 #endif // ASSERT
32 // This addition is safe because we know that top is 37 // This addition is safe because we know that top is
33 // at least size below end, so the add can't wrap. 38 // at least size below end, so the add can't wrap.
34 set_top(obj + size); 39 set_top(obj + size);
35 40
36 invariants(); 41 invariants();