changeset 59275:c5f700512a98

8244775: Remove unnecessary dependency to jfrEvents.hpp Reviewed-by: kbarrett, kvn
author iklam
date Wed, 13 May 2020 10:56:51 -0700
parents d9822606912a
children 0312e36e1daf
files src/hotspot/share/c1/c1_GraphBuilder.cpp src/hotspot/share/ci/ciEnv.cpp src/hotspot/share/compiler/compileBroker.cpp src/hotspot/share/compiler/compilerEvent.cpp src/hotspot/share/compiler/compilerEvent.hpp src/hotspot/share/gc/g1/g1CollectedHeap.cpp src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp src/hotspot/share/gc/g1/g1RemSet.cpp src/hotspot/share/gc/g1/g1RootProcessor.cpp src/hotspot/share/gc/g1/heapRegionManager.cpp src/hotspot/share/jvmci/jvmciCompilerToVM.cpp src/hotspot/share/opto/bytecodeInfo.cpp src/hotspot/share/opto/compile.cpp src/hotspot/share/opto/compile.hpp
diffstat 16 files changed, 110 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/c1/c1_GraphBuilder.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/c1/c1_GraphBuilder.cpp	Wed May 13 10:56:51 2020 -0700
@@ -37,6 +37,7 @@
 #include "compiler/compileBroker.hpp"
 #include "compiler/compilerEvent.hpp"
 #include "interpreter/bytecode.hpp"
+#include "jfr/jfrEvents.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/sharedRuntime.hpp"
--- a/src/hotspot/share/ci/ciEnv.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/ci/ciEnv.cpp	Wed May 13 10:56:51 2020 -0700
@@ -44,6 +44,7 @@
 #include "compiler/disassembler.hpp"
 #include "gc/shared/collectedHeap.inline.hpp"
 #include "interpreter/linkResolver.hpp"
+#include "jfr/jfrEvents.hpp"
 #include "logging/log.hpp"
 #include "memory/allocation.inline.hpp"
 #include "memory/oopFactory.hpp"
--- a/src/hotspot/share/compiler/compileBroker.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/compiler/compileBroker.cpp	Wed May 13 10:56:51 2020 -0700
@@ -37,6 +37,7 @@
 #include "compiler/compilerOracle.hpp"
 #include "compiler/directivesParser.hpp"
 #include "interpreter/linkResolver.hpp"
+#include "jfr/jfrEvents.hpp"
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
 #include "memory/allocation.inline.hpp"
--- a/src/hotspot/share/compiler/compilerEvent.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/compiler/compilerEvent.cpp	Wed May 13 10:56:51 2020 -0700
@@ -25,6 +25,7 @@
 #include "ci/ciMethod.hpp"
 #include "compiler/compilerEvent.hpp"
 #include "jfr/jfr.hpp"
+#include "jfr/jfrEvents.hpp"
 #include "jfr/metadata/jfrSerializer.hpp"
 #include "runtime/semaphore.inline.hpp"
 #include "utilities/growableArray.hpp"
--- a/src/hotspot/share/compiler/compilerEvent.hpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/compiler/compilerEvent.hpp	Wed May 13 10:56:51 2020 -0700
@@ -26,7 +26,6 @@
 
 #include "jni.h"
 #include "compiler/compilerDefinitions.hpp"
-#include "jfr/jfrEvents.hpp"
 #include "memory/allocation.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/ticks.hpp"
@@ -39,6 +38,11 @@
 template <typename>
 class GrowableArray;
 class Method;
