8057037: Verification in ClassLoaderData::is_alive is too slow

Wed, 03 Sep 2014 12:45:14 +0200

author
stefank
date
Wed, 03 Sep 2014 12:45:14 +0200
changeset 7682
04e84c0579be
parent 7681
f996dba3f54e
child 7683
1a9c5e6e13b7

8057037: Verification in ClassLoaderData::is_alive is too slow
Reviewed-by: brutisso, mgerdin, tschatzl

src/share/vm/classfile/classLoaderData.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/classfile/classLoaderData.cpp	Tue Apr 07 02:56:25 2015 -0700
     1.2 +++ b/src/share/vm/classfile/classLoaderData.cpp	Wed Sep 03 12:45:14 2014 +0200
     1.3 @@ -320,27 +320,6 @@
     1.4    }
     1.5  }
     1.6  
     1.7 -#ifdef ASSERT
     1.8 -class AllAliveClosure : public OopClosure {
     1.9 -  BoolObjectClosure* _is_alive_closure;
    1.10 -  bool _found_dead;
    1.11 - public:
    1.12 -  AllAliveClosure(BoolObjectClosure* is_alive_closure) : _is_alive_closure(is_alive_closure), _found_dead(false) {}
    1.13 -  template <typename T> void do_oop_work(T* p) {
    1.14 -    T heap_oop = oopDesc::load_heap_oop(p);
    1.15 -    if (!oopDesc::is_null(heap_oop)) {
    1.16 -      oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
    1.17 -      if (!_is_alive_closure->do_object_b(obj)) {
    1.18 -        _found_dead = true;
    1.19 -      }
    1.20 -    }
    1.21 -  }
    1.22 -  void do_oop(oop* p)       { do_oop_work<oop>(p); }
    1.23 -  void do_oop(narrowOop* p) { do_oop_work<narrowOop>(p); }
    1.24 -  bool found_dead()         { return _found_dead; }
    1.25 -};
    1.26 -#endif
    1.27 -
    1.28  oop ClassLoaderData::keep_alive_object() const {
    1.29    assert(!keep_alive(), "Don't use with CLDs that are artificially kept alive");
    1.30    return is_anonymous() ? _klasses->java_mirror() : class_loader();
    1.31 @@ -350,15 +329,6 @@
    1.32    bool alive = keep_alive() // null class loader and incomplete anonymous klasses.
    1.33        || is_alive_closure->do_object_b(keep_alive_object());
    1.34  
    1.35 -#ifdef ASSERT
    1.36 -  if (alive) {
    1.37 -    AllAliveClosure all_alive_closure(is_alive_closure);
    1.38 -    KlassToOopClosure klass_closure(&all_alive_closure);
    1.39 -    const_cast<ClassLoaderData*>(this)->oops_do(&all_alive_closure, &klass_closure, false);
    1.40 -    assert(!all_alive_closure.found_dead(), err_msg("Found dead oop in alive cld: " PTR_FORMAT, p2i(this)));
    1.41 -  }
    1.42 -#endif
    1.43 -
    1.44    return alive;
    1.45  }
    1.46  

mercurial