src/share/vm/shark/sharkCompiler.hpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2008, 2009 Red Hat, Inc.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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 class SharkContext;
  27 
  28 class SharkCompiler : public AbstractCompiler {
  29  public:
  30   // Creation
  31   SharkCompiler();
  32 
  33   // Name of this compiler
  34   const char *name()     { return "shark"; }
  35 
  36   // Missing feature tests
  37   bool supports_native() { return true; }
  38   bool supports_osr()    { return true; }
  39 
  40   // Customization
  41   bool needs_adapters()  { return false; }
  42   bool needs_stubs()     { return false; }
  43 
  44   // Initialization
  45   void initialize();


  99     assert(execution_engine_lock()->owned_by_self(), "should be");
 100     return _execution_engine;
 101   }
 102 
 103   // Global access
 104  public:
 105   static SharkCompiler* compiler() {
 106     AbstractCompiler *compiler = CompileBroker::compiler(CompLevel_simple);
 107     assert(compiler->is_shark() && compiler->is_initialized(), "should be");
 108     return (SharkCompiler *) compiler;
 109   }
 110 
 111   // Helpers
 112  private:
 113   static const char* methodname(const char* klass, const char* method);
 114   void generate_native_code(SharkEntry*     entry,
 115                             llvm::Function* function,
 116                             const char*     name);
 117   void free_queued_methods();
 118 };


   1 /*
   2  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright 2008, 2009 Red Hat, Inc.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  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 
  50   // Customization
  51   bool needs_adapters()  { return false; }
  52   bool needs_stubs()     { return false; }
  53 
  54   // Initialization
  55   void initialize();


 109     assert(execution_engine_lock()->owned_by_self(), "should be");
 110     return _execution_engine;
 111   }
 112 
 113   // Global access
 114  public:
 115   static SharkCompiler* compiler() {
 116     AbstractCompiler *compiler = CompileBroker::compiler(CompLevel_simple);
 117     assert(compiler->is_shark() && compiler->is_initialized(), "should be");
 118     return (SharkCompiler *) compiler;
 119   }
 120 
 121   // Helpers
 122  private:
 123   static const char* methodname(const char* klass, const char* method);
 124   void generate_native_code(SharkEntry*     entry,
 125                             llvm::Function* function,
 126                             const char*     name);
 127   void free_queued_methods();
 128 };
 129 
 130 #endif // SHARE_VM_SHARK_SHARKCOMPILER_HPP