+class EventCompilation;
+class EventCompilationFailure;
+class EventCompilerInlining;
+class EventCompilerPhase;
+struct JfrStructCalleeMethod;
 
 class CompilerEvent : AllStatic {
  public:
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Wed May 13 10:56:51 2020 -0700
@@ -41,6 +41,7 @@
 #include "gc/g1/g1DirtyCardQueue.hpp"
 #include "gc/g1/g1EvacStats.inline.hpp"
 #include "gc/g1/g1FullCollector.hpp"
+#include "gc/g1/g1GCParPhaseTimesTracker.hpp"
 #include "gc/g1/g1GCPhaseTimes.hpp"
 #include "gc/g1/g1HeapSizingPolicy.hpp"
 #include "gc/g1/g1HeapTransition.hpp"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/g1/g1GCParPhaseTimesTracker.hpp	Wed May 13 10:56:51 2020 -0700
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2020, Oracle and/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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_GC_G1_G1GCPARPHASETIMESTRACKER_HPP
+#define SHARE_GC_G1_G1GCPARPHASETIMESTRACKER_HPP
+
+#include "gc/g1/g1GCPhaseTimes.hpp"
+#include "jfr/jfrEvents.hpp"
+#include "utilities/ticks.hpp"
+
+class G1GCParPhaseTimesTracker : public CHeapObj<mtGC> {
+protected:
+  Ticks _start_time;
+  G1GCPhaseTimes::GCParPhases _phase;
+  G1GCPhaseTimes* _phase_times;
+  uint _worker_id;
+  EventGCPhaseParallel _event;
+  bool _must_record;
+
+public:
+  G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool must_record = true);
+  virtual ~G1GCParPhaseTimesTracker();
+};
+
+class G1EvacPhaseTimesTracker : public G1GCParPhaseTimesTracker {
+  Tickspan _total_time;
+  Tickspan _trim_time;
+
+  G1EvacPhaseWithTrimTimeTracker _trim_tracker;
+public:
+  G1EvacPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1ParScanThreadState* pss, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
+  virtual ~G1EvacPhaseTimesTracker();
+};
+
+#endif
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp	Wed May 13 10:56:51 2020 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
+#include "gc/g1/g1GCParPhaseTimesTracker.hpp"
 #include "gc/g1/g1GCPhaseTimes.hpp"
 #include "gc/g1/g1HotCardCache.hpp"
 #include "gc/g1/g1ParScanThreadState.inline.hpp"
--- a/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp	Wed May 13 10:56:51 2020 -0700
@@ -27,7 +27,6 @@
 
 #include "gc/shared/referenceProcessorPhaseTimes.hpp"
 #include "gc/shared/weakProcessorPhaseTimes.hpp"
-#include "jfr/jfrEvents.hpp"
 #include "logging/logLevel.hpp"
 #include "memory/allocation.hpp"
 #include "utilities/macros.hpp"
@@ -457,28 +456,4 @@
   void stop();
 };
 
-class G1GCParPhaseTimesTracker : public CHeapObj<mtGC> {
-protected:
-  Ticks _start_time;
-  G1GCPhaseTimes::GCParPhases _phase;
-  G1GCPhaseTimes* _phase_times;
-  uint _worker_id;
-  EventGCPhaseParallel _event;
-  bool _must_record;
-
-public:
-  G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool must_record = true);
-  virtual ~G1GCParPhaseTimesTracker();
-};
-
-class G1EvacPhaseTimesTracker : public G1GCParPhaseTimesTracker {
-  Tickspan _total_time;
-  Tickspan _trim_time;
-
-  G1EvacPhaseWithTrimTimeTracker _trim_tracker;
-public:
-  G1EvacPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1ParScanThreadState* pss, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
-  virtual ~G1EvacPhaseTimesTracker();
-};
-
 #endif // SHARE_GC_G1_G1GCPHASETIMES_HPP
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp	Wed May 13 10:56:51 2020 -0700
@@ -31,6 +31,7 @@
 #include "gc/g1/g1ConcurrentRefine.hpp"
 #include "gc/g1/g1DirtyCardQueue.hpp"
 #include "gc/g1/g1FromCardCache.hpp"
+#include "gc/g1/g1GCParPhaseTimesTracker.hpp"
 #include "gc/g1/g1GCPhaseTimes.hpp"
 #include "gc/g1/g1HotCardCache.hpp"
 #include "gc/g1/g1OopClosures.inline.hpp"
--- a/src/hotspot/share/gc/g1/g1RootProcessor.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/gc/g1/g1RootProcessor.cpp	Wed May 13 10:56:51 2020 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2020, Oracle and/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
@@ -32,6 +32,7 @@
 #include "gc/g1/g1CodeBlobClosure.hpp"
 #include "gc/g1/g1CollectedHeap.inline.hpp"
 #include "gc/g1/g1CollectorState.hpp"
+#include "gc/g1/g1GCParPhaseTimesTracker.hpp"
 #include "gc/g1/g1GCPhaseTimes.hpp"
 #include "gc/g1/g1ParScanThreadState.inline.hpp"
 #include "gc/g1/g1Policy.hpp"
--- a/src/hotspot/share/gc/g1/heapRegionManager.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/gc/g1/heapRegionManager.cpp	Wed May 13 10:56:51 2020 -0700
@@ -31,6 +31,7 @@
 #include "gc/g1/heapRegionManager.inline.hpp"
 #include "gc/g1/heapRegionSet.inline.hpp"
 #include "gc/g1/heterogeneousHeapRegionManager.hpp"
+#include "jfr/jfrEvents.hpp"
 #include "logging/logStream.hpp"
 #include "memory/allocation.hpp"
 #include "runtime/atomic.hpp"
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp	Wed May 13 10:56:51 2020 -0700
@@ -32,6 +32,7 @@
 #include "compiler/disassembler.hpp"
 #include "interpreter/linkResolver.hpp"
 #include "interpreter/bytecodeStream.hpp"
