src/share/vm/opto/parseHelper.cpp

Print this page




   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/_parseHelper.cpp.incl"









  27 
  28 //------------------------------make_dtrace_method_entry_exit ----------------
  29 // Dtrace -- record entry or exit of a method if compiled with dtrace support
  30 void GraphKit::make_dtrace_method_entry_exit(ciMethod* method, bool is_entry) {
  31   const TypeFunc *call_type    = OptoRuntime::dtrace_method_entry_exit_Type();
  32   address         call_address = is_entry ? CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry) :
  33                                             CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit);
  34   const char     *call_name    = is_entry ? "dtrace_method_entry" : "dtrace_method_exit";
  35 
  36   // Get base of thread-local storage area
  37   Node* thread = _gvn.transform( new (C, 1) ThreadLocalNode() );
  38 
  39   // Get method
  40   const TypeInstPtr* method_type = TypeInstPtr::make(TypePtr::Constant, method->klass(), true, method, 0);
  41   Node *method_node = _gvn.transform( ConNode::make(C, method_type) );
  42 
  43   kill_dead_locals();
  44 
  45   // For some reason, this call reads only raw memory.
  46   const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM;




   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 "classfile/systemDictionary.hpp"
  27 #include "compiler/compileLog.hpp"
  28 #include "oops/objArrayKlass.hpp"
  29 #include "opto/addnode.hpp"
  30 #include "opto/memnode.hpp"
  31 #include "opto/mulnode.hpp"
  32 #include "opto/parse.hpp"
  33 #include "opto/rootnode.hpp"
  34 #include "opto/runtime.hpp"
  35 #include "runtime/sharedRuntime.hpp"
  36 
  37 //------------------------------make_dtrace_method_entry_exit ----------------
  38 // Dtrace -- record entry or exit of a method if compiled with dtrace support
  39 void GraphKit::make_dtrace_method_entry_exit(ciMethod* method, bool is_entry) {
  40   const TypeFunc *call_type    = OptoRuntime::dtrace_method_entry_exit_Type();
  41   address         call_address = is_entry ? CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry) :
  42                                             CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit);
  43   const char     *call_name    = is_entry ? "dtrace_method_entry" : "dtrace_method_exit";
  44 
  45   // Get base of thread-local storage area
  46   Node* thread = _gvn.transform( new (C, 1) ThreadLocalNode() );
  47 
  48   // Get method
  49   const TypeInstPtr* method_type = TypeInstPtr::make(TypePtr::Constant, method->klass(), true, method, 0);
  50   Node *method_node = _gvn.transform( ConNode::make(C, method_type) );
  51 
  52   kill_dead_locals();
  53 
  54   // For some reason, this call reads only raw memory.
  55   const TypePtr* raw_adr_type = TypeRawPtr::BOTTOM;