< prev index next >

src/hotspot/share/classfile/klassFactory.hpp

Print this page




  19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 * or visit www.oracle.com if you need additional information or have any
  21 * questions.
  22 *
  23 */
  24 
  25 #ifndef SHARE_CLASSFILE_KLASSFACTORY_HPP
  26 #define SHARE_CLASSFILE_KLASSFACTORY_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "runtime/handles.hpp"
  30 
  31 class ClassFileStream;
  32 class ClassLoaderData;
  33 class ClassLoadInfo;
  34 template <typename>
  35 class GrowableArray;
  36 class Klass;
  37 class Symbol;
  38 class TempNewSymbol;

  39 
  40 /*
  41  * KlassFactory is an interface to implementations of the following mapping/function:
  42  *
  43  * Summary: create a VM internal runtime representation ("Klass")
  44             from a bytestream (classfile).
  45  *
  46  * Input:  a named bytestream in the Java class file format (see JVMS, chapter 4).
  47  * Output: a VM runtime representation of a Java class
  48  *
  49  * Pre-conditions:
  50  *   a non-NULL ClassFileStream* // the classfile bytestream
  51  *   a non-NULL Symbol*          // the name of the class
  52  *   a non-NULL ClassLoaderData* // the metaspace allocator
  53  *   (no pending exceptions)
  54  *
  55  * Returns:
  56  *   if the returned value is non-NULL, that value is an indirection (pointer/handle)
  57  *   to a Klass. The caller will not have a pending exception.
  58  *
  59  *   On broken invariants and/or runtime errors the returned value will be
  60  *   NULL (or a NULL handle) and the caller *might* now have a pending exception.
  61  *
  62  */
  63 
  64 class KlassFactory : AllStatic {
  65 
  66   // approved clients
  67   friend class ClassLoader;
  68   friend class ClassLoaderExt;
  69   friend class SystemDictionary;

  70 
  71  private:
  72   static InstanceKlass* create_from_stream(ClassFileStream* stream,
  73                                            Symbol* name,
  74                                            ClassLoaderData* loader_data,
  75                                            const ClassLoadInfo& cl_info,
  76                                            TRAPS);
  77  public:
  78   static InstanceKlass* check_shared_class_file_load_hook(
  79                                           InstanceKlass* ik,
  80                                           Symbol* class_name,
  81                                           Handle class_loader,
  82                                           Handle protection_domain,
  83                                           const ClassFileStream *cfs,
  84                                           TRAPS);
  85 };
  86 
  87 #endif // SHARE_CLASSFILE_KLASSFACTORY_HPP


  19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 * or visit www.oracle.com if you need additional information or have any
  21 * questions.
  22 *
  23 */
  24 
  25 #ifndef SHARE_CLASSFILE_KLASSFACTORY_HPP
  26 #define SHARE_CLASSFILE_KLASSFACTORY_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "runtime/handles.hpp"
  30 
  31 class ClassFileStream;
  32 class ClassLoaderData;
  33 class ClassLoadInfo;
  34 template <typename>
  35 class GrowableArray;
  36 class Klass;
  37 class Symbol;
  38 class TempNewSymbol;
  39 class LambdaFormInvokers;
  40 
  41 /*
  42  * KlassFactory is an interface to implementations of the following mapping/function:
  43  *
  44  * Summary: create a VM internal runtime representation ("Klass")
  45             from a bytestream (classfile).
  46  *
  47  * Input:  a named bytestream in the Java class file format (see JVMS, chapter 4).
  48  * Output: a VM runtime representation of a Java class
  49  *
  50  * Pre-conditions:
  51  *   a non-NULL ClassFileStream* // the classfile bytestream
  52  *   a non-NULL Symbol*          // the name of the class
  53  *   a non-NULL ClassLoaderData* // the metaspace allocator
  54  *   (no pending exceptions)
  55  *
  56  * Returns:
  57  *   if the returned value is non-NULL, that value is an indirection (pointer/handle)
  58  *   to a Klass. The caller will not have a pending exception.
  59  *
  60  *   On broken invariants and/or runtime errors the returned value will be
  61  *   NULL (or a NULL handle) and the caller *might* now have a pending exception.
  62  *
  63  */
  64 
  65 class KlassFactory : AllStatic {
  66 
  67   // approved clients
  68   friend class ClassLoader;
  69   friend class ClassLoaderExt;
  70   friend class SystemDictionary;
  71   friend class LambdaFormInvokers;
  72 
  73  private:
  74   static InstanceKlass* create_from_stream(ClassFileStream* stream,
  75                                            Symbol* name,
  76                                            ClassLoaderData* loader_data,
  77                                            const ClassLoadInfo& cl_info,
  78                                            TRAPS);
  79  public:
  80   static InstanceKlass* check_shared_class_file_load_hook(
  81                                           InstanceKlass* ik,
  82                                           Symbol* class_name,
  83                                           Handle class_loader,
  84                                           Handle protection_domain,
  85                                           const ClassFileStream *cfs,
  86                                           TRAPS);
  87 };
  88 
  89 #endif // SHARE_CLASSFILE_KLASSFACTORY_HPP
< prev index next >