30 #include "compiler/compileTask.hpp"
31 #include "runtime/perfData.hpp"
32
33 class nmethod;
34 class nmethodLocker;
35
36 // CompilerCounters
37 //
38 // Per Compiler Performance Counters.
39 //
40 class CompilerCounters : public CHeapObj<mtCompiler> {
41
42 public:
43 enum {
44 cmname_buffer_length = 160
45 };
46
47 private:
48
49 char _current_method[cmname_buffer_length];
50 PerfStringVariable* _perf_current_method;
51
52 int _compile_type;
53 PerfVariable* _perf_compile_type;
54
55 PerfCounter* _perf_time;
56 PerfCounter* _perf_compiles;
57
58 public:
59 CompilerCounters(const char* name, int instance, TRAPS);
60
61 // these methods should be called in a thread safe context
62
63 void set_current_method(const char* method) {
64 strncpy(_current_method, method, (size_t)cmname_buffer_length-1);
65 _current_method[cmname_buffer_length-1] = '\0';
66 if (UsePerfData) _perf_current_method->set_value(method);
67 }
68
69 char* current_method() { return _current_method; }
70
71 void set_compile_type(int compile_type) {
72 _compile_type = compile_type;
73 if (UsePerfData) _perf_compile_type->set_value((jlong)compile_type);
74 }
75
76 int compile_type() { return _compile_type; }
77
78 PerfCounter* time_counter() { return _perf_time; }
79 PerfCounter* compile_counter() { return _perf_compiles; }
80 };
81
82 // CompileQueue
83 //
84 // A list of CompileTasks.
85 class CompileQueue : public CHeapObj<mtCompiler> {
86 private:
87 const char* _name;
88
89 CompileTask* _first;
90 CompileTask* _last;
91
92 CompileTask* _first_stale;
93
94 int _size;
95
96 void purge_stale_tasks();
97 public:
98 CompileQueue(const char* name) {
99 _name = name;
|
30 #include "compiler/compileTask.hpp"
31 #include "runtime/perfData.hpp"
32
33 class nmethod;
34 class nmethodLocker;
35
36 // CompilerCounters
37 //
38 // Per Compiler Performance Counters.
39 //
40 class CompilerCounters : public CHeapObj<mtCompiler> {
41
42 public:
43 enum {
44 cmname_buffer_length = 160
45 };
46
47 private:
48
49 char _current_method[cmname_buffer_length];
50 int _compile_type;
51
52 public:
53 CompilerCounters();
54
55 // these methods should be called in a thread safe context
56
57 void set_current_method(const char* method) {
58 strncpy(_current_method, method, (size_t)cmname_buffer_length-1);
59 _current_method[cmname_buffer_length-1] = '\0';
60 }
61
62 char* current_method() { return _current_method; }
63
64 void set_compile_type(int compile_type) {
65 _compile_type = compile_type;
66 }
67
68 int compile_type() { return _compile_type; }
69
70 };
71
72 // CompileQueue
73 //
74 // A list of CompileTasks.
75 class CompileQueue : public CHeapObj<mtCompiler> {
76 private:
77 const char* _name;
78
79 CompileTask* _first;
80 CompileTask* _last;
81
82 CompileTask* _first_stale;
83
84 int _size;
85
86 void purge_stale_tasks();
87 public:
88 CompileQueue(const char* name) {
89 _name = name;
|