+#include "jfr/jfrEvents.hpp"
 #include "jvmci/jvmciCompilerToVM.hpp"
 #include "jvmci/jvmciCodeInstaller.hpp"
 #include "jvmci/jvmciRuntime.hpp"
--- a/src/hotspot/share/opto/bytecodeInfo.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/opto/bytecodeInfo.cpp	Wed May 13 10:56:51 2020 -0700
@@ -30,6 +30,7 @@
 #include "compiler/compilerEvent.hpp"
 #include "compiler/compileLog.hpp"
 #include "interpreter/linkResolver.hpp"
+#include "jfr/jfrEvents.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "opto/callGenerator.hpp"
 #include "opto/parse.hpp"
--- a/src/hotspot/share/opto/compile.cpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/opto/compile.cpp	Wed May 13 10:56:51 2020 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2020, Oracle and/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
@@ -35,6 +35,7 @@
 #include "compiler/oopMap.hpp"
 #include "gc/shared/barrierSet.hpp"
 #include "gc/shared/c2/barrierSetC2.hpp"
+#include "jfr/jfrEvents.hpp"
 #include "memory/resourceArea.hpp"
 #include "opto/addnode.hpp"
 #include "opto/block.hpp"
@@ -4562,6 +4563,39 @@
   }
 }
 
+void Compile::print_method(CompilerPhaseType cpt, int level, int idx) {
+  EventCompilerPhase event;
+  if (event.should_commit()) {
+    CompilerEvent::PhaseEvent::post(event, C->_latest_stage_start_counter, cpt, C->_compile_id, level);
+  }
+
+#ifndef PRODUCT
+  if (should_print(level)) {
+    char output[1024];
+    if (idx != 0) {
+      jio_snprintf(output, sizeof(output), "%s:%d", CompilerPhaseTypeHelper::to_string(cpt), idx);
+    } else {
+      jio_snprintf(output, sizeof(output), "%s", CompilerPhaseTypeHelper::to_string(cpt));
+    }
+    _printer->print_method(output, level);
+  }
+#endif
+  C->_latest_stage_start_counter.stamp();
+}
+
+void Compile::end_method(int level) {
+  EventCompilerPhase event;
+  if (event.should_commit()) {
+    CompilerEvent::PhaseEvent::post(event, C->_latest_stage_start_counter, PHASE_END, C->_compile_id, level);
+  }
+
+#ifndef PRODUCT
+  if (_printer && _printer->should_print(level)) {
+    _printer->end_method();
+  }
+#endif
+}
+
 
 #ifndef PRODUCT
 IdealGraphPrinter* Compile::_debug_file_printer = NULL;
--- a/src/hotspot/share/opto/compile.hpp	Wed May 13 10:39:35 2020 -0700
+++ b/src/hotspot/share/opto/compile.hpp	Wed May 13 10:56:51 2020 -0700
@@ -631,25 +631,7 @@
 #endif
   }
 
-  void print_method(CompilerPhaseType cpt, int level = 1, int idx = 0) {
-    EventCompilerPhase event;
-    if (event.should_commit()) {
-      CompilerEvent::PhaseEvent::post(event, C->_latest_stage_start_counter, cpt, C->_compile_id, level);
-    }
-
-#ifndef PRODUCT
-    if (should_print(level)) {
-      char output[1024];
-      if (idx != 0) {
-        jio_snprintf(output, sizeof(output), "%s:%d", CompilerPhaseTypeHelper::to_string(cpt), idx);
-      } else {
-        jio_snprintf(output, sizeof(output), "%s", CompilerPhaseTypeHelper::to_string(cpt));
-      }
-      _printer->print_method(output, level);
-    }
-#endif
-    C->_latest_stage_start_counter.stamp();
-  }
+  void print_method(CompilerPhaseType cpt, int level = 1, int idx = 0);
 
 #ifndef PRODUCT
   void igv_print_method_to_file(const char* phase_name = "Debug", bool append = false);
@@ -658,18 +640,7 @@
   static IdealGraphPrinter* debug_network_printer() { return _debug_network_printer; }
 #endif
 
-  void end_method(int level = 1) {
-    EventCompilerPhase event;
-    if (event.should_commit()) {
-      CompilerEvent::PhaseEvent::post(event, C->_latest_stage_start_counter, PHASE_END, C->_compile_id, level);
-    }
-
-#ifndef PRODUCT
-    if (_printer && _printer->should_print(level)) {
-      _printer->end_method();
-    }
-#endif
-  }
+  void end_method(int level = 1);
 
   int           macro_count()             const { return _macro_nodes->length(); }
   int           predicate_count()         const { return _predicate_opaqs->length();}