< prev index next >

src/share/vm/ci/ciMethodData.hpp

Print this page
rev 9358 : 8057038: Speculative traps not robust when compilation and class unloading are concurrent
Summary: speculative traps can be removed from MDO while being copied by compiler
Reviewed-by: kvn, iveresov


 390   u_char _saw_free_extra_data;
 391 
 392   // Support for interprocedural escape analysis
 393   intx              _eflags;          // flags on escape information
 394   intx              _arg_local;       // bit set of non-escaping arguments
 395   intx              _arg_stack;       // bit set of stack-allocatable arguments
 396   intx              _arg_returned;    // bit set of returned arguments
 397 
 398   // Maturity of the oop when the snapshot is taken.
 399   int _current_mileage;
 400 
 401   // These counters hold the age of MDO in tiered. In tiered we can have the same method
 402   // running at different compilation levels concurrently. So, in order to precisely measure
 403   // its maturity we need separate counters.
 404   int _invocation_counter;
 405   int _backedge_counter;
 406 
 407   // Coherent snapshot of original header.
 408   MethodData _orig;
 409 
 410   // Dedicated area dedicated to parameters. Null if no parameter
 411   // profiling for this method.
 412   DataLayout* _parameters;



 413 
 414   ciMethodData(MethodData* md);
 415   ciMethodData();
 416 
 417   // Accessors
 418   int data_size() const { return _data_size; }
 419   int extra_data_size() const { return _extra_data_size; }
 420   intptr_t * data() const { return _data; }
 421 
 422   MethodData* get_MethodData() const {
 423     return (MethodData*)_metadata;
 424   }
 425 
 426   const char* type_string()                      { return "ciMethodData"; }
 427 
 428   void print_impl(outputStream* st);
 429 
 430   DataLayout* data_layout_at(int data_index) const {
 431     assert(data_index % sizeof(intptr_t) == 0, "unaligned");
 432     return (DataLayout*) (((address)_data) + data_index);


 444   }
 445   ciProfileData* data_before(int bci) {
 446     // avoid SEGV on this edge case
 447     if (data_size() == 0)
 448       return NULL;
 449     int hint = hint_di();
 450     if (data_layout_at(hint)->bci() <= bci)
 451       return data_at(hint);
 452     return first_data();
 453   }
 454 
 455 
 456   // What is the index of the first data entry?
 457   int first_di() { return 0; }
 458 
 459   ciArgInfoData *arg_info() const;
 460 
 461   address data_base() const {
 462     return (address) _data;
 463   }
 464   DataLayout* limit_data_position() const {
 465     return (DataLayout*)((address)data_base() + _data_size);
 466   }
 467 
 468   void load_extra_data();
 469   ciProfileData* bci_to_extra_data(int bci, ciMethod* m, bool& two_free_slots);
 470 
 471 public:
 472   bool is_method_data() const { return true; }
 473 
 474   bool is_empty()  { return _state == empty_state; }
 475   bool is_mature() { return _state == mature_state; }
 476 
 477   int creation_mileage() { return _orig.creation_mileage(); }
 478   int current_mileage()  { return _current_mileage; }
 479 
 480   int invocation_count() { return _invocation_counter; }
 481   int backedge_count()   { return _backedge_counter;   }
 482 
 483 #if INCLUDE_RTM_OPT
 484   // return cached value
 485   int rtm_state() {
 486     if (is_empty()) {


 502   // for sure, set it in the MethodData
 503   void set_argument_type(int bci, int i, ciKlass* k);
 504   void set_parameter_type(int i, ciKlass* k);
 505   void set_return_type(int bci, ciKlass* k);
 506 
 507   void load_data();
 508 
 509   // Convert a dp (data pointer) to a di (data index).
 510   int dp_to_di(address dp) {
 511     return dp - ((address)_data);
 512   }
 513 
 514   // Get the data at an arbitrary (sort of) data index.
 515   ciProfileData* data_at(int data_index);
 516 
 517   // Walk through the data in order.
 518   ciProfileData* first_data() { return data_at(first_di()); }
 519   ciProfileData* next_data(ciProfileData* current);
 520   bool is_valid(ciProfileData* current) { return current != NULL; }
 521 
 522   DataLayout* extra_data_base() const { return limit_data_position(); }


 523 
 524   // Get the data at an arbitrary bci, or NULL if there is none. If m
 525   // is not NULL look for a SpeculativeTrapData if any first.
 526   ciProfileData* bci_to_data(int bci, ciMethod* m = NULL);
 527 
 528   uint overflow_trap_count() const {
 529     return _orig.overflow_trap_count();
 530   }
 531   uint overflow_recompile_count() const {
 532     return _orig.overflow_recompile_count();
 533   }
 534   uint decompile_count() const {
 535     return _orig.decompile_count();
 536   }
 537   uint trap_count(int reason) const {
 538     return _orig.trap_count(reason);
 539   }
 540   uint trap_reason_limit() const { return _orig.trap_reason_limit(); }
 541   uint trap_count_limit()  const { return _orig.trap_count_limit(); }
 542 




 390   u_char _saw_free_extra_data;
 391 
 392   // Support for interprocedural escape analysis
 393   intx              _eflags;          // flags on escape information
 394   intx              _arg_local;       // bit set of non-escaping arguments
 395   intx              _arg_stack;       // bit set of stack-allocatable arguments
 396   intx              _arg_returned;    // bit set of returned arguments
 397 
 398   // Maturity of the oop when the snapshot is taken.
 399   int _current_mileage;
 400 
 401   // These counters hold the age of MDO in tiered. In tiered we can have the same method
 402   // running at different compilation levels concurrently. So, in order to precisely measure
 403   // its maturity we need separate counters.
 404   int _invocation_counter;
 405   int _backedge_counter;
 406 
 407   // Coherent snapshot of original header.
 408   MethodData _orig;
 409 
 410   // Area dedicated to parameters. Null if no parameter
 411   // profiling for this method.
 412   DataLayout* _parameters;
 413   int parameters_size() const {
 414     return _parameters == NULL ? 0 : parameters_type_data()->size_in_bytes();
 415   }
 416 
 417   ciMethodData(MethodData* md);
 418   ciMethodData();
 419 
 420   // Accessors
 421   int data_size() const { return _data_size; }
 422   int extra_data_size() const { return _extra_data_size; }
 423   intptr_t * data() const { return _data; }
 424 
 425   MethodData* get_MethodData() const {
 426     return (MethodData*)_metadata;
 427   }
 428 
 429   const char* type_string()                      { return "ciMethodData"; }
 430 
 431   void print_impl(outputStream* st);
 432 
 433   DataLayout* data_layout_at(int data_index) const {
 434     assert(data_index % sizeof(intptr_t) == 0, "unaligned");
 435     return (DataLayout*) (((address)_data) + data_index);


 447   }
 448   ciProfileData* data_before(int bci) {
 449     // avoid SEGV on this edge case
 450     if (data_size() == 0)
 451       return NULL;
 452     int hint = hint_di();
 453     if (data_layout_at(hint)->bci() <= bci)
 454       return data_at(hint);
 455     return first_data();
 456   }
 457 
 458 
 459   // What is the index of the first data entry?
 460   int first_di() { return 0; }
 461 
 462   ciArgInfoData *arg_info() const;
 463 
 464   address data_base() const {
 465     return (address) _data;
 466   }



 467 
 468   void load_extra_data();
 469   ciProfileData* bci_to_extra_data(int bci, ciMethod* m, bool& two_free_slots);
 470 
 471 public:
 472   bool is_method_data() const { return true; }
 473 
 474   bool is_empty()  { return _state == empty_state; }
 475   bool is_mature() { return _state == mature_state; }
 476 
 477   int creation_mileage() { return _orig.creation_mileage(); }
 478   int current_mileage()  { return _current_mileage; }
 479 
 480   int invocation_count() { return _invocation_counter; }
 481   int backedge_count()   { return _backedge_counter;   }
 482 
 483 #if INCLUDE_RTM_OPT
 484   // return cached value
 485   int rtm_state() {
 486     if (is_empty()) {


 502   // for sure, set it in the MethodData
 503   void set_argument_type(int bci, int i, ciKlass* k);
 504   void set_parameter_type(int i, ciKlass* k);
 505   void set_return_type(int bci, ciKlass* k);
 506 
 507   void load_data();
 508 
 509   // Convert a dp (data pointer) to a di (data index).
 510   int dp_to_di(address dp) {
 511     return dp - ((address)_data);
 512   }
 513 
 514   // Get the data at an arbitrary (sort of) data index.
 515   ciProfileData* data_at(int data_index);
 516 
 517   // Walk through the data in order.
 518   ciProfileData* first_data() { return data_at(first_di()); }
 519   ciProfileData* next_data(ciProfileData* current);
 520   bool is_valid(ciProfileData* current) { return current != NULL; }
 521 
 522   DataLayout* extra_data_base() const  { return data_layout_at(data_size()); }
 523   DataLayout* args_data_limit() const  { return data_layout_at(data_size() + extra_data_size() -
 524                                                                parameters_size()); }
 525 
 526   // Get the data at an arbitrary bci, or NULL if there is none. If m
 527   // is not NULL look for a SpeculativeTrapData if any first.
 528   ciProfileData* bci_to_data(int bci, ciMethod* m = NULL);
 529 
 530   uint overflow_trap_count() const {
 531     return _orig.overflow_trap_count();
 532   }
 533   uint overflow_recompile_count() const {
 534     return _orig.overflow_recompile_count();
 535   }
 536   uint decompile_count() const {
 537     return _orig.decompile_count();
 538   }
 539   uint trap_count(int reason) const {
 540     return _orig.trap_count(reason);
 541   }
 542   uint trap_reason_limit() const { return _orig.trap_reason_limit(); }
 543   uint trap_count_limit()  const { return _orig.trap_count_limit(); }
 544 


< prev index next >