Path: blob/master/src/hotspot/share/gc/g1/g1CodeBlobClosure.hpp
40957 views
/*1* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_GC_G1_G1CODEBLOBCLOSURE_HPP25#define SHARE_GC_G1_G1CODEBLOBCLOSURE_HPP2627#include "gc/g1/g1CollectedHeap.hpp"28#include "memory/iterator.hpp"2930class G1ConcurrentMark;31class nmethod;3233class G1CodeBlobClosure : public CodeBlobClosure {34// Gather nmethod remembered set entries.35class HeapRegionGatheringOopClosure : public OopClosure {36G1CollectedHeap* _g1h;37OopClosure* _work;38nmethod* _nm;3940template <typename T>41void do_oop_work(T* p);4243public:44HeapRegionGatheringOopClosure(OopClosure* oc) : _g1h(G1CollectedHeap::heap()), _work(oc), _nm(NULL) {}4546void do_oop(oop* o);47void do_oop(narrowOop* o);4849void set_nm(nmethod* nm) {50_nm = nm;51}52};5354// Mark all oops below TAMS.55class MarkingOopClosure : public OopClosure {56G1ConcurrentMark* _cm;57uint _worker_id;5859template <typename T>60void do_oop_work(T* p);6162public:63MarkingOopClosure(uint worker_id);6465void do_oop(oop* o);66void do_oop(narrowOop* o);67};6869HeapRegionGatheringOopClosure _oc;70MarkingOopClosure _marking_oc;7172bool _strong;73public:74G1CodeBlobClosure(uint worker_id, OopClosure* oc, bool strong) :75_oc(oc), _marking_oc(worker_id), _strong(strong) { }7677void do_evacuation_and_fixup(nmethod* nm);78void do_marking(nmethod* nm);7980void do_code_blob(CodeBlob* cb);81};8283#endif // SHARE_GC_G1_G1CODEBLOBCLOSURE_HPP848586