hotspot/src/share/vm/runtime/virtualspace.hpp
changeset 2364 7c9f46e9d37c
parent 2268 bea8be80ec88
child 3261 c7d5aae8d3f7
equal deleted inserted replaced
2363:f09f17e0ebc7 2364:7c9f46e9d37c
    30   char*  _base;
    30   char*  _base;
    31   size_t _size;
    31   size_t _size;
    32   size_t _noaccess_prefix;
    32   size_t _noaccess_prefix;
    33   size_t _alignment;
    33   size_t _alignment;
    34   bool   _special;
    34   bool   _special;
       
    35   bool   _executable;
    35 
    36 
    36   // ReservedSpace
    37   // ReservedSpace
    37   ReservedSpace(char* base, size_t size, size_t alignment, bool special);
    38   ReservedSpace(char* base, size_t size, size_t alignment, bool special,
       
    39                 bool executable);
    38   void initialize(size_t size, size_t alignment, bool large,
    40   void initialize(size_t size, size_t alignment, bool large,
    39                   char* requested_address,
    41                   char* requested_address,
    40                   const size_t noaccess_prefix);
    42                   const size_t noaccess_prefix,
       
    43                   bool executable);
    41 
    44 
    42   // Release parts of an already-reserved memory region [addr, addr + len) to
    45   // Release parts of an already-reserved memory region [addr, addr + len) to
    43   // get a new region that has "compound alignment."  Return the start of the
    46   // get a new region that has "compound alignment."  Return the start of the
    44   // resulting region, or NULL on failure.
    47   // resulting region, or NULL on failure.
    45   //
    48   //
    73                 const size_t noaccess_prefix = 0);
    76                 const size_t noaccess_prefix = 0);
    74   ReservedSpace(const size_t prefix_size, const size_t prefix_align,
    77   ReservedSpace(const size_t prefix_size, const size_t prefix_align,
    75                 const size_t suffix_size, const size_t suffix_align,
    78                 const size_t suffix_size, const size_t suffix_align,
    76                 char* requested_address,
    79                 char* requested_address,
    77                 const size_t noaccess_prefix = 0);
    80                 const size_t noaccess_prefix = 0);
       
    81   ReservedSpace(size_t size, size_t alignment, bool large, bool executable);
    78 
    82 
    79   // Accessors
    83   // Accessors
    80   char*  base()      const { return _base;      }
    84   char*  base()            const { return _base;      }
    81   size_t size()      const { return _size;      }
    85   size_t size()            const { return _size;      }
    82   size_t alignment() const { return _alignment; }
    86   size_t alignment()       const { return _alignment; }
    83   bool   special()   const { return _special;   }
    87   bool   special()         const { return _special;   }
    84 
    88   bool   executable()      const { return _executable;   }
    85   size_t noaccess_prefix()   const { return _noaccess_prefix;   }
    89   size_t noaccess_prefix() const { return _noaccess_prefix;   }
    86 
    90   bool is_reserved()       const { return _base != NULL; }
    87   bool is_reserved() const { return _base != NULL; }
       
    88   void release();
    91   void release();
    89 
    92 
    90   // Splitting
    93   // Splitting
    91   ReservedSpace first_part(size_t partition_size, size_t alignment,
    94   ReservedSpace first_part(size_t partition_size, size_t alignment,
    92                            bool split = false, bool realloc = true);
    95                            bool split = false, bool realloc = true);
   124   ReservedHeapSpace(const size_t prefix_size, const size_t prefix_align,
   127   ReservedHeapSpace(const size_t prefix_size, const size_t prefix_align,
   125                     const size_t suffix_size, const size_t suffix_align,
   128                     const size_t suffix_size, const size_t suffix_align,
   126                     char* requested_address);
   129                     char* requested_address);
   127 };
   130 };
   128 
   131 
       
   132 // Class encapsulating behavior specific memory space for Code
       
   133 class ReservedCodeSpace : public ReservedSpace {
       
   134  public:
       
   135   // Constructor
       
   136   ReservedCodeSpace(size_t r_size, size_t rs_align, bool large);
       
   137 };
       
   138 
   129 // VirtualSpace is data structure for committing a previously reserved address range in smaller chunks.
   139 // VirtualSpace is data structure for committing a previously reserved address range in smaller chunks.
   130 
   140 
   131 class VirtualSpace VALUE_OBJ_CLASS_SPEC {
   141 class VirtualSpace VALUE_OBJ_CLASS_SPEC {
   132   friend class VMStructs;
   142   friend class VMStructs;
   133  private:
   143  private:
   140   char* _high;
   150   char* _high;
   141 
   151 
   142   // The entire space has been committed and pinned in memory, no
   152   // The entire space has been committed and pinned in memory, no
   143   // os::commit_memory() or os::uncommit_memory().
   153   // os::commit_memory() or os::uncommit_memory().
   144   bool _special;
   154   bool _special;
       
   155 
       
   156   // Need to know if commit should be executable.
       
   157   bool   _executable;
   145 
   158 
   146   // MPSS Support
   159   // MPSS Support
   147   // Each virtualspace region has a lower, middle, and upper region.
   160   // Each virtualspace region has a lower, middle, and upper region.
   148   // Each region has an end boundary and a high pointer which is the
   161   // Each region has an end boundary and a high pointer which is the
   149   // high water mark for the last allocated byte.
   162   // high water mark for the last allocated byte.