src/hotspot/share/gc/shared/weakProcessor.cpp
author stefank
Thu, 22 Feb 2018 18:36:32 +0100
changeset 49048 4e8c86b75428
parent 47779 24022215d092
child 50113 caf115bb98ad
permissions -rw-r--r--
8198525: Move _size_policy out of GenCollectorPolicy into GenCollectedHeap Reviewed-by: pliden, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47648
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
     1
/*
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
     2
 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
     4
 *
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
     7
 * published by the Free Software Foundation.
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
     8
 *
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    13
 * accompanied this code).
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    14
 *
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    18
 *
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    21
 * questions.
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    22
 *
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    23
 */
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    24
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    25
#include "precompiled.hpp"
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    26
#include "gc/shared/weakProcessor.hpp"
47649
12623954920e 8189360: JvmtiExport::weak_oops_do is called for all JNIHandleBlock instances
stefank
parents: 47648
diff changeset
    27
#include "prims/jvmtiExport.hpp"
47648
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    28
#include "runtime/jniHandles.hpp"
47779
24022215d092 8189440: Event tracing macros for allocation and weak oops processing
egahlin
parents: 47676
diff changeset
    29
#include "trace/tracing.hpp"
24022215d092 8189440: Event tracing macros for allocation and weak oops processing
egahlin
parents: 47676
diff changeset
    30
#include "trace/traceMacros.hpp"
47648
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    31
47676
b1c020fc35a3 8189748: More precise closures for WeakProcessor::weak_oops_do calls
stefank
parents: 47649
diff changeset
    32
void WeakProcessor::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive) {
47648
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    33
  JNIHandles::weak_oops_do(is_alive, keep_alive);
47649
12623954920e 8189360: JvmtiExport::weak_oops_do is called for all JNIHandleBlock instances
stefank
parents: 47648
diff changeset
    34
  JvmtiExport::weak_oops_do(is_alive, keep_alive);
47779
24022215d092 8189440: Event tracing macros for allocation and weak oops processing
egahlin
parents: 47676
diff changeset
    35
  TRACE_WEAK_OOPS_DO(is_alive, keep_alive);
47648
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    36
}
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    37
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    38
void WeakProcessor::oops_do(OopClosure* closure) {
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    39
  AlwaysTrueClosure always_true;
47676
b1c020fc35a3 8189748: More precise closures for WeakProcessor::weak_oops_do calls
stefank
parents: 47649
diff changeset
    40
  weak_oops_do(&always_true, closure);
47648
226b1fc611b9 8189359: Move native weak oops cleaning out of ReferenceProcessor
stefank
parents:
diff changeset
    41
}