comparison src/share/vm/compiler/abstractCompiler.hpp @ 7568:140d4d4ab3b9

added per-compiler compilation speed statistics for C1 and C2 (included in output produced by -XX:+CITime)
author Doug Simon <doug.simon@oracle.com>
date Wed, 30 Jan 2013 21:36:28 +0100
parents 5d0bb7d52783
children 3ac7d10a6572
comparison
equal deleted inserted replaced
7567:a8bc60aeacb8 7568:140d4d4ab3b9
27 27
28 #include "ci/compilerInterface.hpp" 28 #include "ci/compilerInterface.hpp"
29 29
30 typedef void (*initializer)(void); 30 typedef void (*initializer)(void);
31 31
32 #ifdef GRAAL
33 class CompilerStatistics {
34 public:
35 elapsedTimer _t_osr_compilation;
36 elapsedTimer _t_standard_compilation;
37 int _sum_osr_bytes_compiled;
38 int _sum_standard_bytes_compiled;
39 CompilerStatistics() : _sum_osr_bytes_compiled(0), _sum_standard_bytes_compiled(0) {}
40 };
41 #endif
42
32 class AbstractCompiler : public CHeapObj<mtCompiler> { 43 class AbstractCompiler : public CHeapObj<mtCompiler> {
33 private: 44 private:
34 bool _is_initialized; // Mark whether compiler object is initialized 45 bool _is_initialized; // Mark whether compiler object is initialized
35 46
36 protected: 47 protected:
46 // and do so without holding any locks 57 // and do so without holding any locks
47 void initialize_runtimes(initializer f, volatile int* state); 58 void initialize_runtimes(initializer f, volatile int* state);
48 59
49 private: 60 private:
50 Type _type; 61 Type _type;
62
63 #ifdef GRAAL
64 CompilerStatistics _stats;
65 #endif
51 66
52 public: 67 public:
53 AbstractCompiler(Type type) : _is_initialized(false), _type(type) {} 68 AbstractCompiler(Type type) : _is_initialized(false), _type(type) {}
54 69
55 // Name of this compiler 70 // Name of this compiler
81 96
82 // Print compilation timers and statistics 97 // Print compilation timers and statistics
83 virtual void print_timers() { 98 virtual void print_timers() {
84 ShouldNotReachHere(); 99 ShouldNotReachHere();
85 } 100 }
101
102 #ifdef GRAAL
103 CompilerStatistics* stats() { return &_stats; }
104 #endif
86 }; 105 };
87 106
88 #endif // SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP 107 #endif // SHARE_VM_COMPILER_ABSTRACTCOMPILER_HPP