720 // the nsv argument makes it safe to hold oops like _klass 721 { start(); } 722 723 bool next(); 724 725 ChangeType change_type() { return _change_type; } 726 Klass* klass() { return _klass; } 727 }; 728 friend class DepChange::ContextStream; 729 }; 730 731 732 // A class hierarchy change coming through the VM (under the Compile_lock). 733 // The change is structured as a single new type with any number of supers 734 // and implemented interface types. Other than the new type, any of the 735 // super types can be context types for a relevant dependency, which the 736 // new type could invalidate. 737 class KlassDepChange : public DepChange { 738 private: 739 // each change set is rooted in exactly one new type (at present): 740 KlassHandle _new_type; 741 742 void initialize(); 743 744 public: 745 // notes the new type, marks it and all its super-types 746 KlassDepChange(KlassHandle new_type) 747 : _new_type(new_type) 748 { 749 initialize(); 750 } 751 752 // cleans up the marks 753 ~KlassDepChange(); 754 755 // What kind of DepChange is this? 756 virtual bool is_klass_change() const { return true; } 757 758 virtual void mark_for_deoptimization(nmethod* nm) { 759 nm->mark_for_deoptimization(/*inc_recompile_counts=*/true); 760 } 761 762 Klass* new_type() { return _new_type(); } 763 764 // involves_context(k) is true if k is new_type or any of the super types 765 bool involves_context(Klass* k); 766 }; 767 768 769 // A CallSite has changed its target. 770 class CallSiteDepChange : public DepChange { 771 private: 772 Handle _call_site; 773 Handle _method_handle; 774 775 public: 776 CallSiteDepChange(Handle call_site, Handle method_handle); 777 778 // What kind of DepChange is this? 779 virtual bool is_call_site_change() const { return true; } 780 781 virtual void mark_for_deoptimization(nmethod* nm) { 782 nm->mark_for_deoptimization(/*inc_recompile_counts=*/false); | 720 // the nsv argument makes it safe to hold oops like _klass 721 { start(); } 722 723 bool next(); 724 725 ChangeType change_type() { return _change_type; } 726 Klass* klass() { return _klass; } 727 }; 728 friend class DepChange::ContextStream; 729 }; 730 731 732 // A class hierarchy change coming through the VM (under the Compile_lock). 733 // The change is structured as a single new type with any number of supers 734 // and implemented interface types. Other than the new type, any of the 735 // super types can be context types for a relevant dependency, which the 736 // new type could invalidate. 737 class KlassDepChange : public DepChange { 738 private: 739 // each change set is rooted in exactly one new type (at present): 740 Klass* _new_type; 741 742 void initialize(); 743 744 public: 745 // notes the new type, marks it and all its super-types 746 KlassDepChange(Klass* new_type) 747 : _new_type(new_type) 748 { 749 initialize(); 750 } 751 752 // cleans up the marks 753 ~KlassDepChange(); 754 755 // What kind of DepChange is this? 756 virtual bool is_klass_change() const { return true; } 757 758 virtual void mark_for_deoptimization(nmethod* nm) { 759 nm->mark_for_deoptimization(/*inc_recompile_counts=*/true); 760 } 761 762 Klass* new_type() { return _new_type; } 763 764 // involves_context(k) is true if k is new_type or any of the super types 765 bool involves_context(Klass* k); 766 }; 767 768 769 // A CallSite has changed its target. 770 class CallSiteDepChange : public DepChange { 771 private: 772 Handle _call_site; 773 Handle _method_handle; 774 775 public: 776 CallSiteDepChange(Handle call_site, Handle method_handle); 777 778 // What kind of DepChange is this? 779 virtual bool is_call_site_change() const { return true; } 780 781 virtual void mark_for_deoptimization(nmethod* nm) { 782 nm->mark_for_deoptimization(/*inc_recompile_counts=*/false); |