862 enum {
863 Precedent = TypeFunc::Parms // optional edge to force precedence
864 };
865 MemBarNode(Compile* C, int alias_idx, Node* precedent);
866 virtual int Opcode() const = 0;
867 virtual const class TypePtr *adr_type() const { return _adr_type; }
868 virtual const Type *Value( PhaseTransform *phase ) const;
869 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
870 virtual uint match_edge(uint idx) const { return 0; }
871 virtual const Type *bottom_type() const { return TypeTuple::MEMBAR; }
872 virtual Node *match( const ProjNode *proj, const Matcher *m );
873 // Factory method. Builds a wide or narrow membar.
874 // Optional 'precedent' becomes an extra edge if not null.
875 static MemBarNode* make(Compile* C, int opcode,
876 int alias_idx = Compile::AliasIdxBot,
877 Node* precedent = NULL);
878 };
879
880 // "Acquire" - no following ref can move before (but earlier refs can
881 // follow, like an early Load stalled in cache). Requires multi-cpu
882 // visibility. Inserted after a volatile load or FastLock.
883 class MemBarAcquireNode: public MemBarNode {
884 public:
885 MemBarAcquireNode(Compile* C, int alias_idx, Node* precedent)
886 : MemBarNode(C, alias_idx, precedent) {}
887 virtual int Opcode() const;
888 };
889
890 // "Release" - no earlier ref can move after (but later refs can move
891 // up, like a speculative pipelined cache-hitting Load). Requires
892 // multi-cpu visibility. Inserted before a volatile store or FastUnLock.
893 class MemBarReleaseNode: public MemBarNode {
894 public:
895 MemBarReleaseNode(Compile* C, int alias_idx, Node* precedent)
896 : MemBarNode(C, alias_idx, precedent) {}
897 virtual int Opcode() const;
898 };
899
900 // Ordering between a volatile store and a following volatile load.
901 // Requires multi-CPU visibility?
902 class MemBarVolatileNode: public MemBarNode {
903 public:
904 MemBarVolatileNode(Compile* C, int alias_idx, Node* precedent)
905 : MemBarNode(C, alias_idx, precedent) {}
906 virtual int Opcode() const;
907 };
908
909 // Ordering within the same CPU. Used to order unsafe memory references
910 // inside the compiler when we lack alias info. Not needed "outside" the
911 // compiler because the CPU does all the ordering for us.
912 class MemBarCPUOrderNode: public MemBarNode {
913 public:
914 MemBarCPUOrderNode(Compile* C, int alias_idx, Node* precedent)
915 : MemBarNode(C, alias_idx, precedent) {}
|
862 enum {
863 Precedent = TypeFunc::Parms // optional edge to force precedence
864 };
865 MemBarNode(Compile* C, int alias_idx, Node* precedent);
866 virtual int Opcode() const = 0;
867 virtual const class TypePtr *adr_type() const { return _adr_type; }
868 virtual const Type *Value( PhaseTransform *phase ) const;
869 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
870 virtual uint match_edge(uint idx) const { return 0; }
871 virtual const Type *bottom_type() const { return TypeTuple::MEMBAR; }
872 virtual Node *match( const ProjNode *proj, const Matcher *m );
873 // Factory method. Builds a wide or narrow membar.
874 // Optional 'precedent' becomes an extra edge if not null.
875 static MemBarNode* make(Compile* C, int opcode,
876 int alias_idx = Compile::AliasIdxBot,
877 Node* precedent = NULL);
878 };
879
880 // "Acquire" - no following ref can move before (but earlier refs can
881 // follow, like an early Load stalled in cache). Requires multi-cpu
882 // visibility. Inserted after a volatile load.
883 class MemBarAcquireNode: public MemBarNode {
884 public:
885 MemBarAcquireNode(Compile* C, int alias_idx, Node* precedent)
886 : MemBarNode(C, alias_idx, precedent) {}
887 virtual int Opcode() const;
888 };
889
890 // "Release" - no earlier ref can move after (but later refs can move
891 // up, like a speculative pipelined cache-hitting Load). Requires
892 // multi-cpu visibility. Inserted before a volatile store.
893 class MemBarReleaseNode: public MemBarNode {
894 public:
895 MemBarReleaseNode(Compile* C, int alias_idx, Node* precedent)
896 : MemBarNode(C, alias_idx, precedent) {}
897 virtual int Opcode() const;
898 };
899
900 // "Acquire" - no following ref can move before (but earlier refs can
901 // follow, like an early Load stalled in cache). Requires multi-cpu
902 // visibility. Inserted after a FastLock.
903 class MemBarAcquireLockNode: public MemBarNode {
904 public:
905 MemBarAcquireLockNode(Compile* C, int alias_idx, Node* precedent)
906 : MemBarNode(C, alias_idx, precedent) {}
907 virtual int Opcode() const;
908 };
909
910 // "Release" - no earlier ref can move after (but later refs can move
911 // up, like a speculative pipelined cache-hitting Load). Requires
912 // multi-cpu visibility. Inserted before a FastUnLock.
913 class MemBarReleaseLockNode: public MemBarNode {
914 public:
915 MemBarReleaseLockNode(Compile* C, int alias_idx, Node* precedent)
916 : MemBarNode(C, alias_idx, precedent) {}
917 virtual int Opcode() const;
918 };
919
920 // Ordering between a volatile store and a following volatile load.
921 // Requires multi-CPU visibility?
922 class MemBarVolatileNode: public MemBarNode {
923 public:
924 MemBarVolatileNode(Compile* C, int alias_idx, Node* precedent)
925 : MemBarNode(C, alias_idx, precedent) {}
926 virtual int Opcode() const;
927 };
928
929 // Ordering within the same CPU. Used to order unsafe memory references
930 // inside the compiler when we lack alias info. Not needed "outside" the
931 // compiler because the CPU does all the ordering for us.
932 class MemBarCPUOrderNode: public MemBarNode {
933 public:
934 MemBarCPUOrderNode(Compile* C, int alias_idx, Node* precedent)
935 : MemBarNode(C, alias_idx, precedent) {}
|