comparison src/share/vm/interpreter/linkResolver.cpp @ 8702:77443715ec55

8001307: Modify ACC_SUPER behavior Summary: Disallow non-virtual calls even when ACC_SUPER is absent. Reviewed-by: kvn, acorn
author kamg
date Mon, 05 Nov 2012 17:03:33 -0500
parents f6b0eb4e44cf
children b5cb079ecaa4
comparison
equal deleted inserted replaced
8701:b95ad0610fef 8702:77443715ec55
784 { KlassHandle method_klass = KlassHandle(THREAD, 784 { KlassHandle method_klass = KlassHandle(THREAD,
785 resolved_method->method_holder()); 785 resolved_method->method_holder());
786 786
787 if (check_access && 787 if (check_access &&
788 // a) check if ACC_SUPER flag is set for the current class 788 // a) check if ACC_SUPER flag is set for the current class
789 current_klass->is_super() && 789 (current_klass->is_super() || !AllowNonVirtualCalls) &&
790 // b) check if the method class is a superclass of the current class (superclass relation is not reflexive!) 790 // b) check if the method class is a superclass of the current class (superclass relation is not reflexive!)
791 current_klass->is_subtype_of(method_klass()) && current_klass() != method_klass() && 791 current_klass->is_subtype_of(method_klass()) && current_klass() != method_klass() &&
792 // c) check if the method is not <init> 792 // c) check if the method is not <init>
793 resolved_method->name() != vmSymbols::object_initializer_name()) { 793 resolved_method->name() != vmSymbols::object_initializer_name()) {
794 // Lookup super method 794 // Lookup super method