src/share/vm/compiler/compileBroker.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/_compileBroker.cpp.incl"





























  27 
  28 #ifdef DTRACE_ENABLED
  29 
  30 // Only bother with this argument setup if dtrace is available
  31 
  32 HS_DTRACE_PROBE_DECL8(hotspot, method__compile__begin,
  33   char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t);
  34 HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end,
  35   char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t, bool);
  36 
  37 #define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method)              \
  38   {                                                                      \
  39     char* comp_name = (char*)(compiler)->name();                         \
  40     symbolOop klass_name = (method)->klass_name();                       \
  41     symbolOop name = (method)->name();                                   \
  42     symbolOop signature = (method)->signature();                         \
  43     HS_DTRACE_PROBE8(hotspot, method__compile__begin,                    \
  44       comp_name, strlen(comp_name),                                      \
  45       klass_name->bytes(), klass_name->utf8_length(),                    \
  46       name->bytes(), name->utf8_length(),                                \




   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 "classfile/vmSymbols.hpp"
  28 #include "code/codeCache.hpp"
  29 #include "compiler/compileBroker.hpp"
  30 #include "compiler/compileLog.hpp"
  31 #include "compiler/compilerOracle.hpp"
  32 #include "interpreter/linkResolver.hpp"
  33 #include "memory/allocation.inline.hpp"
  34 #include "oops/methodDataOop.hpp"
  35 #include "oops/methodOop.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "prims/nativeLookup.hpp"
  38 #include "runtime/arguments.hpp"
  39 #include "runtime/compilationPolicy.hpp"
  40 #include "runtime/init.hpp"
  41 #include "runtime/interfaceSupport.hpp"
  42 #include "runtime/javaCalls.hpp"
  43 #include "runtime/os.hpp"
  44 #include "runtime/sharedRuntime.hpp"
  45 #include "runtime/sweeper.hpp"
  46 #include "utilities/dtrace.hpp"
  47 #ifdef COMPILER1
  48 #include "c1/c1_Compiler.hpp"
  49 #endif
  50 #ifdef COMPILER2
  51 #include "opto/c2compiler.hpp"
  52 #endif
  53 #ifdef SHARK
  54 #include "shark/sharkCompiler.hpp"
  55 #endif
  56 
  57 #ifdef DTRACE_ENABLED
  58 
  59 // Only bother with this argument setup if dtrace is available
  60 
  61 HS_DTRACE_PROBE_DECL8(hotspot, method__compile__begin,
  62   char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t);
  63 HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end,
  64   char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t, bool);
  65 
  66 #define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method)              \
  67   {                                                                      \
  68     char* comp_name = (char*)(compiler)->name();                         \
  69     symbolOop klass_name = (method)->klass_name();                       \
  70     symbolOop name = (method)->name();                                   \
  71     symbolOop signature = (method)->signature();                         \
  72     HS_DTRACE_PROBE8(hotspot, method__compile__begin,                    \
  73       comp_name, strlen(comp_name),                                      \
  74       klass_name->bytes(), klass_name->utf8_length(),                    \
  75       name->bytes(), name->utf8_length(),                                \