src/share/vm/opto/escape.cpp

Print this page
rev 4773 : 8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
   1 /*
   2  * Copyright (c) 2005, 2012, 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  *


 260 
 261   bool has_scalar_replaceable_candidates = (alloc_worklist.length() > 0);
 262 #ifdef ASSERT
 263   if (VerifyConnectionGraph) {
 264     int alloc_length = alloc_worklist.length();
 265     for (int next = 0; next < alloc_length; ++next) {
 266       Node* n = alloc_worklist.at(next);
 267       PointsToNode* ptn = ptnode_adr(n->_idx);
 268       assert(ptn->escape_state() == PointsToNode::NoEscape && ptn->scalar_replaceable(), "sanity");
 269     }
 270   }
 271 #endif
 272 
 273   // 5. Separate memory graph for scalar replaceable allcations.
 274   if (has_scalar_replaceable_candidates &&
 275       C->AliasLevel() >= 3 && EliminateAllocations) {
 276     // Now use the escape information to create unique types for
 277     // scalar replaceable objects.
 278     split_unique_types(alloc_worklist);
 279     if (C->failing())  return false;
 280     C->print_method("After Escape Analysis", 2);
 281 
 282 #ifdef ASSERT
 283   } else if (Verbose && (PrintEscapeAnalysis || PrintEliminateAllocations)) {
 284     tty->print("=== No allocations eliminated for ");
 285     C->method()->print_short_name();
 286     if(!EliminateAllocations) {
 287       tty->print(" since EliminateAllocations is off ===");
 288     } else if(!has_scalar_replaceable_candidates) {
 289       tty->print(" since there are no scalar replaceable candidates ===");
 290     } else if(C->AliasLevel() < 3) {
 291       tty->print(" since AliasLevel < 3 ===");
 292     }
 293     tty->cr();
 294 #endif
 295   }
 296   return has_non_escaping_obj;
 297 }
 298 
 299 // Utility function for nodes that load an object
 300 void ConnectionGraph::add_objload_to_connection_graph(Node *n, Unique_Node_List *delayed_worklist) {


   1 /*
   2  * Copyright (c) 2005, 2013, 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  *


 260 
 261   bool has_scalar_replaceable_candidates = (alloc_worklist.length() > 0);
 262 #ifdef ASSERT
 263   if (VerifyConnectionGraph) {
 264     int alloc_length = alloc_worklist.length();
 265     for (int next = 0; next < alloc_length; ++next) {
 266       Node* n = alloc_worklist.at(next);
 267       PointsToNode* ptn = ptnode_adr(n->_idx);
 268       assert(ptn->escape_state() == PointsToNode::NoEscape && ptn->scalar_replaceable(), "sanity");
 269     }
 270   }
 271 #endif
 272 
 273   // 5. Separate memory graph for scalar replaceable allcations.
 274   if (has_scalar_replaceable_candidates &&
 275       C->AliasLevel() >= 3 && EliminateAllocations) {
 276     // Now use the escape information to create unique types for
 277     // scalar replaceable objects.
 278     split_unique_types(alloc_worklist);
 279     if (C->failing())  return false;
 280     C->print_method(PHASE_AFTER_EA, 2);
 281 
 282 #ifdef ASSERT
 283   } else if (Verbose && (PrintEscapeAnalysis || PrintEliminateAllocations)) {
 284     tty->print("=== No allocations eliminated for ");
 285     C->method()->print_short_name();
 286     if(!EliminateAllocations) {
 287       tty->print(" since EliminateAllocations is off ===");
 288     } else if(!has_scalar_replaceable_candidates) {
 289       tty->print(" since there are no scalar replaceable candidates ===");
 290     } else if(C->AliasLevel() < 3) {
 291       tty->print(" since AliasLevel < 3 ===");
 292     }
 293     tty->cr();
 294 #endif
 295   }
 296   return has_non_escaping_obj;
 297 }
 298 
 299 // Utility function for nodes that load an object
 300 void ConnectionGraph::add_objload_to_connection_graph(Node *n, Unique_Node_List *delayed_worklist) {