changeset 26680:1f181bd352ce

8056183: os::is_MP() always reports true when NMT is enabled Reviewed-by: shade, coleenp, bdelsart
author dholmes
date Wed, 10 Sep 2014 00:44:16 -0400
parents 8a96177975bc
children d35d35fbbe43
files hotspot/src/share/vm/runtime/os.hpp
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/runtime/os.hpp	Tue Sep 09 18:56:24 2014 +0000
+++ b/hotspot/src/share/vm/runtime/os.hpp	Wed Sep 10 00:44:16 2014 -0400
@@ -214,13 +214,14 @@
 
   // Interface for detecting multiprocessor system
   static inline bool is_MP() {
-#if !INCLUDE_NMT
-    assert(_processor_count > 0, "invalid processor count");
-    return _processor_count > 1 || AssumeMP;
-#else
-    // NMT needs atomic operations before this initialization.
-    return true;
-#endif
+    // During bootstrap if _processor_count is not yet initialized
+    // we claim to be MP as that is safest. If any platform has a
+    // stub generator that might be triggered in this phase and for
+    // which being declared MP when in fact not, is a problem - then
+    // the bootstrap routine for the stub generator needs to check
+    // the processor count directly and leave the bootstrap routine
+    // in place until called after initialization has ocurred.
+    return (_processor_count != 1) || AssumeMP;
   }
   static julong available_memory();
   static julong physical_memory();