hotspot/src/share/vm/opto/arraycopynode.hpp
author thartmann
Mon, 04 Jul 2016 09:14:02 +0200
changeset 40044 4e8299073922
parent 39254 fb4492288b01
child 42086 feac795f345d
permissions -rw-r--r--
8160651: StubRoutines::_dtan does not restore callee save register rbx Summary: Pop rbx before leaving stub. Reviewed-by: vlivanov, vdeshpande
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;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    61
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    62
  bool _arguments_validated;
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
  static const TypeFunc* arraycopy_type() {
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    65
    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
    66
    fields[Src]       = TypeInstPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    67
    fields[SrcPos]    = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    68
    fields[Dest]      = TypeInstPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    69
    fields[DestPos]   = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    70
    fields[Length]    = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    71
    fields[SrcLen]    = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    72
    fields[DestLen]   = TypeInt::INT;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    73
    fields[SrcKlass]  = TypeKlassPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    74
    fields[DestKlass] = TypeKlassPtr::BOTTOM;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    75
    const TypeTuple *domain = TypeTuple::make(ParmLimit, fields);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    76
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    77
    // create result type (range)
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    78
    fields = TypeTuple::fields(0);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    79
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    80
    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
    81
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    82
    return TypeFunc::make(domain, range);
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
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    85
  ArrayCopyNode(Compile* C, bool alloc_tightly_coupled);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    86
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    87
  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
    88
  int get_count(PhaseGVN *phase) const;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    89
  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
    90
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    91
  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
    92
  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
    93
                          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
    94
                          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
    95
  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
    96
                               bool disjoint_bases, int count,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    97
                               Node*& forward_ctl, Node*& backward_ctl);
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
    98
  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
    99
                           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
   100
                           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
   101
                           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
   102
                           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
   103
  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
   104
                            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
   105
                            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
   106
                            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
   107
                            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
   108
  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
   109
                        Node* ctl, Node *mem);
39254
fb4492288b01 8156760: VM crashes if -XX:-ReduceInitialCardMarks is set
thartmann
parents: 35574
diff changeset
   110
  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
   111
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   112
public:
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   113
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   114
  enum {
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   115
    Src   = TypeFunc::Parms,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   116
    SrcPos,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   117
    Dest,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   118
    DestPos,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   119
    Length,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   120
    SrcLen,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   121
    DestLen,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   122
    SrcKlass,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   123
    DestKlass,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   124
    ParmLimit
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   125
  };
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   126
30629
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   127
  // Results from escape analysis for non escaping inputs
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   128
  const TypeOopPtr* _src_type;
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   129
  const TypeOopPtr* _dest_type;
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   130
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   131
  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
   132
                             Node* src, Node* src_offset,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   133
                             Node* dest,  Node* dest_offset,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   134
                             Node* length,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   135
                             bool alloc_tightly_coupled,
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   136
                             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
   137
                             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
   138
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   139
  void connect_outputs(GraphKit* kit);
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
  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
   142
  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
   143
  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
   144
  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
   145
  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
   146
  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
   147
  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
   148
  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
   149
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   150
  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
   151
  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
   152
  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
   153
  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
   154
  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
   155
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   156
  virtual int Opcode() const;
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   157
  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
   158
  virtual bool guaranteed_safepoint()  { return false; }
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   159
  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
   160
30629
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   161
  virtual bool may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase);
b6e5ad2f18d5 8076188: Optimize arraycopy out for non escaping destination
roland
parents: 29337
diff changeset
   162
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   163
  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
   164
39254
fb4492288b01 8156760: VM crashes if -XX:-ReduceInitialCardMarks is set
thartmann
parents: 35574
diff changeset
   165
  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
   166
  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
   167
29337
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   168
#ifndef PRODUCT
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   169
  virtual void dump_spec(outputStream *st) const;
32084
7743e6943cdf 8004073: Implement C2 Ideal node specific dump() method
mhaupt
parents: 30629
diff changeset
   170
  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
   171
#endif
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   172
};
ef2be52deeaf 6912521: System.arraycopy works slower than the simple loop for little lengths
roland
parents:
diff changeset
   173
#endif // SHARE_VM_OPTO_ARRAYCOPYNODE_HPP