src/hotspot/share/gc/serial/markSweep.inline.hpp
author rkennke
Thu, 05 Apr 2018 10:54:53 +0200
changeset 49722 a47d1e21b3f1
parent 49592 77fb0be7d19f
child 50728 9375184cec98
permissions -rw-r--r--
8199735: Mark word updates need to use Access API Reviewed-by: shade, eosterlund
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
49722
a47d1e21b3f1 8199735: Mark word updates need to use Access API
rkennke
parents: 49592
diff changeset
     2
 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5076
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5076
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5076
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30150
diff changeset
    25
#ifndef SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30150
diff changeset
    26
#define SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6762
diff changeset
    27
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30150
diff changeset
    28
#include "gc/serial/markSweep.hpp"
46810
7dad333205cd 8179302: Pre-resolve constant pool string entries and cache resolved_reference arrays in CDS archive.
jiangli
parents: 46415
diff changeset
    29
#include "memory/metaspaceShared.hpp"
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 31346
diff changeset
    30
#include "memory/universe.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30150
diff changeset
    31
#include "oops/markOop.inline.hpp"
49592
77fb0be7d19f 8199946: Move load/store and encode/decode out of oopDesc
stefank
parents: 47897
diff changeset
    32
#include "oops/access.inline.hpp"
77fb0be7d19f 8199946: Move load/store and encode/decode out of oopDesc
stefank
parents: 47897
diff changeset
    33
#include "oops/compressedOops.inline.hpp"
32606
fdaa30d06ada 8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents: 31346
diff changeset
    34
#include "oops/oop.inline.hpp"
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    35
29792
8c6fa07f0869 8075957: Reduce calls to the GC specific object visitors in oopDesc
stefank
parents: 27624
diff changeset
    36
inline int MarkSweep::adjust_pointers(oop obj) {
46415
7d5a286cdf89 8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents: 46285
diff changeset
    37
  return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure);
29792
8c6fa07f0869 8075957: Reduce calls to the GC specific object visitors in oopDesc
stefank
parents: 27624
diff changeset
    38
}
8c6fa07f0869 8075957: Reduce calls to the GC specific object visitors in oopDesc
stefank
parents: 27624
diff changeset
    39
17105
25b392a7740d 8012687: Remove unused is_root checks and closures
stefank
parents: 15482
diff changeset
    40
template <class T> inline void MarkSweep::adjust_pointer(T* p) {
49592
77fb0be7d19f 8199946: Move load/store and encode/decode out of oopDesc
stefank
parents: 47897
diff changeset
    41
  T heap_oop = RawAccess<>::oop_load(p);
77fb0be7d19f 8199946: Move load/store and encode/decode out of oopDesc
stefank
parents: 47897
diff changeset
    42
  if (!CompressedOops::is_null(heap_oop)) {
77fb0be7d19f 8199946: Move load/store and encode/decode out of oopDesc
stefank
parents: 47897
diff changeset
    43
    oop obj = CompressedOops::decode_not_null(heap_oop);
30150
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29792
diff changeset
    44
    assert(Universe::heap()->is_in(obj), "should be in heap");
d9c940aa42ef 8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents: 29792
diff changeset
    45
49722
a47d1e21b3f1 8199735: Mark word updates need to use Access API
rkennke
parents: 49592
diff changeset
    46
    oop new_obj = oop(obj->mark_raw()->decode_pointer());
46810
7dad333205cd 8179302: Pre-resolve constant pool string entries and cache resolved_reference arrays in CDS archive.
jiangli
parents: 46415
diff changeset
    47
47897
eb3696e0c6d8 8189734: Cleanup MarkSweep when G1 dependency is gone
sjohanss
parents: 47216
diff changeset
    48
    assert(new_obj != NULL ||                         // is forwarding ptr?
49722
a47d1e21b3f1 8199735: Mark word updates need to use Access API
rkennke
parents: 49592
diff changeset
    49
           obj->mark_raw() == markOopDesc::prototype() || // not gc marked?
a47d1e21b3f1 8199735: Mark word updates need to use Access API
rkennke
parents: 49592
diff changeset
    50
           (UseBiasedLocking && obj->mark_raw()->has_bias_pattern()),
31346
a70d45c06136 8042668: GC Support for shared heap ranges in CDS
jiangli
parents: 30764
diff changeset
    51
           // not gc marked?
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    52
           "should be forwarded");
46810
7dad333205cd 8179302: Pre-resolve constant pool string entries and cache resolved_reference arrays in CDS archive.
jiangli
parents: 46415
diff changeset
    53
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    54
    if (new_obj != NULL) {
47897
eb3696e0c6d8 8189734: Cleanup MarkSweep when G1 dependency is gone
sjohanss
parents: 47216
diff changeset
    55
      assert(Universe::heap()->is_in_reserved(new_obj),
eb3696e0c6d8 8189734: Cleanup MarkSweep when G1 dependency is gone
sjohanss
parents: 47216
diff changeset
    56
             "should be in object space");
49592
77fb0be7d19f 8199946: Move load/store and encode/decode out of oopDesc
stefank
parents: 47897
diff changeset
    57
      RawAccess<OOP_NOT_NULL>::oop_store(p, new_obj);
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    58
    }
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    59
  }
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    60
}
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
    61
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 30150
diff changeset
    62
#endif // SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP