comparison src/share/vm/classfile/loaderConstraints.cpp @ 1336:0c3f888b7636

6626217: Fixed loader constraint array handling Summary: Loader constraints track array elements, not arrays themselves. Reviewed-by: dcubed, kevinw
author acorn
date Tue, 19 Jan 2010 16:03:09 -0500
parents a61af66fc99e
children 09ac706c2623
comparison
equal deleted inserted replaced
1334:b5d78a3b8843 1336:0c3f888b7636
332 332
333 // No constraints, or else no klass loaded yet. 333 // No constraints, or else no klass loaded yet.
334 return NULL; 334 return NULL;
335 } 335 }
336 336
337
338 klassOop LoaderConstraintTable::find_constrained_elem_klass(symbolHandle name,
339 symbolHandle elem_name,
340 Handle loader,
341 TRAPS) {
342 LoaderConstraintEntry *p = *(find_loader_constraint(name, loader));
343 if (p != NULL) {
344 assert(p->klass() == NULL, "Expecting null array klass");
345
346 // The array name has a constraint, but it will not have a class. Check
347 // each loader for an associated elem
348 for (int i = 0; i < p->num_loaders(); i++) {
349 Handle no_protection_domain;
350
351 klassOop k = SystemDictionary::find(elem_name, p->loader(i), no_protection_domain, THREAD);
352 if (k != NULL) {
353 // Return the first elem klass found.
354 return k;
355 }
356 }
357 }
358
359 // No constraints, or else no klass loaded yet.
360 return NULL;
361 }
362
363
364 void LoaderConstraintTable::ensure_loader_constraint_capacity( 337 void LoaderConstraintTable::ensure_loader_constraint_capacity(
365 LoaderConstraintEntry *p, 338 LoaderConstraintEntry *p,
366 int nfree) { 339 int nfree) {
367 if (p->max_loaders() - p->num_loaders() < nfree) { 340 if (p->max_loaders() - p->num_loaders() < nfree) {
368 int n = nfree + p->num_loaders(); 341 int n = nfree + p->num_loaders();