Print this page
rev 6875 : 8056240: Investigate increased GC remark time after class unloading changes in CRM Fuse
Reviewed-by: mgerdin, coleenp, bdelsart

Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/oops/constantPool.cpp
          +++ new/src/share/vm/oops/constantPool.cpp
↓ open down ↓ 1809 lines elided ↑ open up ↑
1810 1810    // Keep temorarily for debugging until it's stable.
1811 1811    DBG(print_cpool_bytes(cnt, start_bytes));
1812 1812    return (int)(bytes - start_bytes);
1813 1813  } /* end copy_cpool_bytes */
1814 1814  
1815 1815  #undef DBG
1816 1816  
1817 1817  
1818 1818  void ConstantPool::set_on_stack(const bool value) {
1819 1819    if (value) {
1820      -    _flags |= _on_stack;
     1820 +    int old_flags = *const_cast<volatile int *>(&_flags);
     1821 +    while ((old_flags & _on_stack) == 0) {
     1822 +      int new_flags = old_flags | _on_stack;
     1823 +      int result = Atomic::cmpxchg(new_flags, &_flags, old_flags);
     1824 +
     1825 +      if (result == old_flags) {
     1826 +        // Succeeded.
     1827 +        MetadataOnStackMark::record(this, Thread::current());
     1828 +        return;
     1829 +      }
     1830 +      old_flags = result;
     1831 +    }
1821 1832    } else {
     1833 +    // Clearing is done single-threadedly.
1822 1834      _flags &= ~_on_stack;
1823 1835    }
1824      -  if (value) MetadataOnStackMark::record(this);
1825 1836  }
1826 1837  
1827 1838  // JSR 292 support for patching constant pool oops after the class is linked and
1828 1839  // the oop array for resolved references are created.
1829 1840  // We can't do this during classfile parsing, which is how the other indexes are
1830 1841  // patched.  The other patches are applied early for some error checking
1831 1842  // so only defer the pseudo_strings.
1832 1843  void ConstantPool::patch_resolved_references(
1833 1844                                              GrowableArray<Handle>* cp_patches) {
1834 1845    assert(EnableInvokeDynamic, "");
↓ open down ↓ 270 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX