7041262: VM_Version should be called instead of Abstract_VM_Version so that overriding works
authorhseigel
Tue, 16 Oct 2018 11:08:46 -0400
changeset 52148 2d9f8845d0ae
parent 52147 435467bce14e
child 52149 0edbbc64393c
7041262: VM_Version should be called instead of Abstract_VM_Version so that overriding works Summary: Change calls to Abstract_VM_Version methods to be calls to VM_Version methods. Reviewed-by: coleenp, kbarrett, dholmes
src/hotspot/cpu/arm/vm_version_arm_32.cpp
src/hotspot/share/classfile/classLoader.cpp
src/hotspot/share/gc/cms/cmsArguments.cpp
src/hotspot/share/gc/g1/g1Arguments.cpp
src/hotspot/share/gc/parallel/parallelArguments.cpp
src/hotspot/share/gc/z/zInitialize.cpp
src/hotspot/share/prims/jvm.cpp
src/hotspot/share/runtime/thread.cpp
src/hotspot/share/runtime/vm_version.hpp
src/hotspot/share/services/diagnosticCommand.cpp
src/hotspot/share/services/runtimeService.cpp
src/hotspot/share/utilities/vmError.cpp
--- a/src/hotspot/cpu/arm/vm_version_arm_32.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/cpu/arm/vm_version_arm_32.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -318,20 +318,3 @@
   //
   return (!os::is_MP() && (arm_arch() > 5)) ? false : true;
 }
-
-#define EXP
-
-// Temporary override for experimental features
-// Copied from Abstract_VM_Version
-const char* VM_Version::vm_info_string() {
-  switch (Arguments::mode()) {
-    case Arguments::_int:
-      return UseSharedSpaces ? "interpreted mode, sharing" EXP : "interpreted mode" EXP;
-    case Arguments::_mixed:
-      return UseSharedSpaces ? "mixed mode, sharing" EXP    :  "mixed mode" EXP;
-    case Arguments::_comp:
-      return UseSharedSpaces ? "compiled mode, sharing" EXP   : "compiled mode" EXP;
-  };
-  ShouldNotReachHere();
-  return "";
-}
--- a/src/hotspot/share/classfile/classLoader.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/classfile/classLoader.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -163,7 +163,7 @@
   static char version_string[10] = "";
   if (version_string[0] == '\0') {
     jio_snprintf(version_string, sizeof(version_string), "%d.%d",
-                 Abstract_VM_Version::vm_major_version(), Abstract_VM_Version::vm_minor_version());
+                 VM_Version::vm_major_version(), VM_Version::vm_minor_version());
   }
   return (const char*)version_string;
 }
--- a/src/hotspot/share/gc/cms/cmsArguments.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/gc/cms/cmsArguments.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -45,7 +46,7 @@
   assert(UseConcMarkSweepGC, "CMS is expected to be on here");
 
   if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
