src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.hpp
author stefank
Tue, 26 Nov 2019 10:47:46 +0100
changeset 59290 97d13893ec3c
parent 55760 bf8128faace1
permissions -rw-r--r--
8234748: Clean up atomic and orderAccess includes Reviewed-by: dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
55760
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
     1
/*
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
     2
 * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
     3
 *
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
     6
 * published by the Free Software Foundation.
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
     7
 *
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
     8
 * This code is distributed in the hope that it will be useful, but WITHOUT
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
     9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    10
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    11
 * version 2 for more details (a copy is included in the LICENSE file that
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    12
 * accompanied this code).
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    13
 *
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License version
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    15
 * 2 along with this work; if not, write to the Free Software Foundation,
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    16
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    17
 *
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    18
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    19
 * or visit www.oracle.com if you need additional information or have any
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    20
 * questions.
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    21
 *
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    22
 */
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    23
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    24
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHPARALLELCLEANING_HPP
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    25
#define SHARE_GC_SHENANDOAH_SHENANDOAHPARALLELCLEANING_HPP
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    26
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    27
#include "gc/shared/parallelCleaning.hpp"
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    28
#include "gc/shared/weakProcessor.hpp"
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    29
#include "gc/shared/weakProcessorPhaseTimes.hpp"
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    30
#include "gc/shared/workgroup.hpp"
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    31
#include "memory/iterator.hpp"
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    32
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    33
// Perform weak root cleaning at a pause
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    34
template <typename IsAlive, typename KeepAlive>
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    35
class ShenandoahParallelWeakRootsCleaningTask : public AbstractGangTask {
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    36
protected:
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    37
  WeakProcessor::Task     _weak_processing_task;
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    38
  IsAlive*                _is_alive;
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    39
  KeepAlive*              _keep_alive;
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    40
public:
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    41
  ShenandoahParallelWeakRootsCleaningTask(IsAlive* is_alive, KeepAlive* keep_alive, uint num_workers);
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    42
  ~ShenandoahParallelWeakRootsCleaningTask();
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    43
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    44
  void work(uint worker_id);
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    45
};
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    46
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    47
// Perform class unloading at a pause
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    48
class ShenandoahClassUnloadingTask : public AbstractGangTask {
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    49
private:
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    50
  bool                            _unloading_occurred;
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    51
  CodeCacheUnloadingTask          _code_cache_task;
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    52
  KlassCleaningTask               _klass_cleaning_task;
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    53
public:
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    54
  ShenandoahClassUnloadingTask(BoolObjectClosure* is_alive,
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    55
                               uint num_workers,
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    56
                               bool unloading_occurred);
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    57
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    58
  void work(uint worker_id);
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    59
};
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    60
bf8128faace1 8227866: Shenandoah: Split weak root processing and class unloading in parallel cleaning task
zgu
parents:
diff changeset
    61
#endif // SHARE_GC_SHENANDOAH_SHENANDOAHPARALLELCLEANING_HPP