8202552: [AOT][JVMCI] Incorrect usage of INCLUDE_JVMCI and INCLUDE_AOT
authorkvn
Thu, 03 May 2018 09:07:40 -0700
changeset 49972 37b2446d7f86
parent 49971 bafa1860c107
child 49973 e3653598e3b0
8202552: [AOT][JVMCI] Incorrect usage of INCLUDE_JVMCI and INCLUDE_AOT Reviewed-by: stefank, ihse
make/hotspot/lib/JvmFeatures.gmk
src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
src/hotspot/share/compiler/oopMap.cpp
src/hotspot/share/gc/shared/cardTableBarrierSet.cpp
src/hotspot/share/runtime/arguments.cpp
src/hotspot/share/runtime/deoptimization.cpp
src/hotspot/share/runtime/java.cpp
src/hotspot/share/utilities/macros.hpp
--- a/make/hotspot/lib/JvmFeatures.gmk	Mon Apr 30 15:55:21 2018 +0200
+++ b/make/hotspot/lib/JvmFeatures.gmk	Thu May 03 09:07:40 2018 -0700
@@ -138,9 +138,8 @@
       memTracker.cpp nmtDCmd.cpp mallocSiteTable.cpp
 endif
 
-ifeq ($(call check-jvm-feature, aot), true)
-  JVM_CFLAGS_FEATURES += -DINCLUDE_AOT
-else
+ifneq ($(call check-jvm-feature, aot), true)
+  JVM_CFLAGS_FEATURES += -DINCLUDE_AOT=0
   JVM_EXCLUDE_FILES += \
       compiledIC_aot_x86_64.cpp compilerRuntime.cpp \
       aotCodeHeap.cpp aotCompiledMethod.cpp aotLoader.cpp compiledIC_aot.cpp
--- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Mon Apr 30 15:55:21 2018 +0200
+++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp	Thu May 03 09:07:40 2018 -0700
@@ -2339,7 +2339,7 @@
   __ b(cont);
 
   int reexecute_offset = __ pc() - start;
-#if defined(INCLUDE_JVMCI) && !defined(COMPILER1)
+#if INCLUDE_JVMCI && !defined(COMPILER1)
   if (EnableJVMCI && UseJVMCICompiler) {
     // JVMCI does not use this kind of deoptimization
     __ should_not_reach_here();
--- a/src/hotspot/share/compiler/oopMap.cpp	Mon Apr 30 15:55:21 2018 +0200
+++ b/src/hotspot/share/compiler/oopMap.cpp	Thu May 03 09:07:40 2018 -0700
@@ -266,9 +266,9 @@
 }
 
 static void add_derived_oop(oop* base, oop* derived) {
-#if !defined(TIERED) && !defined(INCLUDE_JVMCI)
+#if !defined(TIERED) && !INCLUDE_JVMCI
   COMPILER1_PRESENT(ShouldNotReachHere();)
-#endif // !defined(TIERED) && !defined(INCLUDE_JVMCI)
+#endif // !defined(TIERED) && !INCLUDE_JVMCI
 #if COMPILER2_OR_JVMCI
   DerivedPointerTable::add(derived, base);
 #endif // COMPILER2_OR_JVMCI
@@ -459,7 +459,7 @@
 #ifndef PRODUCT
 
 bool ImmutableOopMap::has_derived_pointer() const {
-#if !defined(TIERED) && !defined(INCLUDE_JVMCI)
+#if !defined(TIERED) && !INCLUDE_JVMCI
   COMPILER1_PRESENT(return false);
 #endif // !TIERED
 #if COMPILER2_OR_JVMCI
--- a/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp	Mon Apr 30 15:55:21 2018 +0200
+++ b/src/hotspot/share/gc/shared/cardTableBarrierSet.cpp	Thu May 03 09:07:40 2018 -0700
@@ -126,7 +126,7 @@
 // that specific collector in mind, and the documentation above suitably
 // extended and updated.
 void CardTableBarrierSet::on_slowpath_allocation_exit(JavaThread* thread, oop new_obj) {
-#if defined(COMPILER2) || INCLUDE_JVMCI
+#if COMPILER2_OR_JVMCI
   if (!ReduceInitialCardMarks) {
     return;
   }
@@ -148,13 +148,13 @@
       invalidate(mr);
     }
   }
-#endif // COMPILER2 || JVMCI
+#endif // COMPILER2_OR_JVMCI
 }
 
 void CardTableBarrierSet::initialize_deferred_card_mark_barriers() {
   // Used for ReduceInitialCardMarks (when COMPILER2 or JVMCI is used);
   // otherwise remains unused.
-#if defined(COMPILER2) || INCLUDE_JVMCI
+#if COMPILER2_OR_JVMCI
   _defer_initial_card_mark = is_server_compilation_mode_vm() && ReduceInitialCardMarks && can_elide_tlab_store_barriers()
                              && (DeferInitialCardMark || card_mark_must_follow_store());
 #else
@@ -163,7 +163,7 @@
 }
 
 void CardTableBarrierSet::flush_deferred_card_mark_barrier(JavaThread* thread) {
-#if defined(COMPILER2) || INCLUDE_JVMCI
+#if COMPILER2_OR_JVMCI
   MemRegion deferred = thread->deferred_card_mark();
   if (!deferred.is_empty()) {
     assert(_defer_initial_card_mark, "Otherwise should be empty");
--- a/src/hotspot/share/runtime/arguments.cpp	Mon Apr 30 15:55:21 2018 +0200
+++ b/src/hotspot/share/runtime/arguments.cpp	Thu May 03 09:07:40 2018 -0700
@@ -3317,7 +3317,7 @@
     FLAG_SET_ERGO(uintx, InitialTenuringThreshold, MaxTenuringThreshold);
   }
 
-#if !defined(COMPILER2) && !INCLUDE_JVMCI
+#if !COMPILER2_OR_JVMCI
   // Don't degrade server performance for footprint
   if (FLAG_IS_DEFAULT(UseLargePages) &&
       MaxHeapSize < LargePageHeapSizeThreshold) {
@@ -3333,7 +3333,7 @@
   }
 #endif
 
-#if !defined(COMPILER2) && !INCLUDE_JVMCI
+#if !COMPILER2_OR_JVMCI
   UNSUPPORTED_OPTION(ProfileInterpreter);
   NOT_PRODUCT(UNSUPPORTED_OPTION(TraceProfileInterpreter));
 #endif
--- a/src/hotspot/share/runtime/deoptimization.cpp	Mon Apr 30 15:55:21 2018 +0200
+++ b/src/hotspot/share/runtime/deoptimization.cpp	Thu May 03 09:07:40 2018 -0700
@@ -200,7 +200,7 @@
 #if COMPILER2_OR_JVMCI
   // Reallocate the non-escaping objects and restore their fields. Then
   // relock objects if synchronization on them was eliminated.
-#ifndef INCLUDE_JVMCI
+#if !INCLUDE_JVMCI
   if (DoEscapeAnalysis || EliminateNestedLocks) {
     if (EliminateAllocations) {
 #endif // INCLUDE_JVMCI
@@ -248,7 +248,7 @@
         // Restore result.
         deoptee.set_saved_oop_result(&map, return_value());
       }
-#ifndef INCLUDE_JVMCI
+#if !INCLUDE_JVMCI
     }
     if (EliminateLocks) {
 #endif // INCLUDE_JVMCI
@@ -283,7 +283,7 @@
 #endif // !PRODUCT
         }
       }
