< prev index next >

src/share/vm/aot/aotCodeHeap.hpp

Print this page
rev 13198 : 8183573: Refactor CodeHeap and AOTCodeHeap to devirtualize hot methods
Reviewed-by: rbackman


 174 
 175   // Collect metaspace info: names -> address in .got section
 176   const char* _metaspace_names;
 177   address _method_metadata;
 178 
 179   address _methods_offsets;
 180   address _klasses_offsets;
 181   address _dependencies;
 182 
 183   Metadata** _metaspace_got;
 184   Metadata** _metadata_got;
 185   oop*    _oop_got;
 186 
 187   int _metaspace_got_size;
 188   int _metadata_got_size;
 189   int _oop_got_size;
 190 
 191   // Collect stubs info
 192   int* _stubs_offsets;
 193 
 194   address _low_boundary;
 195 
 196   bool _lib_symbols_initialized;
 197 
 198   void adjust_boundaries(AOTCompiledMethod* method) {
 199     address low = _low_boundary;
 200     if (method->code_begin() < low) {
 201       low = method->code_begin();

 202     }
 203     address high = high_boundary();
 204     if (method->code_end() > high) {
 205       high = method->code_end();

 206     }
 207     assert(_method_count > 0, "methods count should be set already");
 208 
 209     _low_boundary = low;
 210     _memory.set_high_boundary((char *)high);
 211     _memory.set_high((char *)high);
 212   }
 213 
 214   void register_stubs();
 215 
 216   void link_shared_runtime_symbols();
 217   void link_stub_routines_symbols();
 218   void link_os_symbols();
 219   void link_graal_runtime_symbols();
 220 
 221   void link_global_lib_symbols();
 222   void link_primitive_array_klasses();
 223   void publish_aot(const methodHandle& mh, AOTMethodData* method_data, int code_id);
 224 
 225 
 226   AOTCompiledMethod* next_in_use_at(int index) const;
 227 
 228   // Find klass in SystemDictionary for aot metadata.
 229   static Klass* lookup_klass(const char* name, int len, const Method* method, Thread* THREAD);
 230 public:
 231   AOTCodeHeap(AOTLib* lib);
 232   virtual ~AOTCodeHeap();
 233 
 234   address low_boundary()  const { return _low_boundary; }
 235   address high_boundary() const { return (address)CodeHeap::high(); }
 236 
 237   bool contains(const void* p) const {
 238     bool result = (low_boundary() <= p) && (p < high_boundary());
 239     assert(!result || (_method_count > 0), "");
 240     assert(result == CodeHeap::contains(p), "");
 241     return result;
 242   }
 243 
 244   bool contains_blob(const CodeBlob* blob) const {
 245     return CodeHeap::contains(blob->code_begin());
 246   }
 247 
 248   AOTCompiledMethod* find_aot(address p) const;
 249 
 250   virtual void* find_start(void* p)     const;
 251   virtual CodeBlob* find_blob_unsafe(void* start) const;
 252   virtual void* first() const;
 253   virtual void* next(void *p) const;
 254 
 255   AOTKlassData* find_klass(InstanceKlass* ik);
 256   bool load_klass_data(InstanceKlass* ik, Thread* thread);
 257   Klass* get_klass_from_got(const char* klass_name, int klass_len, const Method* method);
 258   void sweep_dependent_methods(AOTKlassData* klass_data);
 259   bool is_dependent_method(Klass* dependee, AOTCompiledMethod* aot);
 260 
 261   const char* get_name_at(int offset) {
 262     return _metaspace_names + offset;
 263   }
 264 
 265   void oops_do(OopClosure* f);
 266   void metadata_do(void f(Metadata*));




 174 
 175   // Collect metaspace info: names -> address in .got section
 176   const char* _metaspace_names;
 177   address _method_metadata;
 178 
 179   address _methods_offsets;
 180   address _klasses_offsets;
 181   address _dependencies;
 182 
 183   Metadata** _metaspace_got;
 184   Metadata** _metadata_got;
 185   oop*    _oop_got;
 186 
 187   int _metaspace_got_size;
 188   int _metadata_got_size;
 189   int _oop_got_size;
 190 
 191   // Collect stubs info
 192   int* _stubs_offsets;
 193 


 194   bool _lib_symbols_initialized;
 195 
 196   void adjust_boundaries(AOTCompiledMethod* method) {
 197     char* low = (char*)method->code_begin();
 198     if (low < low_boundary()) {
 199       _memory.set_low_boundary(low);
 200       _memory.set_low(low);
 201     }
 202     char* high = (char *)method->code_end();
 203     if (high > high_boundary()) {
 204       _memory.set_high_boundary(high);
 205       _memory.set_high(high);
 206     }
 207     assert(_method_count > 0, "methods count should be set already");




 208   }
 209 
 210   void register_stubs();
 211 
 212   void link_shared_runtime_symbols();
 213   void link_stub_routines_symbols();
 214   void link_os_symbols();
 215   void link_graal_runtime_symbols();
 216 
 217   void link_global_lib_symbols();
 218   void link_primitive_array_klasses();
 219   void publish_aot(const methodHandle& mh, AOTMethodData* method_data, int code_id);
 220 
 221 
 222   AOTCompiledMethod* next_in_use_at(int index) const;
 223 
 224   // Find klass in SystemDictionary for aot metadata.
 225   static Klass* lookup_klass(const char* name, int len, const Method* method, Thread* THREAD);
 226 public:
 227   AOTCodeHeap(AOTLib* lib);
 228   virtual ~AOTCodeHeap();














 229 
 230   AOTCompiledMethod* find_aot(address p) const;
 231 
 232   virtual void* find_start(void* p)     const;
 233   virtual CodeBlob* find_blob_unsafe(void* start) const;
 234   virtual void* first() const;
 235   virtual void* next(void *p) const;
 236 
 237   AOTKlassData* find_klass(InstanceKlass* ik);
 238   bool load_klass_data(InstanceKlass* ik, Thread* thread);
 239   Klass* get_klass_from_got(const char* klass_name, int klass_len, const Method* method);
 240   void sweep_dependent_methods(AOTKlassData* klass_data);
 241   bool is_dependent_method(Klass* dependee, AOTCompiledMethod* aot);
 242 
 243   const char* get_name_at(int offset) {
 244     return _metaspace_names + offset;
 245   }
 246 
 247   void oops_do(OopClosure* f);
 248   void metadata_do(void f(Metadata*));


< prev index next >