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/method.cpp
          +++ new/src/share/vm/oops/method.cpp
↓ open down ↓ 1855 lines elided ↑ open up ↑
1856 1856    Method* o = resolve_jmethod_id(mid);
1857 1857    if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
1858 1858      return NULL;
1859 1859    }
1860 1860    return o;
1861 1861  };
1862 1862  
1863 1863  void Method::set_on_stack(const bool value) {
1864 1864    // Set both the method itself and its constant pool.  The constant pool
1865 1865    // on stack means some method referring to it is also on the stack.
1866      -  _access_flags.set_on_stack(value);
1867 1866    constants()->set_on_stack(value);
1868      -  if (value) MetadataOnStackMark::record(this);
     1867 +
     1868 +  bool succeeded = _access_flags.set_on_stack(value);
     1869 +  if (value && succeeded) {
     1870 +    MetadataOnStackMark::record(this, Thread::current());
     1871 +  }
1869 1872  }
1870 1873  
1871 1874  // Called when the class loader is unloaded to make all methods weak.
1872 1875  void Method::clear_jmethod_ids(ClassLoaderData* loader_data) {
1873 1876    loader_data->jmethod_ids()->clear_all_methods();
1874 1877  }
1875 1878  
1876 1879  bool Method::has_method_vptr(const void* ptr) {
1877 1880    Method m;
1878 1881    // This assumes that the vtbl pointer is the first word of a C++ object.
↓ open down ↓ 154 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX