Mercurial > hg > truffle
annotate src/share/vm/oops/methodData.hpp @ 14521:29ccc4cbabca
Merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 12 Mar 2014 13:30:08 +0100 |
parents | d8041d695d19 |
children | 12eaf1a47a90 |
rev | line source |
---|---|
0 | 1 /* |
7956 | 2 * Copyright (c) 2000, 2013, 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:
1251
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1251
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:
1251
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_OOPS_METHODDATAOOP_HPP |
26 #define SHARE_VM_OOPS_METHODDATAOOP_HPP | |
27 | |
28 #include "interpreter/bytecodes.hpp" | |
29 #include "memory/universe.hpp" | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
30 #include "oops/method.hpp" |
1972 | 31 #include "oops/oop.hpp" |
32 #include "runtime/orderAccess.hpp" | |
33 | |
0 | 34 class BytecodeStream; |
7956 | 35 class KlassSizeStats; |
0 | 36 |
37 // The MethodData object collects counts and other profile information | |
38 // during zeroth-tier (interpretive) and first-tier execution. | |
39 // The profile is used later by compilation heuristics. Some heuristics | |
40 // enable use of aggressive (or "heroic") optimizations. An aggressive | |
41 // optimization often has a down-side, a corner case that it handles | |
42 // poorly, but which is thought to be rare. The profile provides | |
43 // evidence of this rarity for a given method or even BCI. It allows | |
44 // the compiler to back out of the optimization at places where it | |
45 // has historically been a poor choice. Other heuristics try to use | |
46 // specific information gathered about types observed at a given site. | |
47 // | |
48 // All data in the profile is approximate. It is expected to be accurate | |
49 // on the whole, but the system expects occasional inaccuraces, due to | |
50 // counter overflow, multiprocessor races during data collection, space | |
51 // limitations, missing MDO blocks, etc. Bad or missing data will degrade | |
52 // optimization quality but will not affect correctness. Also, each MDO | |
53 // is marked with its birth-date ("creation_mileage") which can be used | |
54 // to assess the quality ("maturity") of its data. | |
55 // | |
56 // Short (<32-bit) counters are designed to overflow to a known "saturated" | |
57 // state. Also, certain recorded per-BCI events are given one-bit counters | |
58 // which overflow to a saturated state which applied to all counters at | |
59 // that BCI. In other words, there is a small lattice which approximates | |
60 // the ideal of an infinite-precision counter for each event at each BCI, | |
61 // and the lattice quickly "bottoms out" in a state where all counters | |
62 // are taken to be indefinitely large. | |
63 // | |
64 // The reader will find many data races in profile gathering code, starting | |
65 // with invocation counter incrementation. None of these races harm correct | |
66 // execution of the compiled code. | |
67 | |
941 | 68 // forward decl |
69 class ProfileData; | |
70 | |
0 | 71 // DataLayout |
72 // | |
73 // Overlay for generic profiling data. | |
74 class DataLayout VALUE_OBJ_CLASS_SPEC { | |
12258
69f26e8e09f9
8024760: add more types, fields and constants to VMStructs
twisti
parents:
10265
diff
changeset
|
75 friend class VMStructs; |
69f26e8e09f9
8024760: add more types, fields and constants to VMStructs
twisti
parents:
10265
diff
changeset
|
76 |
0 | 77 private: |
78 // Every data layout begins with a header. This header | |
79 // contains a tag, which is used to indicate the size/layout | |
80 // of the data, 4 bits of flags, which can be used in any way, | |
81 // 4 bits of trap history (none/one reason/many reasons), | |
82 // and a bci, which is used to tie this piece of data to a | |
83 // specific bci in the bytecodes. | |
84 union { | |
85 intptr_t _bits; | |
86 struct { | |
87 u1 _tag; | |
88 u1 _flags; | |
89 u2 _bci; | |
90 } _struct; | |
91 } _header; | |
92 | |
93 // The data layout has an arbitrary number of cells, each sized | |
94 // to accomodate a pointer or an integer. | |
95 intptr_t _cells[1]; | |
96 | |
97 // Some types of data layouts need a length field. | |
98 static bool needs_array_len(u1 tag); | |
99 | |
100 public: | |
101 enum { | |
102 counter_increment = 1 | |
103 }; | |
104 | |
105 enum { | |
106 cell_size = sizeof(intptr_t) | |
107 }; | |
108 | |
109 // Tag values | |
110 enum { | |
111 no_tag, | |
112 bit_data_tag, | |
113 counter_data_tag, | |
114 jump_data_tag, | |
115 receiver_type_data_tag, | |
116 virtual_call_data_tag, | |
117 ret_data_tag, | |
118 branch_data_tag, | |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
119 multi_branch_data_tag, |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
120 arg_info_data_tag, |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
121 call_type_data_tag, |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
122 virtual_call_type_data_tag, |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
123 parameters_type_data_tag, |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
124 speculative_trap_data_tag |
0 | 125 }; |
126 | |
127 enum { | |
128 // The _struct._flags word is formatted as [trap_state:4 | flags:4]. | |
129 // The trap state breaks down further as [recompile:1 | reason:3]. | |
130 // This further breakdown is defined in deoptimization.cpp. | |
131 // See Deoptimization::trap_state_reason for an assert that | |
132 // trap_bits is big enough to hold reasons < Reason_RECORDED_LIMIT. | |
133 // | |
134 // The trap_state is collected only if ProfileTraps is true. | |
135 trap_bits = 1+3, // 3: enough to distinguish [0..Reason_RECORDED_LIMIT]. | |
136 trap_shift = BitsPerByte - trap_bits, | |
137 trap_mask = right_n_bits(trap_bits), | |
138 trap_mask_in_place = (trap_mask << trap_shift), | |
139 flag_limit = trap_shift, | |
140 flag_mask = right_n_bits(flag_limit), | |
141 first_flag = 0 | |
142 }; | |
143 | |
144 // Size computation | |
145 static int header_size_in_bytes() { | |
146 return cell_size; | |
147 } | |
148 static int header_size_in_cells() { | |
149 return 1; | |
150 } | |
151 | |
152 static int compute_size_in_bytes(int cell_count) { | |
153 return header_size_in_bytes() + cell_count * cell_size; | |
154 } | |
155 | |
156 // Initialization | |
157 void initialize(u1 tag, u2 bci, int cell_count); | |
158 | |
159 // Accessors | |
160 u1 tag() { | |
161 return _header._struct._tag; | |
162 } | |
163 | |
164 // Return a few bits of trap state. Range is [0..trap_mask]. | |
165 // The state tells if traps with zero, one, or many reasons have occurred. | |
166 // It also tells whether zero or many recompilations have occurred. | |
167 // The associated trap histogram in the MDO itself tells whether | |
168 // traps are common or not. If a BCI shows that a trap X has | |
169 // occurred, and the MDO shows N occurrences of X, we make the | |
170 // simplifying assumption that all N occurrences can be blamed | |
171 // on that BCI. | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
172 int trap_state() const { |
0 | 173 return ((_header._struct._flags >> trap_shift) & trap_mask); |
174 } | |
175 | |
176 void set_trap_state(int new_state) { | |
177 assert(ProfileTraps, "used only under +ProfileTraps"); | |
178 uint old_flags = (_header._struct._flags & flag_mask); | |
179 _header._struct._flags = (new_state << trap_shift) | old_flags; | |
180 } | |
181 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
182 u1 flags() const { |
0 | 183 return _header._struct._flags; |
184 } | |
185 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
186 u2 bci() const { |
0 | 187 return _header._struct._bci; |
188 } | |
189 | |
190 void set_header(intptr_t value) { | |
191 _header._bits = value; | |
192 } | |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
193 bool atomic_set_header(intptr_t value) { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
194 if (Atomic::cmpxchg_ptr(value, (volatile intptr_t*)&_header._bits, 0) == 0) { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
195 return true; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
196 } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
197 return false; |
0 | 198 } |
199 intptr_t header() { | |
200 return _header._bits; | |
201 } | |
202 void set_cell_at(int index, intptr_t value) { | |
203 _cells[index] = value; | |
204 } | |
205 void release_set_cell_at(int index, intptr_t value) { | |
206 OrderAccess::release_store_ptr(&_cells[index], value); | |
207 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
208 intptr_t cell_at(int index) const { |
0 | 209 return _cells[index]; |
210 } | |
211 | |
212 void set_flag_at(int flag_number) { | |
213 assert(flag_number < flag_limit, "oob"); | |
214 _header._struct._flags |= (0x1 << flag_number); | |
215 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
216 bool flag_at(int flag_number) const { |
0 | 217 assert(flag_number < flag_limit, "oob"); |
218 return (_header._struct._flags & (0x1 << flag_number)) != 0; | |
219 } | |
220 | |
221 // Low-level support for code generation. | |
222 static ByteSize header_offset() { | |
223 return byte_offset_of(DataLayout, _header); | |
224 } | |
225 static ByteSize tag_offset() { | |
226 return byte_offset_of(DataLayout, _header._struct._tag); | |
227 } | |
228 static ByteSize flags_offset() { | |
229 return byte_offset_of(DataLayout, _header._struct._flags); | |
230 } | |
231 static ByteSize bci_offset() { | |
232 return byte_offset_of(DataLayout, _header._struct._bci); | |
233 } | |
234 static ByteSize cell_offset(int index) { | |
2333
f767174aac14
7021653: Parfait issue in hotspot/src/share/vm/oops/methodDataOops.hpp
coleenp
parents:
2264
diff
changeset
|
235 return byte_offset_of(DataLayout, _cells) + in_ByteSize(index * cell_size); |
0 | 236 } |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
237 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
238 static int cell_offset_in_bytes(int index) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
239 return (int)offset_of(DataLayout, _cells[index]); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
240 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
241 #endif // CC_INTERP |
0 | 242 // Return a value which, when or-ed as a byte into _flags, sets the flag. |
243 static int flag_number_to_byte_constant(int flag_number) { | |
244 assert(0 <= flag_number && flag_number < flag_limit, "oob"); | |
245 DataLayout temp; temp.set_header(0); | |
246 temp.set_flag_at(flag_number); | |
247 return temp._header._struct._flags; | |
248 } | |
249 // Return a value which, when or-ed as a word into _header, sets the flag. | |
250 static intptr_t flag_mask_to_header_mask(int byte_constant) { | |
251 DataLayout temp; temp.set_header(0); | |
252 temp._header._struct._flags = byte_constant; | |
253 return temp._header._bits; | |
254 } | |
941 | 255 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
256 ProfileData* data_in(); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
257 |
941 | 258 // GC support |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
259 void clean_weak_klass_links(BoolObjectClosure* cl); |
0 | 260 }; |
261 | |
262 | |
263 // ProfileData class hierarchy | |
264 class ProfileData; | |
265 class BitData; | |
266 class CounterData; | |
267 class ReceiverTypeData; | |
268 class VirtualCallData; | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
269 class VirtualCallTypeData; |
0 | 270 class RetData; |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
271 class CallTypeData; |
0 | 272 class JumpData; |
273 class BranchData; | |
274 class ArrayData; | |
275 class MultiBranchData; | |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
276 class ArgInfoData; |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
277 class ParametersTypeData; |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
278 class SpeculativeTrapData; |
0 | 279 |
280 // ProfileData | |
281 // | |
282 // A ProfileData object is created to refer to a section of profiling | |
283 // data in a structured way. | |
284 class ProfileData : public ResourceObj { | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
285 friend class TypeEntries; |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
286 friend class ReturnTypeEntry; |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
287 friend class TypeStackSlotEntries; |
0 | 288 private: |
289 #ifndef PRODUCT | |
290 enum { | |
291 tab_width_one = 16, | |
292 tab_width_two = 36 | |
293 }; | |
294 #endif // !PRODUCT | |
295 | |
296 // This is a pointer to a section of profiling data. | |
297 DataLayout* _data; | |
298 | |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
299 char* print_data_on_helper(const MethodData* md) const; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
300 |
0 | 301 protected: |
302 DataLayout* data() { return _data; } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
303 const DataLayout* data() const { return _data; } |
0 | 304 |
305 enum { | |
306 cell_size = DataLayout::cell_size | |
307 }; | |
308 | |
309 public: | |
310 // How many cells are in this? | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
311 virtual int cell_count() const { |
0 | 312 ShouldNotReachHere(); |
313 return -1; | |
314 } | |
315 | |
316 // Return the size of this data. | |
317 int size_in_bytes() { | |
318 return DataLayout::compute_size_in_bytes(cell_count()); | |
319 } | |
320 | |
321 protected: | |
322 // Low-level accessors for underlying data | |
323 void set_intptr_at(int index, intptr_t value) { | |
324 assert(0 <= index && index < cell_count(), "oob"); | |
325 data()->set_cell_at(index, value); | |
326 } | |
327 void release_set_intptr_at(int index, intptr_t value) { | |
328 assert(0 <= index && index < cell_count(), "oob"); | |
329 data()->release_set_cell_at(index, value); | |
330 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
331 intptr_t intptr_at(int index) const { |
0 | 332 assert(0 <= index && index < cell_count(), "oob"); |
333 return data()->cell_at(index); | |
334 } | |
335 void set_uint_at(int index, uint value) { | |
336 set_intptr_at(index, (intptr_t) value); | |
337 } | |
338 void release_set_uint_at(int index, uint value) { | |
339 release_set_intptr_at(index, (intptr_t) value); | |
340 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
341 uint uint_at(int index) const { |
0 | 342 return (uint)intptr_at(index); |
343 } | |
344 void set_int_at(int index, int value) { | |
345 set_intptr_at(index, (intptr_t) value); | |
346 } | |
347 void release_set_int_at(int index, int value) { | |
348 release_set_intptr_at(index, (intptr_t) value); | |
349 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
350 int int_at(int index) const { |
0 | 351 return (int)intptr_at(index); |
352 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
353 int int_at_unchecked(int index) const { |
0 | 354 return (int)data()->cell_at(index); |
355 } | |
356 void set_oop_at(int index, oop value) { | |
12316
190899198332
7195622: CheckUnhandledOops has limited usefulness now
hseigel
parents:
12258
diff
changeset
|
357 set_intptr_at(index, cast_from_oop<intptr_t>(value)); |
0 | 358 } |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
359 oop oop_at(int index) const { |
12316
190899198332
7195622: CheckUnhandledOops has limited usefulness now
hseigel
parents:
12258
diff
changeset
|
360 return cast_to_oop(intptr_at(index)); |
0 | 361 } |
362 | |
363 void set_flag_at(int flag_number) { | |
364 data()->set_flag_at(flag_number); | |
365 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
366 bool flag_at(int flag_number) const { |
0 | 367 return data()->flag_at(flag_number); |
368 } | |
369 | |
370 // two convenient imports for use by subclasses: | |
371 static ByteSize cell_offset(int index) { | |
372 return DataLayout::cell_offset(index); | |
373 } | |
374 static int flag_number_to_byte_constant(int flag_number) { | |
375 return DataLayout::flag_number_to_byte_constant(flag_number); | |
376 } | |
377 | |
378 ProfileData(DataLayout* data) { | |
379 _data = data; | |
380 } | |
381 | |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
382 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
383 // Static low level accessors for DataLayout with ProfileData's semantics. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
384 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
385 static int cell_offset_in_bytes(int index) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
386 return DataLayout::cell_offset_in_bytes(index); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
387 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
388 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
389 static void increment_uint_at_no_overflow(DataLayout* layout, int index, |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
390 int inc = DataLayout::counter_increment) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
391 uint count = ((uint)layout->cell_at(index)) + inc; |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
392 if (count == 0) return; |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
393 layout->set_cell_at(index, (intptr_t) count); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
394 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
395 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
396 static int int_at(DataLayout* layout, int index) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
397 return (int)layout->cell_at(index); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
398 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
399 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
400 static int uint_at(DataLayout* layout, int index) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
401 return (uint)layout->cell_at(index); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
402 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
403 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
404 static oop oop_at(DataLayout* layout, int index) { |
14433
018b357638aa
8028514: PPC64: Fix C++ Interpreter after '7195622: CheckUnhandledOops has limited usefulness now'
simonis
parents:
14422
diff
changeset
|
405 return cast_to_oop(layout->cell_at(index)); |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
406 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
407 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
408 static void set_intptr_at(DataLayout* layout, int index, intptr_t value) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
409 layout->set_cell_at(index, (intptr_t) value); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
410 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
411 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
412 static void set_flag_at(DataLayout* layout, int flag_number) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
413 layout->set_flag_at(flag_number); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
414 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
415 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
416 |
0 | 417 public: |
418 // Constructor for invalid ProfileData. | |
419 ProfileData(); | |
420 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
421 u2 bci() const { |
0 | 422 return data()->bci(); |
423 } | |
424 | |
425 address dp() { | |
426 return (address)_data; | |
427 } | |
428 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
429 int trap_state() const { |
0 | 430 return data()->trap_state(); |
431 } | |
432 void set_trap_state(int new_state) { | |
433 data()->set_trap_state(new_state); | |
434 } | |
435 | |
436 // Type checking | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
437 virtual bool is_BitData() const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
438 virtual bool is_CounterData() const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
439 virtual bool is_JumpData() const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
440 virtual bool is_ReceiverTypeData()const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
441 virtual bool is_VirtualCallData() const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
442 virtual bool is_RetData() const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
443 virtual bool is_BranchData() const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
444 virtual bool is_ArrayData() const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
445 virtual bool is_MultiBranchData() const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
446 virtual bool is_ArgInfoData() const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
447 virtual bool is_CallTypeData() const { return false; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
448 virtual bool is_VirtualCallTypeData()const { return false; } |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
449 virtual bool is_ParametersTypeData() const { return false; } |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
450 virtual bool is_SpeculativeTrapData()const { return false; } |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
451 |
0 | 452 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
453 BitData* as_BitData() const { |
0 | 454 assert(is_BitData(), "wrong type"); |
455 return is_BitData() ? (BitData*) this : NULL; | |
456 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
457 CounterData* as_CounterData() const { |
0 | 458 assert(is_CounterData(), "wrong type"); |
459 return is_CounterData() ? (CounterData*) this : NULL; | |
460 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
461 JumpData* as_JumpData() const { |
0 | 462 assert(is_JumpData(), "wrong type"); |
463 return is_JumpData() ? (JumpData*) this : NULL; | |
464 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
465 ReceiverTypeData* as_ReceiverTypeData() const { |
0 | 466 assert(is_ReceiverTypeData(), "wrong type"); |
467 return is_ReceiverTypeData() ? (ReceiverTypeData*)this : NULL; | |
468 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
469 VirtualCallData* as_VirtualCallData() const { |
0 | 470 assert(is_VirtualCallData(), "wrong type"); |
471 return is_VirtualCallData() ? (VirtualCallData*)this : NULL; | |
472 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
473 RetData* as_RetData() const { |
0 | 474 assert(is_RetData(), "wrong type"); |
475 return is_RetData() ? (RetData*) this : NULL; | |
476 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
477 BranchData* as_BranchData() const { |
0 | 478 assert(is_BranchData(), "wrong type"); |
479 return is_BranchData() ? (BranchData*) this : NULL; | |
480 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
481 ArrayData* as_ArrayData() const { |
0 | 482 assert(is_ArrayData(), "wrong type"); |
483 return is_ArrayData() ? (ArrayData*) this : NULL; | |
484 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
485 MultiBranchData* as_MultiBranchData() const { |
0 | 486 assert(is_MultiBranchData(), "wrong type"); |
487 return is_MultiBranchData() ? (MultiBranchData*)this : NULL; | |
488 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
489 ArgInfoData* as_ArgInfoData() const { |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
490 assert(is_ArgInfoData(), "wrong type"); |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
491 return is_ArgInfoData() ? (ArgInfoData*)this : NULL; |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
492 } |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
493 CallTypeData* as_CallTypeData() const { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
494 assert(is_CallTypeData(), "wrong type"); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
495 return is_CallTypeData() ? (CallTypeData*)this : NULL; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
496 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
497 VirtualCallTypeData* as_VirtualCallTypeData() const { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
498 assert(is_VirtualCallTypeData(), "wrong type"); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
499 return is_VirtualCallTypeData() ? (VirtualCallTypeData*)this : NULL; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
500 } |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
501 ParametersTypeData* as_ParametersTypeData() const { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
502 assert(is_ParametersTypeData(), "wrong type"); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
503 return is_ParametersTypeData() ? (ParametersTypeData*)this : NULL; |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
504 } |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
505 SpeculativeTrapData* as_SpeculativeTrapData() const { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
506 assert(is_SpeculativeTrapData(), "wrong type"); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
507 return is_SpeculativeTrapData() ? (SpeculativeTrapData*)this : NULL; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
508 } |
0 | 509 |
510 | |
511 // Subclass specific initialization | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
512 virtual void post_initialize(BytecodeStream* stream, MethodData* mdo) {} |
0 | 513 |
514 // GC support | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
515 virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) {} |
0 | 516 |
517 // CI translation: ProfileData can represent both MethodDataOop data | |
518 // as well as CIMethodData data. This function is provided for translating | |
519 // an oop in a ProfileData to the ci equivalent. Generally speaking, | |
520 // most ProfileData don't require any translation, so we provide the null | |
521 // translation here, and the required translators are in the ci subclasses. | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
522 virtual void translate_from(const ProfileData* data) {} |
0 | 523 |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
524 virtual void print_data_on(outputStream* st, const char* extra = NULL) const { |
0 | 525 ShouldNotReachHere(); |
526 } | |
527 | |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
528 void print_data_on(outputStream* st, const MethodData* md) const; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
529 |
0 | 530 #ifndef PRODUCT |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
531 void print_shared(outputStream* st, const char* name, const char* extra) const; |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
532 void tab(outputStream* st, bool first = false) const; |
0 | 533 #endif |
534 }; | |
535 | |
536 // BitData | |
537 // | |
538 // A BitData holds a flag or two in its header. | |
539 class BitData : public ProfileData { | |
540 protected: | |
541 enum { | |
542 // null_seen: | |
543 // saw a null operand (cast/aastore/instanceof) | |
8616
d343737786fe
changed profiling of exceptions so that the ExceptionSeen flag also works without GRAALVM
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8611
diff
changeset
|
544 null_seen_flag = DataLayout::first_flag + 0 |
d343737786fe
changed profiling of exceptions so that the ExceptionSeen flag also works without GRAALVM
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8611
diff
changeset
|
545 #ifdef GRAAL |
d343737786fe
changed profiling of exceptions so that the ExceptionSeen flag also works without GRAALVM
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8611
diff
changeset
|
546 // bytecode threw any exception |
d343737786fe
changed profiling of exceptions so that the ExceptionSeen flag also works without GRAALVM
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8611
diff
changeset
|
547 , exception_seen_flag = null_seen_flag + 1 |
d343737786fe
changed profiling of exceptions so that the ExceptionSeen flag also works without GRAALVM
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8611
diff
changeset
|
548 #endif |
0 | 549 }; |
550 enum { bit_cell_count = 0 }; // no additional data fields needed. | |
551 public: | |
552 BitData(DataLayout* layout) : ProfileData(layout) { | |
553 } | |
554 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
555 virtual bool is_BitData() const { return true; } |
0 | 556 |
557 static int static_cell_count() { | |
558 return bit_cell_count; | |
559 } | |
560 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
561 virtual int cell_count() const { |
0 | 562 return static_cell_count(); |
563 } | |
564 | |
565 // Accessor | |
566 | |
567 // The null_seen flag bit is specially known to the interpreter. | |
568 // Consulting it allows the compiler to avoid setting up null_check traps. | |
569 bool null_seen() { return flag_at(null_seen_flag); } | |
570 void set_null_seen() { set_flag_at(null_seen_flag); } | |
8616
d343737786fe
changed profiling of exceptions so that the ExceptionSeen flag also works without GRAALVM
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8611
diff
changeset
|
571 #ifdef GRAAL |
d343737786fe
changed profiling of exceptions so that the ExceptionSeen flag also works without GRAALVM
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8611
diff
changeset
|
572 // true if an exception was thrown at the specific BCI |
d343737786fe
changed profiling of exceptions so that the ExceptionSeen flag also works without GRAALVM
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8611
diff
changeset
|
573 bool exception_seen() { return flag_at(exception_seen_flag); } |
d343737786fe
changed profiling of exceptions so that the ExceptionSeen flag also works without GRAALVM
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8611
diff
changeset
|
574 void set_exception_seen() { set_flag_at(exception_seen_flag); } |
d343737786fe
changed profiling of exceptions so that the ExceptionSeen flag also works without GRAALVM
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8611
diff
changeset
|
575 #endif |
0 | 576 |
577 // Code generation support | |
578 static int null_seen_byte_constant() { | |
579 return flag_number_to_byte_constant(null_seen_flag); | |
580 } | |
581 | |
582 static ByteSize bit_data_size() { | |
583 return cell_offset(bit_cell_count); | |
584 } | |
585 | |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
586 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
587 static int bit_data_size_in_bytes() { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
588 return cell_offset_in_bytes(bit_cell_count); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
589 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
590 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
591 static void set_null_seen(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
592 set_flag_at(layout, null_seen_flag); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
593 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
594 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
595 static DataLayout* advance(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
596 return (DataLayout*) (((address)layout) + (ssize_t)BitData::bit_data_size_in_bytes()); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
597 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
598 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
599 |
0 | 600 #ifndef PRODUCT |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
601 void print_data_on(outputStream* st, const char* extra = NULL) const; |
0 | 602 #endif |
603 }; | |
604 | |
605 // CounterData | |
606 // | |
607 // A CounterData corresponds to a simple counter. | |
608 class CounterData : public BitData { | |
609 protected: | |
610 enum { | |
611 count_off, | |
612 counter_cell_count | |
613 }; | |
614 public: | |
615 CounterData(DataLayout* layout) : BitData(layout) {} | |
616 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
617 virtual bool is_CounterData() const { return true; } |
0 | 618 |
619 static int static_cell_count() { | |
620 return counter_cell_count; | |
621 } | |
622 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
623 virtual int cell_count() const { |
0 | 624 return static_cell_count(); |
625 } | |
626 | |
627 // Direct accessor | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
628 uint count() const { |
0 | 629 return uint_at(count_off); |
630 } | |
631 | |
632 // Code generation support | |
633 static ByteSize count_offset() { | |
634 return cell_offset(count_off); | |
635 } | |
636 static ByteSize counter_data_size() { | |
637 return cell_offset(counter_cell_count); | |
638 } | |
639 | |
1251
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
640 void set_count(uint count) { |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
641 set_uint_at(count_off, count); |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
642 } |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
643 |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
644 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
645 static int counter_data_size_in_bytes() { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
646 return cell_offset_in_bytes(counter_cell_count); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
647 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
648 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
649 static void increment_count_no_overflow(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
650 increment_uint_at_no_overflow(layout, count_off); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
651 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
652 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
653 // Support counter decrementation at checkcast / subtype check failed. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
654 static void decrement_count(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
655 increment_uint_at_no_overflow(layout, count_off, -1); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
656 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
657 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
658 static DataLayout* advance(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
659 return (DataLayout*) (((address)layout) + (ssize_t)CounterData::counter_data_size_in_bytes()); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
660 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
661 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
662 |
0 | 663 #ifndef PRODUCT |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
664 void print_data_on(outputStream* st, const char* extra = NULL) const; |
0 | 665 #endif |
666 }; | |
667 | |
668 // JumpData | |
669 // | |
670 // A JumpData is used to access profiling information for a direct | |
671 // branch. It is a counter, used for counting the number of branches, | |
672 // plus a data displacement, used for realigning the data pointer to | |
673 // the corresponding target bci. | |
674 class JumpData : public ProfileData { | |
675 protected: | |
676 enum { | |
677 taken_off_set, | |
678 displacement_off_set, | |
679 jump_cell_count | |
680 }; | |
681 | |
682 void set_displacement(int displacement) { | |
683 set_int_at(displacement_off_set, displacement); | |
684 } | |
685 | |
686 public: | |
687 JumpData(DataLayout* layout) : ProfileData(layout) { | |
688 assert(layout->tag() == DataLayout::jump_data_tag || | |
689 layout->tag() == DataLayout::branch_data_tag, "wrong type"); | |
690 } | |
691 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
692 virtual bool is_JumpData() const { return true; } |
0 | 693 |
694 static int static_cell_count() { | |
695 return jump_cell_count; | |
696 } | |
697 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
698 virtual int cell_count() const { |
0 | 699 return static_cell_count(); |
700 } | |
701 | |
702 // Direct accessor | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
703 uint taken() const { |
0 | 704 return uint_at(taken_off_set); |
705 } | |
3905
c26de9aef2ed
7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents:
3345
diff
changeset
|
706 |
c26de9aef2ed
7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents:
3345
diff
changeset
|
707 void set_taken(uint cnt) { |
c26de9aef2ed
7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents:
3345
diff
changeset
|
708 set_uint_at(taken_off_set, cnt); |
c26de9aef2ed
7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents:
3345
diff
changeset
|
709 } |
c26de9aef2ed
7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents:
3345
diff
changeset
|
710 |
0 | 711 // Saturating counter |
712 uint inc_taken() { | |
713 uint cnt = taken() + 1; | |
714 // Did we wrap? Will compiler screw us?? | |
715 if (cnt == 0) cnt--; | |
716 set_uint_at(taken_off_set, cnt); | |
717 return cnt; | |
718 } | |
719 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
720 int displacement() const { |
0 | 721 return int_at(displacement_off_set); |
722 } | |
723 | |
724 // Code generation support | |
725 static ByteSize taken_offset() { | |
726 return cell_offset(taken_off_set); | |
727 } | |
728 | |
729 static ByteSize displacement_offset() { | |
730 return cell_offset(displacement_off_set); | |
731 } | |
732 | |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
733 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
734 static void increment_taken_count_no_overflow(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
735 increment_uint_at_no_overflow(layout, taken_off_set); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
736 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
737 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
738 static DataLayout* advance_taken(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
739 return (DataLayout*) (((address)layout) + (ssize_t)int_at(layout, displacement_off_set)); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
740 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
741 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
742 static uint taken_count(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
743 return (uint) uint_at(layout, taken_off_set); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
744 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
745 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
746 |
0 | 747 // Specific initialization. |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
748 void post_initialize(BytecodeStream* stream, MethodData* mdo); |
0 | 749 |
750 #ifndef PRODUCT | |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
751 void print_data_on(outputStream* st, const char* extra = NULL) const; |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
752 #endif |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
753 }; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
754 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
755 // Entries in a ProfileData object to record types: it can either be |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
756 // none (no profile), unknown (conflicting profile data) or a klass if |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
757 // a single one is seen. Whether a null reference was seen is also |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
758 // recorded. No counter is associated with the type and a single type |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
759 // is tracked (unlike VirtualCallData). |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
760 class TypeEntries { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
761 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
762 public: |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
763 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
764 // A single cell is used to record information for a type: |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
765 // - the cell is initialized to 0 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
766 // - when a type is discovered it is stored in the cell |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
767 // - bit zero of the cell is used to record whether a null reference |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
768 // was encountered or not |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
769 // - bit 1 is set to record a conflict in the type information |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
770 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
771 enum { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
772 null_seen = 1, |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
773 type_mask = ~null_seen, |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
774 type_unknown = 2, |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
775 status_bits = null_seen | type_unknown, |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
776 type_klass_mask = ~status_bits |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
777 }; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
778 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
779 // what to initialize a cell to |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
780 static intptr_t type_none() { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
781 return 0; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
782 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
783 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
784 // null seen = bit 0 set? |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
785 static bool was_null_seen(intptr_t v) { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
786 return (v & null_seen) != 0; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
787 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
788 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
789 // conflicting type information = bit 1 set? |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
790 static bool is_type_unknown(intptr_t v) { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
791 return (v & type_unknown) != 0; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
792 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
793 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
794 // not type information yet = all bits cleared, ignoring bit 0? |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
795 static bool is_type_none(intptr_t v) { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
796 return (v & type_mask) == 0; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
797 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
798 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
799 // recorded type: cell without bit 0 and 1 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
800 static intptr_t klass_part(intptr_t v) { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
801 intptr_t r = v & type_klass_mask; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
802 return r; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
803 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
804 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
805 // type recorded |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
806 static Klass* valid_klass(intptr_t k) { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
807 if (!is_type_none(k) && |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
808 !is_type_unknown(k)) { |
13080 | 809 Klass* res = (Klass*)klass_part(k); |
810 assert(res != NULL, "invalid"); | |
811 return res; | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
812 } else { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
813 return NULL; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
814 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
815 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
816 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
817 static intptr_t with_status(intptr_t k, intptr_t in) { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
818 return k | (in & status_bits); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
819 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
820 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
821 static intptr_t with_status(Klass* k, intptr_t in) { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
822 return with_status((intptr_t)k, in); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
823 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
824 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
825 #ifndef PRODUCT |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
826 static void print_klass(outputStream* st, intptr_t k); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
827 #endif |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
828 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
829 // GC support |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
830 static bool is_loader_alive(BoolObjectClosure* is_alive_cl, intptr_t p); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
831 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
832 protected: |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
833 // ProfileData object these entries are part of |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
834 ProfileData* _pd; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
835 // offset within the ProfileData object where the entries start |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
836 const int _base_off; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
837 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
838 TypeEntries(int base_off) |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
839 : _base_off(base_off), _pd(NULL) {} |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
840 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
841 void set_intptr_at(int index, intptr_t value) { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
842 _pd->set_intptr_at(index, value); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
843 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
844 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
845 intptr_t intptr_at(int index) const { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
846 return _pd->intptr_at(index); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
847 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
848 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
849 public: |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
850 void set_profile_data(ProfileData* pd) { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
851 _pd = pd; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
852 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
853 }; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
854 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
855 // Type entries used for arguments passed at a call and parameters on |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
856 // method entry. 2 cells per entry: one for the type encoded as in |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
857 // TypeEntries and one initialized with the stack slot where the |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
858 // profiled object is to be found so that the interpreter can locate |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
859 // it quickly. |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
860 class TypeStackSlotEntries : public TypeEntries { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
861 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
862 private: |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
863 enum { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
864 stack_slot_entry, |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
865 type_entry, |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
866 per_arg_cell_count |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
867 }; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
868 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
869 // offset of cell for stack slot for entry i within ProfileData object |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
870 int stack_slot_offset(int i) const { |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
871 return _base_off + stack_slot_local_offset(i); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
872 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
873 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
874 protected: |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
875 const int _number_of_entries; |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
876 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
877 // offset of cell for type for entry i within ProfileData object |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
878 int type_offset(int i) const { |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
879 return _base_off + type_local_offset(i); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
880 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
881 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
882 public: |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
883 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
884 TypeStackSlotEntries(int base_off, int nb_entries) |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
885 : TypeEntries(base_off), _number_of_entries(nb_entries) {} |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
886 |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
887 static int compute_cell_count(Symbol* signature, bool include_receiver, int max); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
888 |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
889 void post_initialize(Symbol* signature, bool has_receiver, bool include_receiver); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
890 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
891 // offset of cell for stack slot for entry i within this block of cells for a TypeStackSlotEntries |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
892 static int stack_slot_local_offset(int i) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
893 return i * per_arg_cell_count + stack_slot_entry; |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
894 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
895 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
896 // offset of cell for type for entry i within this block of cells for a TypeStackSlotEntries |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
897 static int type_local_offset(int i) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
898 return i * per_arg_cell_count + type_entry; |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
899 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
900 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
901 // stack slot for entry i |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
902 uint stack_slot(int i) const { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
903 assert(i >= 0 && i < _number_of_entries, "oob"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
904 return _pd->uint_at(stack_slot_offset(i)); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
905 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
906 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
907 // set stack slot for entry i |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
908 void set_stack_slot(int i, uint num) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
909 assert(i >= 0 && i < _number_of_entries, "oob"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
910 _pd->set_uint_at(stack_slot_offset(i), num); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
911 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
912 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
913 // type for entry i |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
914 intptr_t type(int i) const { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
915 assert(i >= 0 && i < _number_of_entries, "oob"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
916 return _pd->intptr_at(type_offset(i)); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
917 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
918 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
919 // set type for entry i |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
920 void set_type(int i, intptr_t k) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
921 assert(i >= 0 && i < _number_of_entries, "oob"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
922 _pd->set_intptr_at(type_offset(i), k); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
923 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
924 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
925 static ByteSize per_arg_size() { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
926 return in_ByteSize(per_arg_cell_count * DataLayout::cell_size); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
927 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
928 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
929 static int per_arg_count() { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
930 return per_arg_cell_count ; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
931 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
932 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
933 // GC support |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
934 void clean_weak_klass_links(BoolObjectClosure* is_alive_closure); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
935 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
936 #ifndef PRODUCT |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
937 void print_data_on(outputStream* st) const; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
938 #endif |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
939 }; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
940 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
941 // Type entry used for return from a call. A single cell to record the |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
942 // type. |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
943 class ReturnTypeEntry : public TypeEntries { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
944 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
945 private: |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
946 enum { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
947 cell_count = 1 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
948 }; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
949 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
950 public: |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
951 ReturnTypeEntry(int base_off) |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
952 : TypeEntries(base_off) {} |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
953 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
954 void post_initialize() { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
955 set_type(type_none()); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
956 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
957 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
958 intptr_t type() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
959 return _pd->intptr_at(_base_off); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
960 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
961 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
962 void set_type(intptr_t k) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
963 _pd->set_intptr_at(_base_off, k); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
964 } |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
965 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
966 static int static_cell_count() { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
967 return cell_count; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
968 } |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
969 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
970 static ByteSize size() { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
971 return in_ByteSize(cell_count * DataLayout::cell_size); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
972 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
973 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
974 ByteSize type_offset() { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
975 return DataLayout::cell_offset(_base_off); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
976 } |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
977 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
978 // GC support |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
979 void clean_weak_klass_links(BoolObjectClosure* is_alive_closure); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
980 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
981 #ifndef PRODUCT |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
982 void print_data_on(outputStream* st) const; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
983 #endif |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
984 }; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
985 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
986 // Entries to collect type information at a call: contains arguments |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
987 // (TypeStackSlotEntries), a return type (ReturnTypeEntry) and a |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
988 // number of cells. Because the number of cells for the return type is |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
989 // smaller than the number of cells for the type of an arguments, the |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
990 // number of cells is used to tell how many arguments are profiled and |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
991 // whether a return value is profiled. See has_arguments() and |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
992 // has_return(). |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
993 class TypeEntriesAtCall { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
994 private: |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
995 static int stack_slot_local_offset(int i) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
996 return header_cell_count() + TypeStackSlotEntries::stack_slot_local_offset(i); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
997 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
998 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
999 static int argument_type_local_offset(int i) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1000 return header_cell_count() + TypeStackSlotEntries::type_local_offset(i);; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1001 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1002 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1003 public: |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1004 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1005 static int header_cell_count() { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1006 return 1; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1007 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1008 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1009 static int cell_count_local_offset() { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1010 return 0; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1011 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1012 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1013 static int compute_cell_count(BytecodeStream* stream); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1014 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1015 static void initialize(DataLayout* dl, int base, int cell_count) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1016 int off = base + cell_count_local_offset(); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1017 dl->set_cell_at(off, cell_count - base - header_cell_count()); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1018 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1019 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1020 static bool arguments_profiling_enabled(); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1021 static bool return_profiling_enabled(); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1022 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1023 // Code generation support |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1024 static ByteSize cell_count_offset() { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1025 return in_ByteSize(cell_count_local_offset() * DataLayout::cell_size); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1026 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1027 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1028 static ByteSize args_data_offset() { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1029 return in_ByteSize(header_cell_count() * DataLayout::cell_size); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1030 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1031 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1032 static ByteSize stack_slot_offset(int i) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1033 return in_ByteSize(stack_slot_local_offset(i) * DataLayout::cell_size); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1034 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1035 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1036 static ByteSize argument_type_offset(int i) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1037 return in_ByteSize(argument_type_local_offset(i) * DataLayout::cell_size); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1038 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1039 }; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1040 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1041 // CallTypeData |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1042 // |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1043 // A CallTypeData is used to access profiling information about a non |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1044 // virtual call for which we collect type information about arguments |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1045 // and return value. |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1046 class CallTypeData : public CounterData { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1047 private: |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1048 // entries for arguments if any |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1049 TypeStackSlotEntries _args; |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1050 // entry for return type if any |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1051 ReturnTypeEntry _ret; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1052 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1053 int cell_count_global_offset() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1054 return CounterData::static_cell_count() + TypeEntriesAtCall::cell_count_local_offset(); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1055 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1056 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1057 // number of cells not counting the header |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1058 int cell_count_no_header() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1059 return uint_at(cell_count_global_offset()); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1060 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1061 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1062 void check_number_of_arguments(int total) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1063 assert(number_of_arguments() == total, "should be set in DataLayout::initialize"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1064 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1065 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1066 public: |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1067 CallTypeData(DataLayout* layout) : |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1068 CounterData(layout), |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1069 _args(CounterData::static_cell_count()+TypeEntriesAtCall::header_cell_count(), number_of_arguments()), |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1070 _ret(cell_count() - ReturnTypeEntry::static_cell_count()) |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1071 { |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1072 assert(layout->tag() == DataLayout::call_type_data_tag, "wrong type"); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1073 // Some compilers (VC++) don't want this passed in member initialization list |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1074 _args.set_profile_data(this); |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1075 _ret.set_profile_data(this); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1076 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1077 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1078 const TypeStackSlotEntries* args() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1079 assert(has_arguments(), "no profiling of arguments"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1080 return &_args; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1081 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1082 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1083 const ReturnTypeEntry* ret() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1084 assert(has_return(), "no profiling of return value"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1085 return &_ret; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1086 } |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1087 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1088 virtual bool is_CallTypeData() const { return true; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1089 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1090 static int static_cell_count() { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1091 return -1; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1092 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1093 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1094 static int compute_cell_count(BytecodeStream* stream) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1095 return CounterData::static_cell_count() + TypeEntriesAtCall::compute_cell_count(stream); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1096 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1097 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1098 static void initialize(DataLayout* dl, int cell_count) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1099 TypeEntriesAtCall::initialize(dl, CounterData::static_cell_count(), cell_count); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1100 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1101 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1102 virtual void post_initialize(BytecodeStream* stream, MethodData* mdo); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1103 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1104 virtual int cell_count() const { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1105 return CounterData::static_cell_count() + |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1106 TypeEntriesAtCall::header_cell_count() + |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1107 int_at_unchecked(cell_count_global_offset()); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1108 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1109 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1110 int number_of_arguments() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1111 return cell_count_no_header() / TypeStackSlotEntries::per_arg_count(); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1112 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1113 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1114 void set_argument_type(int i, Klass* k) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1115 assert(has_arguments(), "no arguments!"); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1116 intptr_t current = _args.type(i); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1117 _args.set_type(i, TypeEntries::with_status(k, current)); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1118 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1119 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1120 void set_return_type(Klass* k) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1121 assert(has_return(), "no return!"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1122 intptr_t current = _ret.type(); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1123 _ret.set_type(TypeEntries::with_status(k, current)); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1124 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1125 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1126 // An entry for a return value takes less space than an entry for an |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1127 // argument so if the number of cells exceeds the number of cells |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1128 // needed for an argument, this object contains type information for |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1129 // at least one argument. |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1130 bool has_arguments() const { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1131 bool res = cell_count_no_header() >= TypeStackSlotEntries::per_arg_count(); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1132 assert (!res || TypeEntriesAtCall::arguments_profiling_enabled(), "no profiling of arguments"); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1133 return res; |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1134 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1135 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1136 // An entry for a return value takes less space than an entry for an |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1137 // argument, so if the remainder of the number of cells divided by |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1138 // the number of cells for an argument is not null, a return value |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1139 // is profiled in this object. |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1140 bool has_return() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1141 bool res = (cell_count_no_header() % TypeStackSlotEntries::per_arg_count()) != 0; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1142 assert (!res || TypeEntriesAtCall::return_profiling_enabled(), "no profiling of return values"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1143 return res; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1144 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1145 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1146 // Code generation support |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1147 static ByteSize args_data_offset() { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1148 return cell_offset(CounterData::static_cell_count()) + TypeEntriesAtCall::args_data_offset(); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1149 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1150 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1151 // GC support |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1152 virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1153 if (has_arguments()) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1154 _args.clean_weak_klass_links(is_alive_closure); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1155 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1156 if (has_return()) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1157 _ret.clean_weak_klass_links(is_alive_closure); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1158 } |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1159 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1160 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1161 #ifndef PRODUCT |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
1162 virtual void print_data_on(outputStream* st, const char* extra = NULL) const; |
0 | 1163 #endif |
1164 }; | |
1165 | |
1166 // ReceiverTypeData | |
1167 // | |
1168 // A ReceiverTypeData is used to access profiling information about a | |
1169 // dynamic type check. It consists of a counter which counts the total times | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
1170 // that the check is reached, and a series of (Klass*, count) pairs |
0 | 1171 // which are used to store a type profile for the receiver of the check. |
1172 class ReceiverTypeData : public CounterData { | |
1173 protected: | |
1174 enum { | |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
1175 #ifdef GRAAL |
9762
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1176 // Description of the different counters |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1177 // ReceiverTypeData for instanceof/checkcast/aastore: |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1178 // C1/C2: count is incremented on type overflow and decremented for failed type checks |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1179 // Graal: count decremented for failed type checks and nonprofiled_count is incremented on type overflow |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1180 // TODO (chaeubl): in fact, Graal should also increment the count for failed type checks to mimic the C1/C2 behavior |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1181 // VirtualCallData for invokevirtual/invokeinterface: |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1182 // C1/C2: count is incremented on type overflow |
13108
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1183 // Graal: count is incremented on type overflow, nonprofiled_count is incremented on method overflow |
9762
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1184 |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1185 // Graal is interested in knowing the percentage of type checks involving a type not explicitly in the profile |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1186 nonprofiled_count_off_set = counter_cell_count, |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
1187 receiver0_offset, |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
1188 #else |
0 | 1189 receiver0_offset = counter_cell_count, |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
1190 #endif |
0 | 1191 count0_offset, |
1192 receiver_type_row_cell_count = (count0_offset + 1) - receiver0_offset | |
1193 }; | |
1194 | |
1195 public: | |
1196 ReceiverTypeData(DataLayout* layout) : CounterData(layout) { | |
1197 assert(layout->tag() == DataLayout::receiver_type_data_tag || | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1198 layout->tag() == DataLayout::virtual_call_data_tag || |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1199 layout->tag() == DataLayout::virtual_call_type_data_tag, "wrong type"); |
0 | 1200 } |
1201 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1202 virtual bool is_ReceiverTypeData() const { return true; } |
0 | 1203 |
1204 static int static_cell_count() { | |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
1205 return counter_cell_count + (uint) TypeProfileWidth * receiver_type_row_cell_count GRAAL_ONLY(+ 1); |
0 | 1206 } |
1207 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1208 virtual int cell_count() const { |
0 | 1209 return static_cell_count(); |
1210 } | |
1211 | |
1212 // Direct accessors | |
1213 static uint row_limit() { | |
1214 return TypeProfileWidth; | |
1215 } | |
1216 static int receiver_cell_index(uint row) { | |
1217 return receiver0_offset + row * receiver_type_row_cell_count; | |
1218 } | |
1219 static int receiver_count_cell_index(uint row) { | |
1220 return count0_offset + row * receiver_type_row_cell_count; | |
1221 } | |
1222 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1223 Klass* receiver(uint row) const { |
0 | 1224 assert(row < row_limit(), "oob"); |
1225 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
1226 Klass* recv = (Klass*)intptr_at(receiver_cell_index(row)); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
1227 assert(recv == NULL || recv->is_klass(), "wrong type"); |
0 | 1228 return recv; |
1229 } | |
1230 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
1231 void set_receiver(uint row, Klass* k) { |
941 | 1232 assert((uint)row < row_limit(), "oob"); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
1233 set_intptr_at(receiver_cell_index(row), (uintptr_t)k); |
941 | 1234 } |
1235 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1236 uint receiver_count(uint row) const { |
0 | 1237 assert(row < row_limit(), "oob"); |
1238 return uint_at(receiver_count_cell_index(row)); | |
1239 } | |
1240 | |
941 | 1241 void set_receiver_count(uint row, uint count) { |
1242 assert(row < row_limit(), "oob"); | |
1243 set_uint_at(receiver_count_cell_index(row), count); | |
1244 } | |
1245 | |
1246 void clear_row(uint row) { | |
1247 assert(row < row_limit(), "oob"); | |
1251
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1248 // Clear total count - indicator of polymorphic call site. |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1249 // The site may look like as monomorphic after that but |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1250 // it allow to have more accurate profiling information because |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1251 // there was execution phase change since klasses were unloaded. |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1252 // If the site is still polymorphic then MDO will be updated |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1253 // to reflect it. But it could be the case that the site becomes |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1254 // only bimorphic. Then keeping total count not 0 will be wrong. |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1255 // Even if we use monomorphic (when it is not) for compilation |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1256 // we will only have trap, deoptimization and recompile again |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1257 // with updated MDO after executing method in Interpreter. |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1258 // An additional receiver will be recorded in the cleaned row |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1259 // during next call execution. |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1260 // |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1261 // Note: our profiling logic works with empty rows in any slot. |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1262 // We do sorting a profiling info (ciCallProfile) for compilation. |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1263 // |
576e77447e3c
6923002: assert(false,"this call site should not be polymorphic")
kvn
parents:
1206
diff
changeset
|
1264 set_count(0); |
941 | 1265 set_receiver(row, NULL); |
1266 set_receiver_count(row, 0); | |
9762
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1267 #ifdef GRAAL |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1268 if (!this->is_VirtualCallData()) { |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1269 // if this is a ReceiverTypeData for Graal, the nonprofiled_count |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1270 // must also be reset (see "Description of the different counters" above) |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1271 set_nonprofiled_count(0); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1272 } |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1273 #endif |
941 | 1274 } |
1275 | |
0 | 1276 // Code generation support |
1277 static ByteSize receiver_offset(uint row) { | |
1278 return cell_offset(receiver_cell_index(row)); | |
1279 } | |
1280 static ByteSize receiver_count_offset(uint row) { | |
1281 return cell_offset(receiver_count_cell_index(row)); | |
1282 } | |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
1283 #ifdef GRAAL |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
1284 static ByteSize nonprofiled_receiver_count_offset() { |
9762
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1285 return cell_offset(nonprofiled_count_off_set); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1286 } |
13108
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1287 uint nonprofiled_count() const { |
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1288 return uint_at(nonprofiled_count_off_set); |
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1289 } |
9762
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1290 void set_nonprofiled_count(uint count) { |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1291 set_uint_at(nonprofiled_count_off_set, count); |
7154
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
1292 } |
5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
1293 #endif |
0 | 1294 static ByteSize receiver_type_data_size() { |
1295 return cell_offset(static_cell_count()); | |
1296 } | |
1297 | |
1298 // GC support | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
1299 virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure); |
0 | 1300 |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1301 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1302 static int receiver_type_data_size_in_bytes() { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1303 return cell_offset_in_bytes(static_cell_count()); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1304 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1305 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1306 static Klass *receiver_unchecked(DataLayout* layout, uint row) { |
14433
018b357638aa
8028514: PPC64: Fix C++ Interpreter after '7195622: CheckUnhandledOops has limited usefulness now'
simonis
parents:
14422
diff
changeset
|
1307 Klass* recv = (Klass*)layout->cell_at(receiver_cell_index(row)); |
018b357638aa
8028514: PPC64: Fix C++ Interpreter after '7195622: CheckUnhandledOops has limited usefulness now'
simonis
parents:
14422
diff
changeset
|
1308 return recv; |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1309 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1310 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1311 static void increment_receiver_count_no_overflow(DataLayout* layout, Klass *rcvr) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1312 const int num_rows = row_limit(); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1313 // Receiver already exists? |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1314 for (int row = 0; row < num_rows; row++) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1315 if (receiver_unchecked(layout, row) == rcvr) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1316 increment_uint_at_no_overflow(layout, receiver_count_cell_index(row)); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1317 return; |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1318 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1319 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1320 // New receiver, find a free slot. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1321 for (int row = 0; row < num_rows; row++) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1322 if (receiver_unchecked(layout, row) == NULL) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1323 set_intptr_at(layout, receiver_cell_index(row), (intptr_t)rcvr); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1324 increment_uint_at_no_overflow(layout, receiver_count_cell_index(row)); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1325 return; |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1326 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1327 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1328 // Receiver did not match any saved receiver and there is no empty row for it. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1329 // Increment total counter to indicate polymorphic case. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1330 increment_count_no_overflow(layout); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1331 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1332 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1333 static DataLayout* advance(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1334 return (DataLayout*) (((address)layout) + (ssize_t)ReceiverTypeData::receiver_type_data_size_in_bytes()); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1335 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1336 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1337 |
0 | 1338 #ifndef PRODUCT |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1339 void print_receiver_data_on(outputStream* st) const; |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
1340 void print_data_on(outputStream* st, const char* extra = NULL) const; |
0 | 1341 #endif |
1342 }; | |
1343 | |
1344 // VirtualCallData | |
1345 // | |
1346 // A VirtualCallData is used to access profiling information about a | |
1347 // virtual call. For now, it has nothing more than a ReceiverTypeData. | |
1348 class VirtualCallData : public ReceiverTypeData { | |
1349 public: | |
1350 VirtualCallData(DataLayout* layout) : ReceiverTypeData(layout) { | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1351 assert(layout->tag() == DataLayout::virtual_call_data_tag || |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1352 layout->tag() == DataLayout::virtual_call_type_data_tag, "wrong type"); |
0 | 1353 } |
1354 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1355 virtual bool is_VirtualCallData() const { return true; } |
0 | 1356 |
1357 static int static_cell_count() { | |
1358 // At this point we could add more profile state, e.g., for arguments. | |
1359 // But for now it's the same size as the base record type. | |
9760
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1360 return ReceiverTypeData::static_cell_count() GRAAL_ONLY(+ (uint) MethodProfileWidth * receiver_type_row_cell_count); |
0 | 1361 } |
1362 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1363 virtual int cell_count() const { |
0 | 1364 return static_cell_count(); |
1365 } | |
1366 | |
1367 // Direct accessors | |
1368 static ByteSize virtual_call_data_size() { | |
1369 return cell_offset(static_cell_count()); | |
1370 } | |
1371 | |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1372 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1373 static int virtual_call_data_size_in_bytes() { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1374 return cell_offset_in_bytes(static_cell_count()); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1375 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1376 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1377 static DataLayout* advance(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1378 return (DataLayout*) (((address)layout) + (ssize_t)VirtualCallData::virtual_call_data_size_in_bytes()); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1379 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1380 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1381 |
9760
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1382 #ifdef GRAAL |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1383 static ByteSize method_offset(uint row) { |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1384 return cell_offset(method_cell_index(row)); |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1385 } |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1386 static ByteSize method_count_offset(uint row) { |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1387 return cell_offset(method_count_cell_index(row)); |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1388 } |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1389 static int method_cell_index(uint row) { |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1390 return receiver0_offset + (row + TypeProfileWidth) * receiver_type_row_cell_count; |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1391 } |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1392 static int method_count_cell_index(uint row) { |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1393 return count0_offset + (row + TypeProfileWidth) * receiver_type_row_cell_count; |
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1394 } |
9762
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1395 static uint method_row_limit() { |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1396 return MethodProfileWidth; |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1397 } |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1398 |
13108
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1399 Method* method(uint row) const { |
9762
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1400 assert(row < method_row_limit(), "oob"); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1401 |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1402 Method* method = (Method*)intptr_at(method_cell_index(row)); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1403 assert(method == NULL || method->is_method(), "must be"); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1404 return method; |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1405 } |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1406 |
13108
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1407 uint method_count(uint row) const { |
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1408 assert(row < method_row_limit(), "oob"); |
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1409 return uint_at(method_count_cell_index(row)); |
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1410 } |
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1411 |
9762
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1412 void set_method(uint row, Method* m) { |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1413 assert((uint)row < method_row_limit(), "oob"); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1414 set_intptr_at(method_cell_index(row), (uintptr_t)m); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1415 } |
9760
c76b43ed5089
Added infrastructure for recording invoked methods in the profiling information.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9088
diff
changeset
|
1416 |
9762
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1417 void set_method_count(uint row, uint count) { |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1418 assert(row < method_row_limit(), "oob"); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1419 set_uint_at(method_count_cell_index(row), count); |
0 | 1420 } |
1421 | |
9762
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1422 void clear_method_row(uint row) { |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1423 assert(row < method_row_limit(), "oob"); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1424 // Clear total count - indicator of polymorphic call site (see comment for clear_row() in ReceiverTypeData). |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1425 set_nonprofiled_count(0); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1426 set_method(row, NULL); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1427 set_method_count(row, 0); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1428 } |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1429 |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1430 // GC support |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1431 virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure); |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1432 #endif |
57e5211846f9
Added class unloading support to the method profiling infrastructure.
Christian Haeubl <haeubl@ssw.jku.at>
parents:
9760
diff
changeset
|
1433 |
0 | 1434 #ifndef PRODUCT |
13108
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1435 #ifdef GRAAL |
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1436 void print_method_data_on(outputStream* st) const; |
d84fa69a9874
added support for printing method profiles for virtual calls
Doug Simon <doug.simon@oracle.com>
parents:
13086
diff
changeset
|
1437 #endif |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
1438 void print_data_on(outputStream* st, const char* extra = NULL) const; |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1439 #endif |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1440 }; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1441 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1442 // VirtualCallTypeData |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1443 // |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1444 // A VirtualCallTypeData is used to access profiling information about |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1445 // a virtual call for which we collect type information about |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1446 // arguments and return value. |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1447 class VirtualCallTypeData : public VirtualCallData { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1448 private: |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1449 // entries for arguments if any |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1450 TypeStackSlotEntries _args; |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1451 // entry for return type if any |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1452 ReturnTypeEntry _ret; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1453 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1454 int cell_count_global_offset() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1455 return VirtualCallData::static_cell_count() + TypeEntriesAtCall::cell_count_local_offset(); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1456 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1457 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1458 // number of cells not counting the header |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1459 int cell_count_no_header() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1460 return uint_at(cell_count_global_offset()); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1461 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1462 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1463 void check_number_of_arguments(int total) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1464 assert(number_of_arguments() == total, "should be set in DataLayout::initialize"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1465 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1466 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1467 public: |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1468 VirtualCallTypeData(DataLayout* layout) : |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1469 VirtualCallData(layout), |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1470 _args(VirtualCallData::static_cell_count()+TypeEntriesAtCall::header_cell_count(), number_of_arguments()), |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1471 _ret(cell_count() - ReturnTypeEntry::static_cell_count()) |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1472 { |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1473 assert(layout->tag() == DataLayout::virtual_call_type_data_tag, "wrong type"); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1474 // Some compilers (VC++) don't want this passed in member initialization list |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1475 _args.set_profile_data(this); |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1476 _ret.set_profile_data(this); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1477 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1478 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1479 const TypeStackSlotEntries* args() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1480 assert(has_arguments(), "no profiling of arguments"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1481 return &_args; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1482 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1483 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1484 const ReturnTypeEntry* ret() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1485 assert(has_return(), "no profiling of return value"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1486 return &_ret; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1487 } |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1488 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1489 virtual bool is_VirtualCallTypeData() const { return true; } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1490 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1491 static int static_cell_count() { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1492 return -1; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1493 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1494 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1495 static int compute_cell_count(BytecodeStream* stream) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1496 return VirtualCallData::static_cell_count() + TypeEntriesAtCall::compute_cell_count(stream); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1497 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1498 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1499 static void initialize(DataLayout* dl, int cell_count) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1500 TypeEntriesAtCall::initialize(dl, VirtualCallData::static_cell_count(), cell_count); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1501 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1502 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1503 virtual void post_initialize(BytecodeStream* stream, MethodData* mdo); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1504 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1505 virtual int cell_count() const { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1506 return VirtualCallData::static_cell_count() + |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1507 TypeEntriesAtCall::header_cell_count() + |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1508 int_at_unchecked(cell_count_global_offset()); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1509 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1510 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1511 int number_of_arguments() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1512 return cell_count_no_header() / TypeStackSlotEntries::per_arg_count(); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1513 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1514 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1515 void set_argument_type(int i, Klass* k) { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1516 assert(has_arguments(), "no arguments!"); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1517 intptr_t current = _args.type(i); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1518 _args.set_type(i, TypeEntries::with_status(k, current)); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1519 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1520 |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1521 void set_return_type(Klass* k) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1522 assert(has_return(), "no return!"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1523 intptr_t current = _ret.type(); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1524 _ret.set_type(TypeEntries::with_status(k, current)); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1525 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1526 |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1527 // An entry for a return value takes less space than an entry for an |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1528 // argument, so if the remainder of the number of cells divided by |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1529 // the number of cells for an argument is not null, a return value |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1530 // is profiled in this object. |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1531 bool has_return() const { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1532 bool res = (cell_count_no_header() % TypeStackSlotEntries::per_arg_count()) != 0; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1533 assert (!res || TypeEntriesAtCall::return_profiling_enabled(), "no profiling of return values"); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1534 return res; |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1535 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1536 |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1537 // An entry for a return value takes less space than an entry for an |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1538 // argument so if the number of cells exceeds the number of cells |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1539 // needed for an argument, this object contains type information for |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1540 // at least one argument. |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1541 bool has_arguments() const { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1542 bool res = cell_count_no_header() >= TypeStackSlotEntries::per_arg_count(); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1543 assert (!res || TypeEntriesAtCall::arguments_profiling_enabled(), "no profiling of arguments"); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1544 return res; |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1545 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1546 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1547 // Code generation support |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1548 static ByteSize args_data_offset() { |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1549 return cell_offset(VirtualCallData::static_cell_count()) + TypeEntriesAtCall::args_data_offset(); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1550 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1551 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1552 // GC support |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1553 virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1554 ReceiverTypeData::clean_weak_klass_links(is_alive_closure); |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1555 if (has_arguments()) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1556 _args.clean_weak_klass_links(is_alive_closure); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1557 } |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1558 if (has_return()) { |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1559 _ret.clean_weak_klass_links(is_alive_closure); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
1560 } |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1561 } |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1562 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1563 #ifndef PRODUCT |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
1564 virtual void print_data_on(outputStream* st, const char* extra = NULL) const; |
0 | 1565 #endif |
1566 }; | |
1567 | |
1568 // RetData | |
1569 // | |
1570 // A RetData is used to access profiling information for a ret bytecode. | |
1571 // It is composed of a count of the number of times that the ret has | |
1572 // been executed, followed by a series of triples of the form | |
1573 // (bci, count, di) which count the number of times that some bci was the | |
1574 // target of the ret and cache a corresponding data displacement. | |
1575 class RetData : public CounterData { | |
1576 protected: | |
1577 enum { | |
1578 bci0_offset = counter_cell_count, | |
1579 count0_offset, | |
1580 displacement0_offset, | |
1581 ret_row_cell_count = (displacement0_offset + 1) - bci0_offset | |
1582 }; | |
1583 | |
1584 void set_bci(uint row, int bci) { | |
1585 assert((uint)row < row_limit(), "oob"); | |
1586 set_int_at(bci0_offset + row * ret_row_cell_count, bci); | |
1587 } | |
1588 void release_set_bci(uint row, int bci) { | |
1589 assert((uint)row < row_limit(), "oob"); | |
1590 // 'release' when setting the bci acts as a valid flag for other | |
1591 // threads wrt bci_count and bci_displacement. | |
1592 release_set_int_at(bci0_offset + row * ret_row_cell_count, bci); | |
1593 } | |
1594 void set_bci_count(uint row, uint count) { | |
1595 assert((uint)row < row_limit(), "oob"); | |
1596 set_uint_at(count0_offset + row * ret_row_cell_count, count); | |
1597 } | |
1598 void set_bci_displacement(uint row, int disp) { | |
1599 set_int_at(displacement0_offset + row * ret_row_cell_count, disp); | |
1600 } | |
1601 | |
1602 public: | |
1603 RetData(DataLayout* layout) : CounterData(layout) { | |
1604 assert(layout->tag() == DataLayout::ret_data_tag, "wrong type"); | |
1605 } | |
1606 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1607 virtual bool is_RetData() const { return true; } |
0 | 1608 |
1609 enum { | |
1610 no_bci = -1 // value of bci when bci1/2 are not in use. | |
1611 }; | |
1612 | |
1613 static int static_cell_count() { | |
1614 return counter_cell_count + (uint) BciProfileWidth * ret_row_cell_count; | |
1615 } | |
1616 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1617 virtual int cell_count() const { |
0 | 1618 return static_cell_count(); |
1619 } | |
1620 | |
1621 static uint row_limit() { | |
1622 return BciProfileWidth; | |
1623 } | |
1624 static int bci_cell_index(uint row) { | |
1625 return bci0_offset + row * ret_row_cell_count; | |
1626 } | |
1627 static int bci_count_cell_index(uint row) { | |
1628 return count0_offset + row * ret_row_cell_count; | |
1629 } | |
1630 static int bci_displacement_cell_index(uint row) { | |
1631 return displacement0_offset + row * ret_row_cell_count; | |
1632 } | |
1633 | |
1634 // Direct accessors | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1635 int bci(uint row) const { |
0 | 1636 return int_at(bci_cell_index(row)); |
1637 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1638 uint bci_count(uint row) const { |
0 | 1639 return uint_at(bci_count_cell_index(row)); |
1640 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1641 int bci_displacement(uint row) const { |
0 | 1642 return int_at(bci_displacement_cell_index(row)); |
1643 } | |
1644 | |
1645 // Interpreter Runtime support | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
1646 address fixup_ret(int return_bci, MethodData* mdo); |
0 | 1647 |
1648 // Code generation support | |
1649 static ByteSize bci_offset(uint row) { | |
1650 return cell_offset(bci_cell_index(row)); | |
1651 } | |
1652 static ByteSize bci_count_offset(uint row) { | |
1653 return cell_offset(bci_count_cell_index(row)); | |
1654 } | |
1655 static ByteSize bci_displacement_offset(uint row) { | |
1656 return cell_offset(bci_displacement_cell_index(row)); | |
1657 } | |
1658 | |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1659 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1660 static DataLayout* advance(MethodData *md, int bci); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1661 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1662 |
0 | 1663 // Specific initialization. |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
1664 void post_initialize(BytecodeStream* stream, MethodData* mdo); |
0 | 1665 |
1666 #ifndef PRODUCT | |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
1667 void print_data_on(outputStream* st, const char* extra = NULL) const; |
0 | 1668 #endif |
1669 }; | |
1670 | |
1671 // BranchData | |
1672 // | |
1673 // A BranchData is used to access profiling data for a two-way branch. | |
1674 // It consists of taken and not_taken counts as well as a data displacement | |
1675 // for the taken case. | |
1676 class BranchData : public JumpData { | |
1677 protected: | |
1678 enum { | |
1679 not_taken_off_set = jump_cell_count, | |
1680 branch_cell_count | |
1681 }; | |
1682 | |
1683 void set_displacement(int displacement) { | |
1684 set_int_at(displacement_off_set, displacement); | |
1685 } | |
1686 | |
1687 public: | |
1688 BranchData(DataLayout* layout) : JumpData(layout) { | |
1689 assert(layout->tag() == DataLayout::branch_data_tag, "wrong type"); | |
1690 } | |
1691 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1692 virtual bool is_BranchData() const { return true; } |
0 | 1693 |
1694 static int static_cell_count() { | |
1695 return branch_cell_count; | |
1696 } | |
1697 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1698 virtual int cell_count() const { |
0 | 1699 return static_cell_count(); |
1700 } | |
1701 | |
1702 // Direct accessor | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1703 uint not_taken() const { |
0 | 1704 return uint_at(not_taken_off_set); |
1705 } | |
1706 | |
3905
c26de9aef2ed
7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents:
3345
diff
changeset
|
1707 void set_not_taken(uint cnt) { |
c26de9aef2ed
7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents:
3345
diff
changeset
|
1708 set_uint_at(not_taken_off_set, cnt); |
c26de9aef2ed
7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents:
3345
diff
changeset
|
1709 } |
c26de9aef2ed
7071307: MethodHandle bimorphic inlining should consider the frequency
never
parents:
3345
diff
changeset
|
1710 |
0 | 1711 uint inc_not_taken() { |
1712 uint cnt = not_taken() + 1; | |
1713 // Did we wrap? Will compiler screw us?? | |
1714 if (cnt == 0) cnt--; | |
1715 set_uint_at(not_taken_off_set, cnt); | |
1716 return cnt; | |
1717 } | |
1718 | |
1719 // Code generation support | |
1720 static ByteSize not_taken_offset() { | |
1721 return cell_offset(not_taken_off_set); | |
1722 } | |
1723 static ByteSize branch_data_size() { | |
1724 return cell_offset(branch_cell_count); | |
1725 } | |
1726 | |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1727 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1728 static int branch_data_size_in_bytes() { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1729 return cell_offset_in_bytes(branch_cell_count); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1730 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1731 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1732 static void increment_not_taken_count_no_overflow(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1733 increment_uint_at_no_overflow(layout, not_taken_off_set); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1734 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1735 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1736 static DataLayout* advance_not_taken(DataLayout* layout) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1737 return (DataLayout*) (((address)layout) + (ssize_t)BranchData::branch_data_size_in_bytes()); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1738 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1739 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1740 |
0 | 1741 // Specific initialization. |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
1742 void post_initialize(BytecodeStream* stream, MethodData* mdo); |
0 | 1743 |
1744 #ifndef PRODUCT | |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
1745 void print_data_on(outputStream* st, const char* extra = NULL) const; |
0 | 1746 #endif |
1747 }; | |
1748 | |
1749 // ArrayData | |
1750 // | |
1751 // A ArrayData is a base class for accessing profiling data which does | |
1752 // not have a statically known size. It consists of an array length | |
1753 // and an array start. | |
1754 class ArrayData : public ProfileData { | |
1755 protected: | |
1756 friend class DataLayout; | |
1757 | |
1758 enum { | |
1759 array_len_off_set, | |
1760 array_start_off_set | |
1761 }; | |
1762 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1763 uint array_uint_at(int index) const { |
0 | 1764 int aindex = index + array_start_off_set; |
1765 return uint_at(aindex); | |
1766 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1767 int array_int_at(int index) const { |
0 | 1768 int aindex = index + array_start_off_set; |
1769 return int_at(aindex); | |
1770 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1771 oop array_oop_at(int index) const { |
0 | 1772 int aindex = index + array_start_off_set; |
1773 return oop_at(aindex); | |
1774 } | |
1775 void array_set_int_at(int index, int value) { | |
1776 int aindex = index + array_start_off_set; | |
1777 set_int_at(aindex, value); | |
1778 } | |
1779 | |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1780 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1781 // Static low level accessors for DataLayout with ArrayData's semantics. |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1782 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1783 static void increment_array_uint_at_no_overflow(DataLayout* layout, int index) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1784 int aindex = index + array_start_off_set; |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1785 increment_uint_at_no_overflow(layout, aindex); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1786 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1787 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1788 static int array_int_at(DataLayout* layout, int index) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1789 int aindex = index + array_start_off_set; |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1790 return int_at(layout, aindex); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1791 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1792 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1793 |
0 | 1794 // Code generation support for subclasses. |
1795 static ByteSize array_element_offset(int index) { | |
1796 return cell_offset(array_start_off_set + index); | |
1797 } | |
1798 | |
1799 public: | |
1800 ArrayData(DataLayout* layout) : ProfileData(layout) {} | |
1801 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1802 virtual bool is_ArrayData() const { return true; } |
0 | 1803 |
1804 static int static_cell_count() { | |
1805 return -1; | |
1806 } | |
1807 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1808 int array_len() const { |
0 | 1809 return int_at_unchecked(array_len_off_set); |
1810 } | |
1811 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1812 virtual int cell_count() const { |
0 | 1813 return array_len() + 1; |
1814 } | |
1815 | |
1816 // Code generation support | |
1817 static ByteSize array_len_offset() { | |
1818 return cell_offset(array_len_off_set); | |
1819 } | |
1820 static ByteSize array_start_offset() { | |
1821 return cell_offset(array_start_off_set); | |
1822 } | |
1823 }; | |
1824 | |
1825 // MultiBranchData | |
1826 // | |
1827 // A MultiBranchData is used to access profiling information for | |
1828 // a multi-way branch (*switch bytecodes). It consists of a series | |
1829 // of (count, displacement) pairs, which count the number of times each | |
1830 // case was taken and specify the data displacment for each branch target. | |
1831 class MultiBranchData : public ArrayData { | |
1832 protected: | |
1833 enum { | |
1834 default_count_off_set, | |
1835 default_disaplacement_off_set, | |
1836 case_array_start | |
1837 }; | |
1838 enum { | |
1839 relative_count_off_set, | |
1840 relative_displacement_off_set, | |
1841 per_case_cell_count | |
1842 }; | |
1843 | |
1844 void set_default_displacement(int displacement) { | |
1845 array_set_int_at(default_disaplacement_off_set, displacement); | |
1846 } | |
1847 void set_displacement_at(int index, int displacement) { | |
1848 array_set_int_at(case_array_start + | |
1849 index * per_case_cell_count + | |
1850 relative_displacement_off_set, | |
1851 displacement); | |
1852 } | |
1853 | |
1854 public: | |
1855 MultiBranchData(DataLayout* layout) : ArrayData(layout) { | |
1856 assert(layout->tag() == DataLayout::multi_branch_data_tag, "wrong type"); | |
1857 } | |
1858 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1859 virtual bool is_MultiBranchData() const { return true; } |
0 | 1860 |
1861 static int compute_cell_count(BytecodeStream* stream); | |
1862 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1863 int number_of_cases() const { |
0 | 1864 int alen = array_len() - 2; // get rid of default case here. |
1865 assert(alen % per_case_cell_count == 0, "must be even"); | |
1866 return (alen / per_case_cell_count); | |
1867 } | |
1868 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1869 uint default_count() const { |
0 | 1870 return array_uint_at(default_count_off_set); |
1871 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1872 int default_displacement() const { |
0 | 1873 return array_int_at(default_disaplacement_off_set); |
1874 } | |
1875 | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1876 uint count_at(int index) const { |
0 | 1877 return array_uint_at(case_array_start + |
1878 index * per_case_cell_count + | |
1879 relative_count_off_set); | |
1880 } | |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1881 int displacement_at(int index) const { |
0 | 1882 return array_int_at(case_array_start + |
1883 index * per_case_cell_count + | |
1884 relative_displacement_off_set); | |
1885 } | |
1886 | |
1887 // Code generation support | |
1888 static ByteSize default_count_offset() { | |
1889 return array_element_offset(default_count_off_set); | |
1890 } | |
1891 static ByteSize default_displacement_offset() { | |
1892 return array_element_offset(default_disaplacement_off_set); | |
1893 } | |
1894 static ByteSize case_count_offset(int index) { | |
1895 return case_array_offset() + | |
1896 (per_case_size() * index) + | |
1897 relative_count_offset(); | |
1898 } | |
1899 static ByteSize case_array_offset() { | |
1900 return array_element_offset(case_array_start); | |
1901 } | |
1902 static ByteSize per_case_size() { | |
1903 return in_ByteSize(per_case_cell_count) * cell_size; | |
1904 } | |
1905 static ByteSize relative_count_offset() { | |
1906 return in_ByteSize(relative_count_off_set) * cell_size; | |
1907 } | |
1908 static ByteSize relative_displacement_offset() { | |
1909 return in_ByteSize(relative_displacement_off_set) * cell_size; | |
1910 } | |
1911 | |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1912 #ifdef CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1913 static void increment_count_no_overflow(DataLayout* layout, int index) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1914 if (index == -1) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1915 increment_array_uint_at_no_overflow(layout, default_count_off_set); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1916 } else { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1917 increment_array_uint_at_no_overflow(layout, case_array_start + |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1918 index * per_case_cell_count + |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1919 relative_count_off_set); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1920 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1921 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1922 |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1923 static DataLayout* advance(DataLayout* layout, int index) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1924 if (index == -1) { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1925 return (DataLayout*) (((address)layout) + (ssize_t)array_int_at(layout, default_disaplacement_off_set)); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1926 } else { |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1927 return (DataLayout*) (((address)layout) + (ssize_t)array_int_at(layout, case_array_start + |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1928 index * per_case_cell_count + |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1929 relative_displacement_off_set)); |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1930 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1931 } |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1932 #endif // CC_INTERP |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
1933 |
0 | 1934 // Specific initialization. |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
1935 void post_initialize(BytecodeStream* stream, MethodData* mdo); |
0 | 1936 |
1937 #ifndef PRODUCT | |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
1938 void print_data_on(outputStream* st, const char* extra = NULL) const; |
0 | 1939 #endif |
1940 }; | |
1941 | |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1942 class ArgInfoData : public ArrayData { |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1943 |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1944 public: |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1945 ArgInfoData(DataLayout* layout) : ArrayData(layout) { |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1946 assert(layout->tag() == DataLayout::arg_info_data_tag, "wrong type"); |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1947 } |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1948 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1949 virtual bool is_ArgInfoData() const { return true; } |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1950 |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1951 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1952 int number_of_args() const { |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1953 return array_len(); |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1954 } |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1955 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
1956 uint arg_modified(int arg) const { |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1957 return array_uint_at(arg); |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1958 } |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1959 |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1960 void set_arg_modified(int arg, uint val) { |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1961 array_set_int_at(arg, val); |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1962 } |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1963 |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1964 #ifndef PRODUCT |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
1965 void print_data_on(outputStream* st, const char* extra = NULL) const; |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1966 #endif |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1967 }; |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
1968 |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1969 // ParametersTypeData |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1970 // |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1971 // A ParametersTypeData is used to access profiling information about |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1972 // types of parameters to a method |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1973 class ParametersTypeData : public ArrayData { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1974 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1975 private: |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1976 TypeStackSlotEntries _parameters; |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1977 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1978 static int stack_slot_local_offset(int i) { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1979 assert_profiling_enabled(); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1980 return array_start_off_set + TypeStackSlotEntries::stack_slot_local_offset(i); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1981 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1982 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1983 static int type_local_offset(int i) { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1984 assert_profiling_enabled(); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1985 return array_start_off_set + TypeStackSlotEntries::type_local_offset(i); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1986 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1987 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1988 static bool profiling_enabled(); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1989 static void assert_profiling_enabled() { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1990 assert(profiling_enabled(), "method parameters profiling should be on"); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1991 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1992 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1993 public: |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1994 ParametersTypeData(DataLayout* layout) : ArrayData(layout), _parameters(1, number_of_parameters()) { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1995 assert(layout->tag() == DataLayout::parameters_type_data_tag, "wrong type"); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1996 // Some compilers (VC++) don't want this passed in member initialization list |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1997 _parameters.set_profile_data(this); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1998 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
1999 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2000 static int compute_cell_count(Method* m); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2001 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2002 virtual bool is_ParametersTypeData() const { return true; } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2003 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2004 virtual void post_initialize(BytecodeStream* stream, MethodData* mdo); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2005 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2006 int number_of_parameters() const { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2007 return array_len() / TypeStackSlotEntries::per_arg_count(); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2008 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2009 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2010 const TypeStackSlotEntries* parameters() const { return &_parameters; } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2011 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2012 uint stack_slot(int i) const { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2013 return _parameters.stack_slot(i); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2014 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2015 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2016 void set_type(int i, Klass* k) { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2017 intptr_t current = _parameters.type(i); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2018 _parameters.set_type(i, TypeEntries::with_status((intptr_t)k, current)); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2019 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2020 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2021 virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure) { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2022 _parameters.clean_weak_klass_links(is_alive_closure); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2023 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2024 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2025 #ifndef PRODUCT |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2026 virtual void print_data_on(outputStream* st, const char* extra = NULL) const; |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2027 #endif |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2028 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2029 static ByteSize stack_slot_offset(int i) { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2030 return cell_offset(stack_slot_local_offset(i)); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2031 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2032 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2033 static ByteSize type_offset(int i) { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2034 return cell_offset(type_local_offset(i)); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2035 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2036 }; |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2037 |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2038 // SpeculativeTrapData |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2039 // |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2040 // A SpeculativeTrapData is used to record traps due to type |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2041 // speculation. It records the root of the compilation: that type |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2042 // speculation is wrong in the context of one compilation (for |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2043 // method1) doesn't mean it's wrong in the context of another one (for |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2044 // method2). Type speculation could have more/different data in the |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2045 // context of the compilation of method2 and it's worthwhile to try an |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2046 // optimization that failed for compilation of method1 in the context |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2047 // of compilation of method2. |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2048 // Space for SpeculativeTrapData entries is allocated from the extra |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2049 // data space in the MDO. If we run out of space, the trap data for |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2050 // the ProfileData at that bci is updated. |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2051 class SpeculativeTrapData : public ProfileData { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2052 protected: |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2053 enum { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2054 method_offset, |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2055 speculative_trap_cell_count |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2056 }; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2057 public: |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2058 SpeculativeTrapData(DataLayout* layout) : ProfileData(layout) { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2059 assert(layout->tag() == DataLayout::speculative_trap_data_tag, "wrong type"); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2060 } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2061 |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2062 virtual bool is_SpeculativeTrapData() const { return true; } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2063 |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2064 static int static_cell_count() { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2065 return speculative_trap_cell_count; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2066 } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2067 |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2068 virtual int cell_count() const { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2069 return static_cell_count(); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2070 } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2071 |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2072 // Direct accessor |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2073 Method* method() const { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2074 return (Method*)intptr_at(method_offset); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2075 } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2076 |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2077 void set_method(Method* m) { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2078 set_intptr_at(method_offset, (intptr_t)m); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2079 } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2080 |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2081 #ifndef PRODUCT |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2082 virtual void print_data_on(outputStream* st, const char* extra = NULL) const; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2083 #endif |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2084 }; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2085 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2086 // MethodData* |
0 | 2087 // |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2088 // A MethodData* holds information which has been collected about |
0 | 2089 // a method. Its layout looks like this: |
2090 // | |
2091 // ----------------------------- | |
2092 // | header | | |
2093 // | klass | | |
2094 // ----------------------------- | |
2095 // | method | | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2096 // | size of the MethodData* | |
0 | 2097 // ----------------------------- |
2098 // | Data entries... | | |
2099 // | (variable size) | | |
2100 // | | | |
2101 // . . | |
2102 // . . | |
2103 // . . | |
2104 // | | | |
2105 // ----------------------------- | |
2106 // | |
2107 // The data entry area is a heterogeneous array of DataLayouts. Each | |
2108 // DataLayout in the array corresponds to a specific bytecode in the | |
2109 // method. The entries in the array are sorted by the corresponding | |
2110 // bytecode. Access to the data is via resource-allocated ProfileData, | |
2111 // which point to the underlying blocks of DataLayout structures. | |
2112 // | |
2113 // During interpretation, if profiling in enabled, the interpreter | |
2114 // maintains a method data pointer (mdp), which points at the entry | |
2115 // in the array corresponding to the current bci. In the course of | |
2116 // intepretation, when a bytecode is encountered that has profile data | |
2117 // associated with it, the entry pointed to by mdp is updated, then the | |
2118 // mdp is adjusted to point to the next appropriate DataLayout. If mdp | |
2119 // is NULL to begin with, the interpreter assumes that the current method | |
2120 // is not (yet) being profiled. | |
2121 // | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2122 // In MethodData* parlance, "dp" is a "data pointer", the actual address |
0 | 2123 // of a DataLayout element. A "di" is a "data index", the offset in bytes |
2124 // from the base of the data entry array. A "displacement" is the byte offset | |
2125 // in certain ProfileData objects that indicate the amount the mdp must be | |
2126 // adjusted in the event of a change in control flow. | |
2127 // | |
2128 | |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
2129 CC_INTERP_ONLY(class BytecodeInterpreter;) |
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
2130 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2131 class MethodData : public Metadata { |
0 | 2132 friend class VMStructs; |
14420
abe03600372a
8024468: PPC64 (part 201): cppInterpreter: implement bytecode profiling
goetz
parents:
10265
diff
changeset
|
2133 CC_INTERP_ONLY(friend class BytecodeInterpreter;) |
0 | 2134 private: |
2135 friend class ProfileData; | |
2136 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2137 // Back pointer to the Method* |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2138 Method* _method; |
0 | 2139 |
2140 // Size of this oop in bytes | |
2141 int _size; | |
2142 | |
2143 // Cached hint for bci_to_dp and bci_to_data | |
2144 int _hint_di; | |
2145 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2146 MethodData(methodHandle method, int size, TRAPS); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2147 public: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2148 static MethodData* allocate(ClassLoaderData* loader_data, methodHandle method, TRAPS); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2149 MethodData() {}; // For ciMethodData |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2150 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2151 bool is_methodData() const volatile { return true; } |
13181
389d40d7d99f
fixed bug in MethodData and added assertion that precomputed size == initialized size
Doug Simon <doug.simon@oracle.com>
parents:
13108
diff
changeset
|
2152 void initialize(bool for_reprofile = false); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2153 |
0 | 2154 // Whole-method sticky bits and flags |
2155 enum { | |
13216
51e97f88c771
Profile deoptimizations of OSR methods separately.
Roland Schatz <roland.schatz@oracle.com>
parents:
13181
diff
changeset
|
2156 #ifdef GRAAL |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2157 _trap_hist_limit = 18, // decoupled from Deoptimization::Reason_LIMIT |
13216
51e97f88c771
Profile deoptimizations of OSR methods separately.
Roland Schatz <roland.schatz@oracle.com>
parents:
13181
diff
changeset
|
2158 #else |
3345 | 2159 _trap_hist_limit = 17, // decoupled from Deoptimization::Reason_LIMIT |
13216
51e97f88c771
Profile deoptimizations of OSR methods separately.
Roland Schatz <roland.schatz@oracle.com>
parents:
13181
diff
changeset
|
2160 #endif |
0 | 2161 _trap_hist_mask = max_jubyte, |
2162 _extra_data_count = 4 // extra DataLayout headers, for trap history | |
2163 }; // Public flag values | |
2164 private: | |
2165 uint _nof_decompiles; // count of all nmethod removals | |
2166 uint _nof_overflow_recompiles; // recompile count, excluding recomp. bits | |
2167 uint _nof_overflow_traps; // trap count, excluding _trap_hist | |
2168 union { | |
2169 intptr_t _align; | |
13216
51e97f88c771
Profile deoptimizations of OSR methods separately.
Roland Schatz <roland.schatz@oracle.com>
parents:
13181
diff
changeset
|
2170 #ifdef GRAAL |
51e97f88c771
Profile deoptimizations of OSR methods separately.
Roland Schatz <roland.schatz@oracle.com>
parents:
13181
diff
changeset
|
2171 u1 _array[2*_trap_hist_limit]; |
51e97f88c771
Profile deoptimizations of OSR methods separately.
Roland Schatz <roland.schatz@oracle.com>
parents:
13181
diff
changeset
|
2172 #else |
0 | 2173 u1 _array[_trap_hist_limit]; |
13216
51e97f88c771
Profile deoptimizations of OSR methods separately.
Roland Schatz <roland.schatz@oracle.com>
parents:
13181
diff
changeset
|
2174 #endif |
0 | 2175 } _trap_hist; |
2176 | |
2177 // Support for interprocedural escape analysis, from Thomas Kotzmann. | |
2178 intx _eflags; // flags on escape information | |
2179 intx _arg_local; // bit set of non-escaping arguments | |
2180 intx _arg_stack; // bit set of stack-allocatable arguments | |
2181 intx _arg_returned; // bit set of returned arguments | |
2182 | |
1783 | 2183 int _creation_mileage; // method mileage at MDO creation |
2184 | |
2185 // How many invocations has this MDO seen? | |
2186 // These counters are used to determine the exact age of MDO. | |
2187 // We need those because in tiered a method can be concurrently | |
2188 // executed at different levels. | |
2189 InvocationCounter _invocation_counter; | |
2190 // Same for backedges. | |
2191 InvocationCounter _backedge_counter; | |
2252 | 2192 // Counter values at the time profiling started. |
2193 int _invocation_counter_start; | |
2194 int _backedge_counter_start; | |
1783 | 2195 // Number of loops and blocks is computed when compiling the first |
2196 // time with C1. It is used to determine if method is trivial. | |
2197 short _num_loops; | |
2198 short _num_blocks; | |
2199 // Highest compile level this method has ever seen. | |
2200 u1 _highest_comp_level; | |
2201 // Same for OSR level | |
2202 u1 _highest_osr_comp_level; | |
2203 // Does this method contain anything worth profiling? | |
2204 bool _would_profile; | |
0 | 2205 |
2206 // Size of _data array in bytes. (Excludes header and extra_data fields.) | |
2207 int _data_size; | |
2208 | |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2209 // data index for the area dedicated to parameters. -1 if no |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2210 // parameter profiling. |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2211 int _parameters_type_data_di; |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2212 |
0 | 2213 // Beginning of the data entries |
2214 intptr_t _data[1]; | |
2215 | |
2216 // Helper for size computation | |
2217 static int compute_data_size(BytecodeStream* stream); | |
2218 static int bytecode_cell_count(Bytecodes::Code code); | |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2219 static bool is_speculative_trap_bytecode(Bytecodes::Code code); |
0 | 2220 enum { no_profile_data = -1, variable_cell_count = -2 }; |
2221 | |
2222 // Helper for initialization | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2223 DataLayout* data_layout_at(int data_index) const { |
0 | 2224 assert(data_index % sizeof(intptr_t) == 0, "unaligned"); |
2225 return (DataLayout*) (((address)_data) + data_index); | |
2226 } | |
2227 | |
2228 // Initialize an individual data segment. Returns the size of | |
2229 // the segment in bytes. | |
2230 int initialize_data(BytecodeStream* stream, int data_index); | |
2231 | |
2232 // Helper for data_at | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2233 DataLayout* limit_data_position() const { |
0 | 2234 return (DataLayout*)((address)data_base() + _data_size); |
2235 } | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2236 bool out_of_bounds(int data_index) const { |
0 | 2237 return data_index >= data_size(); |
2238 } | |
2239 | |
2240 // Give each of the data entries a chance to perform specific | |
2241 // data initialization. | |
2242 void post_initialize(BytecodeStream* stream); | |
2243 | |
2244 // hint accessors | |
2245 int hint_di() const { return _hint_di; } | |
2246 void set_hint_di(int di) { | |
2247 assert(!out_of_bounds(di), "hint_di out of bounds"); | |
2248 _hint_di = di; | |
2249 } | |
2250 ProfileData* data_before(int bci) { | |
2251 // avoid SEGV on this edge case | |
2252 if (data_size() == 0) | |
2253 return NULL; | |
2254 int hint = hint_di(); | |
2255 if (data_layout_at(hint)->bci() <= bci) | |
2256 return data_at(hint); | |
2257 return first_data(); | |
2258 } | |
2259 | |
2260 // What is the index of the first data entry? | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2261 int first_di() const { return 0; } |
0 | 2262 |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2263 ProfileData* bci_to_extra_data_helper(int bci, Method* m, DataLayout*& dp); |
0 | 2264 // Find or create an extra ProfileData: |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2265 ProfileData* bci_to_extra_data(int bci, Method* m, bool create_if_missing); |
0 | 2266 |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
2267 // return the argument info cell |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
2268 ArgInfoData *arg_info(); |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
2269 |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2270 enum { |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2271 no_type_profile = 0, |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2272 type_profile_jsr292 = 1, |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2273 type_profile_all = 2 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2274 }; |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2275 |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2276 static bool profile_jsr292(methodHandle m, int bci); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2277 static int profile_arguments_flag(); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2278 static bool profile_arguments_jsr292_only(); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2279 static bool profile_all_arguments(); |
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2280 static bool profile_arguments_for_invoke(methodHandle m, int bci); |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
2281 static int profile_return_flag(); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
2282 static bool profile_all_return(); |
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
2283 static bool profile_return_for_invoke(methodHandle m, int bci); |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2284 static int profile_parameters_flag(); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2285 static bool profile_parameters_jsr292_only(); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2286 static bool profile_all_parameters(); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2287 |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2288 void clean_extra_data(BoolObjectClosure* is_alive); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2289 void clean_extra_data_helper(DataLayout* dp, int shift, bool reset = false); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2290 void verify_extra_data_clean(BoolObjectClosure* is_alive); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2291 |
0 | 2292 public: |
2293 static int header_size() { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2294 return sizeof(MethodData)/wordSize; |
0 | 2295 } |
2296 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2297 // Compute the size of a MethodData* before it is created. |
0 | 2298 static int compute_allocation_size_in_bytes(methodHandle method); |
2299 static int compute_allocation_size_in_words(methodHandle method); | |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2300 static int compute_extra_data_count(int data_size, int empty_bc_count, bool needs_speculative_traps); |
0 | 2301 |
2302 // Determine if a given bytecode can have profile information. | |
2303 static bool bytecode_has_profile(Bytecodes::Code code) { | |
2304 return bytecode_cell_count(code) != no_profile_data; | |
2305 } | |
2306 | |
9080
b84fd7d73702
8007288: Additional WB API for compiler's testing
iignatyev
parents:
8000
diff
changeset
|
2307 // reset into original state |
b84fd7d73702
8007288: Additional WB API for compiler's testing
iignatyev
parents:
8000
diff
changeset
|
2308 void init(); |
0 | 2309 |
2310 // My size | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2311 int size_in_bytes() const { return _size; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2312 int size() const { return align_object_size(align_size_up(_size, BytesPerWord)/BytesPerWord); } |
7956 | 2313 #if INCLUDE_SERVICES |
2314 void collect_statistics(KlassSizeStats *sz) const; | |
2315 #endif | |
0 | 2316 |
2317 int creation_mileage() const { return _creation_mileage; } | |
2318 void set_creation_mileage(int x) { _creation_mileage = x; } | |
1783 | 2319 |
2320 int invocation_count() { | |
2321 if (invocation_counter()->carry()) { | |
2322 return InvocationCounter::count_limit; | |
2323 } | |
2324 return invocation_counter()->count(); | |
2325 } | |
2326 int backedge_count() { | |
2327 if (backedge_counter()->carry()) { | |
2328 return InvocationCounter::count_limit; | |
2329 } | |
2330 return backedge_counter()->count(); | |
2331 } | |
2332 | |
2252 | 2333 int invocation_count_start() { |
2334 if (invocation_counter()->carry()) { | |
2335 return 0; | |
2336 } | |
2337 return _invocation_counter_start; | |
2338 } | |
2339 | |
2340 int backedge_count_start() { | |
2341 if (backedge_counter()->carry()) { | |
2342 return 0; | |
2343 } | |
2344 return _backedge_counter_start; | |
2345 } | |
2346 | |
2347 int invocation_count_delta() { return invocation_count() - invocation_count_start(); } | |
2348 int backedge_count_delta() { return backedge_count() - backedge_count_start(); } | |
2349 | |
2350 void reset_start_counters() { | |
2351 _invocation_counter_start = invocation_count(); | |
2352 _backedge_counter_start = backedge_count(); | |
2353 } | |
2354 | |
1783 | 2355 InvocationCounter* invocation_counter() { return &_invocation_counter; } |
2356 InvocationCounter* backedge_counter() { return &_backedge_counter; } | |
2357 | |
2358 void set_would_profile(bool p) { _would_profile = p; } | |
2359 bool would_profile() const { return _would_profile; } | |
2360 | |
10265
92ef81e2f571
8003557: NPG: Klass* const k should be const Klass* k.
minqi
parents:
9080
diff
changeset
|
2361 int highest_comp_level() const { return _highest_comp_level; } |
1783 | 2362 void set_highest_comp_level(int level) { _highest_comp_level = level; } |
10265
92ef81e2f571
8003557: NPG: Klass* const k should be const Klass* k.
minqi
parents:
9080
diff
changeset
|
2363 int highest_osr_comp_level() const { return _highest_osr_comp_level; } |
1783 | 2364 void set_highest_osr_comp_level(int level) { _highest_osr_comp_level = level; } |
2365 | |
2366 int num_loops() const { return _num_loops; } | |
2367 void set_num_loops(int n) { _num_loops = n; } | |
2368 int num_blocks() const { return _num_blocks; } | |
2369 void set_num_blocks(int n) { _num_blocks = n; } | |
2370 | |
0 | 2371 bool is_mature() const; // consult mileage and ProfileMaturityPercentage |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2372 static int mileage_of(Method* m); |
0 | 2373 |
2374 // Support for interprocedural escape analysis, from Thomas Kotzmann. | |
2375 enum EscapeFlag { | |
2376 estimated = 1 << 0, | |
78
e1e86702e43e
6680665: bytecode Escape Analyzer produces incorrect escape information for methods without oop arguments
kvn
parents:
45
diff
changeset
|
2377 return_local = 1 << 1, |
e1e86702e43e
6680665: bytecode Escape Analyzer produces incorrect escape information for methods without oop arguments
kvn
parents:
45
diff
changeset
|
2378 return_allocated = 1 << 2, |
e1e86702e43e
6680665: bytecode Escape Analyzer produces incorrect escape information for methods without oop arguments
kvn
parents:
45
diff
changeset
|
2379 allocated_escapes = 1 << 3, |
e1e86702e43e
6680665: bytecode Escape Analyzer produces incorrect escape information for methods without oop arguments
kvn
parents:
45
diff
changeset
|
2380 unknown_modified = 1 << 4 |
0 | 2381 }; |
2382 | |
2383 intx eflags() { return _eflags; } | |
2384 intx arg_local() { return _arg_local; } | |
2385 intx arg_stack() { return _arg_stack; } | |
2386 intx arg_returned() { return _arg_returned; } | |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
2387 uint arg_modified(int a) { ArgInfoData *aid = arg_info(); |
9080
b84fd7d73702
8007288: Additional WB API for compiler's testing
iignatyev
parents:
8000
diff
changeset
|
2388 assert(aid != NULL, "arg_info must be not null"); |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
2389 assert(a >= 0 && a < aid->number_of_args(), "valid argument number"); |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
2390 return aid->arg_modified(a); } |
0 | 2391 |
2392 void set_eflags(intx v) { _eflags = v; } | |
2393 void set_arg_local(intx v) { _arg_local = v; } | |
2394 void set_arg_stack(intx v) { _arg_stack = v; } | |
2395 void set_arg_returned(intx v) { _arg_returned = v; } | |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
2396 void set_arg_modified(int a, uint v) { ArgInfoData *aid = arg_info(); |
9080
b84fd7d73702
8007288: Additional WB API for compiler's testing
iignatyev
parents:
8000
diff
changeset
|
2397 assert(aid != NULL, "arg_info must be not null"); |
45
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
2398 assert(a >= 0 && a < aid->number_of_args(), "valid argument number"); |
48a3fa21394b
6667615: (Escape Analysis) extend MDO to cache arguments escape state
kvn
parents:
0
diff
changeset
|
2399 aid->set_arg_modified(a, v); } |
0 | 2400 |
2401 void clear_escape_info() { _eflags = _arg_local = _arg_stack = _arg_returned = 0; } | |
2402 | |
2403 // Location and size of data area | |
2404 address data_base() const { | |
2405 return (address) _data; | |
2406 } | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2407 int data_size() const { |
0 | 2408 return _data_size; |
2409 } | |
2410 | |
2411 // Accessors | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2412 Method* method() const { return _method; } |
0 | 2413 |
2414 // Get the data at an arbitrary (sort of) data index. | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2415 ProfileData* data_at(int data_index) const; |
0 | 2416 |
2417 // Walk through the data in order. | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2418 ProfileData* first_data() const { return data_at(first_di()); } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2419 ProfileData* next_data(ProfileData* current) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2420 bool is_valid(ProfileData* current) const { return current != NULL; } |
0 | 2421 |
2422 // Convert a dp (data pointer) to a di (data index). | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2423 int dp_to_di(address dp) const { |
0 | 2424 return dp - ((address)_data); |
2425 } | |
2426 | |
2427 address di_to_dp(int di) { | |
2428 return (address)data_layout_at(di); | |
2429 } | |
2430 | |
2431 // bci to di/dp conversion. | |
2432 address bci_to_dp(int bci); | |
2433 int bci_to_di(int bci) { | |
2434 return dp_to_di(bci_to_dp(bci)); | |
2435 } | |
2436 | |
2437 // Get the data at an arbitrary bci, or NULL if there is none. | |
2438 ProfileData* bci_to_data(int bci); | |
2439 | |
2440 // Same, but try to create an extra_data record if one is needed: | |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2441 ProfileData* allocate_bci_to_data(int bci, Method* m) { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2442 ProfileData* data = NULL; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2443 // If m not NULL, try to allocate a SpeculativeTrapData entry |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2444 if (m == NULL) { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2445 data = bci_to_data(bci); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2446 } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2447 if (data != NULL) { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2448 return data; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2449 } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2450 data = bci_to_extra_data(bci, m, true); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2451 if (data != NULL) { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2452 return data; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2453 } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2454 // If SpeculativeTrapData allocation fails try to allocate a |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2455 // regular entry |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2456 data = bci_to_data(bci); |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2457 if (data != NULL) { |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2458 return data; |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2459 } |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2460 return bci_to_extra_data(bci, NULL, true); |
0 | 2461 } |
2462 | |
2463 // Add a handful of extra data records, for trap tracking. | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2464 DataLayout* extra_data_base() const { return limit_data_position(); } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2465 DataLayout* extra_data_limit() const { return (DataLayout*)((address)this + size_in_bytes()); } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2466 int extra_data_size() const { return (address)extra_data_limit() |
0 | 2467 - (address)extra_data_base(); } |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2468 static DataLayout* next_extra(DataLayout* dp); |
0 | 2469 |
2470 // Return (uint)-1 for overflow. | |
2471 uint trap_count(int reason) const { | |
13279
05de8cf71a41
fixed broken assertions
Doug Simon <doug.simon@oracle.com>
parents:
13216
diff
changeset
|
2472 assert((uint)reason < GRAAL_ONLY(2*) _trap_hist_limit, "oob"); |
0 | 2473 return (int)((_trap_hist._array[reason]+1) & _trap_hist_mask) - 1; |
2474 } | |
2475 // For loops: | |
2476 static uint trap_reason_limit() { return _trap_hist_limit; } | |
2477 static uint trap_count_limit() { return _trap_hist_mask; } | |
2478 uint inc_trap_count(int reason) { | |
2479 // Count another trap, anywhere in this method. | |
2480 assert(reason >= 0, "must be single trap"); | |
13279
05de8cf71a41
fixed broken assertions
Doug Simon <doug.simon@oracle.com>
parents:
13216
diff
changeset
|
2481 assert((uint)reason < GRAAL_ONLY(2*) _trap_hist_limit, "oob"); |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5111
diff
changeset
|
2482 uint cnt1 = 1 + _trap_hist._array[reason]; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5111
diff
changeset
|
2483 if ((cnt1 & _trap_hist_mask) != 0) { // if no counter overflow... |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5111
diff
changeset
|
2484 _trap_hist._array[reason] = cnt1; |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5111
diff
changeset
|
2485 return cnt1; |
0 | 2486 } else { |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5111
diff
changeset
|
2487 return _trap_hist_mask + (++_nof_overflow_traps); |
0 | 2488 } |
2489 } | |
2490 | |
2491 uint overflow_trap_count() const { | |
2492 return _nof_overflow_traps; | |
2493 } | |
2494 uint overflow_recompile_count() const { | |
2495 return _nof_overflow_recompiles; | |
2496 } | |
2497 void inc_overflow_recompile_count() { | |
2498 _nof_overflow_recompiles += 1; | |
2499 } | |
2500 uint decompile_count() const { | |
2501 return _nof_decompiles; | |
2502 } | |
2503 void inc_decompile_count() { | |
2504 _nof_decompiles += 1; | |
1206
87684f1a88b5
6614597: Performance variability in jvm2008 xml.validation
kvn
parents:
948
diff
changeset
|
2505 if (decompile_count() > (uint)PerMethodRecompilationCutoff) { |
7998 | 2506 method()->set_not_compilable(CompLevel_full_optimization, true, "decompile_count > PerMethodRecompilationCutoff"); |
1206
87684f1a88b5
6614597: Performance variability in jvm2008 xml.validation
kvn
parents:
948
diff
changeset
|
2507 } |
0 | 2508 } |
2509 | |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2510 // Return pointer to area dedicated to parameters in MDO |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2511 ParametersTypeData* parameters_type_data() const { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2512 return _parameters_type_data_di != -1 ? data_layout_at(_parameters_type_data_di)->data_in()->as_ParametersTypeData() : NULL; |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2513 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2514 |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2515 int parameters_type_data_di() const { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2516 assert(_parameters_type_data_di != -1, "no args type data"); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2517 return _parameters_type_data_di; |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2518 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2519 |
0 | 2520 // Support for code generation |
2521 static ByteSize data_offset() { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2522 return byte_offset_of(MethodData, _data[0]); |
0 | 2523 } |
2524 | |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5111
diff
changeset
|
2525 static ByteSize trap_history_offset() { |
6948
e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
diff
changeset
|
2526 return byte_offset_of(MethodData, _trap_hist._array); |
5114
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5111
diff
changeset
|
2527 } |
dad1ac9dba7d
finished first implementation of disabling runtime feedback selectively based on deoptimization history
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5111
diff
changeset
|
2528 |
1783 | 2529 static ByteSize invocation_counter_offset() { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2530 return byte_offset_of(MethodData, _invocation_counter); |
1783 | 2531 } |
2532 static ByteSize backedge_counter_offset() { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2533 return byte_offset_of(MethodData, _backedge_counter); |
1783 | 2534 } |
2535 | |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2536 static ByteSize parameters_type_data_di_offset() { |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2537 return byte_offset_of(MethodData, _parameters_type_data_di); |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2538 } |
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2539 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2540 // Deallocation support - no pointer fields to deallocate |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2541 void deallocate_contents(ClassLoaderData* loader_data) {} |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2542 |
0 | 2543 // GC support |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2544 void set_size(int object_size_in_bytes) { _size = object_size_in_bytes; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2545 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2546 // Printing |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2547 #ifndef PRODUCT |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2548 void print_on (outputStream* st) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2549 #endif |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2550 void print_value_on(outputStream* st) const; |
0 | 2551 |
2552 #ifndef PRODUCT | |
2553 // printing support for method data | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2554 void print_data_on(outputStream* st) const; |
0 | 2555 #endif |
2556 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2557 const char* internal_name() const { return "{method data}"; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2558 |
0 | 2559 // verification |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
3905
diff
changeset
|
2560 void verify_on(outputStream* st); |
0 | 2561 void verify_data_on(outputStream* st); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2562 |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2563 static bool profile_parameters_for_method(methodHandle m); |
12875
d13d7aba8c12
8023657: New type profiling points: arguments to call
roland
parents:
12316
diff
changeset
|
2564 static bool profile_arguments(); |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
2565 static bool profile_return(); |
12962
5ccbab1c69f3
8026251: New type profiling points: parameters to methods
roland
parents:
12882
diff
changeset
|
2566 static bool profile_parameters(); |
12882
ce0cc25bc5e2
8026054: New type profiling points: type of return values at calls
roland
parents:
12875
diff
changeset
|
2567 static bool profile_return_jsr292_only(); |
14500
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2568 |
fdad2932c73f
8031752: Failed speculative optimizations should be reattempted when root of compilation is different
roland
parents:
14435
diff
changeset
|
2569 void clean_method_data(BoolObjectClosure* is_alive); |
0 | 2570 }; |
1972 | 2571 |
2572 #endif // SHARE_VM_OOPS_METHODDATAOOP_HPP |