src/hotspot/share/oops/weakHandle.inline.hpp
author ihse
Mon, 26 Nov 2018 14:18:22 +0100
branchihse-manpages-branch
changeset 57043 23d7457ca4c6
parent 50599 ecc2af326b5f
child 53244 9807daeb47c4
permissions -rw-r--r--
Clean up login in when running which kind of man page creation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49738
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
     1
/*
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
     2
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
     4
 *
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
     7
 * published by the Free Software Foundation.
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
     8
 *
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    13
 * accompanied this code).
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    14
 *
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    18
 *
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    21
 * questions.
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    22
 *
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    23
 */
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    24
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    25
#ifndef SHARE_VM_OOPS_WEAKHANDLE_INLINE_HPP
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    26
#define SHARE_VM_OOPS_WEAKHANDLE_INLINE_HPP
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    27
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    28
#include "oops/weakHandle.hpp"
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    29
#include "oops/access.inline.hpp"
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    30
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    31
template <WeakHandleType T>
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    32
oop WeakHandle<T>::resolve() const {
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    33
  assert(!is_null(), "Must be created");
50599
ecc2af326b5f 8204939: Change Access nomenclature: root to native
kbarrett
parents: 50445
diff changeset
    34
  return NativeAccess<ON_PHANTOM_OOP_REF>::oop_load(_obj);
49738
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    35
}
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    36
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    37
template <WeakHandleType T>
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    38
oop WeakHandle<T>::peek() const {
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    39
  assert(!is_null(), "Must be created");
50599
ecc2af326b5f 8204939: Change Access nomenclature: root to native
kbarrett
parents: 50445
diff changeset
    40
  return NativeAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(_obj);
49738
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    41
}
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    42
50445
bd6b78feb6a3 8195097: Make it possible to process StringTable outside safepoint
rehn
parents: 49738
diff changeset
    43
template <WeakHandleType T>
bd6b78feb6a3 8195097: Make it possible to process StringTable outside safepoint
rehn
parents: 49738
diff changeset
    44
void WeakHandle<T>::replace(oop with_obj) {
50599
ecc2af326b5f 8204939: Change Access nomenclature: root to native
kbarrett
parents: 50445
diff changeset
    45
  NativeAccess<ON_PHANTOM_OOP_REF>::oop_store(_obj, with_obj);
50445
bd6b78feb6a3 8195097: Make it possible to process StringTable outside safepoint
rehn
parents: 49738
diff changeset
    46
}
bd6b78feb6a3 8195097: Make it possible to process StringTable outside safepoint
rehn
parents: 49738
diff changeset
    47
49738
a7bc87a63dd8 8198313: Wrap holder object for ClassLoaderData in a WeakHandle
coleenp
parents:
diff changeset
    48
#endif // SHARE_VM_OOPS_WEAKHANDLE_INLINE_HPP
50445
bd6b78feb6a3 8195097: Make it possible to process StringTable outside safepoint
rehn
parents: 49738
diff changeset
    49