src/hotspot/share/gc/g1/g1CodeBlobClosure.hpp
author tschatzl
Wed, 18 Apr 2018 11:36:48 +0200
changeset 49806 2d62570a615c
parent 47216 71c04702a3d5
child 53244 9807daeb47c4
permissions -rw-r--r--
8200426: Make G1 code use _g1h members Summary: Consistently use _g1h member names for cached G1CollectedHeap* variables. Reviewed-by: sangheki, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32617
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
     1
/*
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
     4
 *
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
     7
 * published by the Free Software Foundation.
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
     8
 *
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    13
 * accompanied this code).
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    14
 *
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    18
 *
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    21
 * questions.
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    22
 *
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    23
 */
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    24
33213
b937f634f56e 8138762: Refactor setup of evacuation closures in G1
mgerdin
parents: 32617
diff changeset
    25
#ifndef SHARE_VM_GC_G1_G1CODEBLOBCLOSURE_HPP
b937f634f56e 8138762: Refactor setup of evacuation closures in G1
mgerdin
parents: 32617
diff changeset
    26
#define SHARE_VM_GC_G1_G1CODEBLOBCLOSURE_HPP
b937f634f56e 8138762: Refactor setup of evacuation closures in G1
mgerdin
parents: 32617
diff changeset
    27
32617
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    28
#include "gc/g1/g1CollectedHeap.hpp"
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    29
#include "memory/iterator.hpp"
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    30
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    31
class nmethod;
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    32
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    33
class G1CodeBlobClosure : public CodeBlobClosure {
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    34
  class HeapRegionGatheringOopClosure : public OopClosure {
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    35
    G1CollectedHeap* _g1h;
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    36
    OopClosure* _work;
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    37
    nmethod* _nm;
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    38
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    39
    template <typename T>
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    40
    void do_oop_work(T* p);
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    41
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    42
  public:
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    43
    HeapRegionGatheringOopClosure(OopClosure* oc) : _g1h(G1CollectedHeap::heap()), _work(oc), _nm(NULL) {}
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    44
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    45
    void do_oop(oop* o);
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    46
    void do_oop(narrowOop* o);
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    47
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    48
    void set_nm(nmethod* nm) {
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    49
      _nm = nm;
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    50
    }
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    51
  };
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    52
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    53
  HeapRegionGatheringOopClosure _oc;
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    54
public:
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    55
  G1CodeBlobClosure(OopClosure* oc) : _oc(oc) {}
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    56
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    57
  void do_code_blob(CodeBlob* cb);
a59435e1fecc 8135012: Don't use G1RootProcessor when scanning remembered sets
mgerdin
parents:
diff changeset
    58
};
33213
b937f634f56e 8138762: Refactor setup of evacuation closures in G1
mgerdin
parents: 32617
diff changeset
    59
b937f634f56e 8138762: Refactor setup of evacuation closures in G1
mgerdin
parents: 32617
diff changeset
    60
#endif // SHARE_VM_GC_G1_G1CODEBLOBCLOSURE_HPP
b937f634f56e 8138762: Refactor setup of evacuation closures in G1
mgerdin
parents: 32617
diff changeset
    61