< prev index next >

src/hotspot/share/gc/z/zPageTableEntry.hpp

Print this page




  29 
  30 //
  31 // Page table entry layout
  32 // -----------------------
  33 //
  34 //   6
  35 //   3                                                                    1 0
  36 //  +----------------------------------------------------------------------+-+
  37 //  |11111111 11111111 11111111 11111111 11111111 11111111 11111111 1111111|1|
  38 //  +----------------------------------------------------------------------+-+
  39 //  |                                                                      |
  40 //  |                                          0-0 Relocating Flag (1-bit) *
  41 //  |
  42 //  |
  43 //  |
  44 //  * 63-1 Page address (63-bits)
  45 //
  46 
  47 class ZPage;
  48 
  49 class ZPageTableEntry VALUE_OBJ_CLASS_SPEC {
  50 private:
  51   typedef ZBitField<uint64_t, bool,   0, 1>     field_relocating;
  52   typedef ZBitField<uint64_t, ZPage*, 1, 63, 1> field_page;
  53 
  54   uint64_t _entry;
  55 
  56 public:
  57   ZPageTableEntry() :
  58       _entry(0) {}
  59 
  60   ZPageTableEntry(ZPage* page, bool relocating) :
  61       _entry(field_page::encode(page) |
  62              field_relocating::encode(relocating)) {}
  63 
  64   bool relocating() const {
  65     return field_relocating::decode(_entry);
  66   }
  67 
  68   ZPage* page() const {
  69     return field_page::decode(_entry);


  29 
  30 //
  31 // Page table entry layout
  32 // -----------------------
  33 //
  34 //   6
  35 //   3                                                                    1 0
  36 //  +----------------------------------------------------------------------+-+
  37 //  |11111111 11111111 11111111 11111111 11111111 11111111 11111111 1111111|1|
  38 //  +----------------------------------------------------------------------+-+
  39 //  |                                                                      |
  40 //  |                                          0-0 Relocating Flag (1-bit) *
  41 //  |
  42 //  |
  43 //  |
  44 //  * 63-1 Page address (63-bits)
  45 //
  46 
  47 class ZPage;
  48 
  49 class ZPageTableEntry {
  50 private:
  51   typedef ZBitField<uint64_t, bool,   0, 1>     field_relocating;
  52   typedef ZBitField<uint64_t, ZPage*, 1, 63, 1> field_page;
  53 
  54   uint64_t _entry;
  55 
  56 public:
  57   ZPageTableEntry() :
  58       _entry(0) {}
  59 
  60   ZPageTableEntry(ZPage* page, bool relocating) :
  61       _entry(field_page::encode(page) |
  62              field_relocating::encode(relocating)) {}
  63 
  64   bool relocating() const {
  65     return field_relocating::decode(_entry);
  66   }
  67 
  68   ZPage* page() const {
  69     return field_page::decode(_entry);
< prev index next >