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 friend class VMStructs;
37
38 class Data {
39 friend class VMStructs;
40 public:
41 elapsedTimer _time; // time spent compiling
42 uint _bytes; // number of bytecodes compiled, including inlined bytecodes
43 uint _count; // number of compilations
44 Data() : _bytes(0), _count(0) {}
45 void update(elapsedTimer time, int bytes) {
46 _time.add(time);
47 _bytes += bytes;
48 _count++;
49 }
50 void reset() {
51 _time.reset();
52 }
53 };
54
55 public:
56 Data _standard; // stats for non-OSR compilations
57 Data _osr; // stats for OSR compilations
58 uint _nmethods_size; //
59 uint _nmethods_code_size;
60
61 double total_time() { return _standard._time.seconds() + _osr._time.seconds(); }
62
63 double bytes_per_second() {
64 uint bytes = _standard._bytes + _osr._bytes;
65 if (bytes == 0) {
66 return 0.0;
67 }
68 double seconds = total_time();
69 return seconds == 0.0 ? 0.0 : (bytes / seconds);
70 }
71
72 CompilerStatistics() : _nmethods_size(0), _nmethods_code_size(0) {}
73 };
74
75 class AbstractCompiler : public CHeapObj<mtCompiler> {
76 private:
77 volatile int _num_compiler_threads;
|
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 friend class VMStructs;
37
38 public:
39 class Data {
40 friend class VMStructs;
41 public:
42 elapsedTimer _time; // time spent compiling
43 uint _bytes; // number of bytecodes compiled, including inlined bytecodes
44 uint _count; // number of compilations
45 Data() : _bytes(0), _count(0) {}
46 void update(elapsedTimer time, int bytes) {
47 _time.add(&time);
48 _bytes += bytes;
49 _count++;
50 }
51 void reset() {
52 _time.reset();
53 }
54 };
55
56 public:
57 Data _standard; // stats for non-OSR compilations
58 Data _osr; // stats for OSR compilations
59 Data _bailout;
60 Data _invalidated;
61 Data _made_not_entrant;
62 uint _nmethods_size; //
63 uint _nmethods_code_size;
64
65 double total_time() { return _standard._time.seconds() + _osr._time.seconds(); }
66
67 double bytes_per_second() {
68 uint bytes = _standard._bytes + _osr._bytes;
69 if (bytes == 0) {
70 return 0.0;
71 }
72 double seconds = total_time();
73 return seconds == 0.0 ? 0.0 : (bytes / seconds);
74 }
75
76 CompilerStatistics() : _nmethods_size(0), _nmethods_code_size(0) {}
77 };
78
79 class AbstractCompiler : public CHeapObj<mtCompiler> {
80 private:
81 volatile int _num_compiler_threads;
|