author | coleenp |
Wed, 13 Nov 2019 08:23:23 -0500 | |
changeset 59056 | 15936b142f86 |
parent 54786 | ebf733a324d4 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
47216
diff
changeset
|
25 |
#ifndef SHARE_CODE_OOPRECORDER_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
47216
diff
changeset
|
26 |
#define SHARE_CODE_OOPRECORDER_HPP |
7397 | 27 |
|
28 |
#include "runtime/handles.hpp" |
|
29 |
#include "utilities/growableArray.hpp" |
|
30 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
31 |
// Recording and retrieval of either oop relocations or metadata in compiled code. |
1 | 32 |
|
33 |
class CodeBlob; |
|
34 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
35 |
template <class T> class ValueRecorder : public StackObj { |
1 | 36 |
public: |
37 |
// A two-way mapping from positive indexes to oop handles. |
|
38 |
// The zero index is reserved for a constant (sharable) null. |
|
39 |
// Indexes may not be negative. |
|
40 |
||
41 |
// Use the given arena to manage storage, if not NULL. |
|
42 |
// By default, uses the current ResourceArea. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
43 |
ValueRecorder(Arena* arena = NULL); |
1 | 44 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
45 |
// Generate a new index on which nmethod::oop_addr_at will work. |
1 | 46 |
// allocate_index and find_index never return the same index, |
47 |
// and allocate_index never returns the same index twice. |
|
48 |
// In fact, two successive calls to allocate_index return successive ints. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
49 |
int allocate_index(T h) { |
1 | 50 |
return add_handle(h, false); |
51 |
} |
|
52 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
53 |
// For a given jobject or Metadata*, this will return the same index |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
54 |
// repeatedly. The index can later be given to nmethod::oop_at or |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
55 |
// metadata_at to retrieve the oop. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
56 |
// However, the oop must not be changed via nmethod::oop_addr_at. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
57 |
int find_index(T h) { |
1 | 58 |
int index = maybe_find_index(h); |
59 |
if (index < 0) { // previously unallocated |
|
60 |
index = add_handle(h, true); |
|
61 |
} |
|
62 |
return index; |
|
63 |
} |
|
64 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
65 |
// returns the size of the generated oop/metadata table, for sizing the |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
66 |
// CodeBlob. Must be called after all oops are allocated! |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
67 |
int size(); |
1 | 68 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
69 |
// Retrieve the value at a given index. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
70 |
T at(int index); |
1 | 71 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
72 |
int count() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
73 |
if (_handles == NULL) return 0; |
1 | 74 |
// there is always a NULL virtually present as first object |
75 |
return _handles->length() + first_index; |
|
76 |
} |
|
77 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
78 |
// Helper function; returns false for NULL or Universe::non_oop_word(). |
54783
3331dad9cb30
8223621: Move Universe usage out of oopRecorder.hpp
stefank
parents:
53244
diff
changeset
|
79 |
inline bool is_real(T h); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
80 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
81 |
// copy the generated table to nmethod |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
82 |
void copy_values_to(nmethod* nm); |
1 | 83 |
|
84 |
bool is_unused() { return _handles == NULL && !_complete; } |
|
85 |
#ifdef ASSERT |
|
86 |
bool is_complete() { return _complete; } |
|
87 |
#endif |
|
88 |
||
89 |
private: |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
90 |
// variant of find_index which does not allocate if not found (yields -1) |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
91 |
int maybe_find_index(T h); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
92 |
|
1 | 93 |
// leaky hash table of handle => index, to help detect duplicate insertion |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
94 |
template <class X> class IndexCache : public ResourceObj { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
95 |
// This class is only used by the ValueRecorder class. |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
96 |
friend class ValueRecorder; |
1 | 97 |
enum { |
98 |
_log_cache_size = 9, |
|
99 |
_cache_size = (1<<_log_cache_size), |
|
100 |
// Index entries are ints. The LSBit is a collision indicator. |
|
101 |
_collision_bit_shift = 0, |
|
102 |
_collision_bit = 1, |
|
103 |
_index_shift = _collision_bit_shift+1 |
|
104 |
}; |
|
105 |
int _cache[_cache_size]; |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
106 |
static juint cache_index(X handle) { |
1 | 107 |
juint ci = (int) (intptr_t) handle; |
108 |
ci ^= ci >> (BitsPerByte*2); |
|
109 |
ci += ci >> (BitsPerByte*1); |
|
110 |
return ci & (_cache_size-1); |
|
111 |
} |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
112 |
int* cache_location(X handle) { |
1 | 113 |
return &_cache[ cache_index(handle) ]; |
114 |
} |
|
115 |
static bool cache_location_collision(int* cloc) { |
|
116 |
return ((*cloc) & _collision_bit) != 0; |
|
117 |
} |
|
118 |
static int cache_location_index(int* cloc) { |
|
119 |
return (*cloc) >> _index_shift; |
|
120 |
} |
|
121 |
static void set_cache_location_index(int* cloc, int index) { |
|
122 |
int cval0 = (*cloc); |
|
123 |
int cval1 = (index << _index_shift); |
|
124 |
if (cval0 != 0 && cval1 != cval0) cval1 += _collision_bit; |
|
125 |
(*cloc) = cval1; |
|
126 |
} |
|
127 |
IndexCache(); |
|
128 |
}; |
|
129 |
||
130 |
void maybe_initialize(); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
131 |
int add_handle(T h, bool make_findable); |
1 | 132 |
|
133 |
enum { null_index = 0, first_index = 1, index_cache_threshold = 20 }; |
|
134 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
135 |
GrowableArray<T>* _handles; // ordered list (first is always NULL) |
1 | 136 |
GrowableArray<int>* _no_finds; // all unfindable indexes; usually empty |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
137 |
IndexCache<T>* _indexes; // map: handle -> its probable index |
1 | 138 |
Arena* _arena; |
139 |
bool _complete; |
|
140 |
||
141 |
#ifdef ASSERT |
|
142 |
static int _find_index_calls, _hit_indexes, _missed_indexes; |
|
143 |
#endif |
|
144 |
}; |
|
7397 | 145 |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
146 |
class OopRecorder; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
147 |
|
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
148 |
class ObjectLookup : public ResourceObj { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
149 |
private: |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
150 |
class ObjectEntry { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
151 |
private: |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
152 |
jobject _value; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
153 |
int _index; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
154 |
|
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
155 |
public: |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
156 |
ObjectEntry(jobject value, int index) : _value(value), _index(index) {} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
157 |
ObjectEntry() : _value(NULL), _index(0) {} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
158 |
oop oop_value() const; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
159 |
int index() { return _index; } |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
160 |
}; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
161 |
|
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
162 |
GrowableArray<ObjectEntry> _values; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
163 |
unsigned int _gc_count; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
164 |
|
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
165 |
// Utility sort functions |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
166 |
static int sort_by_address(oop a, oop b); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
167 |
static int sort_by_address(ObjectEntry* a, ObjectEntry* b); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
168 |
static int sort_oop_by_address(oop const& a, ObjectEntry const& b); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
169 |
|
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
170 |
public: |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
171 |
ObjectLookup(); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
172 |
|
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
173 |
// Resort list if a GC has occurred since the last sort |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
174 |
void maybe_resort(); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
175 |
int find_index(jobject object, OopRecorder* oop_recorder); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
176 |
}; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
177 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
178 |
class OopRecorder : public ResourceObj { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
179 |
private: |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
180 |
ValueRecorder<jobject> _oops; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
181 |
ValueRecorder<Metadata*> _metadata; |
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
182 |
ObjectLookup* _object_lookup; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
183 |
public: |
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
184 |
OopRecorder(Arena* arena = NULL, bool deduplicate = false): _oops(arena), _metadata(arena) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
185 |
if (deduplicate) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
186 |
_object_lookup = new ObjectLookup(); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
187 |
} else { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
188 |
_object_lookup = NULL; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
189 |
} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
190 |
} |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
191 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
192 |
int allocate_oop_index(jobject h) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
193 |
return _oops.allocate_index(h); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
194 |
} |
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
195 |
virtual int find_index(jobject h) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
196 |
return _object_lookup != NULL ? _object_lookup->find_index(h, this) : _oops.find_index(h); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
197 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
198 |
jobject oop_at(int index) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
199 |
return _oops.at(index); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
200 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
201 |
int oop_size() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
202 |
return _oops.size(); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
203 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
204 |
int oop_count() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
205 |
return _oops.count(); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
206 |
} |
54783
3331dad9cb30
8223621: Move Universe usage out of oopRecorder.hpp
stefank
parents:
53244
diff
changeset
|
207 |
inline bool is_real(jobject h); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
208 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
209 |
int allocate_metadata_index(Metadata* oop) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
210 |
return _metadata.allocate_index(oop); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
211 |
} |
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
13728
diff
changeset
|
212 |
virtual int find_index(Metadata* h) { |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
213 |
return _metadata.find_index(h); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
214 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
215 |
Metadata* metadata_at(int index) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
216 |
return _metadata.at(index); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
217 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
218 |
int metadata_size() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
219 |
return _metadata.size(); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
220 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
221 |
int metadata_count() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
222 |
return _metadata.count(); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
223 |
} |
54783
3331dad9cb30
8223621: Move Universe usage out of oopRecorder.hpp
stefank
parents:
53244
diff
changeset
|
224 |
inline bool is_real(Metadata* h); |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
225 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
226 |
bool is_unused() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
227 |
return _oops.is_unused() && _metadata.is_unused(); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
228 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
229 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
230 |
void freeze() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
231 |
_oops.size(); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
232 |
_metadata.size(); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
233 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
234 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
235 |
void copy_values_to(nmethod* nm) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
236 |
if (!_oops.is_unused()) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
237 |
_oops.copy_values_to(nm); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
238 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
239 |
if (!_metadata.is_unused()) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
240 |
_metadata.copy_values_to(nm); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
241 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
242 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
243 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
244 |
#ifdef ASSERT |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
245 |
bool is_complete() { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
246 |
assert(_oops.is_complete() == _metadata.is_complete(), "must agree"); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
247 |
return _oops.is_complete(); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
248 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
249 |
#endif |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
250 |
}; |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
251 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
252 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
47216
diff
changeset
|
253 |
#endif // SHARE_CODE_OOPRECORDER_HPP |