< prev index next >

src/hotspot/share/memory/metaspaceClosure.cpp

Print this page

*** 1,7 **** /* ! * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 53,68 **** } } } bool UniqueMetaspaceClosure::do_ref(MetaspaceClosure::Ref* ref, bool read_only) { ! bool* found = _has_been_visited.get(ref->obj()); if (found != NULL) { assert(*found == read_only, "must be"); return false; // Already visited: no need to iterate embedded pointers. } else { ! bool isnew = _has_been_visited.put(ref->obj(), read_only); ! assert(isnew, "sanity"); do_unique_ref(ref, read_only); return true; // Saw this for the first time: iterate the embedded pointers. } } --- 53,70 ---- } } } bool UniqueMetaspaceClosure::do_ref(MetaspaceClosure::Ref* ref, bool read_only) { ! bool* found = _has_been_visited.lookup(ref->obj()); if (found != NULL) { assert(*found == read_only, "must be"); return false; // Already visited: no need to iterate embedded pointers. } else { ! _has_been_visited.add(ref->obj(), read_only); ! if (_has_been_visited.maybe_grow()) { ! log_info(cds, hashtables)("Expanded _has_been_visited table to %d", _has_been_visited.table_size()); ! } do_unique_ref(ref, read_only); return true; // Saw this for the first time: iterate the embedded pointers. } }
< prev index next >