src/hotspot/share/gc/shared/c2/barrierSetC2.hpp
author neliasso
Fri, 29 Nov 2019 11:26:25 +0100
changeset 59324 5e8f9713e343
parent 59025 b398685dd029
permissions -rw-r--r--
8234520: ZGC: C2: Oop instance cloning causing skipped compiles Reviewed-by: pliden, vlivanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
     1
/*
54048
744dc9c33676 8217417: Decorator name typo: C2_TIGHLY_COUPLED_ALLOC
kbarrett
parents: 52925
diff changeset
     2
 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
     4
 *
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
     8
 *
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    13
 * accompanied this code).
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    14
 *
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    18
 *
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    21
 * questions.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    22
 *
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    23
 */
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    24
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    25
#ifndef SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    26
#define SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    27
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    28
#include "memory/allocation.hpp"
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    29
#include "oops/accessDecorators.hpp"
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    30
#include "opto/loopnode.hpp"
52627
e7d8ea5bfc8f 8213746: GC/C2 abstraction for C2 matcher
rkennke
parents: 52568
diff changeset
    31
#include "opto/matcher.hpp"
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    32
#include "opto/memnode.hpp"
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    33
#include "utilities/globalDefinitions.hpp"
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    34
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    35
// This means the access is mismatched. This means the value of an access
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    36
// is not equivalent to the value pointed to by the address.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    37
const DecoratorSet C2_MISMATCHED             = DECORATOR_LAST << 1;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    38
// The access may not be aligned to its natural size.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    39
const DecoratorSet C2_UNALIGNED              = DECORATOR_LAST << 2;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    40
// The atomic cmpxchg is weak, meaning that spurious false negatives are allowed,
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    41
// but never false positives.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    42
const DecoratorSet C2_WEAK_CMPXCHG           = DECORATOR_LAST << 3;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    43
// This denotes that a load has control dependency.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    44
const DecoratorSet C2_CONTROL_DEPENDENT_LOAD = DECORATOR_LAST << 4;
57582
a79a819a8218 8227407: ZGC: C2 loads and load barriers can get separated by safepoints
eosterlund
parents: 55541
diff changeset
    45
// This denotes that a load that must be pinned, but may float above safepoints.
a79a819a8218 8227407: ZGC: C2 loads and load barriers can get separated by safepoints
eosterlund
parents: 55541
diff changeset
    46
const DecoratorSet C2_UNKNOWN_CONTROL_LOAD   = DECORATOR_LAST << 5;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    47
// This denotes that the access is produced from the sun.misc.Unsafe intrinsics.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    48
const DecoratorSet C2_UNSAFE_ACCESS          = DECORATOR_LAST << 6;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    49
// This denotes that the access mutates state.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    50
const DecoratorSet C2_WRITE_ACCESS           = DECORATOR_LAST << 7;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    51
// This denotes that the access reads state.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    52
const DecoratorSet C2_READ_ACCESS            = DECORATOR_LAST << 8;
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
    53
// A nearby allocation?
54048
744dc9c33676 8217417: Decorator name typo: C2_TIGHLY_COUPLED_ALLOC
kbarrett
parents: 52925
diff changeset
    54
const DecoratorSet C2_TIGHTLY_COUPLED_ALLOC  = DECORATOR_LAST << 9;
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
    55
// Loads and stores from an arraycopy being optimized
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
    56
const DecoratorSet C2_ARRAY_COPY             = DECORATOR_LAST << 10;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    57
52426
38bf0c9c4e64 8213384: Move G1/C2 barrier verification into G1BarrierSetC2
rkennke
parents: 52424
diff changeset
    58
class Compile;
52568
40474b7105f4 8213615: GC/C2 abstraction for escape analysis
rkennke
parents: 52471
diff changeset
    59
class ConnectionGraph;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    60
class GraphKit;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    61
class IdealKit;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    62
class Node;
52712
d17e09494308 8214362: C2: gc interface entry point for split if
roland
parents: 52711
diff changeset
    63
class PhaseGVN;
52711
f480ad035c73 8214172: GC interface entry points for loop opts
roland
parents: 52655
diff changeset
    64
class PhaseIdealLoop;
52568
40474b7105f4 8213615: GC/C2 abstraction for escape analysis
rkennke
parents: 52471
diff changeset
    65
class PhaseMacroExpand;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    66
class Type;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    67
class TypePtr;
52568
40474b7105f4 8213615: GC/C2 abstraction for escape analysis
rkennke
parents: 52471
diff changeset
    68