-#ifndef INCLUDE_JVMCI
+#if !INCLUDE_JVMCI
     }
   }
 #endif // INCLUDE_JVMCI
@@ -491,7 +491,7 @@
 
   assert(CodeCache::find_blob_unsafe(frame_pcs[0]) != NULL, "bad pc");
 
-#ifdef INCLUDE_JVMCI
+#if INCLUDE_JVMCI
   if (exceptionObject() != NULL) {
     thread->set_exception_oop(exceptionObject());
     exec_mode = Unpack_exception;
--- a/src/hotspot/share/runtime/java.cpp	Mon Apr 30 15:55:21 2018 +0200
+++ b/src/hotspot/share/runtime/java.cpp	Thu May 03 09:07:40 2018 -0700
@@ -267,17 +267,17 @@
     IndexSet::print_statistics();
   }
 #endif // ASSERT
-#else
-#ifdef INCLUDE_JVMCI
+#else // COMPILER2
+#if INCLUDE_JVMCI
 #ifndef COMPILER1
   if ((TraceDeoptimization || LogVMOutput || LogCompilation) && UseCompiler) {
     FlagSetting fs(DisplayVMOutput, DisplayVMOutput && TraceDeoptimization);
     Deoptimization::print_statistics();
     SharedRuntime::print_statistics();
   }
-#endif
-#endif
-#endif
+#endif // COMPILER1
+#endif // INCLUDE_JVMCI
+#endif // COMPILER2
 
   if (PrintAOTStatistics) {
     AOTLoader::print_statistics();
--- a/src/hotspot/share/utilities/macros.hpp	Mon Apr 30 15:55:21 2018 +0200
+++ b/src/hotspot/share/utilities/macros.hpp	Thu May 03 09:07:40 2018 -0700
@@ -172,12 +172,12 @@
 #define INCLUDE_JVMCI 1
 #endif
 
-#ifdef INCLUDE_AOT
-# if INCLUDE_AOT && !(INCLUDE_JVMCI)
-#   error "Must have JVMCI for AOT"
-# endif
-#else
-# define INCLUDE_AOT 0
+#ifndef INCLUDE_AOT
+#define INCLUDE_AOT 1
+#endif
+
+#if INCLUDE_AOT && !INCLUDE_JVMCI
+#  error "Must have JVMCI for AOT"
 #endif
 
 #if INCLUDE_JVMCI