src/hotspot/share/gc/g1/g1ParallelCleaning.hpp
author tschatzl
Fri, 29 Nov 2019 10:20:17 +0100
changeset 59321 5775e4825e58
parent 57510 4db4d0d14390
permissions -rw-r--r--
8233998: New young regions registered too early in collection set Reviewed-by: sangheki, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57510
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
     1
/*
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
     4
 *
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
     7
 * published by the Free Software Foundation.
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
     8
 *
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    13
 * accompanied this code).
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    14
 *
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    18
 *
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    21
 * questions.
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    22
 *
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    23
 */
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    24
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    25
#ifndef SHARE_GC_G1_G1PARALLELCLEANING_HPP
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    26
#define SHARE_GC_G1_G1PARALLELCLEANING_HPP
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    27
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    28
#include "gc/shared/parallelCleaning.hpp"
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    29
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    30
#if INCLUDE_JVMCI
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    31
class JVMCICleaningTask : public StackObj {
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    32
  volatile int       _cleaning_claimed;
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    33
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    34
public:
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    35
  JVMCICleaningTask();
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    36
  // Clean JVMCI metadata handles.
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    37
  void work(bool unloading_occurred);
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    38
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    39
private:
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    40
  bool claim_cleaning_task();
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    41
};
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    42
#endif
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    43
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    44
// Do cleanup of some weakly held data in the same parallel task.
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    45
// Assumes a non-moving context.
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    46
class G1ParallelCleaningTask : public AbstractGangTask {
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    47
private:
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    48
  bool                    _unloading_occurred;
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    49
  StringDedupCleaningTask _string_dedup_task;
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    50
  CodeCacheUnloadingTask  _code_cache_task;
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    51
#if INCLUDE_JVMCI
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    52
  JVMCICleaningTask       _jvmci_cleaning_task;
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    53
#endif
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    54
  KlassCleaningTask       _klass_cleaning_task;
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    55
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    56
public:
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    57
  // The constructor is run in the VMThread.
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    58
  G1ParallelCleaningTask(BoolObjectClosure* is_alive,
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    59
                         uint num_workers,
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    60
                         bool unloading_occurred,
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    61
                         bool resize_dedup_table);
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    62
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    63
  void work(uint worker_id);
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    64
};
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    65
4db4d0d14390 8227927: Move ParallelCleaningTask back to G1
zgu
parents:
diff changeset
    66
#endif // SHARE_GC_G1_G1PARALLELCLEANING_HPP