313 // Dead nodes in the hash table inherited from GVN should not replace
314 // existing nodes, remove dead nodes.
315 uint max = size();
316 Node *sentinel_node = sentinel();
317 for( uint i = 0; i < max; ++i ) {
318 Node *n = at(i);
319 if(n != NULL && n != sentinel_node && !useful.test(n->_idx)) {
320 debug_only(n->exit_hash_lock()); // Unlock the node when removed
321 _table[i] = sentinel_node; // Replace with placeholder
322 }
323 }
324 }
325
326
327 void NodeHash::check_no_speculative_types() {
328 #ifdef ASSERT
329 uint max = size();
330 Node *sentinel_node = sentinel();
331 for (uint i = 0; i < max; ++i) {
332 Node *n = at(i);
333 if(n != NULL && n != sentinel_node && n->is_Type()) {
334 TypeNode* tn = n->as_Type();
335 const Type* t = tn->type();
336 const Type* t_no_spec = t->remove_speculative();
337 assert(t == t_no_spec, "dead node in hash table or missed node during speculative cleanup");
338 }
339 }
340 #endif
341 }
342
343 #ifndef PRODUCT
344 //------------------------------dump-------------------------------------------
345 // Dump statistics for the hash table
346 void NodeHash::dump() {
347 _total_inserts += _inserts;
348 _total_insert_probes += _insert_probes;
349 if (PrintCompilation && PrintOptoStatistics && Verbose && (_inserts > 0)) {
350 if (WizardMode) {
351 for (uint i=0; i<_max; i++) {
352 if (_table[i])
353 tty->print("%d/%d/%d ",i,_table[i]->hash()&(_max-1),_table[i]->_idx);
|
313 // Dead nodes in the hash table inherited from GVN should not replace
314 // existing nodes, remove dead nodes.
315 uint max = size();
316 Node *sentinel_node = sentinel();
317 for( uint i = 0; i < max; ++i ) {
318 Node *n = at(i);
319 if(n != NULL && n != sentinel_node && !useful.test(n->_idx)) {
320 debug_only(n->exit_hash_lock()); // Unlock the node when removed
321 _table[i] = sentinel_node; // Replace with placeholder
322 }
323 }
324 }
325
326
327 void NodeHash::check_no_speculative_types() {
328 #ifdef ASSERT
329 uint max = size();
330 Node *sentinel_node = sentinel();
331 for (uint i = 0; i < max; ++i) {
332 Node *n = at(i);
333 if(n != NULL && n != sentinel_node && n->is_Type() && n->outcnt() > 0) {
334 TypeNode* tn = n->as_Type();
335 const Type* t = tn->type();
336 const Type* t_no_spec = t->remove_speculative();
337 assert(t == t_no_spec, "dead node in hash table or missed node during speculative cleanup");
338 }
339 }
340 #endif
341 }
342
343 #ifndef PRODUCT
344 //------------------------------dump-------------------------------------------
345 // Dump statistics for the hash table
346 void NodeHash::dump() {
347 _total_inserts += _inserts;
348 _total_insert_probes += _insert_probes;
349 if (PrintCompilation && PrintOptoStatistics && Verbose && (_inserts > 0)) {
350 if (WizardMode) {
351 for (uint i=0; i<_max; i++) {
352 if (_table[i])
353 tty->print("%d/%d/%d ",i,_table[i]->hash()&(_max-1),_table[i]->_idx);
|