comparison src/share/vm/opto/macro.cpp @ 6275:957c266d8bc5

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Tue, 21 Aug 2012 10:39:19 +0200
parents d2a62e0f25eb
children da91efe96a93
comparison
equal deleted inserted replaced
5891:fd8832ae511d 6275:957c266d8bc5
407 } 407 }
408 Node *start_mem = C->start()->proj_out(TypeFunc::Memory); 408 Node *start_mem = C->start()->proj_out(TypeFunc::Memory);
409 Node *alloc_mem = alloc->in(TypeFunc::Memory); 409 Node *alloc_mem = alloc->in(TypeFunc::Memory);
410 410
411 uint length = mem->req(); 411 uint length = mem->req();
412 GrowableArray <Node *> values(length, length, NULL); 412 GrowableArray <Node *> values(length, length, NULL, false);
413 413
414 // create a new Phi for the value 414 // create a new Phi for the value
415 PhiNode *phi = new (C, length) PhiNode(mem->in(0), phi_type, NULL, instance_id, alias_idx, offset); 415 PhiNode *phi = new (C, length) PhiNode(mem->in(0), phi_type, NULL, instance_id, alias_idx, offset);
416 transform_later(phi); 416 transform_later(phi);
417 value_phis->push(phi, mem->_idx); 417 value_phis->push(phi, mem->_idx);
1445 // result_phi_rawmem (unless we are only generating a slow call when 1445 // result_phi_rawmem (unless we are only generating a slow call when
1446 // both memory projections are combined) 1446 // both memory projections are combined)
1447 if (!always_slow && _memproj_fallthrough != NULL) { 1447 if (!always_slow && _memproj_fallthrough != NULL) {
1448 for (DUIterator_Fast imax, i = _memproj_fallthrough->fast_outs(imax); i < imax; i++) { 1448 for (DUIterator_Fast imax, i = _memproj_fallthrough->fast_outs(imax); i < imax; i++) {
1449 Node *use = _memproj_fallthrough->fast_out(i); 1449 Node *use = _memproj_fallthrough->fast_out(i);
1450 _igvn.hash_delete(use); 1450 _igvn.rehash_node_delayed(use);
1451 imax -= replace_input(use, _memproj_fallthrough, result_phi_rawmem); 1451 imax -= replace_input(use, _memproj_fallthrough, result_phi_rawmem);
1452 _igvn._worklist.push(use);
1453 // back up iterator 1452 // back up iterator
1454 --i; 1453 --i;
1455 } 1454 }
1456 } 1455 }
1457 // Now change uses of _memproj_catchall to use _memproj_fallthrough and delete 1456 // Now change uses of _memproj_catchall to use _memproj_fallthrough and delete
1461 _memproj_fallthrough = new (C, 1) ProjNode(call, TypeFunc::Memory); 1460 _memproj_fallthrough = new (C, 1) ProjNode(call, TypeFunc::Memory);
1462 transform_later(_memproj_fallthrough); 1461 transform_later(_memproj_fallthrough);
1463 } 1462 }
1464 for (DUIterator_Fast imax, i = _memproj_catchall->fast_outs(imax); i < imax; i++) { 1463 for (DUIterator_Fast imax, i = _memproj_catchall->fast_outs(imax); i < imax; i++) {
1465 Node *use = _memproj_catchall->fast_out(i); 1464 Node *use = _memproj_catchall->fast_out(i);
1466 _igvn.hash_delete(use); 1465 _igvn.rehash_node_delayed(use);
1467 imax -= replace_input(use, _memproj_catchall, _memproj_fallthrough); 1466 imax -= replace_input(use, _memproj_catchall, _memproj_fallthrough);
1468 _igvn._worklist.push(use);
1469 // back up iterator 1467 // back up iterator
1470 --i; 1468 --i;
1471 } 1469 }
1472 assert(_memproj_catchall->outcnt() == 0, "all uses must be deleted"); 1470 assert(_memproj_catchall->outcnt() == 0, "all uses must be deleted");
1473 _igvn.remove_dead_node(_memproj_catchall); 1471 _igvn.remove_dead_node(_memproj_catchall);
1479 // (it is different from memory projections where both projections are 1477 // (it is different from memory projections where both projections are
1480 // combined in such case). 1478 // combined in such case).
1481 if (_ioproj_fallthrough != NULL) { 1479 if (_ioproj_fallthrough != NULL) {
1482 for (DUIterator_Fast imax, i = _ioproj_fallthrough->fast_outs(imax); i < imax; i++) { 1480 for (DUIterator_Fast imax, i = _ioproj_fallthrough->fast_outs(imax); i < imax; i++) {
1483 Node *use = _ioproj_fallthrough->fast_out(i); 1481 Node *use = _ioproj_fallthrough->fast_out(i);
1484 _igvn.hash_delete(use); 1482 _igvn.rehash_node_delayed(use);
1485 imax -= replace_input(use, _ioproj_fallthrough, result_phi_i_o); 1483 imax -= replace_input(use, _ioproj_fallthrough, result_phi_i_o);
1486 _igvn._worklist.push(use);
1487 // back up iterator 1484 // back up iterator
1488 --i; 1485 --i;
1489 } 1486 }
1490 } 1487 }
1491 // Now change uses of _ioproj_catchall to use _ioproj_fallthrough and delete 1488 // Now change uses of _ioproj_catchall to use _ioproj_fallthrough and delete
1495 _ioproj_fallthrough = new (C, 1) ProjNode(call, TypeFunc::I_O); 1492 _ioproj_fallthrough = new (C, 1) ProjNode(call, TypeFunc::I_O);
1496 transform_later(_ioproj_fallthrough); 1493 transform_later(_ioproj_fallthrough);
1497 } 1494 }
1498 for (DUIterator_Fast imax, i = _ioproj_catchall->fast_outs(imax); i < imax; i++) { 1495 for (DUIterator_Fast imax, i = _ioproj_catchall->fast_outs(imax); i < imax; i++) {
1499 Node *use = _ioproj_catchall->fast_out(i); 1496 Node *use = _ioproj_catchall->fast_out(i);
1500 _igvn.hash_delete(use); 1497 _igvn.rehash_node_delayed(use);
1501 imax -= replace_input(use, _ioproj_catchall, _ioproj_fallthrough); 1498 imax -= replace_input(use, _ioproj_catchall, _ioproj_fallthrough);
1502 _igvn._worklist.push(use);
1503 // back up iterator 1499 // back up iterator
1504 --i; 1500 --i;
1505 } 1501 }
1506 assert(_ioproj_catchall->outcnt() == 0, "all uses must be deleted"); 1502 assert(_ioproj_catchall->outcnt() == 0, "all uses must be deleted");
1507 _igvn.remove_dead_node(_ioproj_catchall); 1503 _igvn.remove_dead_node(_ioproj_catchall);
1855 if (u->is_AbstractLock()) { 1851 if (u->is_AbstractLock()) {
1856 AbstractLockNode* alock = u->as_AbstractLock(); 1852 AbstractLockNode* alock = u->as_AbstractLock();
1857 if (alock->box_node() == oldbox && alock->obj_node()->eqv_uncast(obj)) { 1853 if (alock->box_node() == oldbox && alock->obj_node()->eqv_uncast(obj)) {
1858 // Replace Box and mark eliminated all related locks and unlocks. 1854 // Replace Box and mark eliminated all related locks and unlocks.
1859 alock->set_non_esc_obj(); 1855 alock->set_non_esc_obj();
1860 _igvn.hash_delete(alock); 1856 _igvn.rehash_node_delayed(alock);
1861 alock->set_box_node(newbox); 1857 alock->set_box_node(newbox);
1862 _igvn._worklist.push(alock);
1863 next_edge = false; 1858 next_edge = false;
1864 } 1859 }
1865 } 1860 }
1866 if (u->is_FastLock() && u->as_FastLock()->obj_node()->eqv_uncast(obj)) { 1861 if (u->is_FastLock() && u->as_FastLock()->obj_node()->eqv_uncast(obj)) {
1867 FastLockNode* flock = u->as_FastLock(); 1862 FastLockNode* flock = u->as_FastLock();
1868 assert(flock->box_node() == oldbox, "sanity"); 1863 assert(flock->box_node() == oldbox, "sanity");
1869 _igvn.hash_delete(flock); 1864 _igvn.rehash_node_delayed(flock);
1870 flock->set_box_node(newbox); 1865 flock->set_box_node(newbox);
1871 _igvn._worklist.push(flock);
1872 next_edge = false; 1866 next_edge = false;
1873 } 1867 }
1874 1868
1875 // Replace old box in monitor debug info. 1869 // Replace old box in monitor debug info.
1876 if (u->is_SafePoint() && u->as_SafePoint()->jvms()) { 1870 if (u->is_SafePoint() && u->as_SafePoint()->jvms()) {
1884 for (int idx = 0; idx < num_mon; idx++) { 1878 for (int idx = 0; idx < num_mon; idx++) {
1885 Node* obj_node = sfn->monitor_obj(jvms, idx); 1879 Node* obj_node = sfn->monitor_obj(jvms, idx);
1886 Node* box_node = sfn->monitor_box(jvms, idx); 1880 Node* box_node = sfn->monitor_box(jvms, idx);
1887 if (box_node == oldbox && obj_node->eqv_uncast(obj)) { 1881 if (box_node == oldbox && obj_node->eqv_uncast(obj)) {
1888 int j = jvms->monitor_box_offset(idx); 1882 int j = jvms->monitor_box_offset(idx);
1889 _igvn.hash_delete(u); 1883 _igvn.replace_input_of(u, j, newbox);
1890 u->set_req(j, newbox);
1891 _igvn._worklist.push(u);
1892 next_edge = false; 1884 next_edge = false;
1893 } 1885 }
1894 } 1886 }
1895 } 1887 }
1896 } 1888 }