22 * |
22 * |
23 */ |
23 */ |
24 #ifndef SHARE_VM_JFR_CHECKPOINT_TYPES_JFRTYPEMANAGER_HPP |
24 #ifndef SHARE_VM_JFR_CHECKPOINT_TYPES_JFRTYPEMANAGER_HPP |
25 #define SHARE_VM_JFR_CHECKPOINT_TYPES_JFRTYPEMANAGER_HPP |
25 #define SHARE_VM_JFR_CHECKPOINT_TYPES_JFRTYPEMANAGER_HPP |
26 |
26 |
27 #include "jfr/metadata/jfrSerializer.hpp" |
|
28 #include "jfr/utilities/jfrAllocation.hpp" |
27 #include "jfr/utilities/jfrAllocation.hpp" |
29 #include "jfr/utilities/jfrDoublyLinkedList.hpp" |
|
30 #include "jfr/utilities/jfrIterator.hpp" |
|
31 |
28 |
32 class JfrSerializerRegistration : public JfrCHeapObj { |
29 class JavaThread; |
33 private: |
30 class JfrCheckpointWriter; |
34 JfrSerializerRegistration* _next; |
|
35 JfrSerializerRegistration* _prev; |
|
36 JfrSerializer* _serializer; |
|
37 mutable JfrCheckpointBlobHandle _cache; |
|
38 JfrTypeId _id; |
|
39 bool _permit_cache; |
|
40 |
31 |
|
32 class JfrTypeManager : public AllStatic { |
41 public: |
33 public: |
42 JfrSerializerRegistration(JfrTypeId id, bool permit_cache, JfrSerializer* serializer); |
34 static bool initialize(); |
43 ~JfrSerializerRegistration(); |
35 static void clear(); |
44 JfrSerializerRegistration* next() const; |
36 static void write_types(JfrCheckpointWriter& writer); |
45 void set_next(JfrSerializerRegistration* next); |
37 static void write_safepoint_types(JfrCheckpointWriter& writer); |
46 JfrSerializerRegistration* prev() const; |
38 static void write_type_set(); |
47 void set_prev(JfrSerializerRegistration* prev); |
39 static void write_type_set_for_unloaded_classes(); |
48 void invoke_serializer(JfrCheckpointWriter& writer) const; |
40 static void create_thread_checkpoint(JavaThread* jt); |
49 JfrTypeId id() const; |
41 static void write_thread_checkpoint(JavaThread* jt); |
50 }; |
42 }; |
51 |
43 |
52 class JfrTypeManager : public JfrCHeapObj { |
|
53 friend class JfrCheckpointManager; |
|
54 public: |
|
55 typedef JfrDoublyLinkedList<JfrSerializerRegistration> List; |
|
56 typedef StopOnNullIterator<const List> Iterator; |
|
57 private: |
|
58 List _types; |
|
59 List _safepoint_types; |
|
60 |
|
61 ~JfrTypeManager(); |
|
62 bool initialize(); |
|
63 size_t number_of_registered_types() const; |
|
64 void write_types(JfrCheckpointWriter& writer) const; |
|
65 void write_safepoint_types(JfrCheckpointWriter& writer) const; |
|
66 void write_type_set() const; |
|
67 void write_type_set_for_unloaded_classes() const; |
|
68 void create_thread_checkpoint(JavaThread* jt) const; |
|
69 void write_thread_checkpoint(JavaThread* jt) const; |
|
70 bool register_serializer(JfrTypeId id, bool require_safepoint, bool permit_cache, JfrSerializer* serializer); |
|
71 }; |
|
72 #endif // SHARE_VM_JFR_CHECKPOINT_TYPES_JFRTYPEMANAGER_HPP |
44 #endif // SHARE_VM_JFR_CHECKPOINT_TYPES_JFRTYPEMANAGER_HPP |