< prev index next > src/hotspot/share/prims/jvmtiTagMap.hpp
Print this page
#include "jvmtifiles/jvmti.h"
#include "memory/allocation.hpp"
class JvmtiEnv;
class JvmtiTagMapTable;
class JvmtiTagMapKeyClosure;
class JvmtiTagMap : public CHeapObj<mtServiceability> {
private:
JvmtiEnv* _env; // the jvmti environment
Monitor _lock; // lock for this tag map
JvmtiTagMapTable* _hashmap; // the hashmap for tags
bool _needs_cleaning;
bool _posting_events;
static bool _has_object_free_events;
// create a tag map
JvmtiTagMap(JvmtiEnv* env);
// accessors
inline JvmtiEnv* env() const { return _env; }
void check_hashmap(GrowableArray<jlong>* objects);
! void entry_iterate(JvmtiTagMapKeyClosure* closure);
public:
// indicates if this tag map is locked
! bool is_locked() { return lock()->is_locked(); }
inline Monitor* lock() { return &_lock; }
- JvmtiTagMapTable* hashmap() { return _hashmap; }
-
// returns true if the hashmaps are empty
! bool is_empty();
! // return tag for the given environment
static JvmtiTagMap* tag_map_for(JvmtiEnv* env);
// destroy tag map
~JvmtiTagMap();
#include "jvmtifiles/jvmti.h"
#include "memory/allocation.hpp"
class JvmtiEnv;
class JvmtiTagMapTable;
+ class JvmtiFlatTagMapTable;
class JvmtiTagMapKeyClosure;
+ class JvmtiHeapwalkObject;
class JvmtiTagMap : public CHeapObj<mtServiceability> {
private:
JvmtiEnv* _env; // the jvmti environment
Monitor _lock; // lock for this tag map
JvmtiTagMapTable* _hashmap; // the hashmap for tags
+ JvmtiFlatTagMapTable* _flat_hashmap;
+
bool _needs_cleaning;
bool _posting_events;
static bool _has_object_free_events;
+ bool _converting_flat_object;
+
// create a tag map
JvmtiTagMap(JvmtiEnv* env);
// accessors
inline JvmtiEnv* env() const { return _env; }
void check_hashmap(GrowableArray<jlong>* objects);
! // moves entries from _flat_hashmap to _hashmap
+ void convert_flat_object_entries();
+
+ public:
+ // for inernal use
+ jlong find(const JvmtiHeapwalkObject& obj) const;
+ void add(const JvmtiHeapwalkObject& obj, jlong tag);
+ void remove(const JvmtiHeapwalkObject& obj);
public:
// indicates if this tag map is locked
! bool is_locked() const { return lock()->is_locked(); }
+ inline const Monitor* lock() const { return &_lock; }
inline Monitor* lock() { return &_lock; }
// returns true if the hashmaps are empty
! bool is_empty() const;
! // return tag map for the given environment
static JvmtiTagMap* tag_map_for(JvmtiEnv* env);
// destroy tag map
~JvmtiTagMap();
static void check_hashmaps_for_heapwalk(GrowableArray<jlong>* objects);
static void set_needs_cleaning() NOT_JVMTI_RETURN;
static void gc_notification(size_t num_dead_entries) NOT_JVMTI_RETURN;
void flush_object_free_events();
! void clear(); // Clear tagmap table after the env is disposed.
// For ServiceThread
static void flush_all_object_free_events() NOT_JVMTI_RETURN;
static bool has_object_free_events_and_reset() NOT_JVMTI_RETURN_(false);
};
static void check_hashmaps_for_heapwalk(GrowableArray<jlong>* objects);
static void set_needs_cleaning() NOT_JVMTI_RETURN;
static void gc_notification(size_t num_dead_entries) NOT_JVMTI_RETURN;
void flush_object_free_events();
! void clear(); // Clear hash tables after the env is disposed.
// For ServiceThread
static void flush_all_object_free_events() NOT_JVMTI_RETURN;
static bool has_object_free_events_and_reset() NOT_JVMTI_RETURN_(false);
};
< prev index next >