src/share/vm/prims/jvm.cpp

changeset 7089
6e0cb14ce59b
parent 6911
ce8f6bb717c9
child 7241
8cb56c8cb30d
     1.1 --- a/src/share/vm/prims/jvm.cpp	Fri Aug 22 12:03:49 2014 -0700
     1.2 +++ b/src/share/vm/prims/jvm.cpp	Thu Aug 21 13:57:51 2014 -0700
     1.3 @@ -28,6 +28,10 @@
     1.4  #include "classfile/javaClasses.hpp"
     1.5  #include "classfile/symbolTable.hpp"
     1.6  #include "classfile/systemDictionary.hpp"
     1.7 +#if INCLUDE_CDS
     1.8 +#include "classfile/sharedClassUtil.hpp"
     1.9 +#include "classfile/systemDictionaryShared.hpp"
    1.10 +#endif
    1.11  #include "classfile/vmSymbols.hpp"
    1.12  #include "gc_interface/collectedHeap.inline.hpp"
    1.13  #include "interpreter/bytecode.hpp"
    1.14 @@ -996,7 +1000,15 @@
    1.15                                                                h_loader,
    1.16                                                                Handle(),
    1.17                                                                CHECK_NULL);
    1.18 -
    1.19 +#if INCLUDE_CDS
    1.20 +  if (k == NULL) {
    1.21 +    // If the class is not already loaded, try to see if it's in the shared
    1.22 +    // archive for the current classloader (h_loader).
    1.23 +    instanceKlassHandle ik = SystemDictionaryShared::find_or_load_shared_class(
    1.24 +        klass_name, h_loader, CHECK_NULL);
    1.25 +    k = ik();
    1.26 +  }
    1.27 +#endif
    1.28    return (k == NULL) ? NULL :
    1.29              (jclass) JNIHandles::make_local(env, k->java_mirror());
    1.30  JVM_END

mercurial