8202684: Minimal VM build is broken after JDK-8199067, JDK-8202638
authorshade
Sat, 05 May 2018 18:55:31 +0200
changeset 50021 b8308d6356e7
parent 50020 9e82ca74f086
child 50022 653343de5e7a
8202684: Minimal VM build is broken after JDK-8199067, JDK-8202638 Reviewed-by: eosterlund, stuefe
src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp
src/hotspot/share/utilities/macros.hpp
test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp
--- a/src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp	Sat May 05 12:38:15 2018 -0400
+++ b/src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp	Sat May 05 18:55:31 2018 +0200
@@ -70,7 +70,7 @@
     if (strcasecmp("dynamic", scale_value) == 0) {
       scale = 0;
     } else {
-      scale = NMTUtil::scale_from_name(scale_value);
+      scale = NMT_ONLY(NMTUtil::scale_from_name(scale_value)) NOT_NMT(0);
       if (scale == 0) {
         output()->print_cr("Invalid scale: \"%s\". Will use dynamic scaling.", scale_value);
       }
--- a/src/hotspot/share/utilities/macros.hpp	Sat May 05 12:38:15 2018 -0400
+++ b/src/hotspot/share/utilities/macros.hpp	Sat May 05 18:55:31 2018 +0200
@@ -218,9 +218,13 @@
 #if INCLUDE_NMT
 #define NOT_NMT_RETURN        /* next token must be ; */
 #define NOT_NMT_RETURN_(code) /* next token must be ; */
+#define NMT_ONLY(x) x
+#define NOT_NMT(x)
 #else
 #define NOT_NMT_RETURN        {}
 #define NOT_NMT_RETURN_(code) { return code; }
+#define NMT_ONLY(x)
+#define NOT_NMT(x) x
 #endif // INCLUDE_NMT
 
 #ifndef INCLUDE_TRACE
--- a/test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp	Sat May 05 12:38:15 2018 -0400
+++ b/test/hotspot/gtest/runtime/test_committed_virtualmemory.cpp	Sat May 05 18:55:31 2018 +0200
@@ -26,6 +26,8 @@
 // Included early because the NMT flags don't include it.
 #include "utilities/macros.hpp"
 
+#if INCLUDE_NMT
+
 #include "runtime/thread.hpp"
 #include "services/memTracker.hpp"
 #include "services/virtualMemoryTracker.hpp"
@@ -208,3 +210,5 @@
   CommittedVirtualMemoryTest::test_committed_region();
   CommittedVirtualMemoryTest::test_partial_region();
 }
+
+#endif // INCLUDE_NMT