< prev index next >

src/hotspot/share/opto/graphKit.cpp

Print this page


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


1981   if (callprojs.fallthrough_catchproj != NULL && !final_ctl->is_top() && do_replaced_nodes) {
1982     replaced_nodes.apply(C, final_ctl);
1983   }
1984   if (!ex_ctl->is_top() && do_replaced_nodes) {
1985     replaced_nodes_exception.apply(C, ex_ctl);
1986   }
1987 }
1988 
1989 
1990 //------------------------------increment_counter------------------------------
1991 // for statistics: increment a VM counter by 1
1992 
1993 void GraphKit::increment_counter(address counter_addr) {
1994   Node* adr1 = makecon(TypeRawPtr::make(counter_addr));
1995   increment_counter(adr1);
1996 }
1997 
1998 void GraphKit::increment_counter(Node* counter_addr) {
1999   int adr_type = Compile::AliasIdxRaw;
2000   Node* ctrl = control();
2001   Node* cnt  = make_load(ctrl, counter_addr, TypeInt::INT, T_INT, adr_type, MemNode::unordered);
2002   Node* incr = _gvn.transform(new AddINode(cnt, _gvn.intcon(1)));
2003   store_to_memory(ctrl, counter_addr, incr, T_INT, adr_type, MemNode::unordered);
2004 }
2005 
2006 
2007 //------------------------------uncommon_trap----------------------------------
2008 // Bail out to the interpreter in mid-method.  Implemented by calling the
2009 // uncommon_trap blob.  This helper function inserts a runtime call with the
2010 // right debug info.
2011 void GraphKit::uncommon_trap(int trap_request,
2012                              ciKlass* klass, const char* comment,
2013                              bool must_throw,
2014                              bool keep_exact_action) {
2015   if (failing())  stop();
2016   if (stopped())  return; // trap reachable?
2017 
2018   // Note:  If ProfileTraps is true, and if a deopt. actually
2019   // occurs here, the runtime will make sure an MDO exists.  There is
2020   // no need to call method()->ensure_method_data() at this point.
2021 
2022   // Set the stack pointer to the right value for reexecution:
2023   set_sp(reexecute_sp());


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


1981   if (callprojs.fallthrough_catchproj != NULL && !final_ctl->is_top() && do_replaced_nodes) {
1982     replaced_nodes.apply(C, final_ctl);
1983   }
1984   if (!ex_ctl->is_top() && do_replaced_nodes) {
1985     replaced_nodes_exception.apply(C, ex_ctl);
1986   }
1987 }
1988 
1989 
1990 //------------------------------increment_counter------------------------------
1991 // for statistics: increment a VM counter by 1
1992 
1993 void GraphKit::increment_counter(address counter_addr) {
1994   Node* adr1 = makecon(TypeRawPtr::make(counter_addr));
1995   increment_counter(adr1);
1996 }
1997 
1998 void GraphKit::increment_counter(Node* counter_addr) {
1999   int adr_type = Compile::AliasIdxRaw;
2000   Node* ctrl = control();
2001   Node* cnt  = make_load(ctrl, counter_addr, TypeLong::LONG, T_LONG, adr_type, MemNode::unordered);
2002   Node* incr = _gvn.transform(new AddLNode(cnt, _gvn.longcon(1)));
2003   store_to_memory(ctrl, counter_addr, incr, T_LONG, adr_type, MemNode::unordered);
2004 }
2005 
2006 
2007 //------------------------------uncommon_trap----------------------------------
2008 // Bail out to the interpreter in mid-method.  Implemented by calling the
2009 // uncommon_trap blob.  This helper function inserts a runtime call with the
2010 // right debug info.
2011 void GraphKit::uncommon_trap(int trap_request,
2012                              ciKlass* klass, const char* comment,
2013                              bool must_throw,
2014                              bool keep_exact_action) {
2015   if (failing())  stop();
2016   if (stopped())  return; // trap reachable?
2017 
2018   // Note:  If ProfileTraps is true, and if a deopt. actually
2019   // occurs here, the runtime will make sure an MDO exists.  There is
2020   // no need to call method()->ensure_method_data() at this point.
2021 
2022   // Set the stack pointer to the right value for reexecution:
2023   set_sp(reexecute_sp());


< prev index next >