Mercurial > hg > truffle
diff src/share/vm/classfile/systemDictionary.cpp @ 6751:2a48c84f1d04
7197269: NPG: FollowReferences has no ClassLoader -> Class link to follow
Summary: restore java/lang/ClassLoader.addClass() upcall
Reviewed-by: sspitsyn, dcubed, jmasa
author | coleenp |
---|---|
date | Mon, 17 Sep 2012 10:46:59 -0400 |
parents | aed758eda82a |
children | f6b0eb4e44cf d8ce2825b193 |
line wrap: on
line diff
--- a/src/share/vm/classfile/systemDictionary.cpp Thu Sep 13 21:20:26 2012 +0200 +++ b/src/share/vm/classfile/systemDictionary.cpp Mon Sep 17 10:46:59 2012 -0400 @@ -1496,6 +1496,19 @@ int d_index = dictionary()->hash_to_index(d_hash); check_constraints(d_index, d_hash, k, class_loader_h, true, CHECK); + // Register class just loaded with class loader (placed in Vector) + // Note we do this before updating the dictionary, as this can + // fail with an OutOfMemoryError (if it does, we will *not* put this + // class in the dictionary and will not update the class hierarchy). + // JVMTI FollowReferences needs to find the classes this way. + if (k->class_loader() != NULL) { + methodHandle m(THREAD, Universe::loader_addClass_method()); + JavaValue result(T_VOID); + JavaCallArguments args(class_loader_h); + args.push_oop(Handle(THREAD, k->java_mirror())); + JavaCalls::call(&result, m, &args, CHECK); + } + // Add the new class. We need recompile lock during update of CHA. { unsigned int p_hash = placeholders()->compute_hash(name_h, loader_data);