class Unique_Node_List;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    69
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    70
// This class wraps a node and a type.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    71
class C2AccessValue: public StackObj {
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    72
protected:
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    73
  Node* _node;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    74
  const Type* _type;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    75
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    76
public:
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    77
  C2AccessValue(Node* node, const Type* type) :
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    78
    _node(node),
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    79
    _type(type) {}
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    80
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    81
  Node* node() const        { return _node; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    82
  const Type* type() const  { return _type; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    83
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    84
  void set_node(Node* node) { _node = node; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    85
};
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    86
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    87
// This class wraps a node and a pointer type.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    88
class C2AccessValuePtr: public C2AccessValue {
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    89
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    90
public:
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    91
  C2AccessValuePtr(Node* node, const TypePtr* type) :
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    92
    C2AccessValue(node, reinterpret_cast<const Type*>(type)) {}
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    93
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    94
  const TypePtr* type() const { return reinterpret_cast<const TypePtr*>(_type); }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    95
};
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    96
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    97
// This class wraps a bunch of context parameters thare are passed around in the
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    98
// BarrierSetC2 backend hierarchy, for loads and stores, to reduce boiler plate.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
    99
class C2Access: public StackObj {
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   100
protected:
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   101
  DecoratorSet      _decorators;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   102
  BasicType         _type;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   103
  Node*             _base;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   104
  C2AccessValuePtr& _addr;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   105
  Node*             _raw_access;
59025
b398685dd029 8233506: ZGC: the load for Reference.get() can be converted to a load for strong refs
eosterlund
parents: 58516
diff changeset
   106
  uint8_t           _barrier_data;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   107
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   108
  void fixup_decorators();
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   109
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   110
public:
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   111
  C2Access(DecoratorSet decorators,
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   112
           BasicType type, Node* base, C2AccessValuePtr& addr) :
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   113
    _decorators(decorators),
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   114
    _type(type),
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   115
    _base(base),
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   116
    _addr(addr),
59025
b398685dd029 8233506: ZGC: the load for Reference.get() can be converted to a load for strong refs
eosterlund
parents: 58516
diff changeset
   117
    _raw_access(NULL),
b398685dd029 8233506: ZGC: the load for Reference.get() can be converted to a load for strong refs
eosterlund
parents: 58516
diff changeset
   118
    _barrier_data(0)
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   119
  {}
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   120
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   121
  DecoratorSet decorators() const { return _decorators; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   122
  Node* base() const              { return _base; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   123
  C2AccessValuePtr& addr() const  { return _addr; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   124
  BasicType type() const          { return _type; }
58273
08a5148e7c4e 8230505: Replace JVM type comparisons to T_OBJECT and T_ARRAY with call to is_reference_type
lfoltan
parents: 58217
diff changeset
   125
  bool is_oop() const             { return is_reference_type(_type); }
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   126
  bool is_raw() const             { return (_decorators & AS_RAW) != 0; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   127
  Node* raw_access() const        { return _raw_access; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   128
59025
b398685dd029 8233506: ZGC: the load for Reference.get() can be converted to a load for strong refs
eosterlund
parents: 58516
diff changeset
   129
  uint8_t barrier_data() const        { return _barrier_data; }
b398685dd029 8233506: ZGC: the load for Reference.get() can be converted to a load for strong refs
eosterlund
parents: 58516
diff changeset
   130
  void set_barrier_data(uint8_t data) { _barrier_data = data; }
b398685dd029 8233506: ZGC: the load for Reference.get() can be converted to a load for strong refs
eosterlund
parents: 58516
diff changeset
   131
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   132
  void set_raw_access(Node* raw_access) { _raw_access = raw_access; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   133
  virtual void set_memory() {} // no-op for normal accesses, but not for atomic accesses.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   134
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   135
  MemNode::MemOrd mem_node_mo() const;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   136
  bool needs_cpu_membar() const;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   137
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   138
  virtual PhaseGVN& gvn() const = 0;
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   139
  virtual bool is_parse_access() const { return false; }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   140
  virtual bool is_opt_access() const { return false; }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   141
};
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   142
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   143
// C2Access for parse time calls to the BarrierSetC2 backend.
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   144
class C2ParseAccess: public C2Access {
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   145
protected:
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   146
  GraphKit*         _kit;
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   147
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   148
  void* barrier_set_state() const;
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   149
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   150
public:
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   151
  C2ParseAccess(GraphKit* kit, DecoratorSet decorators,
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   152
                BasicType type, Node* base, C2AccessValuePtr& addr) :
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   153
    C2Access(decorators, type, base, addr),
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   154
    _kit(kit) {
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   155
    fixup_decorators();
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   156
  }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   157
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   158
  GraphKit* kit() const           { return _kit; }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   159
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   160
  template <typename T>
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   161
  T barrier_set_state_as() const {
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   162
    return reinterpret_cast<T>(barrier_set_state());
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   163
  }
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   164
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   165
  virtual PhaseGVN& gvn() const;
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   166
  virtual bool is_parse_access() const { return true; }
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   167
};
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   168
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   169
// This class wraps a bunch of context parameters thare are passed around in the
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   170
// BarrierSetC2 backend hierarchy, for atomic accesses, to reduce boiler plate.
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   171
class C2AtomicParseAccess: public C2ParseAccess {
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   172
  Node* _memory;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   173
  uint  _alias_idx;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   174
  bool  _needs_pinning;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   175
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   176
public:
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   177
  C2AtomicParseAccess(GraphKit* kit, DecoratorSet decorators, BasicType type,
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   178
                 Node* base, C2AccessValuePtr& addr, uint alias_idx) :
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   179
    C2ParseAccess(kit, decorators, type, base, addr),
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   180
    _memory(NULL),
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   181
    _alias_idx(alias_idx),
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   182
    _needs_pinning(true) {}
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   183
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   184
  // Set the memory node based on the current memory slice.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   185
  virtual void set_memory();
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   186
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   187
  Node* memory() const       { return _memory; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   188
  uint alias_idx() const     { return _alias_idx; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   189
  bool needs_pinning() const { return _needs_pinning; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   190
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   191
  void set_needs_pinning(bool value)    { _needs_pinning = value; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   192
};
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   193
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   194
// C2Access for optimization time calls to the BarrierSetC2 backend.
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   195
class C2OptAccess: public C2Access {
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   196
  PhaseGVN& _gvn;
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   197
  MergeMemNode* _mem;
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   198
  Node* _ctl;
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   199
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   200
public:
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   201
  C2OptAccess(PhaseGVN& gvn, Node* ctl, MergeMemNode* mem, DecoratorSet decorators,
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   202
              BasicType type, Node* base, C2AccessValuePtr& addr) :
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   203
    C2Access(decorators, type, base, addr),
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   204
    _gvn(gvn), _mem(mem), _ctl(ctl) {
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   205
    fixup_decorators();
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   206
  }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   207
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   208
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   209
  MergeMemNode* mem() const { return _mem; }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   210
  Node* ctl() const { return _ctl; }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   211
  // void set_mem(Node* mem) { _mem = mem; }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   212
  void set_ctl(Node* ctl) { _ctl = ctl; }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   213
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   214
  virtual PhaseGVN& gvn() const { return _gvn; }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   215
  virtual bool is_opt_access() const { return true; }
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   216
};
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   217
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   218
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   219
// This is the top-level class for the backend of the Access API in C2.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   220
// The top-level class is responsible for performing raw accesses. The
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   221
// various GC barrier sets inherit from the BarrierSetC2 class to sprinkle
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   222
// barriers into the accesses.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   223
class BarrierSetC2: public CHeapObj<mtGC> {
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   224
protected:
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   225
  virtual void resolve_address(C2Access& access) const;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   226
  virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   227
  virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   228
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   229
  virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   230
                                               Node* new_val, const Type* val_type) const;
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   231
  virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   232
                                                Node* new_val, const Type* value_type) const;
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   233
  virtual Node* atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* val_type) const;
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   234
  virtual Node* atomic_add_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* val_type) const;
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   235
  void pin_atomic_op(C2AtomicParseAccess& access) const;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   236
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   237
public:
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   238
  // This is the entry-point for the backend to perform accesses through the Access API.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   239
  virtual Node* store_at(C2Access& access, C2AccessValue& val) const;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   240
  virtual Node* load_at(C2Access& access, const Type* val_type) const;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   241
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   242
  virtual Node* atomic_cmpxchg_val_at(C2AtomicParseAccess& access, Node* expected_val,
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   243
                                      Node* new_val, const Type* val_type) const;
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   244
  virtual Node* atomic_cmpxchg_bool_at(C2AtomicParseAccess& access, Node* expected_val,
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   245
                                       Node* new_val, const Type* val_type) const;
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   246
  virtual Node* atomic_xchg_at(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const;
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 52224
diff changeset
   247
  virtual Node* atomic_add_at(C2AtomicParseAccess& access, Node* new_val, const Type* value_type) const;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   248
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   249
  virtual void clone(GraphKit* kit, Node* src, Node* dst, Node* size, bool is_array) const;
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   250
51705
8123901bc3d1 8210187: Explicit barriers for C2
rkennke
parents: 51485
diff changeset
   251
  virtual Node* resolve(GraphKit* kit, Node* n, DecoratorSet decorators) const { return n; }
8123901bc3d1 8210187: Explicit barriers for C2
rkennke
parents: 51485
diff changeset
   252
51806
1ecc914fb707 8210829: Modularize allocations in C2
rkennke
parents: 51705
diff changeset
   253
  virtual Node* obj_allocate(PhaseMacroExpand* macro, Node* ctrl, Node* mem, Node* toobig_false, Node* size_in_bytes,
1ecc914fb707 8210829: Modularize allocations in C2
rkennke
parents: 51705
diff changeset
   254
                             Node*& i_o, Node*& needgc_ctrl,
1ecc914fb707 8210829: Modularize allocations in C2
rkennke
parents: 51705
diff changeset
   255
                             Node*& fast_oop_ctrl, Node*& fast_oop_rawmem,
1ecc914fb707 8210829: Modularize allocations in C2
rkennke
parents: 51705
diff changeset
   256
                             intx prefetch_lines) const;
1ecc914fb707 8210829: Modularize allocations in C2
rkennke
parents: 51705
diff changeset
   257
52429
b64514ff68fd 8213381: Hook to allow GC to inject Node::Ideal() calls
rkennke
parents: 52426
diff changeset
   258
  virtual Node* ideal_node(PhaseGVN* phase, Node* n, bool can_reshape) const { return NULL; }
b64514ff68fd 8213381: Hook to allow GC to inject Node::Ideal() calls
rkennke
parents: 52426
diff changeset
   259
  virtual Node* identity_node(PhaseGVN* phase, Node* n) const { return n; }
b64514ff68fd 8213381: Hook to allow GC to inject Node::Ideal() calls
rkennke
parents: 52426
diff changeset
   260
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   261
  // These are general helper methods used by C2
51984
2ef304ee001d 8210887: Tweak C2 gc api for arraycopy
roland
parents: 51880
diff changeset
   262
  enum ArrayCopyPhase {
2ef304ee001d 8210887: Tweak C2 gc api for arraycopy
roland
parents: 51880
diff changeset
   263
    Parsing,
2ef304ee001d 8210887: Tweak C2 gc api for arraycopy
roland
parents: 51880
diff changeset
   264
    Optimization,
2ef304ee001d 8210887: Tweak C2 gc api for arraycopy
roland
parents: 51880
diff changeset
   265
    Expansion
2ef304ee001d 8210887: Tweak C2 gc api for arraycopy
roland
parents: 51880
diff changeset
   266
  };
55307
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 54048
diff changeset
   267
51984
2ef304ee001d 8210887: Tweak C2 gc api for arraycopy
roland
parents: 51880
diff changeset
   268
  virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const { return false; }
58217
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 57584
diff changeset
   269
  virtual void clone_at_expansion(PhaseMacroExpand* phase, ArrayCopyNode* ac) const;
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   270
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   271
  // Support for GC barriers emitted during parsing
58516
d376d86b0a01 8230565: ZGC: Redesign C2 load barrier to expand on the MachNode level
eosterlund
parents: 58273
diff changeset
   272
  virtual bool has_load_barrier_nodes() const { return false; }
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   273
  virtual bool is_gc_barrier_node(Node* node) const { return false; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   274
  virtual Node* step_over_gc_barrier(Node* c) const { return c; }
55541
700ef5241888 8226287: Make process_users_of_allocation handle gc barriers
neliasso
parents: 55307
diff changeset
   275
  virtual Node* step_over_gc_barrier_ctrl(Node* c) const { return c; }
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   276
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   277
  // Support for macro expanded GC barriers
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   278
  virtual void register_potential_barrier_node(Node* node) const { }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   279
  virtual void unregister_potential_barrier_node(Node* node) const { }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   280
  virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const { }
52224
4f2215a00ed1 8212611: Small collection of simple changes from shenandoah
roland
parents: 51984
diff changeset
   281
  virtual void enqueue_useful_gc_barrier(PhaseIterGVN* igvn, Node* node) const {}
4f2215a00ed1 8212611: Small collection of simple changes from shenandoah
roland
parents: 51984
diff changeset
   282
  virtual void eliminate_useless_gc_barriers(Unique_Node_List &useful, Compile* C) const {}
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   283
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   284
  // Allow barrier sets to have shared state that is preserved across a compilation unit.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   285
  // This could for example comprise macro nodes to be expanded during macro expansion.
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   286
  virtual void* create_barrier_state(Arena* comp_arena) const { return NULL; }
52711
f480ad035c73 8214172: GC interface entry points for loop opts
roland
parents: 52655
diff changeset
   287
  // If the BarrierSetC2 state has barrier nodes in its compilation
f480ad035c73 8214172: GC interface entry points for loop opts
roland
parents: 52655
diff changeset
   288
  // unit state to be expanded later, then now is the time to do so.
f480ad035c73 8214172: GC interface entry points for loop opts
roland
parents: 52655
diff changeset
   289
  virtual bool expand_barriers(Compile* C, PhaseIterGVN& igvn) const { return false; }
f480ad035c73 8214172: GC interface entry points for loop opts
roland
parents: 52655
diff changeset
   290
  virtual bool optimize_loops(PhaseIdealLoop* phase, LoopOptsMode mode, VectorSet& visited, Node_Stack& nstack, Node_List& worklist) const { return false; }
f480ad035c73 8214172: GC interface entry points for loop opts
roland
parents: 52655
diff changeset
   291
  virtual bool strip_mined_loops_expanded(LoopOptsMode mode) const { return false; }
f480ad035c73 8214172: GC interface entry points for loop opts
roland
parents: 52655
diff changeset
   292
  virtual bool is_gc_specific_loop_opts_pass(LoopOptsMode mode) const { return false; }
52426
38bf0c9c4e64 8213384: Move G1/C2 barrier verification into G1BarrierSetC2
rkennke
parents: 52424
diff changeset
   293
52655
c88468bc7690 8214057: GC/C2 abstraction for Node::has_special_unique_user()
rkennke
parents: 52654
diff changeset
   294
  virtual bool has_special_unique_user(const Node* node) const { return false; }
c88468bc7690 8214057: GC/C2 abstraction for Node::has_special_unique_user()
rkennke
parents: 52654
diff changeset
   295
52426
38bf0c9c4e64 8213384: Move G1/C2 barrier verification into G1BarrierSetC2
rkennke
parents: 52424
diff changeset
   296
  enum CompilePhase {
55307
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 54048
diff changeset
   297
    BeforeOptimize,
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 54048
diff changeset
   298
    BeforeMacroExpand,
52426
38bf0c9c4e64 8213384: Move G1/C2 barrier verification into G1BarrierSetC2
rkennke
parents: 52424
diff changeset
   299
    BeforeCodeGen
38bf0c9c4e64 8213384: Move G1/C2 barrier verification into G1BarrierSetC2
rkennke
parents: 52424
diff changeset
   300
  };
52441
6082c529aed8 8213371: GC/C2 abstraction and cleanup to handle custom offset for GC memory accesses
rkennke
parents: 52429
diff changeset
   301
6082c529aed8 8213371: GC/C2 abstraction and cleanup to handle custom offset for GC memory accesses
rkennke
parents: 52429
diff changeset
   302
  virtual bool flatten_gc_alias_type(const TypePtr*& adr_type) const { return false; }
6082c529aed8 8213371: GC/C2 abstraction and cleanup to handle custom offset for GC memory accesses
rkennke
parents: 52429
diff changeset
   303
#ifdef ASSERT
6082c529aed8 8213371: GC/C2 abstraction and cleanup to handle custom offset for GC memory accesses
rkennke
parents: 52429
diff changeset
   304
  virtual bool verify_gc_alias_type(const TypePtr* adr_type, int offset) const { return false; }
55307
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 54048
diff changeset
   305
  virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
52441
6082c529aed8 8213371: GC/C2 abstraction and cleanup to handle custom offset for GC memory accesses
rkennke
parents: 52429
diff changeset
   306
#endif
52471
04d7e790aa2e 8213489: GC/C2 abstraction for Compile::final_graph_reshaping()
rkennke
parents: 52441
diff changeset
   307
04d7e790aa2e 8213489: GC/C2 abstraction for Compile::final_graph_reshaping()
rkennke
parents: 52441
diff changeset
   308
  virtual bool final_graph_reshaping(Compile* compile, Node* n, uint opcode) const { return false; }
04d7e790aa2e 8213489: GC/C2 abstraction for Compile::final_graph_reshaping()
rkennke
parents: 52441
diff changeset
   309
52568
40474b7105f4 8213615: GC/C2 abstraction for escape analysis
rkennke
parents: 52471
diff changeset
   310
  virtual bool escape_add_to_con_graph(ConnectionGraph* conn_graph, PhaseGVN* gvn, Unique_Node_List* delayed_worklist, Node* n, uint opcode) const { return false; }
40474b7105f4 8213615: GC/C2 abstraction for escape analysis
rkennke
parents: 52471
diff changeset
   311
  virtual bool escape_add_final_edges(ConnectionGraph* conn_graph, PhaseGVN* gvn, Node* n, uint opcode) const { return false; }
40474b7105f4 8213615: GC/C2 abstraction for escape analysis
rkennke
parents: 52471
diff changeset
   312
  virtual bool escape_has_out_with_unsafe_object(Node* n) const { return false; }
52627
e7d8ea5bfc8f 8213746: GC/C2 abstraction for C2 matcher
rkennke
parents: 52568
diff changeset
   313
e7d8ea5bfc8f 8213746: GC/C2 abstraction for C2 matcher
rkennke
parents: 52568
diff changeset
   314
  virtual bool matcher_find_shared_visit(Matcher* matcher, Matcher::MStack& mstack, Node* n, uint opcode, bool& mem_op, int& mem_addr_idx) const { return false; };
e7d8ea5bfc8f 8213746: GC/C2 abstraction for C2 matcher
rkennke
parents: 52568
diff changeset
   315
  virtual bool matcher_find_shared_post_visit(Matcher* matcher, Node* n, uint opcode) const { return false; };
e7d8ea5bfc8f 8213746: GC/C2 abstraction for C2 matcher
rkennke
parents: 52568
diff changeset
   316
  virtual bool matcher_is_store_load_barrier(Node* x, uint xop) const { return false; }
52654
95ce45e0249f 8214055: GC/C2 abstraction for phaseX
rkennke
parents: 52627
diff changeset
   317
55307
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 54048
diff changeset
   318
  virtual void igvn_add_users_to_worklist(PhaseIterGVN* igvn, Node* use) const { }
ed12027517c0 8224675: Late GC barrier insertion for ZGC
neliasso
parents: 54048
diff changeset
   319
  virtual void ccp_analyze(PhaseCCP* ccp, Unique_Node_List& worklist, Node* use) const { }
52654
95ce45e0249f 8214055: GC/C2 abstraction for phaseX
rkennke
parents: 52627
diff changeset
   320
52712
d17e09494308 8214362: C2: gc interface entry point for split if
roland
parents: 52711
diff changeset
   321
  virtual Node* split_if_pre(PhaseIdealLoop* phase, Node* n) const { return NULL; }
52925
9c18c9d839d3 8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents: 52712
diff changeset
   322
  virtual bool build_loop_late_post(PhaseIdealLoop* phase, Node* n) const { return false; }
9c18c9d839d3 8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents: 52712
diff changeset
   323
  virtual bool sink_node(PhaseIdealLoop* phase, Node* n, Node* x, Node* x_ctrl, Node* n_ctrl) const { return false; }
58516
d376d86b0a01 8230565: ZGC: Redesign C2 load barrier to expand on the MachNode level
eosterlund
parents: 58273
diff changeset
   324
d376d86b0a01 8230565: ZGC: Redesign C2 load barrier to expand on the MachNode level
eosterlund
parents: 58273
diff changeset
   325
  virtual void late_barrier_analysis() const { }
d376d86b0a01 8230565: ZGC: Redesign C2 load barrier to expand on the MachNode level
eosterlund
parents: 58273
diff changeset
   326
  virtual int estimate_stub_size() const { return 0; }
d376d86b0a01 8230565: ZGC: Redesign C2 load barrier to expand on the MachNode level
eosterlund
parents: 58273
diff changeset
   327
  virtual void emit_stubs(CodeBuffer& cb) const { }
59324
5e8f9713e343 8234520: ZGC: C2: Oop instance cloning causing skipped compiles
neliasso
parents: 59025
diff changeset
   328
5e8f9713e343 8234520: ZGC: C2: Oop instance cloning causing skipped compiles
neliasso
parents: 59025
diff changeset
   329
  static int arraycopy_payload_base_offset(bool is_array);
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   330
};
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   331
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents:
diff changeset
   332
#endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP