src/share/vm/aot/aotCodeHeap.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/aot

src/share/vm/aot/aotCodeHeap.hpp

Print this page
rev 29186 : Review changes 2


 168     }
 169     assert(_method_count > 0, "methods count should be set already");
 170 
 171     _low_boundary = low;
 172     _memory.set_high_boundary((char *)high);
 173     _memory.set_high((char *)high);
 174   }
 175 
 176   void handle_config_error(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
 177   void verify_flag(bool aot_flag, bool flag, const char* name);
 178   void verify_config(const AOTHeader* header);
 179   void register_stubs();
 180 
 181   void link_shared_runtime_symbols();
 182   void link_stub_routines_symbols();
 183   void link_os_symbols();
 184   void link_graal_runtime_symbols();
 185 
 186   void link_global_lib_symbols();
 187   void link_primitive_array_klasses();
 188   void publish_aot(instanceKlassHandle kh, methodHandle mh, AOTMethodData* method_data, int code_id);
 189 
 190   address load_symbol(const char *name);
 191 
 192   AOTCompiledMethod* next_in_use_at(int index) const;
 193 
 194   // Find klass in SystemDictionary for aot metadata.
 195   static Klass* lookup_klass(const char* name, int len, const Method* method, Thread* THREAD);
 196 public:
 197   AOTCodeHeap(void* handle, const char* name, int id);
 198   virtual ~AOTCodeHeap();
 199 
 200   address low_boundary()  const { return _low_boundary; }
 201   address high_boundary() const { return (address)CodeHeap::high(); }
 202 
 203   bool contains(const void* p) const {
 204     bool result = (low_boundary() <= p) && (p < high_boundary());
 205     assert(!result || (_method_count > 0), "");
 206     assert(result == CodeHeap::contains(p), "");
 207     return result;
 208   }
 209   AOTCompiledMethod* find_aot(address p) const;
 210 
 211   virtual void* find_start(void* p)     const;
 212   virtual CodeBlob* find_blob_unsafe(void* start) const;
 213   virtual void* first() const;
 214   virtual void* next(void *p) const;
 215 
 216   AOTKlassData* find_klass(InstanceKlass* ik);
 217   bool load_klass_data(instanceKlassHandle kh, Thread* thread);
 218   Klass* get_klass_from_got(const char* klass_name, int klass_len, const Method* method);
 219   void sweep_dependent_methods(AOTKlassData* klass_data);
 220   bool is_dependent_method(Klass* dependee, AOTCompiledMethod* aot);
 221 
 222   const char* get_name_at(int offset) {
 223     return _metaspace_names + offset;
 224   }
 225 
 226   void oops_do(OopClosure* f);
 227   void metadata_do(void f(Metadata*));
 228   void got_metadata_do(void f(Metadata*));
 229 
 230 #ifdef ASSERT
 231   bool got_contains(Metadata **p) {
 232     return (p >= &_metadata_got[0] && p < &_metadata_got[_metadata_got_size]) ||
 233            (p >= &_metaspace_got[0] && p < &_metaspace_got[_metaspace_got_size]);
 234   }
 235 #endif
 236 
 237   int dso_id() const { return _dso_id; }


 245         AOTCompiledMethod* m = _code_to_aot[index]._aot;
 246         assert(m != NULL, "AOT method should be set");
 247         if (!m->is_runtime_stub()) {
 248           return m;
 249         }
 250     }
 251     return NULL;
 252   }
 253 
 254   static int  narrow_oop_shift() { return _narrow_oop_shift; }
 255   static int  narrow_klass_shift() { return _narrow_klass_shift; }
 256   static bool narrow_oop_shift_initialized() { return _narrow_oop_shift_initialized; }
 257   static Method* find_method(KlassHandle klass, Thread* thread, const char* method_name);
 258 
 259   void verify_flag(int  aot_flag, int  flag, const char* name);
 260 
 261   void cleanup_inline_caches();
 262 
 263   DEBUG_ONLY( int verify_icholder_relocations(); )
 264 
 265   void flush_evol_dependents_on(instanceKlassHandle dependee);
 266 
 267   void alive_methods_do(void f(CompiledMethod* nm));
 268 
 269 #ifndef PRODUCT
 270   static int klasses_seen;
 271   static int aot_klasses_found;
 272   static int aot_klasses_fp_miss;
 273   static int aot_klasses_cl_miss;
 274   static int aot_methods_found;
 275 
 276   static void print_statistics();
 277 #endif
 278 };
 279 
 280 #endif // SHARE_VM_AOT_AOTCODEHEAP_HPP


 168     }
 169     assert(_method_count > 0, "methods count should be set already");
 170 
 171     _low_boundary = low;
 172     _memory.set_high_boundary((char *)high);
 173     _memory.set_high((char *)high);
 174   }
 175 
 176   void handle_config_error(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
 177   void verify_flag(bool aot_flag, bool flag, const char* name);
 178   void verify_config(const AOTHeader* header);
 179   void register_stubs();
 180 
 181   void link_shared_runtime_symbols();
 182   void link_stub_routines_symbols();
 183   void link_os_symbols();
 184   void link_graal_runtime_symbols();
 185 
 186   void link_global_lib_symbols();
 187   void link_primitive_array_klasses();
 188   void publish_aot(const methodHandle& mh, AOTMethodData* method_data, int code_id);
 189 
 190   address load_symbol(const char *name);
 191 
 192   AOTCompiledMethod* next_in_use_at(int index) const;
 193 
 194   // Find klass in SystemDictionary for aot metadata.
 195   static Klass* lookup_klass(const char* name, int len, const Method* method, Thread* THREAD);
 196 public:
 197   AOTCodeHeap(void* handle, const char* name, int id);
 198   virtual ~AOTCodeHeap();
 199 
 200   address low_boundary()  const { return _low_boundary; }
 201   address high_boundary() const { return (address)CodeHeap::high(); }
 202 
 203   bool contains(const void* p) const {
 204     bool result = (low_boundary() <= p) && (p < high_boundary());
 205     assert(!result || (_method_count > 0), "");
 206     assert(result == CodeHeap::contains(p), "");
 207     return result;
 208   }
 209   AOTCompiledMethod* find_aot(address p) const;
 210 
 211   virtual void* find_start(void* p)     const;
 212   virtual CodeBlob* find_blob_unsafe(void* start) const;
 213   virtual void* first() const;
 214   virtual void* next(void *p) const;
 215 
 216   AOTKlassData* find_klass(InstanceKlass* ik);
 217   bool load_klass_data(const instanceKlassHandle& kh, Thread* thread);
 218   Klass* get_klass_from_got(const char* klass_name, int klass_len, const Method* method);
 219   void sweep_dependent_methods(AOTKlassData* klass_data);
 220   bool is_dependent_method(Klass* dependee, AOTCompiledMethod* aot);
 221 
 222   const char* get_name_at(int offset) {
 223     return _metaspace_names + offset;
 224   }
 225 
 226   void oops_do(OopClosure* f);
 227   void metadata_do(void f(Metadata*));
 228   void got_metadata_do(void f(Metadata*));
 229 
 230 #ifdef ASSERT
 231   bool got_contains(Metadata **p) {
 232     return (p >= &_metadata_got[0] && p < &_metadata_got[_metadata_got_size]) ||
 233            (p >= &_metaspace_got[0] && p < &_metaspace_got[_metaspace_got_size]);
 234   }
 235 #endif
 236 
 237   int dso_id() const { return _dso_id; }


 245         AOTCompiledMethod* m = _code_to_aot[index]._aot;
 246         assert(m != NULL, "AOT method should be set");
 247         if (!m->is_runtime_stub()) {
 248           return m;
 249         }
 250     }
 251     return NULL;
 252   }
 253 
 254   static int  narrow_oop_shift() { return _narrow_oop_shift; }
 255   static int  narrow_klass_shift() { return _narrow_klass_shift; }
 256   static bool narrow_oop_shift_initialized() { return _narrow_oop_shift_initialized; }
 257   static Method* find_method(KlassHandle klass, Thread* thread, const char* method_name);
 258 
 259   void verify_flag(int  aot_flag, int  flag, const char* name);
 260 
 261   void cleanup_inline_caches();
 262 
 263   DEBUG_ONLY( int verify_icholder_relocations(); )
 264 
 265   void flush_evol_dependents_on(const instanceKlassHandle& dependee);
 266 
 267   void alive_methods_do(void f(CompiledMethod* nm));
 268 
 269 #ifndef PRODUCT
 270   static int klasses_seen;
 271   static int aot_klasses_found;
 272   static int aot_klasses_fp_miss;
 273   static int aot_klasses_cl_miss;
 274   static int aot_methods_found;
 275 
 276   static void print_statistics();
 277 #endif
 278 };
 279 
 280 #endif // SHARE_VM_AOT_AOTCODEHEAP_HPP
src/share/vm/aot/aotCodeHeap.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File