Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/nmethod.cpp @ 6787:8966c2d65d96
7200470: KeepAliveClosure not needed in CodeCache::do_unloading
Summary: Removed the unused keep_alive parameter
Reviewed-by: stefank, dholmes, kamg, coleenp
author | brutisso |
---|---|
date | Tue, 25 Sep 2012 14:58:12 +0200 |
parents | da91efe96a93 |
children | f2e12eb74117 |
comparison
equal
deleted
inserted
replaced
6762:04ed664b7e30 | 6787:8966c2d65d96 |
---|---|
1470 } | 1470 } |
1471 } | 1471 } |
1472 | 1472 |
1473 | 1473 |
1474 // If this oop is not live, the nmethod can be unloaded. | 1474 // If this oop is not live, the nmethod can be unloaded. |
1475 bool nmethod::can_unload(BoolObjectClosure* is_alive, | 1475 bool nmethod::can_unload(BoolObjectClosure* is_alive, oop* root, bool unloading_occurred) { |
1476 OopClosure* keep_alive, | |
1477 oop* root, bool unloading_occurred) { | |
1478 assert(root != NULL, "just checking"); | 1476 assert(root != NULL, "just checking"); |
1479 oop obj = *root; | 1477 oop obj = *root; |
1480 if (obj == NULL || is_alive->do_object_b(obj)) { | 1478 if (obj == NULL || is_alive->do_object_b(obj)) { |
1481 return false; | 1479 return false; |
1482 } | 1480 } |
1581 | 1579 |
1582 // This is called at the end of the strong tracing/marking phase of a | 1580 // This is called at the end of the strong tracing/marking phase of a |
1583 // GC to unload an nmethod if it contains otherwise unreachable | 1581 // GC to unload an nmethod if it contains otherwise unreachable |
1584 // oops. | 1582 // oops. |
1585 | 1583 |
1586 void nmethod::do_unloading(BoolObjectClosure* is_alive, | 1584 void nmethod::do_unloading(BoolObjectClosure* is_alive, bool unloading_occurred) { |
1587 OopClosure* keep_alive, bool unloading_occurred) { | |
1588 // Make sure the oop's ready to receive visitors | 1585 // Make sure the oop's ready to receive visitors |
1589 assert(!is_zombie() && !is_unloaded(), | 1586 assert(!is_zombie() && !is_unloaded(), |
1590 "should not call follow on zombie or unloaded nmethod"); | 1587 "should not call follow on zombie or unloaded nmethod"); |
1591 | 1588 |
1592 // If the method is not entrant then a JMP is plastered over the | 1589 // If the method is not entrant then a JMP is plastered over the |
1670 // the code. Other oops (oop_index>0) are seen as part of scopes_oops. | 1667 // the code. Other oops (oop_index>0) are seen as part of scopes_oops. |
1671 assert(1 == (r->oop_is_immediate()) + | 1668 assert(1 == (r->oop_is_immediate()) + |
1672 (r->oop_addr() >= oops_begin() && r->oop_addr() < oops_end()), | 1669 (r->oop_addr() >= oops_begin() && r->oop_addr() < oops_end()), |
1673 "oop must be found in exactly one place"); | 1670 "oop must be found in exactly one place"); |
1674 if (r->oop_is_immediate() && r->oop_value() != NULL) { | 1671 if (r->oop_is_immediate() && r->oop_value() != NULL) { |
1675 if (can_unload(is_alive, keep_alive, r->oop_addr(), unloading_occurred)) { | 1672 if (can_unload(is_alive, r->oop_addr(), unloading_occurred)) { |
1676 return; | 1673 return; |
1677 } | 1674 } |
1678 } | 1675 } |
1679 } | 1676 } |
1680 } | 1677 } |
1682 | 1679 |
1683 | 1680 |
1684 // Scopes | 1681 // Scopes |
1685 for (oop* p = oops_begin(); p < oops_end(); p++) { | 1682 for (oop* p = oops_begin(); p < oops_end(); p++) { |
1686 if (*p == Universe::non_oop_word()) continue; // skip non-oops | 1683 if (*p == Universe::non_oop_word()) continue; // skip non-oops |
1687 if (can_unload(is_alive, keep_alive, p, unloading_occurred)) { | 1684 if (can_unload(is_alive, p, unloading_occurred)) { |
1688 return; | 1685 return; |
1689 } | 1686 } |
1690 } | 1687 } |
1691 | 1688 |
1692 // Ensure that all metadata is still alive | 1689 // Ensure that all metadata is still alive |