< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp

Print this page
@@ -1,7 +1,8 @@
  /*
   * Copyright (c) 2017, 2021, Red Hat, Inc. All rights reserved.
+  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

@@ -39,20 +40,37 @@
  #include "runtime/vmThread.hpp"
  #include "runtime/vmOperations.hpp"
  #include "services/memoryService.hpp"
  
  class GCTimer;
+ class ShenandoahGeneration;
+ 
+ #define SHENANDOAH_RETURN_EVENT_MESSAGE(generation_type, prefix, postfix) \
+   switch (generation_type) {                                              \
+     case NON_GEN:                                                         \
+       return prefix " (NON-GENERATIONAL)" postfix;                        \
+     case GLOBAL:                                                          \
+       return prefix " (GLOBAL)" postfix;                                  \
+     case YOUNG:                                                           \
+       return prefix " (YOUNG)" postfix;                                   \
+     case OLD:                                                             \
+       return prefix " (OLD)" postfix;                                     \
+     default:                                                              \
+       ShouldNotReachHere();                                               \
+       return prefix " (UNKNOWN)" postfix;                                 \
+   }                                                                       \
  
  class ShenandoahGCSession : public StackObj {
  private:
    ShenandoahHeap* const _heap;
+   ShenandoahGeneration* const _generation;
    GCTimer*  const _timer;
    GCTracer* const _tracer;
  
    TraceMemoryManagerStats _trace_cycle;
  public:
-   ShenandoahGCSession(GCCause::Cause cause);
+   ShenandoahGCSession(GCCause::Cause cause, ShenandoahGeneration* generation);
    ~ShenandoahGCSession();
  };
  
  /*
   * ShenandoahGCPhaseTiming tracks Shenandoah specific timing information

@@ -62,15 +80,16 @@
  private:
    static ShenandoahPhaseTimings::Phase  _current_phase;
  
    ShenandoahPhaseTimings* const         _timings;
    const ShenandoahPhaseTimings::Phase   _phase;
+   const bool                            _should_aggregate;
    ShenandoahPhaseTimings::Phase         _parent_phase;
    double _start;
  
  public:
-   ShenandoahTimingsTracker(ShenandoahPhaseTimings::Phase phase);
+   ShenandoahTimingsTracker(ShenandoahPhaseTimings::Phase phase, bool should_aggregate = false);
    ~ShenandoahTimingsTracker();
  
    static ShenandoahPhaseTimings::Phase current_phase() { return _current_phase; }
  
    static bool is_current_phase_valid();
< prev index next >