src/hotspot/share/opto/arraycopynode.hpp
author coleenp
Thu, 10 Jan 2019 15:13:51 -0500
changeset 53244 9807daeb47c4
parent 52435 eac000022f61
child 54048 744dc9c33676
permissions -rw-r--r--
8216167: Update include guards to reflect correct directories Summary: Use script and some manual fixup to fix directores names in include guards. Reviewed-by: lfoltan, eosterlund, kbarrett
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52435
diff changeset
     2
 * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
     4
 *
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
     8
 *
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    13
 * accompanied this code).
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    14
 *
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    18
 *
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    21
 * questions.
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    22
 *
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    23
 */
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    24
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52435
diff changeset
    25
#ifndef SHARE_OPTO_ARRAYCOPYNODE_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52435
diff changeset
    26
#define SHARE_OPTO_ARRAYCOPYNODE_HPP
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    27
52435
eac000022f61 8213464: Fix missing include after JDK-8212243
mdoerr
parents: 52424
diff changeset
    28
#include "gc/shared/c2/barrierSetC2.hpp"
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    29
#include "opto/callnode.hpp"
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    30
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    31
class GraphKit;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    32
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    33
class ArrayCopyNode : public CallNode {
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    34
private:
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    35
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    36
  // What kind of arraycopy variant is this?
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    37
  enum {
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    38
    None,            // not set yet
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    39
    ArrayCopy,       // System.arraycopy()
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    40
    CloneBasic,      // A clone that can be copied by 64 bit chunks
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    41
    CloneOop,        // An oop array clone
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    42
    CopyOf,          // Arrays.copyOf()
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    43
    CopyOfRange      // Arrays.copyOfRange()
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    44
  } _kind;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    45
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    46
#ifndef PRODUCT
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    47
  static const char* _kind_names[CopyOfRange+1];
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    48
#endif
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    49
  // Is the alloc obtained with
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    50
  // AllocateArrayNode::Ideal_array_allocation() tighly coupled
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    51
  // (arraycopy follows immediately the allocation)?
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    52
  // We cache the result of LibraryCallKit::tightly_coupled_allocation
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    53
  // here because it's much easier to find whether there's a tightly
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    54
  // couple allocation at parse time than at macro expansion time. At
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    55
  // macro expansion time, for every use of the allocation node we
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    56
  // would need to figure out whether it happens after the arraycopy (and
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    57
  // can be ignored) or between the allocation and the arraycopy. At
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    58
  // parse time, it's straightforward because whatever happens after
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    59
  // the arraycopy is not parsed yet so doesn't exist when
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    60
  // LibraryCallKit::tightly_coupled_allocation() is called.
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    61
  bool _alloc_tightly_coupled;
42086
feac795f345d 8159611: C2: ArrayCopy elimination skips required parameter checks
simonis
parents: 39254
diff changeset
    62
  bool _has_negative_length_guard;
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    63
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    64
  bool _arguments_validated;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    65
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    66
  static const TypeFunc* arraycopy_type() {
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    67
    const Type** fields = TypeTuple::fields(ParmLimit - TypeFunc::Parms);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    68
    fields[Src]       = TypeInstPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    69
    fields[SrcPos]    = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    70
    fields[Dest]      = TypeInstPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    71
    fields[DestPos]   = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    72
    fields[Length]    = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    73
    fields[SrcLen]    = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    74
    fields[DestLen]   = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    75
    fields[SrcKlass]  = TypeKlassPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    76
    fields[DestKlass] = TypeKlassPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    77
    const TypeTuple *domain = TypeTuple::make(ParmLimit, fields);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    78
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    79
    // create result type (range)
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    80
    fields = TypeTuple::fields(0);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    81
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    82
    const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    83
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    84
    return TypeFunc::make(domain, range);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    85
  }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    86
42086
feac795f345d 8159611: C2: ArrayCopy elimination skips required parameter checks
simonis
parents: 39254
diff changeset
    87
  ArrayCopyNode(Compile* C, bool alloc_tightly_coupled, bool has_negative_length_guard);
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    88
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    89
  intptr_t get_length_if_constant(PhaseGVN *phase) const;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    90
  int get_count(PhaseGVN *phase) const;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    91
  static const TypePtr* get_address_type(PhaseGVN *phase, Node* n);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    92
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    93
  Node* try_clone_instance(PhaseGVN *phase, bool can_reshape, int count);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    94
  bool prepare_array_copy(PhaseGVN *phase, bool can_reshape,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    95
                          Node*& adr_src, Node*& base_src, Node*& adr_dest, Node*& base_dest,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    96
                          BasicType& copy_type, const Type*& value_type, bool& disjoint_bases);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    97
  void array_copy_test_overlap(PhaseGVN *phase, bool can_reshape,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    98
                               bool disjoint_bases, int count,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    99
                               Node*& forward_ctl, Node*& backward_ctl);
51984
2ef304ee001d 8210887: Tweak C2 gc api for arraycopy
roland
parents: 47216
diff changeset
   100
  Node* array_copy_forward(PhaseGVN *phase, bool can_reshape, Node*& ctl,
2ef304ee001d 8210887: Tweak C2 gc api for arraycopy
roland
parents: 47216
diff changeset
   101
                           MergeMemNode* mm,
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   102
                           const TypePtr* atp_src, const TypePtr* atp_dest,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   103
                           Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   104
                           BasicType copy_type, const Type* value_type, int count);
51984
2ef304ee001d 8210887: Tweak C2 gc api for arraycopy
roland
parents: 47216
diff changeset
   105
  Node* array_copy_backward(PhaseGVN *phase, bool can_reshape, Node*& ctl,
2ef304ee001d 8210887: Tweak C2 gc api for arraycopy
roland
parents: 47216
diff changeset
   106
                            MergeMemNode* mm,
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   107
                            const TypePtr* atp_src, const TypePtr* atp_dest,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   108
                            Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   109
                            BasicType copy_type, const Type* value_type, int count);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   110
  bool finish_transform(PhaseGVN *phase, bool can_reshape,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   111
                        Node* ctl, Node *mem);
45427
64e07017ce01 8179678: ArrayCopy with same src and dst can cause incorrect execution or compiler crash
roland
parents: 42086
diff changeset
   112
  static bool may_modify_helper(const TypeOopPtr *t_oop, Node* n, PhaseTransform *phase, CallNode*& call);
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   113
52424
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 51984
diff changeset
   114
  static Node* load(BarrierSetC2* bs, PhaseGVN *phase, Node*& ctl, MergeMemNode* mem, Node* addr, const TypePtr* adr_type, const Type *type, BasicType bt);
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 51984
diff changeset
   115
  void store(BarrierSetC2* bs, PhaseGVN *phase, Node*& ctl, MergeMemNode* mem, Node* addr, const TypePtr* adr_type, Node* val, const Type *type, BasicType bt);
e3d79743f57d 8212243: More gc interface tweaks for arraycopy
roland
parents: 51984
diff changeset
   116
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   117
public:
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   118
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   119
  enum {
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   120
    Src   = TypeFunc::Parms,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   121
    SrcPos,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   122
    Dest,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   123
    DestPos,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   124
    Length,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   125
    SrcLen,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   126
    DestLen,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   127
    SrcKlass,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   128
    DestKlass,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   129
    ParmLimit
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   130
  };
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   131
30629
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   132
  // Results from escape analysis for non escaping inputs
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   133
  const TypeOopPtr* _src_type;
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   134
  const TypeOopPtr* _dest_type;
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   135
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   136
  static ArrayCopyNode* make(GraphKit* kit, bool may_throw,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   137
                             Node* src, Node* src_offset,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   138
                             Node* dest,  Node* dest_offset,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   139
                             Node* length,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   140
                             bool alloc_tightly_coupled,
42086
feac795f345d 8159611: C2: ArrayCopy elimination skips required parameter checks
simonis
parents: 39254
diff changeset
   141
                             bool has_negative_length_guard,
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   142
                             Node* src_klass = NULL, Node* dest_klass = NULL,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   143
                             Node* src_length = NULL, Node* dest_length = NULL);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   144
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   145
  void connect_outputs(GraphKit* kit);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   146
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   147
  bool is_arraycopy()             const  { assert(_kind != None, "should bet set"); return _kind == ArrayCopy; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   148
  bool is_arraycopy_validated()   const  { assert(_kind != None, "should bet set"); return _kind == ArrayCopy && _arguments_validated; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   149
  bool is_clonebasic()            const  { assert(_kind != None, "should bet set"); return _kind == CloneBasic; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   150
  bool is_cloneoop()              const  { assert(_kind != None, "should bet set"); return _kind == CloneOop; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   151
  bool is_copyof()                const  { assert(_kind != None, "should bet set"); return _kind == CopyOf; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   152
  bool is_copyof_validated()      const  { assert(_kind != None, "should bet set"); return _kind == CopyOf && _arguments_validated; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   153
  bool is_copyofrange()           const  { assert(_kind != None, "should bet set"); return _kind == CopyOfRange; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   154
  bool is_copyofrange_validated() const  { assert(_kind != None, "should bet set"); return _kind == CopyOfRange && _arguments_validated; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   155
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   156
  void set_arraycopy(bool validated)   { assert(_kind == None, "shouldn't bet set yet"); _kind = ArrayCopy; _arguments_validated = validated; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   157
  void set_clonebasic()                { assert(_kind == None, "shouldn't bet set yet"); _kind = CloneBasic; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   158
  void set_cloneoop()                  { assert(_kind == None, "shouldn't bet set yet"); _kind = CloneOop; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   159
  void set_copyof(bool validated)      { assert(_kind == None, "shouldn't bet set yet"); _kind = CopyOf; _arguments_validated = validated; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   160
  void set_copyofrange(bool validated) { assert(_kind == None, "shouldn't bet set yet"); _kind = CopyOfRange; _arguments_validated = validated; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   161
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   162
  virtual int Opcode() const;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   163
  virtual uint size_of() const; // Size is bigger
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   164
  virtual bool guaranteed_safepoint()  { return false; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   165
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   166
30629
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   167
  virtual bool may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase);
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   168
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   169
  bool is_alloc_tightly_coupled() const { return _alloc_tightly_coupled; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   170
42086
feac795f345d 8159611: C2: ArrayCopy elimination skips required parameter checks
simonis
parents: 39254
diff changeset
   171
  bool has_negative_length_guard() const { return _has_negative_length_guard; }
feac795f345d 8159611: C2: ArrayCopy elimination skips required parameter checks
simonis
parents: 39254
diff changeset
   172
39254
fb4492288b01 8156760: VM crashes if -XX:-ReduceInitialCardMarks is set
thartmann
parents: 35574
diff changeset
   173
  static bool may_modify(const TypeOopPtr *t_oop, MemBarNode* mb, PhaseTransform *phase, ArrayCopyNode*& ac);
45427
64e07017ce01 8179678: ArrayCopy with same src and dst can cause incorrect execution or compiler crash
roland
parents: 42086
diff changeset
   174
  bool modifies(intptr_t offset_lo, intptr_t offset_hi, PhaseTransform* phase, bool must_modify) const;
32370
38b7b5772b4f 8130847: Cloned object's fields observed as null after C2 escape analysis
roland
parents: 32084
diff changeset
   175
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   176
#ifndef PRODUCT
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   177
  virtual void dump_spec(outputStream *st) const;
32084
7743e6943cdf 8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents: 30629
diff changeset
   178
  virtual void dump_compact_spec(outputStream* st) const;
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   179
#endif
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   180
};
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52435
diff changeset
   181
#endif // SHARE_OPTO_ARRAYCOPYNODE_HPP