src/hotspot/share/gc/shared/barrierSet.hpp
author rkennke
Thu, 05 Jul 2018 19:22:38 +0200
changeset 50940 3009952d5985
parent 50599 ecc2af326b5f
child 52070 e4d72440d60e
permissions -rw-r--r--
8206407: Primitive atomic_cmpxchg_in_heap_at() in BarrierSet::Access needs to call non-oop raw method Reviewed-by: pliden, shade
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
48628
69d65d9dcadb 8193063: Enabling narrowOop values for RawAccess accesses
eosterlund
parents: 47998
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: 4886
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4886
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: 4886
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: 29331
diff changeset
    25
#ifndef SHARE_VM_GC_SHARED_BARRIERSET_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29331
diff changeset
    26
#define SHARE_VM_GC_SHARED_BARRIERSET_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    28
#include "gc/shared/barrierSetConfig.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "memory/memRegion.hpp"
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    30
#include "oops/access.hpp"
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    31
#include "oops/accessBackend.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    32
#include "oops/oopsHierarchy.hpp"
29325
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    33
#include "utilities/fakeRttiSupport.hpp"
49484
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
    34
#include "utilities/macros.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    35
49906
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
    36
class BarrierSetAssembler;
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
    37
class BarrierSetC1;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
    38
class BarrierSetC2;
48961
120b61d50f85 8195103: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents: 48628
diff changeset
    39
class JavaThread;
120b61d50f85 8195103: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents: 48628
diff changeset
    40
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// This class provides the interface between a barrier implementation and
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// the rest of the system.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 12268
diff changeset
    44
class BarrierSet: public CHeapObj<mtGC> {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  friend class VMStructs;
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    46
49752
93d84f667d12 8201318: Introduce GCThreadLocalData to abstract GC-specific data belonging to a thread
pliden
parents: 49658
diff changeset
    47
  static BarrierSet* _barrier_set;
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    48
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
public:
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    50
  enum Name {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    51
#define BARRIER_SET_DECLARE_BS_ENUM(bs_name) bs_name ,
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    52
    FOR_EACH_BARRIER_SET_DO(BARRIER_SET_DECLARE_BS_ENUM)
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    53
#undef BARRIER_SET_DECLARE_BS_ENUM
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    54
    UnknownBS
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    55
  };
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    56
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    57
protected:
29325
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    58
  // Fake RTTI support.  For a derived class T to participate
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    59
  // - T must have a corresponding Name entry.
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    60
  // - GetName<T> must be specialized to return the corresponding Name
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    61
  //   entry.
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    62
  // - If T is a base class, the constructor must have a FakeRtti
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    63
  //   parameter and pass it up to its base class, with the tag set
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    64
  //   augmented with the corresponding Name entry.
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    65
  // - If T is a concrete class, the constructor must create a
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    66
  //   FakeRtti object whose tag set includes the corresponding Name
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    67
  //   entry, and pass it up to its base class.
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    68
  typedef FakeRttiSupport<BarrierSet, Name> FakeRtti;
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    69
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    70
private:
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    71
  FakeRtti _fake_rtti;
49484
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
    72
  BarrierSetAssembler* _barrier_set_assembler;
49906
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
    73
  BarrierSetC1* _barrier_set_c1;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
    74
  BarrierSetC2* _barrier_set_c2;
29325
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    75
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    76
public:
29325
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    77
  // Metafunction mapping a class derived from BarrierSet to the
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    78
  // corresponding Name enum tag.
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    79
  template<typename T> struct GetName;
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    80
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    81
  // Metafunction mapping a Name enum type to the corresponding
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    82
  // lass derived from BarrierSet.
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
    83
  template<BarrierSet::Name T> struct GetType;
29325
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    84
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    85
  // Note: This is not presently the Name corresponding to the
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    86
  // concrete class of this object.
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    87
  BarrierSet::Name kind() const { return _fake_rtti.concrete_tag(); }
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    88
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    89
  // Test whether this object is of the type corresponding to bsn.
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    90
  bool is_a(BarrierSet::Name bsn) const { return _fake_rtti.has_tag(bsn); }
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    91
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    92
  // End of fake RTTI support.
0e86e64c66e5 8069016: Add BarrierSet downcast support
kbarrett
parents: 29081
diff changeset
    93
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
protected:
49906
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
    95
  BarrierSet(BarrierSetAssembler* barrier_set_assembler,
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
    96
             BarrierSetC1* barrier_set_c1,
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
    97
             BarrierSetC2* barrier_set_c2,
49906
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
    98
             const FakeRtti& fake_rtti) :
49484
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
    99
    _fake_rtti(fake_rtti),
49906
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
   100
    _barrier_set_assembler(barrier_set_assembler),
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   101
    _barrier_set_c1(barrier_set_c1),
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   102
    _barrier_set_c2(barrier_set_c2) {}
28830
a252e278c3d9 8064947: Clean up BarrierSet ctor/dtor
jprovino
parents: 27687
diff changeset
   103
  ~BarrierSet() { }
a252e278c3d9 8064947: Clean up BarrierSet ctor/dtor
jprovino
parents: 27687
diff changeset
   104
49484
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
   105
  template <class BarrierSetAssemblerT>
50521
32ab7150a270 8204850: BarrierSet::make_* should be static
shade
parents: 50389
diff changeset
   106
  static BarrierSetAssembler* make_barrier_set_assembler() {
49484
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
   107
    return NOT_ZERO(new BarrierSetAssemblerT()) ZERO_ONLY(NULL);
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
   108
  }
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
   109
49906
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
   110
  template <class BarrierSetC1T>
50521
32ab7150a270 8204850: BarrierSet::make_* should be static
shade
parents: 50389
diff changeset
   111
  static BarrierSetC1* make_barrier_set_c1() {
49906
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
   112
    return COMPILER1_PRESENT(new BarrierSetC1T()) NOT_COMPILER1(NULL);
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
   113
  }
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
   114
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   115
  template <class BarrierSetC2T>
50521
32ab7150a270 8204850: BarrierSet::make_* should be static
shade
parents: 50389
diff changeset
   116
  static BarrierSetC2* make_barrier_set_c2() {
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   117
    return COMPILER2_PRESENT(new BarrierSetC2T()) NOT_COMPILER2(NULL);
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   118
  }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   119
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
public:
48961
120b61d50f85 8195103: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents: 48628
diff changeset
   121
  // Support for optimizing compilers to call the barrier set on slow path allocations
120b61d50f85 8195103: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents: 48628
diff changeset
   122
  // that did not enter a TLAB. Used for e.g. ReduceInitialCardMarks.
120b61d50f85 8195103: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents: 48628
diff changeset
   123
  // The allocation is safe to use iff it returns true. If not, the slow-path allocation
120b61d50f85 8195103: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents: 48628
diff changeset
   124
  // is redone until it succeeds. This can e.g. prevent allocations from the slow path
120b61d50f85 8195103: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents: 48628
diff changeset
   125
  // to be in old.
120b61d50f85 8195103: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents: 48628
diff changeset
   126
  virtual void on_slowpath_allocation_exit(JavaThread* thread, oop new_obj) {}
49752
93d84f667d12 8201318: Introduce GCThreadLocalData to abstract GC-specific data belonging to a thread
pliden
parents: 49658
diff changeset
   127
  virtual void on_thread_create(Thread* thread) {}
93d84f667d12 8201318: Introduce GCThreadLocalData to abstract GC-specific data belonging to a thread
pliden
parents: 49658
diff changeset
   128
  virtual void on_thread_destroy(Thread* thread) {}
49007
82d9d5744e5f 8197994: Move JavaThread::initialize_queues() logic to G1SATBCardTableLoggingModRefBS
pliden
parents: 48961
diff changeset
   129
  virtual void on_thread_attach(JavaThread* thread) {}
82d9d5744e5f 8197994: Move JavaThread::initialize_queues() logic to G1SATBCardTableLoggingModRefBS
pliden
parents: 48961
diff changeset
   130
  virtual void on_thread_detach(JavaThread* thread) {}
48961
120b61d50f85 8195103: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents: 48628
diff changeset
   131
  virtual void make_parsable(JavaThread* thread) {}
120b61d50f85 8195103: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents: 48628
diff changeset
   132
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
public:
12268
f7897aacb9ce 7157141: crash in 64 bit with corrupted oops
never
parents: 8498
diff changeset
   134
  // Print a description of the memory for the barrier set
f7897aacb9ce 7157141: crash in 64 bit with corrupted oops
never
parents: 8498
diff changeset
   135
  virtual void print_on(outputStream* st) const = 0;
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   136
49752
93d84f667d12 8201318: Introduce GCThreadLocalData to abstract GC-specific data belonging to a thread
pliden
parents: 49658
diff changeset
   137
  static BarrierSet* barrier_set() { return _barrier_set; }
93d84f667d12 8201318: Introduce GCThreadLocalData to abstract GC-specific data belonging to a thread
pliden
parents: 49658
diff changeset
   138
  static void set_barrier_set(BarrierSet* barrier_set);
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   139
49484
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
   140
  BarrierSetAssembler* barrier_set_assembler() {
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
   141
    assert(_barrier_set_assembler != NULL, "should be set");
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
   142
    return _barrier_set_assembler;
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
   143
  }
ee8fa73b90f9 8198949: Modularize arraycopy stub routine GC barriers
eosterlund
parents: 49383
diff changeset
   144
49906
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
   145
  BarrierSetC1* barrier_set_c1() {
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
   146
    assert(_barrier_set_c1 != NULL, "should be set");
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
   147
    return _barrier_set_c1;
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
   148
  }
4bb58f644e4e 8201543: Modularize C1 GC barriers
eosterlund
parents: 49752
diff changeset
   149
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   150
  BarrierSetC2* barrier_set_c2() {
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   151
    assert(_barrier_set_c2 != NULL, "should be set");
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   152
    return _barrier_set_c2;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   153
  }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 49906
diff changeset
   154
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   155
  // The AccessBarrier of a BarrierSet subclass is called by the Access API
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   156
  // (cf. oops/access.hpp) to perform decorated accesses. GC implementations
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   157
  // may override these default access operations by declaring an
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   158
  // AccessBarrier class in its BarrierSet. Its accessors will then be
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   159
  // automatically resolved at runtime.
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   160
  //
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   161
  // In order to register a new FooBarrierSet::AccessBarrier with the Access API,
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   162
  // the following steps should be taken:
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   163
  // 1) Provide an enum "name" for the BarrierSet in barrierSetConfig.hpp
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   164
  // 2) Make sure the barrier set headers are included from barrierSetConfig.inline.hpp
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   165
  // 3) Provide specializations for BarrierSet::GetName and BarrierSet::GetType.
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   166
  template <DecoratorSet decorators, typename BarrierSetT>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   167
  class AccessBarrier: protected RawAccessBarrier<decorators> {
48628
69d65d9dcadb 8193063: Enabling narrowOop values for RawAccess accesses
eosterlund
parents: 47998
diff changeset
   168
  private:
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   169
    typedef RawAccessBarrier<decorators> Raw;
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   170
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   171
  public:
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   172
    // Primitive heap accesses. These accessors get resolved when
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   173
    // IN_HEAP is set (e.g. when using the HeapAccess API), it is
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   174
    // not an oop_* overload, and the barrier strength is AS_NORMAL.
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   175
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   176
    static T load_in_heap(T* addr) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   177
      return Raw::template load<T>(addr);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   178
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   179
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   180
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   181
    static T load_in_heap_at(oop base, ptrdiff_t offset) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   182
      return Raw::template load_at<T>(base, offset);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   183
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   184
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   185
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   186
    static void store_in_heap(T* addr, T value) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   187
      Raw::store(addr, value);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   188
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   189
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   190
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   191
    static void store_in_heap_at(oop base, ptrdiff_t offset, T value) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   192
      Raw::store_at(base, offset, value);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   193
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   194
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   195
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   196
    static T atomic_cmpxchg_in_heap(T new_value, T* addr, T compare_value) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   197
      return Raw::atomic_cmpxchg(new_value, addr, compare_value);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   198
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   199
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   200
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   201
    static T atomic_cmpxchg_in_heap_at(T new_value, oop base, ptrdiff_t offset, T compare_value) {
50940
3009952d5985 8206407: Primitive atomic_cmpxchg_in_heap_at() in BarrierSet::Access needs to call non-oop raw method
rkennke
parents: 50599
diff changeset
   202
      return Raw::atomic_cmpxchg_at(new_value, base, offset, compare_value);
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   203
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   204
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   205
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   206
    static T atomic_xchg_in_heap(T new_value, T* addr) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   207
      return Raw::atomic_xchg(new_value, addr);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   208
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   209
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   210
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   211
    static T atomic_xchg_in_heap_at(T new_value, oop base, ptrdiff_t offset) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   212
      return Raw::atomic_xchg_at(new_value, base, offset);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   213
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   214
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   215
    template <typename T>
50389
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   216
    static void arraycopy_in_heap(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   217
                                  arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   218
                                  size_t length) {
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   219
      Raw::arraycopy(src_obj, src_offset_in_bytes, src_raw,
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   220
                     dst_obj, dst_offset_in_bytes, dst_raw,
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   221
                     length);
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   222
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   223
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   224
    // Heap oop accesses. These accessors get resolved when
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   225
    // IN_HEAP is set (e.g. when using the HeapAccess API), it is
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   226
    // an oop_* overload, and the barrier strength is AS_NORMAL.
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   227
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   228
    static oop oop_load_in_heap(T* addr) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   229
      return Raw::template oop_load<oop>(addr);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   230
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   231
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   232
    static oop oop_load_in_heap_at(oop base, ptrdiff_t offset) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   233
      return Raw::template oop_load_at<oop>(base, offset);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   234
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   235
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   236
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   237
    static void oop_store_in_heap(T* addr, oop value) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   238
      Raw::oop_store(addr, value);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   239
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   240
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   241
    static void oop_store_in_heap_at(oop base, ptrdiff_t offset, oop value) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   242
      Raw::oop_store_at(base, offset, value);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   243
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   244
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   245
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   246
    static oop oop_atomic_cmpxchg_in_heap(oop new_value, T* addr, oop compare_value) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   247
      return Raw::oop_atomic_cmpxchg(new_value, addr, compare_value);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   248
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   249
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   250
    static oop oop_atomic_cmpxchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset, oop compare_value) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   251
      return Raw::oop_atomic_cmpxchg_at(new_value, base, offset, compare_value);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   252
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   253
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   254
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   255
    static oop oop_atomic_xchg_in_heap(oop new_value, T* addr) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   256
      return Raw::oop_atomic_xchg(new_value, addr);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   257
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   258
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   259
    static oop oop_atomic_xchg_in_heap_at(oop new_value, oop base, ptrdiff_t offset) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   260
      return Raw::oop_atomic_xchg_at(new_value, base, offset);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   261
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   262
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   263
    template <typename T>
50389
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   264
    static bool oop_arraycopy_in_heap(arrayOop src_obj, size_t src_offset_in_bytes, T* src_raw,
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   265
                                      arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw,
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   266
                                      size_t length) {
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   267
      return Raw::oop_arraycopy(src_obj, src_offset_in_bytes, src_raw,
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   268
                                dst_obj, dst_offset_in_bytes, dst_raw,
7e8c0409a747 8198285: More consistent Access API for arraycopy
rkennke
parents: 50180
diff changeset
   269
                                length);
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   270
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   271
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   272
    // Off-heap oop accesses. These accessors get resolved when
50599
ecc2af326b5f 8204939: Change Access nomenclature: root to native
kbarrett
parents: 50521
diff changeset
   273
    // IN_HEAP is not set (e.g. when using the NativeAccess API), it is
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   274
    // an oop* overload, and the barrier strength is AS_NORMAL.
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   275
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   276
    static oop oop_load_not_in_heap(T* addr) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   277
      return Raw::template oop_load<oop>(addr);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   278
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   279
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   280
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   281
    static void oop_store_not_in_heap(T* addr, oop value) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   282
      Raw::oop_store(addr, value);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   283
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   284
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   285
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   286
    static oop oop_atomic_cmpxchg_not_in_heap(oop new_value, T* addr, oop compare_value) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   287
      return Raw::oop_atomic_cmpxchg(new_value, addr, compare_value);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   288
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   289
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   290
    template <typename T>
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   291
    static oop oop_atomic_xchg_not_in_heap(oop new_value, T* addr) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   292
      return Raw::oop_atomic_xchg(new_value, addr);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   293
    }
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   294
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   295
    // Clone barrier support
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   296
    static void clone_in_heap(oop src, oop dst, size_t size) {
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   297
      Raw::clone(src, dst, size);
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   298
    }
49041
44122f767467 8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents: 49007
diff changeset
   299
44122f767467 8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents: 49007
diff changeset
   300
    static oop resolve(oop obj) {
44122f767467 8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents: 49007
diff changeset
   301
      return Raw::resolve(obj);
44122f767467 8198286: Direct memory accessors in typeArrayOop.hpp should use Access API
eosterlund
parents: 49007
diff changeset
   302
    }
49658
8237a91c1cca 8199781: Don't use naked == for comparing oops
rkennke
parents: 49484
diff changeset
   303
8237a91c1cca 8199781: Don't use naked == for comparing oops
rkennke
parents: 49484
diff changeset
   304
    static bool equals(oop o1, oop o2) {
8237a91c1cca 8199781: Don't use naked == for comparing oops
rkennke
parents: 49484
diff changeset
   305
      return Raw::equals(o1, o2);
8237a91c1cca 8199781: Don't use naked == for comparing oops
rkennke
parents: 49484
diff changeset
   306
    }
47998
fb0275c320a0 8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents: 47794
diff changeset
   307
  };
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   309
29331
b788134d664a 8074319: barrier_set_cast defined via friend injection
jwilhelm
parents: 29325
diff changeset
   310
template<typename T>
b788134d664a 8074319: barrier_set_cast defined via friend injection
jwilhelm
parents: 29325
diff changeset
   311
inline T* barrier_set_cast(BarrierSet* bs) {
b788134d664a 8074319: barrier_set_cast defined via friend injection
jwilhelm
parents: 29325
diff changeset
   312
  assert(bs->is_a(BarrierSet::GetName<T>::value), "wrong type of barrier set");
b788134d664a 8074319: barrier_set_cast defined via friend injection
jwilhelm
parents: 29325
diff changeset
   313
  return static_cast<T*>(bs);
b788134d664a 8074319: barrier_set_cast defined via friend injection
jwilhelm
parents: 29325
diff changeset
   314
}
b788134d664a 8074319: barrier_set_cast defined via friend injection
jwilhelm
parents: 29325
diff changeset
   315
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 29331
diff changeset
   316
#endif // SHARE_VM_GC_SHARED_BARRIERSET_HPP