1 /* 2 * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_spaceDecorator.cpp.incl" 27 28 // Catch-all file for utility classes 29 30 #ifndef PRODUCT 31 32 // Returns true is the location q matches the mangling 33 // pattern. 34 bool SpaceMangler::is_mangled(HeapWord* q) { 35 // This test loses precision but is good enough 36 return badHeapWord == (max_juint & (uintptr_t) q->value()); 37 } 38 39 40 void SpaceMangler::set_top_for_allocations(HeapWord* v) { 41 if (v < end()) { 42 assert(!CheckZapUnusedHeapArea || is_mangled(v), 43 "The high water mark is not mangled"); 44 } 45 _top_for_allocations = v; 46 } | 1 /* 2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "gc_implementation/shared/spaceDecorator.hpp" 27 #include "memory/space.inline.hpp" 28 #include "utilities/copy.hpp" 29 30 // Catch-all file for utility classes 31 32 #ifndef PRODUCT 33 34 // Returns true is the location q matches the mangling 35 // pattern. 36 bool SpaceMangler::is_mangled(HeapWord* q) { 37 // This test loses precision but is good enough 38 return badHeapWord == (max_juint & (uintptr_t) q->value()); 39 } 40 41 42 void SpaceMangler::set_top_for_allocations(HeapWord* v) { 43 if (v < end()) { 44 assert(!CheckZapUnusedHeapArea || is_mangled(v), 45 "The high water mark is not mangled"); 46 } 47 _top_for_allocations = v; 48 } |