1 /*
2 * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 // JvmtiTagMap
26
27 #ifndef _JAVA_JVMTI_TAG_MAP_H_
28 #define _JAVA_JVMTI_TAG_MAP_H_
29
30 // forward references
31 class JvmtiTagHashmap;
32 class JvmtiTagHashmapEntry;
33 class JvmtiTagHashmapEntryClosure;
34
35 class JvmtiTagMap : public CHeapObj {
36 private:
37
38 enum{
39 n_hashmaps = 2, // encapsulates 2 hashmaps
40 max_free_entries = 4096 // maximum number of free entries per env
41 };
42
43 // memory region for young generation
44 static MemRegion _young_gen;
45 static void get_young_generation();
46
47 JvmtiEnv* _env; // the jvmti environment
48 Mutex _lock; // lock for this tag map
115 const void* user_data);
116
117 void follow_references(jint heap_filter,
118 KlassHandle klass,
119 jobject initial_object,
120 const jvmtiHeapCallbacks* callbacks,
121 const void* user_data);
122
123 // get tagged objects
124 jvmtiError get_objects_with_tags(const jlong* tags, jint count,
125 jint* count_ptr, jobject** object_result_ptr,
126 jlong** tag_result_ptr);
127
128 // call post-GC to rehash the tag maps.
129 static void gc_epilogue(bool full);
130
131 // call after referencing processing has completed (CMS)
132 static void cms_ref_processing_epilogue();
133 };
134
135 #endif /* _JAVA_JVMTI_TAG_MAP_H_ */
|
1 /*
2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 // JvmtiTagMap
26
27 #ifndef SHARE_VM_PRIMS_JVMTITAGMAP_HPP
28 #define SHARE_VM_PRIMS_JVMTITAGMAP_HPP
29
30 #ifndef JVMTI_KERNEL
31 #include "gc_interface/collectedHeap.hpp"
32 #include "jvmtifiles/jvmti.h"
33 #include "jvmtifiles/jvmtiEnv.hpp"
34 #include "memory/allocation.hpp"
35 #include "memory/genCollectedHeap.hpp"
36 #include "memory/universe.hpp"
37 #endif
38
39 // forward references
40 class JvmtiTagHashmap;
41 class JvmtiTagHashmapEntry;
42 class JvmtiTagHashmapEntryClosure;
43
44 class JvmtiTagMap : public CHeapObj {
45 private:
46
47 enum{
48 n_hashmaps = 2, // encapsulates 2 hashmaps
49 max_free_entries = 4096 // maximum number of free entries per env
50 };
51
52 // memory region for young generation
53 static MemRegion _young_gen;
54 static void get_young_generation();
55
56 JvmtiEnv* _env; // the jvmti environment
57 Mutex _lock; // lock for this tag map
124 const void* user_data);
125
126 void follow_references(jint heap_filter,
127 KlassHandle klass,
128 jobject initial_object,
129 const jvmtiHeapCallbacks* callbacks,
130 const void* user_data);
131
132 // get tagged objects
133 jvmtiError get_objects_with_tags(const jlong* tags, jint count,
134 jint* count_ptr, jobject** object_result_ptr,
135 jlong** tag_result_ptr);
136
137 // call post-GC to rehash the tag maps.
138 static void gc_epilogue(bool full);
139
140 // call after referencing processing has completed (CMS)
141 static void cms_ref_processing_epilogue();
142 };
143
144 #endif // SHARE_VM_PRIMS_JVMTITAGMAP_HPP
|