src/share/vm/shark/sharkCompiler.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/shark

src/share/vm/shark/sharkCompiler.hpp

Print this page
rev 9032 : 8137167: JEP165: Compiler Control: Implementation task
Summary: Compiler Control JEP
Reviewed-by: roland, twisti


  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef SHARE_VM_SHARK_SHARKCOMPILER_HPP
  27 #define SHARE_VM_SHARK_SHARKCOMPILER_HPP
  28 
  29 #include "ci/ciEnv.hpp"
  30 #include "ci/ciMethod.hpp"
  31 #include "compiler/abstractCompiler.hpp"
  32 #include "compiler/compileBroker.hpp"

  33 #include "shark/llvmHeaders.hpp"
  34 #include "shark/sharkMemoryManager.hpp"
  35 
  36 class SharkContext;
  37 
  38 class SharkCompiler : public AbstractCompiler {
  39  public:
  40   // Creation
  41   SharkCompiler();
  42 
  43   // Name of this compiler
  44   const char *name()     { return "shark"; }
  45 
  46   // Missing feature tests
  47   bool supports_native() { return true; }
  48   bool supports_osr()    { return true; }
  49   bool can_compile_method(methodHandle method)  {
  50     return ! (method->is_method_handle_intrinsic() || method->is_compiled_lambda_form());
  51   }
  52 
  53   // Initialization
  54   void initialize();
  55 
  56   // Compile a normal (bytecode) method and install it in the VM
  57   void compile_method(ciEnv* env, ciMethod* target, int entry_bci);
  58 
  59   // Print compilation timers and statistics
  60   void print_timers();
  61 
  62   // Generate a wrapper for a native (JNI) method
  63   nmethod* generate_native_wrapper(MacroAssembler* masm,
  64                                    methodHandle    target,
  65                                    int             compile_id,
  66                                    BasicType*      arg_types,
  67                                    BasicType       return_type);
  68 
  69   // Free compiled methods (and native wrappers)
  70   void free_compiled_method(address code);
  71 
  72   // Each thread generating IR needs its own context.  The normal
  73   // context is used for bytecode methods, and is protected from
  74   // multiple simultaneous accesses by being restricted to the
  75   // compiler thread.  The native context is used for JNI methods,
  76   // and is protected from multiple simultaneous accesses by the
  77   // adapter handler library lock.




  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #ifndef SHARE_VM_SHARK_SHARKCOMPILER_HPP
  27 #define SHARE_VM_SHARK_SHARKCOMPILER_HPP
  28 
  29 #include "ci/ciEnv.hpp"
  30 #include "ci/ciMethod.hpp"
  31 #include "compiler/abstractCompiler.hpp"
  32 #include "compiler/compileBroker.hpp"
  33 #include "compiler/compilerDirectives.hpp"
  34 #include "shark/llvmHeaders.hpp"
  35 #include "shark/sharkMemoryManager.hpp"
  36 
  37 class SharkContext;
  38 
  39 class SharkCompiler : public AbstractCompiler {
  40  public:
  41   // Creation
  42   SharkCompiler();
  43 
  44   // Name of this compiler
  45   const char *name()     { return "shark"; }
  46 
  47   // Missing feature tests
  48   bool supports_native() { return true; }
  49   bool supports_osr()    { return true; }
  50   bool can_compile_method(methodHandle method)  {
  51     return ! (method->is_method_handle_intrinsic() || method->is_compiled_lambda_form());
  52   }
  53 
  54   // Initialization
  55   void initialize();
  56 
  57   // Compile a normal (bytecode) method and install it in the VM
  58   void compile_method(ciEnv* env, ciMethod* target, int entry_bci, DirectiveSet* dirset);
  59 
  60   // Print compilation timers and statistics
  61   void print_timers();
  62 
  63   // Generate a wrapper for a native (JNI) method
  64   nmethod* generate_native_wrapper(MacroAssembler* masm,
  65                                    methodHandle    target,
  66                                    int             compile_id,
  67                                    BasicType*      arg_types,
  68                                    BasicType       return_type);
  69 
  70   // Free compiled methods (and native wrappers)
  71   void free_compiled_method(address code);
  72 
  73   // Each thread generating IR needs its own context.  The normal
  74   // context is used for bytecode methods, and is protected from
  75   // multiple simultaneous accesses by being restricted to the
  76   // compiler thread.  The native context is used for JNI methods,
  77   // and is protected from multiple simultaneous accesses by the
  78   // adapter handler library lock.


src/share/vm/shark/sharkCompiler.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File