src/share/vm/opto/escape.cpp

Print this page


   1 /*
   2  * Copyright (c) 2005, 2009, 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  *
  23  */
  24 
  25 #include "incls/_precompiled.incl"
  26 #include "incls/_escape.cpp.incl"









  27 
  28 void PointsToNode::add_edge(uint targIdx, PointsToNode::EdgeType et) {
  29   uint v = (targIdx << EdgeShift) + ((uint) et);
  30   if (_edges == NULL) {
  31      Arena *a = Compile::current()->comp_arena();
  32     _edges = new(a) GrowableArray<uint>(a, INITIAL_EDGE_COUNT, 0, 0);
  33   }
  34   _edges->append_if_missing(v);
  35 }
  36 
  37 void PointsToNode::remove_edge(uint targIdx, PointsToNode::EdgeType et) {
  38   uint v = (targIdx << EdgeShift) + ((uint) et);
  39 
  40   _edges->remove(v);
  41 }
  42 
  43 #ifndef PRODUCT
  44 static const char *node_type_names[] = {
  45   "UnknownType",
  46   "JavaObject",


   1 /*
   2  * Copyright (c) 2005, 2010, 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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "ci/bcEscapeAnalyzer.hpp"
  27 #include "libadt/vectset.hpp"
  28 #include "memory/allocation.hpp"
  29 #include "opto/c2compiler.hpp"
  30 #include "opto/callnode.hpp"
  31 #include "opto/cfgnode.hpp"
  32 #include "opto/compile.hpp"
  33 #include "opto/escape.hpp"
  34 #include "opto/phaseX.hpp"
  35 #include "opto/rootnode.hpp"
  36 
  37 void PointsToNode::add_edge(uint targIdx, PointsToNode::EdgeType et) {
  38   uint v = (targIdx << EdgeShift) + ((uint) et);
  39   if (_edges == NULL) {
  40      Arena *a = Compile::current()->comp_arena();
  41     _edges = new(a) GrowableArray<uint>(a, INITIAL_EDGE_COUNT, 0, 0);
  42   }
  43   _edges->append_if_missing(v);
  44 }
  45 
  46 void PointsToNode::remove_edge(uint targIdx, PointsToNode::EdgeType et) {
  47   uint v = (targIdx << EdgeShift) + ((uint) et);
  48 
  49   _edges->remove(v);
  50 }
  51 
  52 #ifndef PRODUCT
  53 static const char *node_type_names[] = {
  54   "UnknownType",
  55   "JavaObject",