src/hotspot/share/memory/heapShared.inline.hpp
author phh
Sat, 30 Nov 2019 14:33:05 -0800
changeset 59330 5b96c12f909d
parent 58178 bb1aaed00341
permissions -rw-r--r--
8234541: C1 emits an empty message when it inlines successfully Summary: Use "inline" as the message when successfull Reviewed-by: thartmann, mdoerr Contributed-by: navy.xliu@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51491
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52062
diff changeset
     2
 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
51491
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
     4
 *
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
     7
 * published by the Free Software Foundation.
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
     8
 *
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    13
 * accompanied this code).
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    14
 *
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    18
 *
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    21
 * questions.
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    22
 *
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    23
 */
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    24
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52062
diff changeset
    25
#ifndef SHARE_MEMORY_HEAPSHARED_INLINE_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52062
diff changeset
    26
#define SHARE_MEMORY_HEAPSHARED_INLINE_HPP
51491
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    27
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    28
#include "oops/compressedOops.inline.hpp"
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    29
#include "memory/heapShared.hpp"
58178
bb1aaed00341 8231051: Remove check_obj_alignment() and replace with is_object_aligned()
pliden
parents: 53244
diff changeset
    30
#include "utilities/align.hpp"
52062
8dbf1a13af49 8206009: Move CDS java heap object archiving code to heapShared.hpp and heapShared.cpp
jiangli
parents: 51720
diff changeset
    31
#if INCLUDE_G1GC
8dbf1a13af49 8206009: Move CDS java heap object archiving code to heapShared.hpp and heapShared.cpp
jiangli
parents: 51720
diff changeset
    32
#include "gc/g1/g1Allocator.inline.hpp"
8dbf1a13af49 8206009: Move CDS java heap object archiving code to heapShared.hpp and heapShared.cpp
jiangli
parents: 51720
diff changeset
    33
#endif
51491
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    34
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    35
#if INCLUDE_CDS_JAVA_HEAP
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    36
52062
8dbf1a13af49 8206009: Move CDS java heap object archiving code to heapShared.hpp and heapShared.cpp
jiangli
parents: 51720
diff changeset
    37
bool HeapShared::is_archived_object(oop p) {
8dbf1a13af49 8206009: Move CDS java heap object archiving code to heapShared.hpp and heapShared.cpp
jiangli
parents: 51720
diff changeset
    38
  return (p == NULL) ? false : G1ArchiveAllocator::is_archived_object(p);
8dbf1a13af49 8206009: Move CDS java heap object archiving code to heapShared.hpp and heapShared.cpp
jiangli
parents: 51720
diff changeset
    39
}
8dbf1a13af49 8206009: Move CDS java heap object archiving code to heapShared.hpp and heapShared.cpp
jiangli
parents: 51720
diff changeset
    40
51720
b7bfd64e43a6 8210523: runtime/appcds/cacheObject/DifferentHeapSizes.java crash
iklam
parents: 51491
diff changeset
    41
inline oop HeapShared::decode_from_archive(narrowOop v) {
51491
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    42
  assert(!CompressedOops::is_null(v), "narrow oop value can never be zero");
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    43
  oop result = (oop)(void*)((uintptr_t)_narrow_oop_base + ((uintptr_t)v << _narrow_oop_shift));
58178
bb1aaed00341 8231051: Remove check_obj_alignment() and replace with is_object_aligned()
pliden
parents: 53244
diff changeset
    44
  assert(is_object_aligned(result), "address not aligned: " INTPTR_FORMAT, p2i((void*) result));
51491
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    45
  return result;
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    46
}
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    47
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    48
#endif
187c84a5efe1 8208658: Make CDS archived heap regions usable even if compressed oop encoding has changed
iklam
parents:
diff changeset
    49
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52062
diff changeset
    50
#endif // SHARE_MEMORY_HEAPSHARED_INLINE_HPP