@@ -1572,28 +1572,20 @@ void VM_RedefineClasses::map_operand_index(int old_index, int new_index) {
1572
1572
1573
1573
1574
1574
// Merge old_cp and scratch_cp and return the results of the merge via
1575
- // merge_cp_p. The number of entries in * merge_cp_p is returned via
1575
+ // merge_cp_p. The number of entries in merge_cp_p is returned via
1576
1576
// merge_cp_length_p. The entries in old_cp occupy the same locations
1577
- // in * merge_cp_p. Also creates a map of indices from entries in
1578
- // scratch_cp to the corresponding entry in * merge_cp_p. Index map
1577
+ // in merge_cp_p. Also creates a map of indices from entries in
1578
+ // scratch_cp to the corresponding entry in merge_cp_p. Index map
1579
1579
// entries are only created for entries in scratch_cp that occupy a
1580
- // different location in * merged_cp_p.
1580
+ // different location in merged_cp_p.
1581
1581
bool VM_RedefineClasses::merge_constant_pools (const constantPoolHandle& old_cp,
1582
- const constantPoolHandle& scratch_cp, constantPoolHandle * merge_cp_p,
1583
- int * merge_cp_length_p, TRAPS) {
1582
+ const constantPoolHandle& scratch_cp, constantPoolHandle& merge_cp_p,
1583
+ int & merge_cp_length_p, TRAPS) {
1584
1584
1585
- if (merge_cp_p == nullptr ) {
1586
- assert (false , " caller must provide scratch constantPool" );
1587
- return false ; // robustness
1588
- }
1589
- if (merge_cp_length_p == nullptr ) {
1590
- assert (false , " caller must provide scratch CP length" );
1591
- return false ; // robustness
1592
- }
1593
1585
// Worst case we need old_cp->length() + scratch_cp()->length(),
1594
1586
// but the caller might be smart so make sure we have at least
1595
1587
// the minimum.
1596
- if ((* merge_cp_p) ->length () < old_cp->length ()) {
1588
+ if (merge_cp_p->length () < old_cp->length ()) {
1597
1589
assert (false , " merge area too small" );
1598
1590
return false ; // robustness
1599
1591
}
@@ -1621,36 +1613,36 @@ bool VM_RedefineClasses::merge_constant_pools(const constantPoolHandle& old_cp,
1621
1613
// revert the copy to JVM_CONSTANT_UnresolvedClass
1622
1614
// May be resolving while calling this so do the same for
1623
1615
// JVM_CONSTANT_UnresolvedClass (klass_name_at() deals with transition)
1624
- (* merge_cp_p) ->temp_unresolved_klass_at_put (old_i,
1616
+ merge_cp_p->temp_unresolved_klass_at_put (old_i,
1625
1617
old_cp->klass_name_index_at (old_i));
1626
1618
break ;
1627
1619
1628
1620
case JVM_CONSTANT_Double:
1629
1621
case JVM_CONSTANT_Long:
1630
- // just copy the entry to * merge_cp_p, but double and long take
1622
+ // just copy the entry to merge_cp_p, but double and long take
1631
1623
// two constant pool entries
1632
- ConstantPool::copy_entry_to (old_cp, old_i, * merge_cp_p, old_i);
1624
+ ConstantPool::copy_entry_to (old_cp, old_i, merge_cp_p, old_i);
1633
1625
old_i++;
1634
1626
break ;
1635
1627
1636
1628
default :
1637
- // just copy the entry to * merge_cp_p
1638
- ConstantPool::copy_entry_to (old_cp, old_i, * merge_cp_p, old_i);
1629
+ // just copy the entry to merge_cp_p
1630
+ ConstantPool::copy_entry_to (old_cp, old_i, merge_cp_p, old_i);
1639
1631
break ;
1640
1632
}
1641
1633
} // end for each old_cp entry
1642
1634
1643
- ConstantPool::copy_operands (old_cp, * merge_cp_p, CHECK_false);
1644
- (* merge_cp_p) ->extend_operands (scratch_cp, CHECK_false);
1635
+ ConstantPool::copy_operands (old_cp, merge_cp_p, CHECK_false);
1636
+ merge_cp_p->extend_operands (scratch_cp, CHECK_false);
1645
1637
1646
1638
// We don't need to sanity check that *merge_cp_length_p is within
1647
1639
// *merge_cp_p bounds since we have the minimum on-entry check above.
1648
- (* merge_cp_length_p) = old_i;
1640
+ merge_cp_length_p = old_i;
1649
1641
}
1650
1642
1651
1643
// merge_cp_len should be the same as old_cp->length() at this point
1652
1644
// so this trace message is really a "warm-and-breathing" message.
1653
- log_debug (redefine, class , constantpool)(" after pass 0: merge_cp_len=%d" , * merge_cp_length_p);
1645
+ log_debug (redefine, class , constantpool)(" after pass 0: merge_cp_len=%d" , merge_cp_length_p);
1654
1646
1655
1647
int scratch_i; // index into scratch_cp
1656
1648
{
@@ -1674,13 +1666,13 @@ bool VM_RedefineClasses::merge_constant_pools(const constantPoolHandle& old_cp,
1674
1666
break ;
1675
1667
}
1676
1668
1677
- bool match = scratch_cp->compare_entry_to (scratch_i, * merge_cp_p, scratch_i);
1669
+ bool match = scratch_cp->compare_entry_to (scratch_i, merge_cp_p, scratch_i);
1678
1670
if (match) {
1679
1671
// found a match at the same index so nothing more to do
1680
1672
continue ;
1681
1673
}
1682
1674
1683
- int found_i = scratch_cp->find_matching_entry (scratch_i, * merge_cp_p);
1675
+ int found_i = scratch_cp->find_matching_entry (scratch_i, merge_cp_p);
1684
1676
if (found_i != 0 ) {
1685
1677
guarantee (found_i != scratch_i,
1686
1678
" compare_entry_to() and find_matching_entry() do not agree" );
@@ -1692,14 +1684,14 @@ bool VM_RedefineClasses::merge_constant_pools(const constantPoolHandle& old_cp,
1692
1684
}
1693
1685
1694
1686
// No match found so we have to append this entry and any unique
1695
- // referenced entries to * merge_cp_p.
1696
- append_entry (scratch_cp, scratch_i, merge_cp_p, merge_cp_length_p);
1687
+ // referenced entries to merge_cp_p.
1688
+ append_entry (scratch_cp, scratch_i, & merge_cp_p, & merge_cp_length_p);
1697
1689
}
1698
1690
}
1699
1691
1700
1692
log_debug (redefine, class , constantpool)
1701
1693
(" after pass 1a: merge_cp_len=%d, scratch_i=%d, index_map_len=%d" ,
1702
- * merge_cp_length_p, scratch_i, _index_map_count);
1694
+ merge_cp_length_p, scratch_i, _index_map_count);
1703
1695
1704
1696
if (scratch_i < scratch_cp->length ()) {
1705
1697
// Pass 1b:
@@ -1721,24 +1713,24 @@ bool VM_RedefineClasses::merge_constant_pools(const constantPoolHandle& old_cp,
1721
1713
}
1722
1714
1723
1715
int found_i =
1724
- scratch_cp->find_matching_entry (scratch_i, * merge_cp_p);
1716
+ scratch_cp->find_matching_entry (scratch_i, merge_cp_p);
1725
1717
if (found_i != 0 ) {
1726
- // Found a matching entry somewhere else in * merge_cp_p so
1718
+ // Found a matching entry somewhere else in merge_cp_p so
1727
1719
// just need a mapping entry.
1728
1720
map_index (scratch_cp, scratch_i, found_i);
1729
1721
continue ;
1730
1722
}
1731
1723
1732
1724
// No match found so we have to append this entry and any unique
1733
- // referenced entries to * merge_cp_p.
1734
- append_entry (scratch_cp, scratch_i, merge_cp_p, merge_cp_length_p);
1725
+ // referenced entries to merge_cp_p.
1726
+ append_entry (scratch_cp, scratch_i, & merge_cp_p, & merge_cp_length_p);
1735
1727
}
1736
1728
1737
1729
log_debug (redefine, class , constantpool)
1738
1730
(" after pass 1b: merge_cp_len=%d, scratch_i=%d, index_map_len=%d" ,
1739
- * merge_cp_length_p, scratch_i, _index_map_count);
1731
+ merge_cp_length_p, scratch_i, _index_map_count);
1740
1732
}
1741
- finalize_operands_merge (* merge_cp_p, CHECK_false);
1733
+ finalize_operands_merge (merge_cp_p, CHECK_false);
1742
1734
1743
1735
return true ;
1744
1736
} // end merge_constant_pools()
@@ -1815,8 +1807,8 @@ jvmtiError VM_RedefineClasses::merge_cp_and_rewrite(
1815
1807
1816
1808
// reference to the cp holder is needed for copy_operands()
1817
1809
merge_cp->set_pool_holder (scratch_class);
1818
- bool result = merge_constant_pools (old_cp, scratch_cp, & merge_cp,
1819
- & merge_cp_length, THREAD);
1810
+ bool result = merge_constant_pools (old_cp, scratch_cp, merge_cp,
1811
+ merge_cp_length, THREAD);
1820
1812
merge_cp->set_pool_holder (nullptr );
1821
1813
1822
1814
if (!result) {
0 commit comments