comparison src/share/vm/opto/callnode.hpp @ 4970:33df1aeaebbf

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 27 Feb 2012 13:10:13 +0100
parents e9a5e0a812c8
children ee138854b3a6
comparison
equal deleted inserted replaced
4703:2cfb7fb2dce7 4970:33df1aeaebbf
789 // Walks out edges to find it... 789 // Walks out edges to find it...
790 // (Note: Both InitializeNode::allocation and AllocateNode::initialization 790 // (Note: Both InitializeNode::allocation and AllocateNode::initialization
791 // are defined in graphKit.cpp, which sets up the bidirectional relation.) 791 // are defined in graphKit.cpp, which sets up the bidirectional relation.)
792 InitializeNode* initialization(); 792 InitializeNode* initialization();
793 793
794 // Return the corresponding storestore barrier (or null if none).
795 // Walks out edges to find it...
796 MemBarStoreStoreNode* storestore();
797
794 // Convenience for initialization->maybe_set_complete(phase) 798 // Convenience for initialization->maybe_set_complete(phase)
795 bool maybe_set_complete(PhaseGVN* phase); 799 bool maybe_set_complete(PhaseGVN* phase);
796 }; 800 };
797 801
798 //------------------------------AllocateArray--------------------------------- 802 //------------------------------AllocateArray---------------------------------
834 }; 838 };
835 839
836 //------------------------------AbstractLockNode----------------------------------- 840 //------------------------------AbstractLockNode-----------------------------------
837 class AbstractLockNode: public CallNode { 841 class AbstractLockNode: public CallNode {
838 private: 842 private:
839 bool _eliminate; // indicates this lock can be safely eliminated 843 enum {
840 bool _coarsened; // indicates this lock was coarsened 844 Regular = 0, // Normal lock
845 NonEscObj, // Lock is used for non escaping object
846 Coarsened, // Lock was coarsened
847 Nested // Nested lock
848 } _kind;
841 #ifndef PRODUCT 849 #ifndef PRODUCT
842 NamedCounter* _counter; 850 NamedCounter* _counter;
843 #endif 851 #endif
844 852
845 protected: 853 protected:
852 GrowableArray<AbstractLockNode*> &lock_ops); 860 GrowableArray<AbstractLockNode*> &lock_ops);
853 bool find_unlocks_for_region(const RegionNode* region, LockNode* lock, 861 bool find_unlocks_for_region(const RegionNode* region, LockNode* lock,
854 GrowableArray<AbstractLockNode*> &lock_ops); 862 GrowableArray<AbstractLockNode*> &lock_ops);
855 LockNode *find_matching_lock(UnlockNode* unlock); 863 LockNode *find_matching_lock(UnlockNode* unlock);
856 864
865 // Update the counter to indicate that this lock was eliminated.
866 void set_eliminated_lock_counter() PRODUCT_RETURN;
857 867
858 public: 868 public:
859 AbstractLockNode(const TypeFunc *tf) 869 AbstractLockNode(const TypeFunc *tf)
860 : CallNode(tf, NULL, TypeRawPtr::BOTTOM), 870 : CallNode(tf, NULL, TypeRawPtr::BOTTOM),
861 _coarsened(false), 871 _kind(Regular)
862 _eliminate(false)
863 { 872 {
864 #ifndef PRODUCT 873 #ifndef PRODUCT
865 _counter = NULL; 874 _counter = NULL;
866 #endif 875 #endif
867 } 876 }
868 virtual int Opcode() const = 0; 877 virtual int Opcode() const = 0;
869 Node * obj_node() const {return in(TypeFunc::Parms + 0); } 878 Node * obj_node() const {return in(TypeFunc::Parms + 0); }
870 Node * box_node() const {return in(TypeFunc::Parms + 1); } 879 Node * box_node() const {return in(TypeFunc::Parms + 1); }
871 Node * fastlock_node() const {return in(TypeFunc::Parms + 2); } 880 Node * fastlock_node() const {return in(TypeFunc::Parms + 2); }
881 void set_box_node(Node* box) { set_req(TypeFunc::Parms + 1, box); }
882
872 const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;} 883 const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;}
873 884
874 virtual uint size_of() const { return sizeof(*this); } 885 virtual uint size_of() const { return sizeof(*this); }
875 886
876 bool is_eliminated() {return _eliminate; } 887 bool is_eliminated() const { return (_kind != Regular); }
877 // mark node as eliminated and update the counter if there is one 888 bool is_non_esc_obj() const { return (_kind == NonEscObj); }
878 void set_eliminated(); 889 bool is_coarsened() const { return (_kind == Coarsened); }
879 890 bool is_nested() const { return (_kind == Nested); }
880 bool is_coarsened() { return _coarsened; } 891
881 void set_coarsened() { _coarsened = true; } 892 void set_non_esc_obj() { _kind = NonEscObj; set_eliminated_lock_counter(); }
882 void clear_coarsened() { _coarsened = false; } 893 void set_coarsened() { _kind = Coarsened; set_eliminated_lock_counter(); }
894 void set_nested() { _kind = Nested; set_eliminated_lock_counter(); }
883 895
884 // locking does not modify its arguments 896 // locking does not modify its arguments
885 virtual bool may_modify(const TypePtr *addr_t, PhaseTransform *phase){ return false;} 897 virtual bool may_modify(const TypePtr *addr_t, PhaseTransform *phase){ return false;}
886 898
887 #ifndef PRODUCT 899 #ifndef PRODUCT
888 void create_lock_counter(JVMState* s); 900 void create_lock_counter(JVMState* s);
889 NamedCounter* counter() const { return _counter; } 901 NamedCounter* counter() const { return _counter; }
890 #endif 902 #endif
930 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); 942 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
931 // Expansion modifies the JVMState, so we need to clone it 943 // Expansion modifies the JVMState, so we need to clone it
932 virtual void clone_jvms() { 944 virtual void clone_jvms() {
933 set_jvms(jvms()->clone_deep(Compile::current())); 945 set_jvms(jvms()->clone_deep(Compile::current()));
934 } 946 }
947
948 bool is_nested_lock_region(); // Is this Lock nested?
935 }; 949 };
936 950
937 //------------------------------Unlock--------------------------------------- 951 //------------------------------Unlock---------------------------------------
938 // High-level unlock operation 952 // High-level unlock operation
939 class UnlockNode : public AbstractLockNode { 953 class UnlockNode : public AbstractLockNode {