src/share/vm/compiler/abstractCompiler.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/compiler/abstractCompiler.hpp	Wed Sep 16 15:18:26 2015
--- new/src/share/vm/compiler/abstractCompiler.hpp	Wed Sep 16 15:18:26 2015

*** 25,34 **** --- 25,75 ---- #ifndef SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP #define SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP #include "ci/compilerInterface.hpp" + typedef void (*initializer)(void); + + #if INCLUDE_JVMCI + // Per-compiler statistics + class CompilerStatistics VALUE_OBJ_CLASS_SPEC { + friend class VMStructs; + + class Data VALUE_OBJ_CLASS_SPEC { + friend class VMStructs; + public: + elapsedTimer _time; // time spent compiling + int _bytes; // number of bytecodes compiled, including inlined bytecodes + int _count; // number of compilations + Data() : _bytes(0), _count(0) {} + void update(elapsedTimer time, int bytes) { + _time.add(time); + _bytes += bytes; + _count++; + } + void reset() { + _time.reset(); + } + }; + + public: + Data _standard; // stats for non-OSR compilations + Data _osr; // stats for OSR compilations + int _nmethods_size; // + int _nmethods_code_size; + int bytes_per_second() { + int bytes = _standard._bytes + _osr._bytes; + if (bytes == 0) { + return 0; + } + double seconds = _standard._time.seconds() + _osr._time.seconds(); + return seconds == 0.0 ? 0 : (int) (bytes / seconds); + } + CompilerStatistics() : _nmethods_size(0), _nmethods_code_size(0) {} + }; + #endif + class AbstractCompiler : public CHeapObj<mtCompiler> { private: volatile int _num_compiler_threads; protected:
*** 43,58 **** --- 84,104 ---- // The (closed set) of concrete compiler classes. enum Type { none, c1, c2, + jvmci, shark }; private: Type _type; + #if INCLUDE_JVMCI + CompilerStatistics _stats; + #endif + public: AbstractCompiler(Type type) : _type(type), _compiler_state(uninitialized), _num_compiler_threads(0) {} // This function determines the compiler thread that will perform the // shutdown of the corresponding compiler runtime.
*** 113,122 **** --- 159,169 ---- } // Compiler type queries. bool is_c1() { return _type == c1; } bool is_c2() { return _type == c2; } + bool is_jvmci() { return _type == jvmci; } bool is_shark() { return _type == shark; } // Customization virtual void initialize () = 0;
*** 136,143 **** --- 183,194 ---- // Print compilation timers and statistics virtual void print_timers() { ShouldNotReachHere(); } + + #if INCLUDE_JVMCI + CompilerStatistics* stats() { return &_stats; } + #endif }; #endif // SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP

src/share/vm/compiler/abstractCompiler.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File