hotspot/src/share/vm/opto/arraycopynode.hpp
author simonis
Thu, 06 Oct 2016 18:51:24 +0200
changeset 42086 feac795f345d
parent 39254 fb4492288b01
child 45427 64e07017ce01
permissions -rw-r--r--
8159611: C2: ArrayCopy elimination skips required parameter checks Reviewed-by: kvn, zmajo, thartmann
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
/*
39254
fb4492288b01 8156760: VM crashes if -XX:-ReduceInitialCardMarks is set
thartmann
parents: 35574
diff changeset
     2
 * Copyright (c) 2016, 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
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    25
#ifndef SHARE_VM_OPTO_ARRAYCOPYNODE_HPP
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    26
#define SHARE_VM_OPTO_ARRAYCOPYNODE_HPP
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    27
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    28
#include "opto/callnode.hpp"
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    29
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    30
class GraphKit;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    31
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    32
class ArrayCopyNode : public CallNode {
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    33
private:
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    34
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    35
  // What kind of arraycopy variant is this?
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    36
  enum {
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    37
    None,            // not set yet
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    38
    ArrayCopy,       // System.arraycopy()
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    39
    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
    40
    CloneOop,        // An oop array clone
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    41
    CopyOf,          // Arrays.copyOf()
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    42
    CopyOfRange      // Arrays.copyOfRange()
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    43
  } _kind;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    44
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    45
#ifndef PRODUCT
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    46
  static const char* _kind_names[CopyOfRange+1];
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    47
#endif
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    48
  // Is the alloc obtained with
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    49
  // AllocateArrayNode::Ideal_array_allocation() tighly coupled
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    50
  // (arraycopy follows immediately the allocation)?
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    51
  // 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
    52
  // 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
    53
  // 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
    54
  // 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
    55
  // 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
    56
  // 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
    57
  // 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
    58
  // 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
    59
  // LibraryCallKit::tightly_coupled_allocation() is called.
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    60
  bool _alloc_tightly_coupled;
42086
feac795f345d 8159611: C2: ArrayCopy elimination skips required parameter checks
simonis
parents: 39254
diff changeset
    61
  bool _has_negative_length_guard;
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    62
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    63
  bool _arguments_validated;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    64
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    65
  static const TypeFunc* arraycopy_type() {
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    66
    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
    67
    fields[Src]       = TypeInstPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    68
    fields[SrcPos]    = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    69
    fields[Dest]      = TypeInstPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    70
    fields[DestPos]   = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    71
    fields[Length]    = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    72
    fields[SrcLen]    = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    73
    fields[DestLen]   = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    74
    fields[SrcKlass]  = TypeKlassPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    75
    fields[DestKlass] = TypeKlassPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    76
    const TypeTuple *domain = TypeTuple::make(ParmLimit, fields);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    77
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    78
    // create result type (range)
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    79
    fields = TypeTuple::fields(0);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    80
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    81
    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
    82
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    83
    return TypeFunc::make(domain, range);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    84
  }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    85
42086
feac795f345d 8159611: C2: ArrayCopy elimination skips required parameter checks
simonis
parents: 39254
diff changeset
    86
  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
    87
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    88
  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
    89
  int get_count(PhaseGVN *phase) const;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    90
  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
    91
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    92
  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
    93
  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
    94
                          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
    95
                          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
    96
  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
    97
                               bool disjoint_bases, int count,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    98
                               Node*& forward_ctl, Node*& backward_ctl);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    99
  Node* array_copy_forward(PhaseGVN *phase, bool can_reshape, Node* ctl,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   100
                           Node* start_mem_src, Node* start_mem_dest,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   101
                           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
   102
                           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
   103
                           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
   104
  Node* array_copy_backward(PhaseGVN *phase, bool can_reshape, Node* ctl,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   105
                            Node *start_mem_src, Node* start_mem_dest,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   106
                            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
   107
                            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
   108
                            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
   109
  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
   110
                        Node* ctl, Node *mem);
39254
fb4492288b01 8156760: VM crashes if -XX:-ReduceInitialCardMarks is set
thartmann
parents: 35574
diff changeset
   111
  static bool may_modify_helper(const TypeOopPtr *t_oop, Node* n, PhaseTransform *phase, ArrayCopyNode*& ac);
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   112
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   113
public:
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   114
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   115
  enum {
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   116
    Src   = TypeFunc::Parms,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   117
    SrcPos,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   118
    Dest,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   119
    DestPos,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   120
    Length,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   121
    SrcLen,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   122
    DestLen,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   123
    SrcKlass,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   124
    DestKlass,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   125
    ParmLimit
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   126
  };
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   127
30629
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   128
  // Results from escape analysis for non escaping inputs
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   129
  const TypeOopPtr* _src_type;
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   130
  const TypeOopPtr* _dest_type;
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   131
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   132
  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
   133
                             Node* src, Node* src_offset,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   134
                             Node* dest,  Node* dest_offset,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   135
                             Node* length,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   136
                             bool alloc_tightly_coupled,
42086
feac795f345d 8159611: C2: ArrayCopy elimination skips required parameter checks
simonis
parents: 39254
diff changeset
   137
                             bool has_negative_length_guard,
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   138
                             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
   139
                             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
   140
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   141
  void connect_outputs(GraphKit* kit);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   142
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   143
  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
   144
  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
   145
  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
   146
  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
   147
  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
   148
  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
   149
  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
   150
  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
   151
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   152
  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
   153
  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
   154
  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
   155
  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
   156
  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
   157
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   158
  virtual int Opcode() const;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   159
  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
   160
  virtual bool guaranteed_safepoint()  { return false; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   161
  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
   162
30629
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   163
  virtual bool may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase);
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   164
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   165
  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
   166
42086
feac795f345d 8159611: C2: ArrayCopy elimination skips required parameter checks
simonis
parents: 39254
diff changeset
   167
  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
   168
39254
fb4492288b01 8156760: VM crashes if -XX:-ReduceInitialCardMarks is set
thartmann
parents: 35574
diff changeset
   169
  static bool may_modify(const TypeOopPtr *t_oop, MemBarNode* mb, PhaseTransform *phase, ArrayCopyNode*& ac);
32370
38b7b5772b4f 8130847: Cloned object's fields observed as null after C2 escape analysis
roland
parents: 32084
diff changeset
   170
  bool modifies(intptr_t offset_lo, intptr_t offset_hi, PhaseTransform* phase, bool must_modify);
38b7b5772b4f 8130847: Cloned object's fields observed as null after C2 escape analysis
roland
parents: 32084
diff changeset
   171
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   172
#ifndef PRODUCT
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   173
  virtual void dump_spec(outputStream *st) const;
32084
7743e6943cdf 8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents: 30629
diff changeset
   174
  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
   175
#endif
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   176
};
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   177
#endif // SHARE_VM_OPTO_ARRAYCOPYNODE_HPP