Mercurial > hg > graal-compiler
comparison src/share/vm/ci/ciMethodData.hpp @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | fdad2932c73f |
children | 89152779163c |
comparison
equal
deleted
inserted
replaced
14908:8db6e76cb658 | 14909:4ca6dc0799b6 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
29 #include "ci/ciKlass.hpp" | 29 #include "ci/ciKlass.hpp" |
30 #include "ci/ciObject.hpp" | 30 #include "ci/ciObject.hpp" |
31 #include "ci/ciUtilities.hpp" | 31 #include "ci/ciUtilities.hpp" |
32 #include "oops/methodData.hpp" | 32 #include "oops/methodData.hpp" |
33 #include "oops/oop.inline.hpp" | 33 #include "oops/oop.inline.hpp" |
34 #include "runtime/deoptimization.hpp" | |
35 | 34 |
36 class ciBitData; | 35 class ciBitData; |
37 class ciCounterData; | 36 class ciCounterData; |
38 class ciJumpData; | 37 class ciJumpData; |
39 class ciReceiverTypeData; | 38 class ciReceiverTypeData; |
43 class ciMultiBranchData; | 42 class ciMultiBranchData; |
44 class ciArgInfoData; | 43 class ciArgInfoData; |
45 class ciCallTypeData; | 44 class ciCallTypeData; |
46 class ciVirtualCallTypeData; | 45 class ciVirtualCallTypeData; |
47 class ciParametersTypeData; | 46 class ciParametersTypeData; |
48 class ciSpeculativeTrapData;; | |
49 | 47 |
50 typedef ProfileData ciProfileData; | 48 typedef ProfileData ciProfileData; |
51 | 49 |
52 class ciBitData : public BitData { | 50 class ciBitData : public BitData { |
53 public: | 51 public: |
173 bool return_maybe_null() const { | 171 bool return_maybe_null() const { |
174 return ret()->maybe_null(); | 172 return ret()->maybe_null(); |
175 } | 173 } |
176 | 174 |
177 #ifndef PRODUCT | 175 #ifndef PRODUCT |
178 void print_data_on(outputStream* st, const char* extra) const; | 176 void print_data_on(outputStream* st) const; |
179 #endif | 177 #endif |
180 }; | 178 }; |
181 | 179 |
182 class ciReceiverTypeData : public ReceiverTypeData { | 180 class ciReceiverTypeData : public ReceiverTypeData { |
183 public: | 181 public: |
200 virtual void translate_from(const ProfileData* data) { | 198 virtual void translate_from(const ProfileData* data) { |
201 translate_receiver_data_from(data); | 199 translate_receiver_data_from(data); |
202 } | 200 } |
203 void translate_receiver_data_from(const ProfileData* data); | 201 void translate_receiver_data_from(const ProfileData* data); |
204 #ifndef PRODUCT | 202 #ifndef PRODUCT |
205 void print_data_on(outputStream* st, const char* extra) const; | 203 void print_data_on(outputStream* st) const; |
206 void print_receiver_data_on(outputStream* st) const; | 204 void print_receiver_data_on(outputStream* st) const; |
207 #endif | 205 #endif |
208 }; | 206 }; |
209 | 207 |
210 class ciVirtualCallData : public VirtualCallData { | 208 class ciVirtualCallData : public VirtualCallData { |
225 // Copy & translate from oop based VirtualCallData | 223 // Copy & translate from oop based VirtualCallData |
226 virtual void translate_from(const ProfileData* data) { | 224 virtual void translate_from(const ProfileData* data) { |
227 rtd_super()->translate_receiver_data_from(data); | 225 rtd_super()->translate_receiver_data_from(data); |
228 } | 226 } |
229 #ifndef PRODUCT | 227 #ifndef PRODUCT |
230 void print_data_on(outputStream* st, const char* extra) const; | 228 void print_data_on(outputStream* st) const; |
231 #endif | 229 #endif |
232 }; | 230 }; |
233 | 231 |
234 class ciVirtualCallTypeData : public VirtualCallTypeData { | 232 class ciVirtualCallTypeData : public VirtualCallTypeData { |
235 private: | 233 private: |
287 bool return_maybe_null() const { | 285 bool return_maybe_null() const { |
288 return ret()->maybe_null(); | 286 return ret()->maybe_null(); |
289 } | 287 } |
290 | 288 |
291 #ifndef PRODUCT | 289 #ifndef PRODUCT |
292 void print_data_on(outputStream* st, const char* extra) const; | 290 void print_data_on(outputStream* st) const; |
293 #endif | 291 #endif |
294 }; | 292 }; |
295 | 293 |
296 | 294 |
297 class ciRetData : public RetData { | 295 class ciRetData : public RetData { |
336 bool parameter_maybe_null(int i) const { | 334 bool parameter_maybe_null(int i) const { |
337 return parameters()->maybe_null(i); | 335 return parameters()->maybe_null(i); |
338 } | 336 } |
339 | 337 |
340 #ifndef PRODUCT | 338 #ifndef PRODUCT |
341 void print_data_on(outputStream* st, const char* extra) const; | 339 void print_data_on(outputStream* st) const; |
342 #endif | |
343 }; | |
344 | |
345 class ciSpeculativeTrapData : public SpeculativeTrapData { | |
346 public: | |
347 ciSpeculativeTrapData(DataLayout* layout) : SpeculativeTrapData(layout) {} | |
348 | |
349 virtual void translate_from(const ProfileData* data); | |
350 | |
351 ciMethod* method() const { | |
352 return (ciMethod*)intptr_at(method_offset); | |
353 } | |
354 | |
355 void set_method(ciMethod* m) { | |
356 set_intptr_at(method_offset, (intptr_t)m); | |
357 } | |
358 | |
359 #ifndef PRODUCT | |
360 void print_data_on(outputStream* st, const char* extra) const; | |
361 #endif | 340 #endif |
362 }; | 341 }; |
363 | 342 |
364 // ciMethodData | 343 // ciMethodData |
365 // | 344 // |
454 | 433 |
455 // What is the index of the first data entry? | 434 // What is the index of the first data entry? |
456 int first_di() { return 0; } | 435 int first_di() { return 0; } |
457 | 436 |
458 ciArgInfoData *arg_info() const; | 437 ciArgInfoData *arg_info() const; |
459 | |
460 address data_base() const { | |
461 return (address) _data; | |
462 } | |
463 DataLayout* limit_data_position() const { | |
464 return (DataLayout*)((address)data_base() + _data_size); | |
465 } | |
466 | |
467 void load_extra_data(); | |
468 ciProfileData* bci_to_extra_data(int bci, ciMethod* m, bool& two_free_slots); | |
469 | 438 |
470 public: | 439 public: |
471 bool is_method_data() const { return true; } | 440 bool is_method_data() const { return true; } |
472 | 441 |
473 bool is_empty() { return _state == empty_state; } | 442 bool is_empty() { return _state == empty_state; } |
504 // Walk through the data in order. | 473 // Walk through the data in order. |
505 ciProfileData* first_data() { return data_at(first_di()); } | 474 ciProfileData* first_data() { return data_at(first_di()); } |
506 ciProfileData* next_data(ciProfileData* current); | 475 ciProfileData* next_data(ciProfileData* current); |
507 bool is_valid(ciProfileData* current) { return current != NULL; } | 476 bool is_valid(ciProfileData* current) { return current != NULL; } |
508 | 477 |
509 DataLayout* extra_data_base() const { return limit_data_position(); } | 478 // Get the data at an arbitrary bci, or NULL if there is none. |
510 | 479 ciProfileData* bci_to_data(int bci); |
511 // Get the data at an arbitrary bci, or NULL if there is none. If m | 480 ciProfileData* bci_to_extra_data(int bci, bool create_if_missing); |
512 // is not NULL look for a SpeculativeTrapData if any first. | |
513 ciProfileData* bci_to_data(int bci, ciMethod* m = NULL); | |
514 | 481 |
515 uint overflow_trap_count() const { | 482 uint overflow_trap_count() const { |
516 return _orig.overflow_trap_count(); | 483 return _orig.overflow_trap_count(); |
517 } | 484 } |
518 uint overflow_recompile_count() const { | 485 uint overflow_recompile_count() const { |
527 uint trap_reason_limit() const { return _orig.trap_reason_limit(); } | 494 uint trap_reason_limit() const { return _orig.trap_reason_limit(); } |
528 uint trap_count_limit() const { return _orig.trap_count_limit(); } | 495 uint trap_count_limit() const { return _orig.trap_count_limit(); } |
529 | 496 |
530 // Helpful query functions that decode trap_state. | 497 // Helpful query functions that decode trap_state. |
531 int has_trap_at(ciProfileData* data, int reason); | 498 int has_trap_at(ciProfileData* data, int reason); |
532 int has_trap_at(int bci, ciMethod* m, int reason) { | 499 int has_trap_at(int bci, int reason) { |
533 assert((m != NULL) == Deoptimization::reason_is_speculate(reason), "inconsistent method/reason"); | 500 return has_trap_at(bci_to_data(bci), reason); |
534 return has_trap_at(bci_to_data(bci, m), reason); | |
535 } | 501 } |
536 int trap_recompiled_at(ciProfileData* data); | 502 int trap_recompiled_at(ciProfileData* data); |
537 int trap_recompiled_at(int bci, ciMethod* m) { | 503 int trap_recompiled_at(int bci) { |
538 return trap_recompiled_at(bci_to_data(bci, m)); | 504 return trap_recompiled_at(bci_to_data(bci)); |
539 } | 505 } |
540 | 506 |
541 void clear_escape_info(); | 507 void clear_escape_info(); |
542 bool has_escape_info(); | 508 bool has_escape_info(); |
543 void update_escape_info(); | 509 void update_escape_info(); |