< prev index next >

src/share/vm/jvmci/jvmciCompiler.hpp

Print this page




  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 #ifndef SHARE_VM_JVMCI_JVMCI_COMPILER_HPP
  25 #define SHARE_VM_JVMCI_JVMCI_COMPILER_HPP
  26 
  27 #include "compiler/abstractCompiler.hpp"
  28 #include "jvmci/jvmciEnv.hpp"
  29 #include "utilities/exceptions.hpp"
  30 
  31 class JVMCICompiler : public AbstractCompiler {
  32 private:
  33   bool _bootstrapping;
  34 
  35   /**





  36    * Number of methods successfully compiled by a call to
  37    * JVMCICompiler::compile_method().
  38    */
  39   volatile int _methods_compiled;
  40 
  41   static JVMCICompiler* _instance;
  42 
  43   static elapsedTimer _codeInstallTimer;
  44 
  45   static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false);
  46 
  47 public:
  48   JVMCICompiler();
  49 
  50   static JVMCICompiler* instance(TRAPS) {
  51     if (!EnableJVMCI) {
  52       THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVMCI is not enabled")
  53     }
  54     return _instance;
  55   }
  56 
  57   virtual const char* name() { return "JVMCI"; }
  58 
  59   virtual bool supports_native()                 { return true; }
  60   virtual bool supports_osr   ()                 { return true; }
  61 
  62   bool is_jvmci()                                { return true; }
  63   bool is_c1   ()                                { return false; }
  64   bool is_c2   ()                                { return false; }
  65 
  66   bool needs_stubs            () { return false; }
  67 
  68   // Initialization
  69   virtual void initialize();
  70 
  71   void bootstrap();
  72 
  73   // Compilation entry point for methods
  74   virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci, DirectiveSet* directive);
  75 
  76   void compile_method(const methodHandle& target, int entry_bci, JVMCIEnv* env);
  77 
  78   virtual bool is_trivial(Method* method);
  79 
  80   // Print compilation timers and statistics
  81   virtual void print_timers();
  82 
  83   /**
  84    * Gets the number of methods that have been successfully compiled by
  85    * a call to JVMCICompiler::compile_method().
  86    */
  87   int methods_compiled() { return _methods_compiled; }
  88 
  89   // Print compilation timers and statistics
  90   static void print_compilation_timers();
  91 


  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 #ifndef SHARE_VM_JVMCI_JVMCI_COMPILER_HPP
  25 #define SHARE_VM_JVMCI_JVMCI_COMPILER_HPP
  26 
  27 #include "compiler/abstractCompiler.hpp"
  28 #include "jvmci/jvmciEnv.hpp"
  29 #include "utilities/exceptions.hpp"
  30 
  31 class JVMCICompiler : public AbstractCompiler {
  32 private:
  33   bool _bootstrapping;
  34 
  35   /**
  36    * True if we have seen a bootstrap compilation request.
  37    */
  38   volatile bool _bootstrap_compilation_request_handled;
  39 
  40   /**
  41    * Number of methods successfully compiled by a call to
  42    * JVMCICompiler::compile_method().
  43    */
  44   volatile int _methods_compiled;
  45 
  46   static JVMCICompiler* _instance;
  47 
  48   static elapsedTimer _codeInstallTimer;
  49 
  50   static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false);
  51 
  52 public:
  53   JVMCICompiler();
  54 
  55   static JVMCICompiler* instance(TRAPS) {
  56     if (!EnableJVMCI) {
  57       THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVMCI is not enabled")
  58     }
  59     return _instance;
  60   }
  61 
  62   virtual const char* name() { return "JVMCI"; }
  63 
  64   virtual bool supports_native()                 { return true; }
  65   virtual bool supports_osr   ()                 { return true; }
  66 
  67   bool is_jvmci()                                { return true; }
  68   bool is_c1   ()                                { return false; }
  69   bool is_c2   ()                                { return false; }
  70 
  71   bool needs_stubs            () { return false; }
  72 
  73   // Initialization
  74   virtual void initialize();
  75 
  76   void bootstrap(TRAPS);
  77 
  78   // Compilation entry point for methods
  79   virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci, DirectiveSet* directive);
  80 
  81   void compile_method(const methodHandle& target, int entry_bci, JVMCIEnv* env);
  82 
  83   virtual bool is_trivial(Method* method);
  84 
  85   // Print compilation timers and statistics
  86   virtual void print_timers();
  87 
  88   /**
  89    * Gets the number of methods that have been successfully compiled by
  90    * a call to JVMCICompiler::compile_method().
  91    */
  92   int methods_compiled() { return _methods_compiled; }
  93 
  94   // Print compilation timers and statistics
  95   static void print_compilation_timers();
  96 
< prev index next >