< prev index next >

src/hotspot/share/compiler/abstractCompiler.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 
 25 #ifndef SHARE_COMPILER_ABSTRACTCOMPILER_HPP
 26 #define SHARE_COMPILER_ABSTRACTCOMPILER_HPP
 27 
 28 #include "ci/compilerInterface.hpp"
 29 #include "compiler/compilerDefinitions.hpp"
 30 #include "compiler/compilerDirectives.hpp"
 31 
 32 typedef void (*initializer)(void);
 33 
 34 // Per-compiler statistics
 35 class CompilerStatistics {

 36   class Data {
 37     friend class VMStructs;
 38   public:
 39     elapsedTimer _time;  // time spent compiling
 40     uint _bytes;         // number of bytecodes compiled, including inlined bytecodes
 41     uint _count;         // number of compilations
 42     Data() : _bytes(0), _count(0) {}
 43     void update(elapsedTimer time, int bytes) {
 44       _time.add(time);
 45       _bytes += bytes;
 46       _count++;
 47     }
 48     void reset() {
 49       _time.reset();
 50     }
 51   };
 52 
 53  public:
 54   Data _standard;  // stats for non-OSR compilations
 55   Data _osr;       // stats for OSR compilations



 56   uint _nmethods_size; //
 57   uint _nmethods_code_size;
 58 
 59   double total_time() { return _standard._time.seconds() + _osr._time.seconds(); }
 60 
 61   double bytes_per_second() {
 62     uint bytes = _standard._bytes + _osr._bytes;
 63     if (bytes == 0) {
 64       return 0.0;
 65     }
 66     double seconds = total_time();
 67     return seconds == 0.0 ? 0.0 : (bytes / seconds);
 68   }
 69 
 70   CompilerStatistics() : _nmethods_size(0), _nmethods_code_size(0) {}
 71 };
 72 
 73 class AbstractCompiler : public CHeapObj<mtCompiler> {
 74  private:
 75   volatile int _num_compiler_threads;

 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 #ifndef SHARE_COMPILER_ABSTRACTCOMPILER_HPP
 26 #define SHARE_COMPILER_ABSTRACTCOMPILER_HPP
 27 
 28 #include "ci/compilerInterface.hpp"
 29 #include "compiler/compilerDefinitions.hpp"
 30 #include "compiler/compilerDirectives.hpp"
 31 
 32 typedef void (*initializer)(void);
 33 
 34 // Per-compiler statistics
 35 class CompilerStatistics {
 36  public:
 37   class Data {
 38     friend class VMStructs;
 39   public:
 40     elapsedTimer _time;  // time spent compiling
 41     uint _bytes;         // number of bytecodes compiled, including inlined bytecodes
 42     uint _count;         // number of compilations
 43     Data() : _bytes(0), _count(0) {}
 44     void update(elapsedTimer time, int bytes) {
 45       _time.add(&time);
 46       _bytes += bytes;
 47       _count++;
 48     }
 49     void reset() {
 50       _time.reset();
 51     }
 52   };
 53 
 54  public:
 55   Data _standard;  // stats for non-OSR compilations
 56   Data _osr;       // stats for OSR compilations
 57   Data _bailout;
 58   Data _invalidated;
 59   Data _made_not_entrant;
 60   uint _nmethods_size; //
 61   uint _nmethods_code_size;
 62 
 63   double total_time() { return _standard._time.seconds() + _osr._time.seconds(); }
 64 
 65   double bytes_per_second() {
 66     uint bytes = _standard._bytes + _osr._bytes;
 67     if (bytes == 0) {
 68       return 0.0;
 69     }
 70     double seconds = total_time();
 71     return seconds == 0.0 ? 0.0 : (bytes / seconds);
 72   }
 73 
 74   CompilerStatistics() : _nmethods_size(0), _nmethods_code_size(0) {}
 75 };
 76 
 77 class AbstractCompiler : public CHeapObj<mtCompiler> {
 78  private:
 79   volatile int _num_compiler_threads;
< prev index next >