comparison src/share/vm/opto/phaseX.cpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 89152779163c 1555c0843770
children 7848fc12602b
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
319 if(n != NULL && n != sentinel_node && !useful.test(n->_idx)) { 319 if(n != NULL && n != sentinel_node && !useful.test(n->_idx)) {
320 debug_only(n->exit_hash_lock()); // Unlock the node when removed 320 debug_only(n->exit_hash_lock()); // Unlock the node when removed
321 _table[i] = sentinel_node; // Replace with placeholder 321 _table[i] = sentinel_node; // Replace with placeholder
322 } 322 }
323 } 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
324 } 341 }
325 342
326 #ifndef PRODUCT 343 #ifndef PRODUCT
327 //------------------------------dump------------------------------------------- 344 //------------------------------dump-------------------------------------------
328 // Dump statistics for the hash table 345 // Dump statistics for the hash table
983 } 1000 }
984 } 1001 }
985 if ( VerifyIterativeGVN && PrintOpto ) { 1002 if ( VerifyIterativeGVN && PrintOpto ) {
986 if ( _verify_counter == _verify_full_passes ) 1003 if ( _verify_counter == _verify_full_passes )
987 tty->print_cr("VerifyIterativeGVN: %d transforms and verify passes", 1004 tty->print_cr("VerifyIterativeGVN: %d transforms and verify passes",
988 _verify_full_passes); 1005 (int) _verify_full_passes);
989 else 1006 else
990 tty->print_cr("VerifyIterativeGVN: %d transforms, %d full verify passes", 1007 tty->print_cr("VerifyIterativeGVN: %d transforms, %d full verify passes",
991 _verify_counter, _verify_full_passes); 1008 (int) _verify_counter, (int) _verify_full_passes);
992 } 1009 }
993 #endif 1010 #endif
994 } 1011 }
995 1012
996 1013
1360 Node* u = use->fast_out(i2); 1377 Node* u = use->fast_out(i2);
1361 if (u->Opcode() == Op_RShiftI) 1378 if (u->Opcode() == Op_RShiftI)
1362 _worklist.push(u); 1379 _worklist.push(u);
1363 } 1380 }
1364 } 1381 }
1382 // If changed AddI/SubI inputs, check CmpU for range check optimization.
1383 if (use_op == Op_AddI || use_op == Op_SubI) {
1384 for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
1385 Node* u = use->fast_out(i2);
1386 if (u->is_Cmp() && (u->Opcode() == Op_CmpU)) {
1387 _worklist.push(u);
1388 }
1389 }
1390 }
1365 // If changed AddP inputs, check Stores for loop invariant 1391 // If changed AddP inputs, check Stores for loop invariant
1366 if( use_op == Op_AddP ) { 1392 if( use_op == Op_AddP ) {
1367 for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { 1393 for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
1368 Node* u = use->fast_out(i2); 1394 Node* u = use->fast_out(i2);
1369 if (u->is_Mem()) 1395 if (u->is_Mem())
1390 */ 1416 */
1391 void PhaseIterGVN::remove_speculative_types() { 1417 void PhaseIterGVN::remove_speculative_types() {
1392 assert(UseTypeSpeculation, "speculation is off"); 1418 assert(UseTypeSpeculation, "speculation is off");
1393 for (uint i = 0; i < _types.Size(); i++) { 1419 for (uint i = 0; i < _types.Size(); i++) {
1394 const Type* t = _types.fast_lookup(i); 1420 const Type* t = _types.fast_lookup(i);
1395 if (t != NULL && t->isa_oopptr()) { 1421 if (t != NULL) {
1396 const TypeOopPtr* to = t->is_oopptr(); 1422 _types.map(i, t->remove_speculative());
1397 _types.map(i, to->remove_speculative()); 1423 }
1398 } 1424 }
1399 } 1425 _table.check_no_speculative_types();
1400 } 1426 }
1401 1427
1402 //============================================================================= 1428 //=============================================================================
1403 #ifndef PRODUCT 1429 #ifndef PRODUCT
1404 uint PhaseCCP::_total_invokes = 0; 1430 uint PhaseCCP::_total_invokes = 0;