58 debug_only(_adr_type=at; adr_type();)
59 }
60 MemNode( Node *c0, Node *c1, Node *c2, const TypePtr* at, Node *c3 )
61 : Node(c0,c1,c2,c3) {
62 init_class_id(Class_Mem);
63 debug_only(_adr_type=at; adr_type();)
64 }
65 MemNode( Node *c0, Node *c1, Node *c2, const TypePtr* at, Node *c3, Node *c4)
66 : Node(c0,c1,c2,c3,c4) {
67 init_class_id(Class_Mem);
68 debug_only(_adr_type=at; adr_type();)
69 }
70
71 public:
72 // Helpers for the optimizer. Documented in memnode.cpp.
73 static bool detect_ptr_independence(Node* p1, AllocateNode* a1,
74 Node* p2, AllocateNode* a2,
75 PhaseTransform* phase);
76 static bool adr_phi_is_loop_invariant(Node* adr_phi, Node* cast);
77
78 static Node *optimize_simple_memory_chain(Node *mchain, const TypePtr *t_adr, PhaseGVN *phase);
79 static Node *optimize_memory_chain(Node *mchain, const TypePtr *t_adr, PhaseGVN *phase);
80 // This one should probably be a phase-specific function:
81 static bool all_controls_dominate(Node* dom, Node* sub);
82
83 // Find any cast-away of null-ness and keep its control.
84 static Node *Ideal_common_DU_postCCP( PhaseCCP *ccp, Node* n, Node* adr );
85 virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
86
87 virtual const class TypePtr *adr_type() const; // returns bottom_type of address
88
89 // Shared code for Ideal methods:
90 Node *Ideal_common(PhaseGVN *phase, bool can_reshape); // Return -1 for short-circuit NULL.
91
92 // Helper function for adr_type() implementations.
93 static const TypePtr* calculate_adr_type(const Type* t, const TypePtr* cross_check = NULL);
94
95 // Raw access function, to allow copying of adr_type efficiently in
96 // product builds and retain the debug info for debug builds.
97 const TypePtr *raw_adr_type() const {
98 #ifdef ASSERT
99 return _adr_type;
1082 // Return my own memory projection (meaning the initial zero bits)
1083 // if there is no such store. Return NULL if there is a problem.
1084 Node* find_captured_store(intptr_t start, int size_in_bytes, PhaseTransform* phase);
1085
1086 // Called when the associated AllocateNode is expanded into CFG.
1087 Node* complete_stores(Node* rawctl, Node* rawmem, Node* rawptr,
1088 intptr_t header_size, Node* size_in_bytes,
1089 PhaseGVN* phase);
1090
1091 private:
1092 void remove_extra_zeroes();
1093
1094 // Find out where a captured store should be placed (or already is placed).
1095 int captured_store_insertion_point(intptr_t start, int size_in_bytes,
1096 PhaseTransform* phase);
1097
1098 static intptr_t get_store_offset(Node* st, PhaseTransform* phase);
1099
1100 Node* make_raw_address(intptr_t offset, PhaseTransform* phase);
1101
1102 bool detect_init_independence(Node* n, bool st_is_pinned, int& count);
1103
1104 void coalesce_subword_stores(intptr_t header_size, Node* size_in_bytes,
1105 PhaseGVN* phase);
1106
1107 intptr_t find_next_fullword_store(uint i, PhaseGVN* phase);
1108 };
1109
1110 //------------------------------MergeMem---------------------------------------
1111 // (See comment in memnode.cpp near MergeMemNode::MergeMemNode for semantics.)
1112 class MergeMemNode: public Node {
1113 virtual uint hash() const ; // { return NO_HASH; }
1114 virtual uint cmp( const Node &n ) const ; // Always fail, except on self
1115 friend class MergeMemStream;
1116 MergeMemNode(Node* def); // clients use MergeMemNode::make
1117
1118 public:
1119 // If the input is a whole memory state, clone it with all its slices intact.
1120 // Otherwise, make a new memory state with just that base memory input.
1121 // In either case, the result is a newly created MergeMem.
1122 static MergeMemNode* make(Compile* C, Node* base_memory);
|
58 debug_only(_adr_type=at; adr_type();)
59 }
60 MemNode( Node *c0, Node *c1, Node *c2, const TypePtr* at, Node *c3 )
61 : Node(c0,c1,c2,c3) {
62 init_class_id(Class_Mem);
63 debug_only(_adr_type=at; adr_type();)
64 }
65 MemNode( Node *c0, Node *c1, Node *c2, const TypePtr* at, Node *c3, Node *c4)
66 : Node(c0,c1,c2,c3,c4) {
67 init_class_id(Class_Mem);
68 debug_only(_adr_type=at; adr_type();)
69 }
70
71 public:
72 // Helpers for the optimizer. Documented in memnode.cpp.
73 static bool detect_ptr_independence(Node* p1, AllocateNode* a1,
74 Node* p2, AllocateNode* a2,
75 PhaseTransform* phase);
76 static bool adr_phi_is_loop_invariant(Node* adr_phi, Node* cast);
77
78 static Node *optimize_simple_memory_chain(Node *mchain, const TypeOopPtr *t_oop, Node *load, PhaseGVN *phase);
79 static Node *optimize_memory_chain(Node *mchain, const TypePtr *t_adr, Node *load, PhaseGVN *phase);
80 // This one should probably be a phase-specific function:
81 static bool all_controls_dominate(Node* dom, Node* sub);
82
83 // Find any cast-away of null-ness and keep its control.
84 static Node *Ideal_common_DU_postCCP( PhaseCCP *ccp, Node* n, Node* adr );
85 virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
86
87 virtual const class TypePtr *adr_type() const; // returns bottom_type of address
88
89 // Shared code for Ideal methods:
90 Node *Ideal_common(PhaseGVN *phase, bool can_reshape); // Return -1 for short-circuit NULL.
91
92 // Helper function for adr_type() implementations.
93 static const TypePtr* calculate_adr_type(const Type* t, const TypePtr* cross_check = NULL);
94
95 // Raw access function, to allow copying of adr_type efficiently in
96 // product builds and retain the debug info for debug builds.
97 const TypePtr *raw_adr_type() const {
98 #ifdef ASSERT
99 return _adr_type;
1082 // Return my own memory projection (meaning the initial zero bits)
1083 // if there is no such store. Return NULL if there is a problem.
1084 Node* find_captured_store(intptr_t start, int size_in_bytes, PhaseTransform* phase);
1085
1086 // Called when the associated AllocateNode is expanded into CFG.
1087 Node* complete_stores(Node* rawctl, Node* rawmem, Node* rawptr,
1088 intptr_t header_size, Node* size_in_bytes,
1089 PhaseGVN* phase);
1090
1091 private:
1092 void remove_extra_zeroes();
1093
1094 // Find out where a captured store should be placed (or already is placed).
1095 int captured_store_insertion_point(intptr_t start, int size_in_bytes,
1096 PhaseTransform* phase);
1097
1098 static intptr_t get_store_offset(Node* st, PhaseTransform* phase);
1099
1100 Node* make_raw_address(intptr_t offset, PhaseTransform* phase);
1101
1102 bool detect_init_independence(Node* n, int& count);
1103
1104 void coalesce_subword_stores(intptr_t header_size, Node* size_in_bytes,
1105 PhaseGVN* phase);
1106
1107 intptr_t find_next_fullword_store(uint i, PhaseGVN* phase);
1108 };
1109
1110 //------------------------------MergeMem---------------------------------------
1111 // (See comment in memnode.cpp near MergeMemNode::MergeMemNode for semantics.)
1112 class MergeMemNode: public Node {
1113 virtual uint hash() const ; // { return NO_HASH; }
1114 virtual uint cmp( const Node &n ) const ; // Always fail, except on self
1115 friend class MergeMemStream;
1116 MergeMemNode(Node* def); // clients use MergeMemNode::make
1117
1118 public:
1119 // If the input is a whole memory state, clone it with all its slices intact.
1120 // Otherwise, make a new memory state with just that base memory input.
1121 // In either case, the result is a newly created MergeMem.
1122 static MergeMemNode* make(Compile* C, Node* base_memory);
|