< prev index next >

src/share/vm/aot/aotCodeHeap.hpp

Print this page
rev 13198 : Consolidated and devirtualize CodeHeap::contains and contains_blob


 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     }
 201     char* high = (char *)method->code_end();
 202     if (high > high_boundary()) {
 203       _memory.set_high_boundary(high);
 204       _memory.set_high(high);
 205     }
 206     assert(_method_count > 0, "methods count should be set already");




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














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


< prev index next >