comparison src/share/vm/graal/graalEnv.cpp @ 3674:d3d3dd0a3421

Fixed a regression.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 21 Nov 2011 13:56:38 +0100
parents 5e331d5f760e
children f8d7ab42c479
comparison
equal deleted inserted replaced
3673:3b09031817ec 3674:d3d3dd0a3421
47 // ------------------------------------------------------------------ 47 // ------------------------------------------------------------------
48 // ciEnv::check_klass_accessiblity 48 // ciEnv::check_klass_accessiblity
49 // 49 //
50 // Note: the logic of this method should mirror the logic of 50 // Note: the logic of this method should mirror the logic of
51 // constantPoolOopDesc::verify_constant_pool_resolve. 51 // constantPoolOopDesc::verify_constant_pool_resolve.
52 bool GraalEnv::check_klass_accessibility(KlassHandle& accessing_klass, KlassHandle& resolved_klass) { 52 bool GraalEnv::check_klass_accessibility(KlassHandle accessing_klass, KlassHandle resolved_klass) {
53 if (accessing_klass->oop_is_objArray()) { 53 if (accessing_klass->oop_is_objArray()) {
54 accessing_klass = objArrayKlass::cast(accessing_klass())->bottom_klass(); 54 accessing_klass = objArrayKlass::cast(accessing_klass())->bottom_klass();
55 } 55 }
56 if (!accessing_klass->oop_is_instance()) { 56 if (!accessing_klass->oop_is_instance()) {
57 return true; 57 return true;
201 false); 201 false);
202 // Calculate accessibility the hard way. 202 // Calculate accessibility the hard way.
203 if (k.is_null()) { 203 if (k.is_null()) {
204 is_accessible = false; 204 is_accessible = false;
205 } else if (k->class_loader() != accessor->class_loader() && 205 } else if (k->class_loader() != accessor->class_loader() &&
206 get_klass_by_name_impl(accessor, cpool, k->name(), true) == NULL) { 206 get_klass_by_name_impl(accessor, cpool, k->name(), true).is_null()) {
207 // Loaded only remotely. Not linked yet. 207 // Loaded only remotely. Not linked yet.
208 is_accessible = false; 208 is_accessible = false;
209 } else { 209 } else {
210 // Linked locally, and we must also check public/private, etc. 210 // Linked locally, and we must also check public/private, etc.
211 is_accessible = check_klass_accessibility(accessor, k); 211 is_accessible = check_klass_accessibility(accessor, k);
212 }
213 if (!is_accessible) {
214 return KlassHandle();
212 } 215 }
213 return k; 216 return k;
214 } 217 }
215 218
216 // It is known to be accessible, since it was found in the constant pool. 219 // It is known to be accessible, since it was found in the constant pool.
225 KlassHandle GraalEnv::get_klass_by_index(constantPoolHandle& cpool, 228 KlassHandle GraalEnv::get_klass_by_index(constantPoolHandle& cpool,
226 int index, 229 int index,
227 bool& is_accessible, 230 bool& is_accessible,
228 KlassHandle& accessor) { 231 KlassHandle& accessor) {
229 ResourceMark rm; 232 ResourceMark rm;
230 return get_klass_by_index_impl(cpool, index, is_accessible, accessor); 233 KlassHandle result = get_klass_by_index_impl(cpool, index, is_accessible, accessor);
234 return result;
231 } 235 }
232 236
233 // ------------------------------------------------------------------ 237 // ------------------------------------------------------------------
234 // ciEnv::get_field_by_index_impl 238 // ciEnv::get_field_by_index_impl
235 // 239 //