comparison src/share/vm/classfile/defaultMethods.cpp @ 12213:42863137168c

8024647: Default method resolution with private superclass method Reviewed-by: kamg, minqi
author acorn
date Mon, 16 Sep 2013 17:57:56 -0400
parents 915cc4f3fb15
children 36b97be47bde f2512d89ad0c
comparison
equal deleted inserted replaced
12211:2e6938dd68f2 12213:42863137168c
448 void print_selected(outputStream* str, int indent) const { 448 void print_selected(outputStream* str, int indent) const {
449 assert(has_target(), "Should be called otherwise"); 449 assert(has_target(), "Should be called otherwise");
450 streamIndentor si(str, indent * 2); 450 streamIndentor si(str, indent * 2);
451 str->indent().print("Selected method: "); 451 str->indent().print("Selected method: ");
452 print_method(str, _selected_target); 452 print_method(str, _selected_target);
453 Klass* method_holder = _selected_target->method_holder();
454 if (!method_holder->is_interface()) {
455 tty->print(" : in superclass");
456 }
453 str->print_cr(""); 457 str->print_cr("");
454 } 458 }
455 459
456 void print_exception(outputStream* str, int indent) { 460 void print_exception(outputStream* str, int indent) {
457 assert(throws_exception(), "Should be called otherwise"); 461 assert(throws_exception(), "Should be called otherwise");
1139 } 1143 }
1140 } 1144 }
1141 #endif // ndef PRODUCT 1145 #endif // ndef PRODUCT
1142 if (method->has_target()) { 1146 if (method->has_target()) {
1143 Method* selected = method->get_selected_target(); 1147 Method* selected = method->get_selected_target();
1144 max_stack = assemble_redirect( 1148 if (selected->method_holder()->is_interface()) {
1149 max_stack = assemble_redirect(
1145 &bpool, &buffer, slot->signature(), selected, CHECK); 1150 &bpool, &buffer, slot->signature(), selected, CHECK);
1151 }
1146 } else if (method->throws_exception()) { 1152 } else if (method->throws_exception()) {
1147 max_stack = assemble_abstract_method_error( 1153 max_stack = assemble_abstract_method_error(
1148 &bpool, &buffer, method->get_exception_message(), CHECK); 1154 &bpool, &buffer, method->get_exception_message(), CHECK);
1149 } 1155 }
1150 AccessFlags flags = accessFlags_from( 1156 if (max_stack != 0) {
1157 AccessFlags flags = accessFlags_from(
1151 JVM_ACC_PUBLIC | JVM_ACC_SYNTHETIC | JVM_ACC_BRIDGE); 1158 JVM_ACC_PUBLIC | JVM_ACC_SYNTHETIC | JVM_ACC_BRIDGE);
1152 Method* m = new_method(&bpool, &buffer, slot->name(), slot->signature(), 1159 Method* m = new_method(&bpool, &buffer, slot->name(), slot->signature(),
1153 flags, max_stack, slot->size_of_parameters(), 1160 flags, max_stack, slot->size_of_parameters(),
1154 ConstMethod::OVERPASS, CHECK); 1161 ConstMethod::OVERPASS, CHECK);
1155 if (m != NULL) { 1162 if (m != NULL) {
1156 overpasses.push(m); 1163 overpasses.push(m);
1164 }
1157 } 1165 }
1158 } 1166 }
1159 } 1167 }
1160 1168
1161 #ifndef PRODUCT 1169 #ifndef PRODUCT