< prev index next >

src/share/vm/opto/escape.cpp

Print this page
rev 10759 : [backport] Remove old code from escape analysis


   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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/bcEscapeAnalyzer.hpp"
  27 #include "compiler/compileLog.hpp"
  28 #include "gc_implementation/shenandoah/brooksPointer.hpp"
  29 #include "libadt/vectset.hpp"
  30 #include "memory/allocation.hpp"
  31 #include "opto/c2compiler.hpp"
  32 #include "opto/callnode.hpp"
  33 #include "opto/cfgnode.hpp"
  34 #include "opto/compile.hpp"
  35 #include "opto/escape.hpp"
  36 #include "opto/phaseX.hpp"
  37 #include "opto/rootnode.hpp"
  38 #include "opto/shenandoahSupport.hpp"
  39 
  40 ConnectionGraph::ConnectionGraph(Compile * C, PhaseIterGVN *igvn) :
  41   _nodes(C->comp_arena(), C->unique(), C->unique(), NULL),
  42   _in_worklist(C->comp_arena()),
  43   _next_pidx(0),
  44   _collecting(true),
  45   _verify(false),
  46   _compile(C),
  47   _igvn(igvn),
  48   _node_map(C->comp_arena()) {


2026   } else if (offset != oopDesc::klass_offset_in_bytes()) {
2027     if (adr_type->isa_instptr()) {
2028       ciField* field = _compile->alias_type(adr_type->isa_instptr())->field();
2029       if (field != NULL) {
2030         bt = field->layout_type();
2031       } else {
2032         // Check for unsafe oop field access
2033         for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
2034           int opcode = n->fast_out(i)->Opcode();
2035           if (opcode == Op_StoreP || opcode == Op_LoadP ||
2036               opcode == Op_StoreN || opcode == Op_LoadN) {
2037             bt = T_OBJECT;
2038             (*unsafe) = true;
2039             break;
2040           }
2041         }
2042       }
2043     } else if (adr_type->isa_aryptr()) {
2044       if (offset == arrayOopDesc::length_offset_in_bytes()) {
2045         // Ignore array length load.
2046       } else if (UseShenandoahGC && ShenandoahReadBarrier && offset == BrooksPointer::byte_offset()) {
2047         // Shenandoah read barrier.
2048         bt = T_ARRAY;
2049       } else if (find_second_addp(n, n->in(AddPNode::Base)) != NULL) {
2050         // Ignore first AddP.
2051       } else {
2052         const Type* elemtype = adr_type->isa_aryptr()->elem();
2053         bt = elemtype->array_element_basic_type();
2054       }
2055     } else if (adr_type->isa_rawptr() || adr_type->isa_klassptr()) {
2056       // Allocation initialization, ThreadLocal field access, unsafe access
2057       for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
2058         int opcode = n->fast_out(i)->Opcode();
2059         if (opcode == Op_StoreP || opcode == Op_LoadP ||
2060             opcode == Op_StoreN || opcode == Op_LoadN) {
2061           bt = T_OBJECT;
2062           break;
2063         }
2064       }
2065     }
2066   }
2067   return (bt == T_OBJECT || bt == T_NARROWOOP || bt == T_ARRAY);
2068 }




   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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/bcEscapeAnalyzer.hpp"
  27 #include "compiler/compileLog.hpp"

  28 #include "libadt/vectset.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "opto/c2compiler.hpp"
  31 #include "opto/callnode.hpp"
  32 #include "opto/cfgnode.hpp"
  33 #include "opto/compile.hpp"
  34 #include "opto/escape.hpp"
  35 #include "opto/phaseX.hpp"
  36 #include "opto/rootnode.hpp"
  37 #include "opto/shenandoahSupport.hpp"
  38 
  39 ConnectionGraph::ConnectionGraph(Compile * C, PhaseIterGVN *igvn) :
  40   _nodes(C->comp_arena(), C->unique(), C->unique(), NULL),
  41   _in_worklist(C->comp_arena()),
  42   _next_pidx(0),
  43   _collecting(true),
  44   _verify(false),
  45   _compile(C),
  46   _igvn(igvn),
  47   _node_map(C->comp_arena()) {


2025   } else if (offset != oopDesc::klass_offset_in_bytes()) {
2026     if (adr_type->isa_instptr()) {
2027       ciField* field = _compile->alias_type(adr_type->isa_instptr())->field();
2028       if (field != NULL) {
2029         bt = field->layout_type();
2030       } else {
2031         // Check for unsafe oop field access
2032         for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
2033           int opcode = n->fast_out(i)->Opcode();
2034           if (opcode == Op_StoreP || opcode == Op_LoadP ||
2035               opcode == Op_StoreN || opcode == Op_LoadN) {
2036             bt = T_OBJECT;
2037             (*unsafe) = true;
2038             break;
2039           }
2040         }
2041       }
2042     } else if (adr_type->isa_aryptr()) {
2043       if (offset == arrayOopDesc::length_offset_in_bytes()) {
2044         // Ignore array length load.



2045       } else if (find_second_addp(n, n->in(AddPNode::Base)) != NULL) {
2046         // Ignore first AddP.
2047       } else {
2048         const Type* elemtype = adr_type->isa_aryptr()->elem();
2049         bt = elemtype->array_element_basic_type();
2050       }
2051     } else if (adr_type->isa_rawptr() || adr_type->isa_klassptr()) {
2052       // Allocation initialization, ThreadLocal field access, unsafe access
2053       for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
2054         int opcode = n->fast_out(i)->Opcode();
2055         if (opcode == Op_StoreP || opcode == Op_LoadP ||
2056             opcode == Op_StoreN || opcode == Op_LoadN) {
2057           bt = T_OBJECT;
2058           break;
2059         }
2060       }
2061     }
2062   }
2063   return (bt == T_OBJECT || bt == T_NARROWOOP || bt == T_ARRAY);
2064 }


< prev index next >