hotspot/src/share/vm/oops/klassVtable.cpp
changeset 23999 22eb7be3d99d
parent 22232 26acfad336c0
child 24424 2658d7834c6e
equal deleted inserted replaced
23998:418ac4fe9834 23999:22eb7be3d99d
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   620   // miranda method in the super, whose entry it should re-use.
   620   // miranda method in the super, whose entry it should re-use.
   621   // Actually, to handle cases that javac would not generate, we need
   621   // Actually, to handle cases that javac would not generate, we need
   622   // this check for all access permissions.
   622   // this check for all access permissions.
   623   InstanceKlass *sk = InstanceKlass::cast(super);
   623   InstanceKlass *sk = InstanceKlass::cast(super);
   624   if (sk->has_miranda_methods()) {
   624   if (sk->has_miranda_methods()) {
   625     if (sk->lookup_method_in_all_interfaces(name, signature, false) != NULL) {
   625     if (sk->lookup_method_in_all_interfaces(name, signature, Klass::normal) != NULL) {
   626       return false;  // found a matching miranda; we do not need a new entry
   626       return false;  // found a matching miranda; we do not need a new entry
   627     }
   627     }
   628   }
   628   }
   629   return true; // found no match; we need a new entry
   629   return true; // found no match; we need a new entry
   630 }
   630 }
   696       Method* mo = InstanceKlass::cast(super)->lookup_method(name, signature);
   696       Method* mo = InstanceKlass::cast(super)->lookup_method(name, signature);
   697       while (mo != NULL && mo->access_flags().is_static()
   697       while (mo != NULL && mo->access_flags().is_static()
   698              && mo->method_holder() != NULL
   698              && mo->method_holder() != NULL
   699              && mo->method_holder()->super() != NULL)
   699              && mo->method_holder()->super() != NULL)
   700       {
   700       {
   701          mo = mo->method_holder()->super()->uncached_lookup_method(name, signature);
   701          mo = mo->method_holder()->super()->uncached_lookup_method(name, signature, Klass::normal);
   702       }
   702       }
   703       if (mo == NULL || mo->access_flags().is_private() ) {
   703       if (mo == NULL || mo->access_flags().is_private() ) {
   704         // super class hierarchy does not implement it or protection is different
   704         // super class hierarchy does not implement it or protection is different
   705         return true;
   705         return true;
   706       }
   706       }
   741 
   741 
   742     if (!is_duplicate) { // we don't want duplicate miranda entries in the vtable
   742     if (!is_duplicate) { // we don't want duplicate miranda entries in the vtable
   743       if (is_miranda(im, class_methods, default_methods, super)) { // is it a miranda at all?
   743       if (is_miranda(im, class_methods, default_methods, super)) { // is it a miranda at all?
   744         InstanceKlass *sk = InstanceKlass::cast(super);
   744         InstanceKlass *sk = InstanceKlass::cast(super);
   745         // check if it is a duplicate of a super's miranda
   745         // check if it is a duplicate of a super's miranda
   746         if (sk->lookup_method_in_all_interfaces(im->name(), im->signature(), false) == NULL) {
   746         if (sk->lookup_method_in_all_interfaces(im->name(), im->signature(), Klass::normal) == NULL) {
   747           new_mirandas->append(im);
   747           new_mirandas->append(im);
   748         }
   748         }
   749         if (all_mirandas != NULL) {
   749         if (all_mirandas != NULL) {
   750           all_mirandas->append(im);
   750           all_mirandas->append(im);
   751         }
   751         }