src/share/vm/classfile/systemDictionary.cpp

changeset 8497
50e62b688ddc
parent 7936
928e1994ad43
child 8604
04d83ba48607
child 8621
4eba7ec59722
equal deleted inserted replaced
8496:bde4021b44f2 8497:50e62b688ddc
1 /* 1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2016, 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.
1196 // are shared, add them to the main system dictionary and reset 1196 // are shared, add them to the main system dictionary and reset
1197 // their hierarchy references (supers, subs, and interfaces). 1197 // their hierarchy references (supers, subs, and interfaces).
1198 1198
1199 if (ik->super() != NULL) { 1199 if (ik->super() != NULL) {
1200 Symbol* cn = ik->super()->name(); 1200 Symbol* cn = ik->super()->name();
1201 resolve_super_or_fail(class_name, cn, 1201 Klass *s = resolve_super_or_fail(class_name, cn,
1202 class_loader, protection_domain, true, CHECK_(nh)); 1202 class_loader, protection_domain, true, CHECK_(nh));
1203 if (s != ik->super()) {
1204 // The dynamically resolved super class is not the same as the one we used during dump time,
1205 // so we cannot use ik.
1206 return nh;
1207 }
1203 } 1208 }
1204 1209
1205 Array<Klass*>* interfaces = ik->local_interfaces(); 1210 Array<Klass*>* interfaces = ik->local_interfaces();
1206 int num_interfaces = interfaces->length(); 1211 int num_interfaces = interfaces->length();
1207 for (int index = 0; index < num_interfaces; index++) { 1212 for (int index = 0; index < num_interfaces; index++) {
1210 // Note: can not use InstanceKlass::cast here because 1215 // Note: can not use InstanceKlass::cast here because
1211 // interfaces' InstanceKlass's C++ vtbls haven't been 1216 // interfaces' InstanceKlass's C++ vtbls haven't been
1212 // reinitialized yet (they will be once the interface classes 1217 // reinitialized yet (they will be once the interface classes
1213 // are loaded) 1218 // are loaded)
1214 Symbol* name = k->name(); 1219 Symbol* name = k->name();
1215 resolve_super_or_fail(class_name, name, class_loader, protection_domain, false, CHECK_(nh)); 1220 Klass* i = resolve_super_or_fail(class_name, name, class_loader, protection_domain, false, CHECK_(nh));
1221 if (k != i) {
1222 // The dynamically resolved interface class is not the same as the one we used during dump time,
1223 // so we cannot use ik.
1224 return nh;
1225 }
1216 } 1226 }
1217 1227
1218 // Adjust methods to recover missing data. They need addresses for 1228 // Adjust methods to recover missing data. They need addresses for
1219 // interpreter entry points and their default native method address 1229 // interpreter entry points and their default native method address
1220 // must be reset. 1230 // must be reset.

mercurial