src/share/vm/oops/method.cpp

changeset 8440
fde446cb8e19
parent 8402
cc78c97abff8
child 8536
371fd9bb8202
     1.1 --- a/src/share/vm/oops/method.cpp	Mon May 30 15:24:37 2016 +0530
     1.2 +++ b/src/share/vm/oops/method.cpp	Fri Jun 10 15:34:32 2016 +0530
     1.3 @@ -1778,7 +1778,7 @@
     1.4    void clear_all_methods() {
     1.5      for (JNIMethodBlock* b = this; b != NULL; b = b->_next) {
     1.6        for (int i = 0; i< number_of_methods; i++) {
     1.7 -        _methods[i] = NULL;
     1.8 +        b->_methods[i] = NULL;
     1.9        }
    1.10      }
    1.11    }
    1.12 @@ -1788,7 +1788,7 @@
    1.13      int count = 0;
    1.14      for (JNIMethodBlock* b = this; b != NULL; b = b->_next) {
    1.15        for (int i = 0; i< number_of_methods; i++) {
    1.16 -        if (_methods[i] != _free_method) count++;
    1.17 +        if (b->_methods[i] != _free_method) count++;
    1.18        }
    1.19      }
    1.20      return count;
    1.21 @@ -1846,6 +1846,9 @@
    1.22    Method* m = resolve_jmethod_id(mid);
    1.23    assert(m != NULL, "should be called with non-null method");
    1.24    InstanceKlass* ik = m->method_holder();
    1.25 +  if (ik == NULL) {
    1.26 +    return false;
    1.27 +  }
    1.28    ClassLoaderData* cld = ik->class_loader_data();
    1.29    if (cld->jmethod_ids() == NULL) return false;
    1.30    return (cld->jmethod_ids()->contains((Method**)mid));
    1.31 @@ -1853,6 +1856,9 @@
    1.32  
    1.33  Method* Method::checked_resolve_jmethod_id(jmethodID mid) {
    1.34    if (mid == NULL) return NULL;
    1.35 +  if (!Method::is_method_id(mid)) {
    1.36 +    return NULL;
    1.37 +  }
    1.38    Method* o = resolve_jmethod_id(mid);
    1.39    if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
    1.40      return NULL;

mercurial