< prev index next >

src/hotspot/share/cds/finalImageRecipes.hpp

Print this page
@@ -40,35 +40,74 @@
  //   - The recipes are applied when CDSConfig::is_dumping_final_static_archive() is true.
  // The following information are recorded:
  //   - The list of all classes that are stored in the AOTConfiguration file.
  //   - The list of all classes that require AOT resolution of invokedynamic call sites.
  class FinalImageRecipes {
+   static constexpr int HAS_CLASS            = 0x1;
+   static constexpr int HAS_FIELD_AND_METHOD = 0x2;
+   static constexpr int HAS_INDY             = 0x4;
+ 
    // A list of all the archived classes from the preimage. We want to transfer all of these
    // into the final image.
    Array<Klass*>* _all_klasses;
  
-   // The classes who have resolved at least one indy CP entry during the training run.
-   // _indy_cp_indices[i] is a list of all resolved CP entries for _indy_klasses[i].
-   Array<InstanceKlass*>* _indy_klasses;
-   Array<Array<int>*>*    _indy_cp_indices;
+   // For each klass k _all_klasses->at(i), _cp_recipes->at(i) lists all the {klass,field,method,indy}
+   // cp indices that were resolved for k during the training run.
+   Array<Array<int>*>* _cp_recipes;
+   Array<int>* _cp_flags;
+ 
+   // The RefectionData for  _reflect_klasses[i] should be initialized with _reflect_flags[i]
+   Array<InstanceKlass*>* _reflect_klasses;
+   Array<int>*            _reflect_flags;
+ 
+   static GrowableArray<InstanceKlass*>* _tmp_reflect_klasses;
+   static GrowableArray<int>* _tmp_reflect_flags;
+ 
+   struct TmpDynamicProxyClassInfo {
+     int _loader_type;
+     int _access_flags;
+     const char* _proxy_name;
+     GrowableArray<Klass*>* _interfaces;
+   };
+ 
+   struct DynamicProxyClassInfo {
+     int _loader_type;
+     int _access_flags;
+     const char* _proxy_name;
+     Array<Klass*>* _interfaces;
+   };
+ 
+   Array<DynamicProxyClassInfo>* _dynamic_proxy_classes;
+ 
+   static GrowableArray<TmpDynamicProxyClassInfo>* _tmp_dynamic_proxy_classes;
+ 
+   FinalImageRecipes() : _all_klasses(nullptr), _cp_recipes(nullptr), _cp_flags(nullptr),
+                         _reflect_klasses(nullptr), _reflect_flags(nullptr),
+                         _dynamic_proxy_classes(nullptr) {}
  
-   FinalImageRecipes() : _indy_klasses(nullptr), _indy_cp_indices(nullptr) {}
  
    void* operator new(size_t size) throw();
  
    // Called when dumping preimage
-   void record_recipes_impl();
+   void record_all_classes();
+   void record_recipes_for_constantpool();
+   void record_recipes_for_reflection_data();
+   void record_recipes_for_dynamic_proxies();
  
    // Called when dumping final image
    void apply_recipes_impl(TRAPS);
    void load_all_classes(TRAPS);
-   void apply_recipes_for_invokedynamic(TRAPS);
+   void apply_recipes_for_constantpool(JavaThread* current);
+   void apply_recipes_for_reflection_data(JavaThread* current);
+   void apply_recipes_for_dynamic_proxies(TRAPS);
  
  public:
    static void serialize(SerializeClosure* soc);
  
    // Called when dumping preimage
+   static void add_dynamic_proxy_class(oop loader, const char* proxy_name, objArrayOop interfaces, int access_flags);
+   static void add_reflection_data_flags(InstanceKlass* ik, TRAPS);
    static void record_recipes();
  
    // Called when dumping final image
    static void apply_recipes(TRAPS);
  };
< prev index next >