Mercurial > hg > truffle
annotate src/share/vm/prims/jvmtiTagMap.hpp @ 5073:2db1ad9dd385
rename PiNode.value to PiNode.object and UnsafeCastNode.x to UnsafeCastNode.object
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Wed, 14 Mar 2012 16:57:18 +0100 |
parents | 1d1603768966 |
children | d2a62e0f25eb |
rev | line source |
---|---|
0 | 1 /* |
2426
1d1603768966
7010070: Update all 2010 Oracle-changed OpenJDK files to have the proper copyright dates - second pass
trims
parents:
2125
diff
changeset
|
2 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 // JvmtiTagMap | |
26 | |
1972 | 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 | |
0 | 38 |
39 // forward references | |
40 class JvmtiTagHashmap; | |
41 class JvmtiTagHashmapEntry; | |
42 class JvmtiTagHashmapEntryClosure; | |
43 | |
44 class JvmtiTagMap : public CHeapObj { | |
45 private: | |
46 | |
47 enum{ | |
2125
7246a374a9f2
6458402: 3 jvmti tests fail with CMS and +ExplicitGCInvokesConcurrent
kamg
parents:
1972
diff
changeset
|
48 max_free_entries = 4096 // maximum number of free entries per env |
0 | 49 }; |
50 | |
51 JvmtiEnv* _env; // the jvmti environment | |
52 Mutex _lock; // lock for this tag map | |
2125
7246a374a9f2
6458402: 3 jvmti tests fail with CMS and +ExplicitGCInvokesConcurrent
kamg
parents:
1972
diff
changeset
|
53 JvmtiTagHashmap* _hashmap; // the hashmap |
0 | 54 |
55 JvmtiTagHashmapEntry* _free_entries; // free list for this environment | |
56 int _free_entries_count; // number of entries on the free list | |
57 | |
58 // create a tag map | |
59 JvmtiTagMap(JvmtiEnv* env); | |
60 | |
61 // accessors | |
62 inline Mutex* lock() { return &_lock; } | |
63 inline JvmtiEnv* env() const { return _env; } | |
64 | |
2125
7246a374a9f2
6458402: 3 jvmti tests fail with CMS and +ExplicitGCInvokesConcurrent
kamg
parents:
1972
diff
changeset
|
65 void do_weak_oops(BoolObjectClosure* is_alive, OopClosure* f); |
0 | 66 |
67 // iterate over all entries in this tag map | |
68 void entry_iterate(JvmtiTagHashmapEntryClosure* closure); | |
69 | |
70 public: | |
71 | |
72 // indicates if this tag map is locked | |
73 bool is_locked() { return lock()->is_locked(); } | |
74 | |
2125
7246a374a9f2
6458402: 3 jvmti tests fail with CMS and +ExplicitGCInvokesConcurrent
kamg
parents:
1972
diff
changeset
|
75 JvmtiTagHashmap* hashmap() { return _hashmap; } |
0 | 76 |
77 // create/destroy entries | |
2125
7246a374a9f2
6458402: 3 jvmti tests fail with CMS and +ExplicitGCInvokesConcurrent
kamg
parents:
1972
diff
changeset
|
78 JvmtiTagHashmapEntry* create_entry(oop ref, jlong tag); |
0 | 79 void destroy_entry(JvmtiTagHashmapEntry* entry); |
80 | |
81 // returns true if the hashmaps are empty | |
82 bool is_empty(); | |
83 | |
84 // return tag for the given environment | |
85 static JvmtiTagMap* tag_map_for(JvmtiEnv* env); | |
86 | |
87 // destroy tag map | |
88 ~JvmtiTagMap(); | |
89 | |
90 // set/get tag | |
91 void set_tag(jobject obj, jlong tag); | |
92 jlong get_tag(jobject obj); | |
93 | |
94 // deprecated heap iteration functions | |
95 void iterate_over_heap(jvmtiHeapObjectFilter object_filter, | |
96 KlassHandle klass, | |
97 jvmtiHeapObjectCallback heap_object_callback, | |
98 const void* user_data); | |
99 | |
100 void iterate_over_reachable_objects(jvmtiHeapRootCallback heap_root_callback, | |
101 jvmtiStackReferenceCallback stack_ref_callback, | |
102 jvmtiObjectReferenceCallback object_ref_callback, | |
103 const void* user_data); | |
104 | |
105 void iterate_over_objects_reachable_from_object(jobject object, | |
106 jvmtiObjectReferenceCallback object_reference_callback, | |
107 const void* user_data); | |
108 | |
109 | |
110 // advanced (JVMTI 1.1) heap iteration functions | |
111 void iterate_through_heap(jint heap_filter, | |
112 KlassHandle klass, | |
113 const jvmtiHeapCallbacks* callbacks, | |
114 const void* user_data); | |
115 | |
116 void follow_references(jint heap_filter, | |
117 KlassHandle klass, | |
118 jobject initial_object, | |
119 const jvmtiHeapCallbacks* callbacks, | |
120 const void* user_data); | |
121 | |
122 // get tagged objects | |
123 jvmtiError get_objects_with_tags(const jlong* tags, jint count, | |
124 jint* count_ptr, jobject** object_result_ptr, | |
125 jlong** tag_result_ptr); | |
126 | |
2125
7246a374a9f2
6458402: 3 jvmti tests fail with CMS and +ExplicitGCInvokesConcurrent
kamg
parents:
1972
diff
changeset
|
127 static void weak_oops_do( |
7246a374a9f2
6458402: 3 jvmti tests fail with CMS and +ExplicitGCInvokesConcurrent
kamg
parents:
1972
diff
changeset
|
128 BoolObjectClosure* is_alive, OopClosure* f) KERNEL_RETURN; |
0 | 129 }; |
130 | |
1972 | 131 #endif // SHARE_VM_PRIMS_JVMTITAGMAP_HPP |