1 /* 2 * Copyright (c) 2003, 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/_compactingPermGenGen.cpp.incl" 27 28 29 // An ObjectClosure helper: Recursively adjust all pointers in an object 30 // and all objects by referenced it. Clear marks on objects in order to 31 // prevent visiting any object twice. This helper is used when the 32 // RedefineClasses() API has been called. 33 34 class AdjustSharedObjectClosure : public ObjectClosure { 35 public: 36 void do_object(oop obj) { 37 if (obj->is_shared_readwrite()) { 38 if (obj->mark()->is_marked()) { 39 obj->init_mark(); // Don't revisit this object. 40 obj->adjust_pointers(); // Adjust this object's references. 41 } 42 } 43 } 44 }; 45 46 | 1 /* 2 * Copyright (c) 2003, 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 "classfile/symbolTable.hpp" 27 #include "classfile/systemDictionary.hpp" 28 #include "memory/compactingPermGenGen.hpp" 29 #include "memory/filemap.hpp" 30 #include "memory/genOopClosures.inline.hpp" 31 #include "memory/generation.inline.hpp" 32 #include "memory/generationSpec.hpp" 33 #include "oops/oop.inline.hpp" 34 #include "runtime/java.hpp" 35 #ifndef SERIALGC 36 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp" 37 #endif 38 39 40 // An ObjectClosure helper: Recursively adjust all pointers in an object 41 // and all objects by referenced it. Clear marks on objects in order to 42 // prevent visiting any object twice. This helper is used when the 43 // RedefineClasses() API has been called. 44 45 class AdjustSharedObjectClosure : public ObjectClosure { 46 public: 47 void do_object(oop obj) { 48 if (obj->is_shared_readwrite()) { 49 if (obj->mark()->is_marked()) { 50 obj->init_mark(); // Don't revisit this object. 51 obj->adjust_pointers(); // Adjust this object's references. 52 } 53 } 54 } 55 }; 56 57 |