hotspot/src/share/vm/aot/aotCodeHeap.hpp
changeset 46647 634dc786bf96
parent 46556 beb2c322626d
child 46949 44ccdba2d72e
equal deleted inserted replaced
46646:5165b3a5b44a 46647:634dc786bf96
   189   int _oop_got_size;
   189   int _oop_got_size;
   190 
   190 
   191   // Collect stubs info
   191   // Collect stubs info
   192   int* _stubs_offsets;
   192   int* _stubs_offsets;
   193 
   193 
   194   address _low_boundary;
       
   195 
       
   196   bool _lib_symbols_initialized;
   194   bool _lib_symbols_initialized;
   197 
   195 
   198   void adjust_boundaries(AOTCompiledMethod* method) {
   196   void adjust_boundaries(AOTCompiledMethod* method) {
   199     address low = _low_boundary;
   197     char* low = (char*)method->code_begin();
   200     if (method->code_begin() < low) {
   198     if (low < low_boundary()) {
   201       low = method->code_begin();
   199       _memory.set_low_boundary(low);
       
   200       _memory.set_low(low);
   202     }
   201     }
   203     address high = high_boundary();
   202     char* high = (char *)method->code_end();
   204     if (method->code_end() > high) {
   203     if (high > high_boundary()) {
   205       high = method->code_end();
   204       _memory.set_high_boundary(high);
       
   205       _memory.set_high(high);
   206     }
   206     }
   207     assert(_method_count > 0, "methods count should be set already");
   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   }
   208   }
   213 
   209 
   214   void register_stubs();
   210   void register_stubs();
   215 
   211 
   216   void link_shared_runtime_symbols();
   212   void link_shared_runtime_symbols();
   228   // Find klass in SystemDictionary for aot metadata.
   224   // Find klass in SystemDictionary for aot metadata.
   229   static Klass* lookup_klass(const char* name, int len, const Method* method, Thread* THREAD);
   225   static Klass* lookup_klass(const char* name, int len, const Method* method, Thread* THREAD);
   230 public:
   226 public:
   231   AOTCodeHeap(AOTLib* lib);
   227   AOTCodeHeap(AOTLib* lib);
   232   virtual ~AOTCodeHeap();
   228   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 
   229 
   248   AOTCompiledMethod* find_aot(address p) const;
   230   AOTCompiledMethod* find_aot(address p) const;
   249 
   231 
   250   virtual void* find_start(void* p)     const;
   232   virtual void* find_start(void* p)     const;
   251   virtual CodeBlob* find_blob_unsafe(void* start) const;
   233   virtual CodeBlob* find_blob_unsafe(void* start) const;