< prev index next >

src/hotspot/share/cds/archiveBuilder.hpp

Print this page
*** 140,10 ***
--- 140,14 ---
          _buffered_addr = ref->obj();
        } else {
          _buffered_addr = nullptr;
        }
      }
+     SourceObjInfo(address src, address buf) {
+       _source_addr = src;
+       _buffered_addr = buf;
+     }
  
      // This constructor is only used for regenerated objects (created by LambdaFormInvokers, etc).
      //   src = address of a Method or InstanceKlass that has been regenerated.
      //   renegerated_obj_info = info for the regenerated version of src.
      SourceObjInfo(address src, SourceObjInfo* renegerated_obj_info) :

*** 202,10 ***
--- 206,11 ---
    ReservedSpace _shared_rs;
    VirtualSpace _shared_vs;
  
    DumpRegion _rw_region;
    DumpRegion _ro_region;
+   DumpRegion _cc_region;
    CHeapBitMap _ptrmap;    // bitmap used by ArchivePtrMarker
  
    SourceObjList _rw_src_objs;                 // objs to put in rw region
    SourceObjList _ro_src_objs;                 // objs to put in ro region
    ResizeableResourceHashtable<address, SourceObjInfo, AnyObj::C_HEAP, mtClassShared> _src_obj_table;

*** 241,10 ***
--- 246,11 ---
  
    void iterate_sorted_roots(MetaspaceClosure* it);
    void sort_klasses();
    static int compare_symbols_by_address(Symbol** a, Symbol** b);
    static int compare_klass_by_name(Klass** a, Klass** b);
+   void update_hidden_class_loader_type(InstanceKlass* ik);
  
    void make_shallow_copies(DumpRegion *dump_region, const SourceObjList* src_objs);
    void make_shallow_copy(DumpRegion *dump_region, SourceObjInfo* src_info);
  
    void relocate_embedded_pointers(SourceObjList* src_objs);

*** 274,10 ***
--- 280,13 ---
    address requested_static_archive_bottom()  const { return  _requested_static_archive_bottom;    }
    address mapped_static_archive_bottom()     const { return  _mapped_static_archive_bottom;       }
    intx buffer_to_requested_delta()           const { return _buffer_to_requested_delta;           }
  
    bool is_in_buffer_space(address p) const {
+     if (current_dump_space() == nullptr) {
+       return false;
+     }
      return (buffer_bottom() <= p && p < buffer_top());
    }
  
    template <typename T> bool is_in_requested_static_archive(T p) const {
      return _requested_static_archive_bottom <= (address)p && (address)p < _requested_static_archive_top;

*** 326,12 ***
    u4 any_to_offset_u4(T p) const {
      uintx offset = any_to_offset((address)p);
      return to_offset_u4(offset);
    }
  
-   static void assert_is_vm_thread() PRODUCT_RETURN;
- 
  public:
    ArchiveBuilder();
    ~ArchiveBuilder();
  
    void gather_klasses_and_symbols();
--- 335,10 ---

*** 341,17 ***
--- 348,24 ---
    void remember_embedded_pointer_in_enclosing_obj(MetaspaceClosure::Ref* ref);
    static void serialize_dynamic_archivable_items(SerializeClosure* soc);
  
    DumpRegion* rw_region() { return &_rw_region; }
    DumpRegion* ro_region() { return &_ro_region; }
+   DumpRegion* cc_region() { return &_cc_region; }
+ 
+   void start_cc_region();
+   void end_cc_region();
  
    static char* rw_region_alloc(size_t num_bytes) {
      return current()->rw_region()->allocate(num_bytes);
    }
    static char* ro_region_alloc(size_t num_bytes) {
      return current()->ro_region()->allocate(num_bytes);
    }
+   static char* cc_region_alloc(size_t num_bytes) {
+     return current()->cc_region()->allocate(num_bytes);
+   }
  
    template <typename T>
    static Array<T>* new_ro_array(int length) {
      size_t byte_size = Array<T>::byte_sizeof(length, sizeof(T));
      Array<T>* array = (Array<T>*)ro_region_alloc(byte_size);

*** 388,10 ***
--- 402,16 ---
    void write_pointer_in_buffer(address* ptr_location, address src_addr);
    template <typename T> void write_pointer_in_buffer(T* ptr_location, T src_addr) {
      write_pointer_in_buffer((address*)ptr_location, (address)src_addr);
    }
  
+   void mark_and_relocate_to_buffered_addr(address* ptr_location);
+   template <typename T> void mark_and_relocate_to_buffered_addr(T ptr_location) {
+     mark_and_relocate_to_buffered_addr((address*)ptr_location);
+   }
+ 
+   bool has_been_archived(address src_addr) const;
    address get_buffered_addr(address src_addr) const;
    template <typename T> T get_buffered_addr(T src_addr) const {
      return (T)get_buffered_addr((address)src_addr);
    }
  

*** 403,15 ***
    // All klasses and symbols that will be copied into the archive
    GrowableArray<Klass*>*  klasses() const { return _klasses; }
    GrowableArray<Symbol*>* symbols() const { return _symbols; }
  
    static bool is_active() {
!     return (_current != nullptr);
    }
  
    static ArchiveBuilder* current() {
-     assert_is_vm_thread();
      assert(_current != nullptr, "ArchiveBuilder must be active");
      return _current;
    }
  
    static DumpAllocStats* alloc_stats() {
--- 423,15 ---
    // All klasses and symbols that will be copied into the archive
    GrowableArray<Klass*>*  klasses() const { return _klasses; }
    GrowableArray<Symbol*>* symbols() const { return _symbols; }
  
    static bool is_active() {
!     CDS_ONLY(return (_current != nullptr));
+     NOT_CDS(return false;)
    }
  
    static ArchiveBuilder* current() {
      assert(_current != nullptr, "ArchiveBuilder must be active");
      return _current;
    }
  
    static DumpAllocStats* alloc_stats() {
< prev index next >