src/share/vm/jvmci/jvmciRuntime.hpp

Print this page




  54     warning("Error at line %d while parsing %s: %s", _lineNo, _filename == NULL ? "?" : _filename, message);
  55   }
  56  public:
  57   ParseClosure() : _lineNo(0), _filename(NULL), _abort(false) {}
  58   void parse_line(char* line) {
  59     _lineNo++;
  60     do_line(line);
  61   }
  62   virtual void do_line(char* line) = 0;
  63   int lineNo() { return _lineNo; }
  64   bool is_aborted() { return _abort; }
  65   void set_filename(char* path) {_filename = path; _lineNo = 0;}
  66 };
  67 
  68 class JVMCIRuntime: public AllStatic {
  69  private:
  70   static jobject _HotSpotJVMCIRuntime_instance;
  71   static bool _HotSpotJVMCIRuntime_initialized;
  72   static bool _well_known_classes_initialized;
  73   static const char* _compiler;
  74   static int _options_count;
  75   static SystemProperty** _options;
  76 
  77   static int _trivial_prefixes_count;
  78   static char** _trivial_prefixes;
  79 
  80   static bool _shutdown_called;
  81 
  82   /**
  83    * Instantiates a service object, calls its default constructor and returns it.
  84    *
  85    * @param name the name of a class implementing jdk.vm.ci.service.Service
  86    */
  87   static Handle create_Service(const char* name, TRAPS);
  88 
  89  public:
  90 
  91   /**
  92    * Parses *.properties files in jre/lib/jvmci/ and adds the properties to plist.
  93    */
  94   static void init_system_properties(SystemProperty** plist);
  95 
  96   /**
  97    * Saves the value of the "jvmci.compiler" system property for processing
  98    * when JVMCI is initialized.
  99    */
 100   static void save_compiler(const char* compiler);
 101 
 102   /**
 103    * Saves the value of the system properties starting with "jvmci.option." for processing
 104    * when JVMCI is initialized.
 105    *
 106    * @param props the head of the system property list
 107    */
 108   static void save_options(SystemProperty* props);
 109 
 110   /**
 111    * If either the PrintFlags or ShowFlags JVMCI option is present,
 112    * then JVMCI is initialized to show the help message.
 113    */
 114   static void maybe_print_flags(TRAPS);
 115 
 116   static bool is_HotSpotJVMCIRuntime_initialized() { return _HotSpotJVMCIRuntime_initialized; }
 117 
 118   /**
 119    * Gets the singleton HotSpotJVMCIRuntime instance, initializing it if necessary
 120    */
 121   static Handle get_HotSpotJVMCIRuntime(TRAPS) {
 122     initialize_JVMCI(CHECK_(Handle()));
 123     return Handle(JNIHandles::resolve_non_null(_HotSpotJVMCIRuntime_instance));
 124   }
 125 
 126   static jobject get_HotSpotJVMCIRuntime_jobject(TRAPS) {
 127     initialize_JVMCI(CHECK_NULL);
 128     assert(_HotSpotJVMCIRuntime_initialized, "must be");
 129     return _HotSpotJVMCIRuntime_instance;
 130   }
 131 
 132   static Handle callStatic(const char* className, const char* methodName, const char* returnType, JavaCallArguments* args, TRAPS);
 133 
 134   /**
 135    * Trigger initialization of HotSpotJVMCIRuntime through JVMCI.getRuntime()




  54     warning("Error at line %d while parsing %s: %s", _lineNo, _filename == NULL ? "?" : _filename, message);
  55   }
  56  public:
  57   ParseClosure() : _lineNo(0), _filename(NULL), _abort(false) {}
  58   void parse_line(char* line) {
  59     _lineNo++;
  60     do_line(line);
  61   }
  62   virtual void do_line(char* line) = 0;
  63   int lineNo() { return _lineNo; }
  64   bool is_aborted() { return _abort; }
  65   void set_filename(char* path) {_filename = path; _lineNo = 0;}
  66 };
  67 
  68 class JVMCIRuntime: public AllStatic {
  69  private:
  70   static jobject _HotSpotJVMCIRuntime_instance;
  71   static bool _HotSpotJVMCIRuntime_initialized;
  72   static bool _well_known_classes_initialized;
  73   static const char* _compiler;


  74 
  75   static int _trivial_prefixes_count;
  76   static char** _trivial_prefixes;
  77 
  78   static bool _shutdown_called;
  79 
  80   /**
  81    * Instantiates a service object, calls its default constructor and returns it.
  82    *
  83    * @param name the name of a class implementing jdk.vm.ci.service.Service
  84    */
  85   static Handle create_Service(const char* name, TRAPS);
  86 
  87  public:
  88 
  89   /**
  90    * Parses *.properties files in jre/lib/jvmci/ and adds the properties to plist.
  91    */
  92   static void init_system_properties(SystemProperty** plist);
  93 
  94   /**
  95    * Saves the value of the "jvmci.compiler" system property for processing
  96    * when JVMCI is initialized.
  97    */
  98   static void save_compiler(const char* compiler);
  99 














 100   static bool is_HotSpotJVMCIRuntime_initialized() { return _HotSpotJVMCIRuntime_initialized; }
 101 
 102   /**
 103    * Gets the singleton HotSpotJVMCIRuntime instance, initializing it if necessary
 104    */
 105   static Handle get_HotSpotJVMCIRuntime(TRAPS) {
 106     initialize_JVMCI(CHECK_(Handle()));
 107     return Handle(JNIHandles::resolve_non_null(_HotSpotJVMCIRuntime_instance));
 108   }
 109 
 110   static jobject get_HotSpotJVMCIRuntime_jobject(TRAPS) {
 111     initialize_JVMCI(CHECK_NULL);
 112     assert(_HotSpotJVMCIRuntime_initialized, "must be");
 113     return _HotSpotJVMCIRuntime_instance;
 114   }
 115 
 116   static Handle callStatic(const char* className, const char* methodName, const char* returnType, JavaCallArguments* args, TRAPS);
 117 
 118   /**
 119    * Trigger initialization of HotSpotJVMCIRuntime through JVMCI.getRuntime()