< prev index next >

src/hotspot/share/opto/arraycopynode.hpp

Print this page


   1 /*
   2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


  79     fields = TypeTuple::fields(0);
  80 
  81     const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
  82 
  83     return TypeFunc::make(domain, range);
  84   }
  85 
  86   ArrayCopyNode(Compile* C, bool alloc_tightly_coupled, bool has_negative_length_guard);
  87 
  88   intptr_t get_length_if_constant(PhaseGVN *phase) const;
  89   int get_count(PhaseGVN *phase) const;
  90   static const TypePtr* get_address_type(PhaseGVN *phase, Node* n);
  91 
  92   Node* try_clone_instance(PhaseGVN *phase, bool can_reshape, int count);
  93   bool prepare_array_copy(PhaseGVN *phase, bool can_reshape,
  94                           Node*& adr_src, Node*& base_src, Node*& adr_dest, Node*& base_dest,
  95                           BasicType& copy_type, const Type*& value_type, bool& disjoint_bases);
  96   void array_copy_test_overlap(PhaseGVN *phase, bool can_reshape,
  97                                bool disjoint_bases, int count,
  98                                Node*& forward_ctl, Node*& backward_ctl);
  99   Node* array_copy_forward(PhaseGVN *phase, bool can_reshape, Node* ctl,
 100                            Node* start_mem_src, Node* start_mem_dest,
 101                            const TypePtr* atp_src, const TypePtr* atp_dest,
 102                            Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest,
 103                            BasicType copy_type, const Type* value_type, int count);
 104   Node* array_copy_backward(PhaseGVN *phase, bool can_reshape, Node* ctl,
 105                             Node *start_mem_src, Node* start_mem_dest,
 106                             const TypePtr* atp_src, const TypePtr* atp_dest,
 107                             Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest,
 108                             BasicType copy_type, const Type* value_type, int count);
 109   bool finish_transform(PhaseGVN *phase, bool can_reshape,
 110                         Node* ctl, Node *mem);
 111   static bool may_modify_helper(const TypeOopPtr *t_oop, Node* n, PhaseTransform *phase, CallNode*& call);




 112 
 113 public:
 114 
 115   enum {
 116     Src   = TypeFunc::Parms,
 117     SrcPos,
 118     Dest,
 119     DestPos,
 120     Length,
 121     SrcLen,
 122     DestLen,
 123     SrcKlass,
 124     DestKlass,
 125     ParmLimit
 126   };
 127 
 128   // Results from escape analysis for non escaping inputs
 129   const TypeOopPtr* _src_type;
 130   const TypeOopPtr* _dest_type;
 131 


   1 /*
   2  * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


  79     fields = TypeTuple::fields(0);
  80 
  81     const TypeTuple *range = TypeTuple::make(TypeFunc::Parms+0, fields);
  82 
  83     return TypeFunc::make(domain, range);
  84   }
  85 
  86   ArrayCopyNode(Compile* C, bool alloc_tightly_coupled, bool has_negative_length_guard);
  87 
  88   intptr_t get_length_if_constant(PhaseGVN *phase) const;
  89   int get_count(PhaseGVN *phase) const;
  90   static const TypePtr* get_address_type(PhaseGVN *phase, Node* n);
  91 
  92   Node* try_clone_instance(PhaseGVN *phase, bool can_reshape, int count);
  93   bool prepare_array_copy(PhaseGVN *phase, bool can_reshape,
  94                           Node*& adr_src, Node*& base_src, Node*& adr_dest, Node*& base_dest,
  95                           BasicType& copy_type, const Type*& value_type, bool& disjoint_bases);
  96   void array_copy_test_overlap(PhaseGVN *phase, bool can_reshape,
  97                                bool disjoint_bases, int count,
  98                                Node*& forward_ctl, Node*& backward_ctl);
  99   Node* array_copy_forward(PhaseGVN *phase, bool can_reshape, Node*& ctl,
 100                            MergeMemNode* mm,
 101                            const TypePtr* atp_src, const TypePtr* atp_dest,
 102                            Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest,
 103                            BasicType copy_type, const Type* value_type, int count);
 104   Node* array_copy_backward(PhaseGVN *phase, bool can_reshape, Node*& ctl,
 105                             MergeMemNode* mm,
 106                             const TypePtr* atp_src, const TypePtr* atp_dest,
 107                             Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest,
 108                             BasicType copy_type, const Type* value_type, int count);
 109   bool finish_transform(PhaseGVN *phase, bool can_reshape,
 110                         Node* ctl, Node *mem);
 111   static bool may_modify_helper(const TypeOopPtr *t_oop, Node* n, PhaseTransform *phase, CallNode*& call);
 112 
 113 #if INCLUDE_SHENANDOAHGC
 114   static Node* shenandoah_add_storeval_barrier(PhaseGVN *phase, bool can_reshape, Node* v, MergeMemNode* mem, Node*& ctl);
 115 #endif
 116 
 117 public:
 118 
 119   enum {
 120     Src   = TypeFunc::Parms,
 121     SrcPos,
 122     Dest,
 123     DestPos,
 124     Length,
 125     SrcLen,
 126     DestLen,
 127     SrcKlass,
 128     DestKlass,
 129     ParmLimit
 130   };
 131 
 132   // Results from escape analysis for non escaping inputs
 133   const TypeOopPtr* _src_type;
 134   const TypeOopPtr* _dest_type;
 135 


< prev index next >