-    FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
+    FLAG_SET_DEFAULT(ParallelGCThreads, VM_Version::parallel_worker_threads());
     assert(ParallelGCThreads > 0, "We should always have at least one thread by default");
   } else if (ParallelGCThreads == 0) {
     jio_fprintf(defaultStream::error_stream(),
--- a/src/hotspot/share/gc/g1/g1Arguments.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/gc/g1/g1Arguments.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -75,7 +75,7 @@
 void G1Arguments::initialize() {
   GCArguments::initialize();
   assert(UseG1GC, "Error");
-  FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
+  FLAG_SET_DEFAULT(ParallelGCThreads, VM_Version::parallel_worker_threads());
   if (ParallelGCThreads == 0) {
     assert(!FLAG_IS_DEFAULT(ParallelGCThreads), "The default value for ParallelGCThreads should not be 0.");
     vm_exit_during_initialization("The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0", NULL);
--- a/src/hotspot/share/gc/parallel/parallelArguments.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/gc/parallel/parallelArguments.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -50,7 +51,7 @@
   // If no heap maximum was requested explicitly, use some reasonable fraction
   // of the physical memory, up to a maximum of 1GB.
   FLAG_SET_DEFAULT(ParallelGCThreads,
-                   Abstract_VM_Version::parallel_worker_threads());
+                   VM_Version::parallel_worker_threads());
   if (ParallelGCThreads == 0) {
     jio_fprintf(defaultStream::error_stream(),
         "The Parallel GC can not be combined with -XX:ParallelGCThreads=0\n");
--- a/src/hotspot/share/gc/z/zInitialize.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/gc/z/zInitialize.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -38,8 +38,8 @@
 ZInitialize::ZInitialize(ZBarrierSet* barrier_set) {
   log_info(gc, init)("Initializing %s", ZGCName);
   log_info(gc, init)("Version: %s (%s)",
-                     Abstract_VM_Version::vm_release(),
-                     Abstract_VM_Version::jdk_debug_level());
+                     VM_Version::vm_release(),
+                     VM_Version::jdk_debug_level());
 
   // Early initialization
   ZAddressMasks::initialize();
--- a/src/hotspot/share/prims/jvm.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/prims/jvm.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -3736,8 +3736,8 @@
 {
   memset(info, 0, info_size);
 
-  info->jvm_version = Abstract_VM_Version::jvm_version();
-  info->patch_version = Abstract_VM_Version::vm_patch_version();
+  info->jvm_version = VM_Version::jvm_version();
+  info->patch_version = VM_Version::vm_patch_version();
 
   // when we add a new capability in the jvm_version_info struct, we should also
   // consider to expose this new capability in the sun.rt.jvmCapabilities jvmstat
--- a/src/hotspot/share/runtime/thread.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/runtime/thread.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -4569,9 +4569,9 @@
   st->print_raw_cr(os::local_time_string(buf, sizeof(buf)));
 
   st->print_cr("Full thread dump %s (%s %s):",
-               Abstract_VM_Version::vm_name(),
-               Abstract_VM_Version::vm_release(),
-               Abstract_VM_Version::vm_info_string());
+               VM_Version::vm_name(),
+               VM_Version::vm_release(),
+               VM_Version::vm_info_string());
   st->cr();
 
 #if INCLUDE_SERVICES
--- a/src/hotspot/share/runtime/vm_version.hpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/runtime/vm_version.hpp	Tue Oct 16 11:08:46 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -69,7 +69,7 @@
   // occurred.  Examines a variety of the hardware capabilities of
   // the platform to determine which features can be used to execute the
   // program.
-  static void initialize();
+  static void initialize() { }
 
   // This allows for early initialization of VM_Version information
   // that may be needed later in the initialization sequence but before
--- a/src/hotspot/share/services/diagnosticCommand.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/services/diagnosticCommand.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -213,8 +213,8 @@
 }
 
 void VersionDCmd::execute(DCmdSource source, TRAPS) {
-  output()->print_cr("%s version %s", Abstract_VM_Version::vm_name(),
-          Abstract_VM_Version::vm_release());
+  output()->print_cr("%s version %s", VM_Version::vm_name(),
+          VM_Version::vm_release());
   JDK_Version jdk_version = JDK_Version::current();
   if (jdk_version.patch_version() > 0) {
     output()->print_cr("JDK %d.%d.%d.%d", jdk_version.major_version(),
--- a/src/hotspot/share/services/runtimeService.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/services/runtimeService.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -66,7 +66,7 @@
 
     // create performance counters for jvm_version and its capabilities
     PerfDataManager::create_constant(SUN_RT, "jvmVersion", PerfData::U_None,
-                                     (jlong) Abstract_VM_Version::jvm_version(), CHECK);
+                                     (jlong) VM_Version::jvm_version(), CHECK);
 
     // The capabilities counter is a binary representation of the VM capabilities in string.
     // This string respresentation simplifies the implementation of the client side
--- a/src/hotspot/share/utilities/vmError.cpp	Tue Oct 16 07:49:08 2018 -0700
+++ b/src/hotspot/share/utilities/vmError.cpp	Tue Oct 16 11:08:46 2018 -0400
@@ -319,18 +319,18 @@
                                 JDK_Version::runtime_name() : "";
    const char* runtime_version = JDK_Version::runtime_version() != NULL ?
                                    JDK_Version::runtime_version() : "";
-   const char* jdk_debug_level = Abstract_VM_Version::printable_jdk_debug_level() != NULL ?
-                                   Abstract_VM_Version::printable_jdk_debug_level() : "";
+   const char* jdk_debug_level = VM_Version::printable_jdk_debug_level() != NULL ?
+                                   VM_Version::printable_jdk_debug_level() : "";
 
    st->print_cr("# JRE version: %s (%s) (%sbuild %s)", runtime_name, buf,
                  jdk_debug_level, runtime_version);
 
    // This is the long version with some default settings added
    st->print_cr("# Java VM: %s (%s%s, %s%s%s%s%s, %s, %s)",
-                 Abstract_VM_Version::vm_name(),
+                 VM_Version::vm_name(),
                  jdk_debug_level,
-                 Abstract_VM_Version::vm_release(),
-                 Abstract_VM_Version::vm_info_string(),
+                 VM_Version::vm_release(),
+                 VM_Version::vm_info_string(),
                  TieredCompilation ? ", tiered" : "",
 #if INCLUDE_JVMCI
                  EnableJVMCI ? ", jvmci" : "",
@@ -340,7 +340,7 @@
 #endif
                  UseCompressedOops ? ", compressed oops" : "",
                  GCConfig::hs_err_name(),
-                 Abstract_VM_Version::vm_platform_string()
+                 VM_Version::vm_platform_string()
                );
 }
 
@@ -1007,7 +1007,7 @@
   STEP("printing internal vm info")
 
      if (_verbose) {
-       st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
+       st->print_cr("vm_info: %s", VM_Version::internal_vm_info_string());
        st->cr();
      }
 
@@ -1170,7 +1170,7 @@
 
   // STEP("printing internal vm info")
 
-  st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string());
+  st->print_cr("vm_info: %s", VM_Version::internal_vm_info_string());
   st->cr();
 
   // print a defined marker to show that error handling finished correctly.