Mercurial > hg > truffle
annotate src/share/vm/code/oopRecorder.hpp @ 18675:72d0cd2eeca4
handle null in HotSpotzreferenceMap.getFrameMap()|getRegisterMap()
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Sun, 14 Dec 2014 13:43:02 +0100 |
parents | 50942f016967 |
children |
rev | line source |
---|---|
0 | 1 /* |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
2 * Copyright (c) 1998, 2012, 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 | |
1972 | 25 #ifndef SHARE_VM_CODE_OOPRECORDER_HPP |
26 #define SHARE_VM_CODE_OOPRECORDER_HPP | |
27 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
28 #include "memory/universe.hpp" |
1972 | 29 #include "runtime/handles.hpp" |
30 #include "utilities/growableArray.hpp" | |
31 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
32 // Recording and retrieval of either oop relocations or metadata in compiled code. |
0 | 33 |
34 class CodeBlob; | |
35 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
36 template <class T> class ValueRecorder : public StackObj { |
0 | 37 public: |
38 // A two-way mapping from positive indexes to oop handles. | |
39 // The zero index is reserved for a constant (sharable) null. | |
40 // Indexes may not be negative. | |
41 | |
42 // Use the given arena to manage storage, if not NULL. | |
43 // By default, uses the current ResourceArea. | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
44 ValueRecorder(Arena* arena = NULL); |
0 | 45 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
46 // Generate a new index on which nmethod::oop_addr_at will work. |
0 | 47 // allocate_index and find_index never return the same index, |
48 // and allocate_index never returns the same index twice. | |
49 // In fact, two successive calls to allocate_index return successive ints. | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
50 int allocate_index(T h) { |
0 | 51 return add_handle(h, false); |
52 } | |
53 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
54 // For a given jobject or Metadata*, this will return the same index |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
55 // repeatedly. The index can later be given to nmethod::oop_at or |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
56 // metadata_at to retrieve the oop. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
57 // However, the oop must not be changed via nmethod::oop_addr_at. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
58 int find_index(T h) { |
0 | 59 int index = maybe_find_index(h); |
60 if (index < 0) { // previously unallocated | |
61 index = add_handle(h, true); | |
62 } | |
63 return index; | |
64 } | |
65 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
66 // returns the size of the generated oop/metadata table, for sizing the |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
67 // CodeBlob. Must be called after all oops are allocated! |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
68 int size(); |
0 | 69 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
70 // Retrieve the value at a given index. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
71 T at(int index); |
0 | 72 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
73 int count() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
74 if (_handles == NULL) return 0; |
0 | 75 // there is always a NULL virtually present as first object |
76 return _handles->length() + first_index; | |
77 } | |
78 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
79 // Helper function; returns false for NULL or Universe::non_oop_word(). |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
80 bool is_real(T h) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
81 return h != NULL && h != (T)Universe::non_oop_word(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
82 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
83 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
84 // copy the generated table to nmethod |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
85 void copy_values_to(nmethod* nm); |
0 | 86 |
87 bool is_unused() { return _handles == NULL && !_complete; } | |
88 #ifdef ASSERT | |
89 bool is_complete() { return _complete; } | |
90 #endif | |
91 | |
92 private: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
93 // variant of find_index which does not allocate if not found (yields -1) |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
94 int maybe_find_index(T h); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
95 |
0 | 96 // leaky hash table of handle => index, to help detect duplicate insertion |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
97 template <class X> class IndexCache : public ResourceObj { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
98 // This class is only used by the ValueRecorder class. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
99 friend class ValueRecorder; |
0 | 100 enum { |
101 _log_cache_size = 9, | |
102 _cache_size = (1<<_log_cache_size), | |
103 // Index entries are ints. The LSBit is a collision indicator. | |
104 _collision_bit_shift = 0, | |
105 _collision_bit = 1, | |
106 _index_shift = _collision_bit_shift+1 | |
107 }; | |
108 int _cache[_cache_size]; | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
109 static juint cache_index(X handle) { |
0 | 110 juint ci = (int) (intptr_t) handle; |
111 ci ^= ci >> (BitsPerByte*2); | |
112 ci += ci >> (BitsPerByte*1); | |
113 return ci & (_cache_size-1); | |
114 } | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
115 int* cache_location(X handle) { |
0 | 116 return &_cache[ cache_index(handle) ]; |
117 } | |
118 static bool cache_location_collision(int* cloc) { | |
119 return ((*cloc) & _collision_bit) != 0; | |
120 } | |
121 static int cache_location_index(int* cloc) { | |
122 return (*cloc) >> _index_shift; | |
123 } | |
124 static void set_cache_location_index(int* cloc, int index) { | |
125 int cval0 = (*cloc); | |
126 int cval1 = (index << _index_shift); | |
127 if (cval0 != 0 && cval1 != cval0) cval1 += _collision_bit; | |
128 (*cloc) = cval1; | |
129 } | |
130 IndexCache(); | |
131 }; | |
132 | |
133 void maybe_initialize(); | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
134 int add_handle(T h, bool make_findable); |
0 | 135 |
136 enum { null_index = 0, first_index = 1, index_cache_threshold = 20 }; | |
137 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
138 GrowableArray<T>* _handles; // ordered list (first is always NULL) |
0 | 139 GrowableArray<int>* _no_finds; // all unfindable indexes; usually empty |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
140 IndexCache<T>* _indexes; // map: handle -> its probable index |
0 | 141 Arena* _arena; |
142 bool _complete; | |
143 | |
144 #ifdef ASSERT | |
145 static int _find_index_calls, _hit_indexes, _missed_indexes; | |
146 #endif | |
147 }; | |
1972 | 148 |
17375
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
149 class OopRecorder; |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
150 |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
151 class ObjectLookup : public ResourceObj { |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
152 private: |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
153 class ObjectEntry { |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
154 private: |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
155 jobject _value; |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
156 int _index; |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
157 |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
158 public: |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
159 ObjectEntry(jobject value, int index): _value(value), _index(index) {} |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
160 ObjectEntry() {} |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
161 oop oop_value(); // { return JNIHandles::resolve(_value); } |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
162 int index() { return _index; } |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
163 }; |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
164 |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
165 GrowableArray<ObjectEntry> _values; |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
166 unsigned int _gc_count; |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
167 |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
168 // Utility sort functions |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
169 static int sort_by_address(oop a, oop b); |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
170 static int sort_by_address(ObjectEntry* a, ObjectEntry* b); |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
171 static int sort_oop_by_address(oop a, ObjectEntry b); |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
172 |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
173 public: |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
174 ObjectLookup(); |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
175 |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
176 // Resort list if a GC has occurred since the last sort |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
177 void maybe_resort(); |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
178 int find_index(jobject object, OopRecorder* oop_recorder); |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
179 }; |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
180 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
181 class OopRecorder : public ResourceObj { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
182 private: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
183 ValueRecorder<jobject> _oops; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
184 ValueRecorder<Metadata*> _metadata; |
17375
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
185 ObjectLookup* _object_lookup; |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
186 public: |
17375
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
187 OopRecorder(Arena* arena = NULL, bool deduplicate = false): _oops(arena), _metadata(arena) { |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
188 if (deduplicate) { |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
189 _object_lookup = new ObjectLookup(); |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
190 } else { |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
191 _object_lookup = NULL; |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
192 } |
44b83285b645
Deduplicate constant oops during code installation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17374
diff
changeset
|
193 } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
194 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
195 int allocate_oop_index(jobject h) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
196 return _oops.allocate_index(h); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
197 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
198 int find_index(jobject h) { |
17428
50942f016967
remove duplicate check in OopRecorder
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
17375
diff
changeset
|
199 return _object_lookup != NULL ? _object_lookup->find_index(h, this) : _oops.find_index(h); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
200 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
201 jobject oop_at(int index) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
202 return _oops.at(index); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
203 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
204 int oop_size() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
205 return _oops.size(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
206 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
207 int oop_count() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
208 return _oops.count(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
209 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
210 bool is_real(jobject h) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
211 return _oops.is_real(h); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
212 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
213 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
214 int allocate_metadata_index(Metadata* oop) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
215 return _metadata.allocate_index(oop); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
216 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
217 int find_index(Metadata* h) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
218 return _metadata.find_index(h); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
219 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
220 Metadata* metadata_at(int index) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
221 return _metadata.at(index); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
222 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
223 int metadata_size() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
224 return _metadata.size(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
225 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
226 int metadata_count() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
227 return _metadata.count(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
228 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
229 bool is_real(Metadata* h) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
230 return _metadata.is_real(h); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
231 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
232 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
233 bool is_unused() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
234 return _oops.is_unused() && _metadata.is_unused(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
235 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
236 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
237 void freeze() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
238 _oops.size(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
239 _metadata.size(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
240 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
241 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
242 void copy_values_to(nmethod* nm) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
243 if (!_oops.is_unused()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
244 _oops.copy_values_to(nm); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
245 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
246 if (!_metadata.is_unused()) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
247 _metadata.copy_values_to(nm); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
248 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
249 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
250 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
251 #ifdef ASSERT |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
252 bool is_complete() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
253 assert(_oops.is_complete() == _metadata.is_complete(), "must agree"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
254 return _oops.is_complete(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
255 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
256 #endif |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
257 }; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
258 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
259 |
1972 | 260 #endif // SHARE_VM_CODE_OOPRECORDER_HPP |