1161 } 1162 } 1163 NOT_PRODUCT(verify_PhaseIterGVN();) 1164 } 1165 1166 1167 /** 1168 * Register a new node with the optimizer. Update the types array, the def-use 1169 * info. Put on worklist. 1170 */ 1171 Node* PhaseIterGVN::register_new_node_with_optimizer(Node* n, Node* orig) { 1172 set_type_bottom(n); 1173 _worklist.push(n); 1174 if (orig != NULL) C->copy_node_notes_to(n, orig); 1175 return n; 1176 } 1177 1178 //------------------------------transform-------------------------------------- 1179 // Non-recursive: idealize Node 'n' with respect to its inputs and its value 1180 Node *PhaseIterGVN::transform( Node *n ) { 1181 if (_delay_transform) { 1182 // Register the node but don't optimize for now 1183 register_new_node_with_optimizer(n); 1184 return n; 1185 } 1186 1187 // If brand new node, make space in type array, and give it a type. 1188 ensure_type_or_null(n); 1189 if (type_or_null(n) == NULL) { 1190 set_type_bottom(n); 1191 } 1192 1193 return transform_old(n); 1194 } 1195 1196 Node *PhaseIterGVN::transform_old(Node* n) { 1197 DEBUG_ONLY(uint loop_count = 0;); 1198 NOT_PRODUCT(set_transforms()); 1199 1200 // Remove 'n' from hash table in case it gets modified 1201 _table.hash_delete(n); 1202 if (VerifyIterativeGVN) { 1203 assert(!_table.find_index(n->_idx), "found duplicate entry in table"); 1204 } 1205 1206 // Apply the Ideal call in a loop until it no longer applies 1207 Node* k = n; 1208 DEBUG_ONLY(dead_loop_check(k);) 1209 DEBUG_ONLY(bool is_new = (k->outcnt() == 0);) 1210 C->remove_modified_node(k); | 1161 } 1162 } 1163 NOT_PRODUCT(verify_PhaseIterGVN();) 1164 } 1165 1166 1167 /** 1168 * Register a new node with the optimizer. Update the types array, the def-use 1169 * info. Put on worklist. 1170 */ 1171 Node* PhaseIterGVN::register_new_node_with_optimizer(Node* n, Node* orig) { 1172 set_type_bottom(n); 1173 _worklist.push(n); 1174 if (orig != NULL) C->copy_node_notes_to(n, orig); 1175 return n; 1176 } 1177 1178 //------------------------------transform-------------------------------------- 1179 // Non-recursive: idealize Node 'n' with respect to its inputs and its value 1180 Node *PhaseIterGVN::transform( Node *n ) { 1181 // If brand new node, make space in type array, and give it a type. 1182 ensure_type_or_null(n); 1183 if (type_or_null(n) == NULL) { 1184 set_type_bottom(n); 1185 } 1186 1187 if (_delay_transform) { 1188 // Add the node to the worklist but don't optimize for now 1189 _worklist.push(n); 1190 return n; 1191 } 1192 1193 return transform_old(n); 1194 } 1195 1196 Node *PhaseIterGVN::transform_old(Node* n) { 1197 DEBUG_ONLY(uint loop_count = 0;); 1198 NOT_PRODUCT(set_transforms()); 1199 1200 // Remove 'n' from hash table in case it gets modified 1201 _table.hash_delete(n); 1202 if (VerifyIterativeGVN) { 1203 assert(!_table.find_index(n->_idx), "found duplicate entry in table"); 1204 } 1205 1206 // Apply the Ideal call in a loop until it no longer applies 1207 Node* k = n; 1208 DEBUG_ONLY(dead_loop_check(k);) 1209 DEBUG_ONLY(bool is_new = (k->outcnt() == 0);) 1210 C->remove_modified_node(k); |