< prev index next >

src/hotspot/share/gc/shared/weakProcessorPhases.hpp

Print this page




  28 #include "memory/allocation.hpp"
  29 #include "utilities/globalDefinitions.hpp"
  30 #include "utilities/macros.hpp"
  31 
  32 class BoolObjectClosure;
  33 class OopClosure;
  34 class OopStorage;
  35 
  36 class WeakProcessorPhases : AllStatic {
  37 public:
  38   typedef void (*Processor)(BoolObjectClosure*, OopClosure*);
  39 
  40   enum Phase {
  41     // Serial phases.
  42     JVMTI_ONLY(jvmti COMMA)
  43     JFR_ONLY(jfr COMMA)
  44 
  45     // OopStorage phases.
  46     jni,
  47     stringtable,
  48     resolved_method_table,
  49     vm
  50   };
  51 
  52   static const uint serial_phase_start = 0;
  53   static const uint serial_phase_count = jni;
  54   static const uint oop_storage_phase_start = serial_phase_count;
  55   static const uint oop_storage_phase_count = (vm + 1) - oop_storage_phase_start;
  56   static const uint phase_count = serial_phase_count + oop_storage_phase_count;
  57 
  58   static Phase phase(uint value);
  59   static uint index(Phase phase);
  60   // Indexes relative to the corresponding phase_start constant.
  61   static uint serial_index(Phase phase);
  62   static uint oop_storage_index(Phase phase);
  63 
  64   static bool is_serial(Phase phase);
  65   static bool is_oop_storage(Phase phase);
  66 
  67   static const char* description(Phase phase);
  68   static Processor processor(Phase phase); // Precondition: is_serial(phase)
  69   static OopStorage* oop_storage(Phase phase); // Precondition: is_oop_storage(phase)
  70 
  71   static bool is_stringtable(Phase phase);
  72   static bool is_resolved_method_table(Phase phase);
  73 };
  74 
  75 typedef WeakProcessorPhases::Phase WeakProcessorPhase;
  76 
  77 #define FOR_EACH_WEAK_PROCESSOR_PHASE(P)                                \
  78   for (WeakProcessorPhase P = static_cast<WeakProcessorPhase>(0);       \
  79        static_cast<uint>(P) <  WeakProcessorPhases::phase_count;        \
  80        P = static_cast<WeakProcessorPhase>(static_cast<uint>(P) + 1))
  81 
  82 #define FOR_EACH_WEAK_PROCESSOR_OOP_STORAGE_PHASE(P)                    \
  83   for (WeakProcessorPhase P = static_cast<WeakProcessorPhase>(WeakProcessorPhases::oop_storage_phase_start); \
  84        static_cast<uint>(P) < (WeakProcessorPhases::oop_storage_phase_start + \
  85                                WeakProcessorPhases::oop_storage_phase_count); \
  86        P = static_cast<WeakProcessorPhase>(static_cast<uint>(P) + 1))
  87 
  88 #endif // SHARE_GC_SHARED_WEAKPROCESSORPHASES_HPP


  28 #include "memory/allocation.hpp"
  29 #include "utilities/globalDefinitions.hpp"
  30 #include "utilities/macros.hpp"
  31 
  32 class BoolObjectClosure;
  33 class OopClosure;
  34 class OopStorage;
  35 
  36 class WeakProcessorPhases : AllStatic {
  37 public:
  38   typedef void (*Processor)(BoolObjectClosure*, OopClosure*);
  39 
  40   enum Phase {
  41     // Serial phases.
  42     JVMTI_ONLY(jvmti COMMA)
  43     JFR_ONLY(jfr COMMA)
  44 
  45     // OopStorage phases.
  46     jni,
  47     stringtable,

  48     vm
  49   };
  50 
  51   static const uint serial_phase_start = 0;
  52   static const uint serial_phase_count = jni;
  53   static const uint oop_storage_phase_start = serial_phase_count;
  54   static const uint oop_storage_phase_count = (vm + 1) - oop_storage_phase_start;
  55   static const uint phase_count = serial_phase_count + oop_storage_phase_count;
  56 
  57   static Phase phase(uint value);
  58   static uint index(Phase phase);
  59   // Indexes relative to the corresponding phase_start constant.
  60   static uint serial_index(Phase phase);
  61   static uint oop_storage_index(Phase phase);
  62 
  63   static bool is_serial(Phase phase);
  64   static bool is_oop_storage(Phase phase);
  65 
  66   static const char* description(Phase phase);
  67   static Processor processor(Phase phase); // Precondition: is_serial(phase)
  68   static OopStorage* oop_storage(Phase phase); // Precondition: is_oop_storage(phase)
  69 
  70   static bool is_stringtable(Phase phase);

  71 };
  72 
  73 typedef WeakProcessorPhases::Phase WeakProcessorPhase;
  74 
  75 #define FOR_EACH_WEAK_PROCESSOR_PHASE(P)                                \
  76   for (WeakProcessorPhase P = static_cast<WeakProcessorPhase>(0);       \
  77        static_cast<uint>(P) <  WeakProcessorPhases::phase_count;        \
  78        P = static_cast<WeakProcessorPhase>(static_cast<uint>(P) + 1))
  79 
  80 #define FOR_EACH_WEAK_PROCESSOR_OOP_STORAGE_PHASE(P)                    \
  81   for (WeakProcessorPhase P = static_cast<WeakProcessorPhase>(WeakProcessorPhases::oop_storage_phase_start); \
  82        static_cast<uint>(P) < (WeakProcessorPhases::oop_storage_phase_start + \
  83                                WeakProcessorPhases::oop_storage_phase_count); \
  84        P = static_cast<WeakProcessorPhase>(static_cast<uint>(P) + 1))
  85 
  86 #endif // SHARE_GC_SHARED_WEAKPROCESSORPHASES_HPP
< prev index next >