< prev index next >

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

Print this page




  32 // -----------------------
  33 //
  34 //   7   4 3 2 1 0
  35 //  +---+-+-+-+-+-+
  36 //  |000|1|1|1|1|1|
  37 //  +---+-+-+-+-+-+
  38 //  |   | | | | |
  39 //  |   | | | | * 0-0 Java Thread Flag (1-bit)
  40 //  |   | | | |
  41 //  |   | | | * 1-1 Worker Thread Flag (1-bit)
  42 //  |   | | |
  43 //  |   | | * 2-2 Non-Blocking Flag (1-bit)
  44 //  |   | |
  45 //  |   | * 3-3 Relocation Flag (1-bit)
  46 //  |   |
  47 //  |   * 4-4 No Reserve Flag (1-bit)
  48 //  |
  49 //  * 7-5 Unused (3-bits)
  50 //
  51 
  52 class ZAllocationFlags VALUE_OBJ_CLASS_SPEC {
  53 private:
  54   typedef ZBitField<uint8_t, bool, 0, 1> field_java_thread;
  55   typedef ZBitField<uint8_t, bool, 1, 1> field_worker_thread;
  56   typedef ZBitField<uint8_t, bool, 2, 1> field_non_blocking;
  57   typedef ZBitField<uint8_t, bool, 3, 1> field_relocation;
  58   typedef ZBitField<uint8_t, bool, 4, 1> field_no_reserve;
  59 
  60   uint8_t _flags;
  61 
  62 public:
  63   ZAllocationFlags() :
  64       _flags(0) {}
  65 
  66   void set_java_thread() {
  67     _flags |= field_java_thread::encode(true);
  68   }
  69 
  70   void set_worker_thread() {
  71     _flags |= field_worker_thread::encode(true);
  72   }




  32 // -----------------------
  33 //
  34 //   7   4 3 2 1 0
  35 //  +---+-+-+-+-+-+
  36 //  |000|1|1|1|1|1|
  37 //  +---+-+-+-+-+-+
  38 //  |   | | | | |
  39 //  |   | | | | * 0-0 Java Thread Flag (1-bit)
  40 //  |   | | | |
  41 //  |   | | | * 1-1 Worker Thread Flag (1-bit)
  42 //  |   | | |
  43 //  |   | | * 2-2 Non-Blocking Flag (1-bit)
  44 //  |   | |
  45 //  |   | * 3-3 Relocation Flag (1-bit)
  46 //  |   |
  47 //  |   * 4-4 No Reserve Flag (1-bit)
  48 //  |
  49 //  * 7-5 Unused (3-bits)
  50 //
  51 
  52 class ZAllocationFlags {
  53 private:
  54   typedef ZBitField<uint8_t, bool, 0, 1> field_java_thread;
  55   typedef ZBitField<uint8_t, bool, 1, 1> field_worker_thread;
  56   typedef ZBitField<uint8_t, bool, 2, 1> field_non_blocking;
  57   typedef ZBitField<uint8_t, bool, 3, 1> field_relocation;
  58   typedef ZBitField<uint8_t, bool, 4, 1> field_no_reserve;
  59 
  60   uint8_t _flags;
  61 
  62 public:
  63   ZAllocationFlags() :
  64       _flags(0) {}
  65 
  66   void set_java_thread() {
  67     _flags |= field_java_thread::encode(true);
  68   }
  69 
  70   void set_worker_thread() {
  71     _flags |= field_worker_thread::encode(true);
  72   }


< prev index next >