Tue, 24 Dec 2013 11:48:39 -0800
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
Summary: Copyright year updated for files modified during 2013
Reviewed-by: twisti, iveresov
duke@435 | 1 | /* |
mikael@6198 | 2 | * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
stefank@2314 | 25 | #include "precompiled.hpp" |
coleenp@4037 | 26 | #include "classfile/classLoaderData.hpp" |
stefank@2314 | 27 | #include "memory/cardTableRS.hpp" |
stefank@2314 | 28 | #include "memory/genRemSet.hpp" |
stefank@2314 | 29 | |
duke@435 | 30 | // This kind of "BarrierSet" allows a "CollectedHeap" to detect and |
duke@435 | 31 | // enumerate ref fields that have been modified (since the last |
duke@435 | 32 | // enumeration.) |
duke@435 | 33 | |
duke@435 | 34 | uintx GenRemSet::max_alignment_constraint(Name nm) { |
jwilhelm@5818 | 35 | assert(nm == GenRemSet::CardTable, "Unrecognized GenRemSet type."); |
jwilhelm@5818 | 36 | return CardTableRS::ct_max_alignment_constraint(); |
duke@435 | 37 | } |
coleenp@4037 | 38 | |
coleenp@4037 | 39 | class HasAccumulatedModifiedOopsClosure : public KlassClosure { |
coleenp@4037 | 40 | bool _found; |
coleenp@4037 | 41 | public: |
coleenp@4037 | 42 | HasAccumulatedModifiedOopsClosure() : _found(false) {} |
coleenp@4037 | 43 | void do_klass(Klass* klass) { |
coleenp@4037 | 44 | if (_found) { |
coleenp@4037 | 45 | return; |
coleenp@4037 | 46 | } |
coleenp@4037 | 47 | |
coleenp@4037 | 48 | if (klass->has_accumulated_modified_oops()) { |
coleenp@4037 | 49 | _found = true; |
coleenp@4037 | 50 | } |
coleenp@4037 | 51 | } |
coleenp@4037 | 52 | bool found() { |
coleenp@4037 | 53 | return _found; |
coleenp@4037 | 54 | } |
coleenp@4037 | 55 | }; |
coleenp@4037 | 56 | |
coleenp@4037 | 57 | bool KlassRemSet::mod_union_is_clear() { |
coleenp@4037 | 58 | HasAccumulatedModifiedOopsClosure closure; |
coleenp@4037 | 59 | ClassLoaderDataGraph::classes_do(&closure); |
coleenp@4037 | 60 | |
coleenp@4037 | 61 | return !closure.found(); |
coleenp@4037 | 62 | } |
coleenp@4037 | 63 | |
coleenp@4037 | 64 | |
coleenp@4037 | 65 | class ClearKlassModUnionClosure : public KlassClosure { |
coleenp@4037 | 66 | public: |
coleenp@4037 | 67 | void do_klass(Klass* klass) { |
coleenp@4037 | 68 | if (klass->has_accumulated_modified_oops()) { |
coleenp@4037 | 69 | klass->clear_accumulated_modified_oops(); |
coleenp@4037 | 70 | } |
coleenp@4037 | 71 | } |
coleenp@4037 | 72 | }; |
coleenp@4037 | 73 | |
coleenp@4037 | 74 | void KlassRemSet::clear_mod_union() { |
coleenp@4037 | 75 | ClearKlassModUnionClosure closure; |
coleenp@4037 | 76 | ClassLoaderDataGraph::classes_do(&closure); |
coleenp@4037 | 77 | } |