27 #define SHARE_CODE_CODEHEAPSTATE_HPP
28
29 #include "memory/heap.hpp"
30 #include "utilities/debug.hpp"
31 #include "utilities/globalDefinitions.hpp"
32 #include "utilities/ostream.hpp"
33
34 class CodeHeapState : public CHeapObj<mtCode> {
35
36 public:
37 enum compType {
38 noComp = 0, // must be! due to initialization by memset to zero
39 c1,
40 c2,
41 jvmci,
42 lastComp
43 };
44
45 enum blobType {
46 noType = 0, // must be! due to initialization by memset to zero
47 // The nMethod_* values correspond 1:1 to the CompiledMethod enum values.
48 nMethod_inuse, // executable. This is the "normal" state for a nmethod.
49 nMethod_notused, // assumed inactive, marked not entrant. Could be revived if necessary.
50 nMethod_notentrant, // no new activations allowed, marked for deoptimization. Old activations may still exist.
51 // Will transition to "zombie" after all activations are gone.
52 nMethod_zombie, // No more activations exist, ready for purge (remove from code cache).
53 nMethod_unloaded, // No activations exist, should not be called. Transient state on the way to "zombie".
54 nMethod_alive = nMethod_notentrant, // Combined state: nmethod may have activations, thus can't be purged.
55 nMethod_dead = nMethod_zombie, // Combined state: nmethod does not have any activations.
56 runtimeStub = nMethod_unloaded + 1,
57 ricochetStub,
58 deoptimizationStub,
59 uncommonTrapStub,
60 exceptionStub,
61 safepointStub,
62 adapterBlob,
63 mh_adapterBlob,
64 bufferBlob,
65 lastType
66 };
67
197 // Thats what the CodeHeapStat and CodeHeapStatArray are used for.
198 // Before a heap segment is processed, the contents of the CodeHeapStat
199 // element is copied to the global variables (get_HeapStatGlobals).
200 // When processing is done, the possibly modified global variables are
201 // copied back (set_HeapStatGlobals) to the CodeHeapStat element.
202 struct CodeHeapStat {
203 StatElement* StatArray;
204 struct FreeBlk* FreeArray;
205 struct TopSizeBlk* TopSizeArray;
206 struct SizeDistributionElement* SizeDistributionArray;
207 const char* heapName;
208 size_t segment_size;
209 // StatElement data
210 size_t alloc_granules;
211 size_t granule_size;
212 bool segment_granules;
213 unsigned int nBlocks_t1;
214 unsigned int nBlocks_t2;
215 unsigned int nBlocks_alive;
216 unsigned int nBlocks_dead;
217 unsigned int nBlocks_unloaded;
218 unsigned int nBlocks_stub;
219 // FreeBlk data
220 unsigned int alloc_freeBlocks;
221 // UsedBlk data
222 unsigned int alloc_topSizeBlocks;
223 unsigned int used_topSizeBlocks;
224 // method hotness data. Temperature range is [-reset_val..+reset_val]
225 int avgTemp;
226 int maxTemp;
227 int minTemp;
228 };
229
230 #endif // SHARE_CODE_CODEHEAPSTATE_HPP
|
27 #define SHARE_CODE_CODEHEAPSTATE_HPP
28
29 #include "memory/heap.hpp"
30 #include "utilities/debug.hpp"
31 #include "utilities/globalDefinitions.hpp"
32 #include "utilities/ostream.hpp"
33
34 class CodeHeapState : public CHeapObj<mtCode> {
35
36 public:
37 enum compType {
38 noComp = 0, // must be! due to initialization by memset to zero
39 c1,
40 c2,
41 jvmci,
42 lastComp
43 };
44
45 enum blobType {
46 noType = 0, // must be! due to initialization by memset to zero
47 // The nMethod_* values correspond to the CompiledMethod enum values.
48 // We can't use the CompiledMethod values 1:1 because we depend on noType == 0.
49 nMethod_inconstruction, // under construction. Very soon, the type will transition to "in_use".
50 nMethod_inuse, // executable. This is the "normal" state for a nmethod.
51 nMethod_notused, // assumed inactive, marked not entrant. Could be revived if necessary.
52 nMethod_notentrant, // no new activations allowed, marked for deoptimization. Old activations may still exist.
53 // Will transition to "zombie" after all activations are gone.
54 nMethod_zombie, // No more activations exist, ready for purge (remove from code cache).
55 nMethod_unloaded, // No activations exist, should not be called. Transient state on the way to "zombie".
56 nMethod_alive = nMethod_notentrant, // Combined state: nmethod may have activations, thus can't be purged.
57 nMethod_dead = nMethod_zombie, // Combined state: nmethod does not have any activations.
58 runtimeStub = nMethod_unloaded + 1,
59 ricochetStub,
60 deoptimizationStub,
61 uncommonTrapStub,
62 exceptionStub,
63 safepointStub,
64 adapterBlob,
65 mh_adapterBlob,
66 bufferBlob,
67 lastType
68 };
69
199 // Thats what the CodeHeapStat and CodeHeapStatArray are used for.
200 // Before a heap segment is processed, the contents of the CodeHeapStat
201 // element is copied to the global variables (get_HeapStatGlobals).
202 // When processing is done, the possibly modified global variables are
203 // copied back (set_HeapStatGlobals) to the CodeHeapStat element.
204 struct CodeHeapStat {
205 StatElement* StatArray;
206 struct FreeBlk* FreeArray;
207 struct TopSizeBlk* TopSizeArray;
208 struct SizeDistributionElement* SizeDistributionArray;
209 const char* heapName;
210 size_t segment_size;
211 // StatElement data
212 size_t alloc_granules;
213 size_t granule_size;
214 bool segment_granules;
215 unsigned int nBlocks_t1;
216 unsigned int nBlocks_t2;
217 unsigned int nBlocks_alive;
218 unsigned int nBlocks_dead;
219 unsigned int nBlocks_inconstr;
220 unsigned int nBlocks_unloaded;
221 unsigned int nBlocks_stub;
222 // FreeBlk data
223 unsigned int alloc_freeBlocks;
224 // UsedBlk data
225 unsigned int alloc_topSizeBlocks;
226 unsigned int used_topSizeBlocks;
227 // method hotness data. Temperature range is [-reset_val..+reset_val]
228 int avgTemp;
229 int maxTemp;
230 int minTemp;
231 };
232
233 #endif // SHARE_CODE_CODEHEAPSTATE_HPP
|