8153743: AllocateHeap() and ReallocateHeap() should use ALWAYSINLINE macro
authorysuenaga
Tue, 21 Jun 2016 19:29:39 -0400
changeset 39405 314741ca98d5
parent 39404 d0ad5220e91c
child 39406 e0a7495281a7
child 39407 2e75eb109278
8153743: AllocateHeap() and ReallocateHeap() should use ALWAYSINLINE macro Reviewed-by: dholmes, zgu
hotspot/src/share/vm/memory/allocation.inline.hpp
hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp
--- a/hotspot/src/share/vm/memory/allocation.inline.hpp	Tue Jun 21 19:25:41 2016 -0400
+++ b/hotspot/src/share/vm/memory/allocation.inline.hpp	Tue Jun 21 19:29:39 2016 -0400
@@ -28,6 +28,7 @@
 #include "runtime/atomic.inline.hpp"
 #include "runtime/os.hpp"
 #include "services/memTracker.hpp"
+#include "utilities/globalDefinitions.hpp"
 
 // Explicit C-heap memory management
 
@@ -63,18 +64,12 @@
   return p;
 }
 
-#ifdef __GNUC__
-__attribute__((always_inline))
-#endif
-inline char* AllocateHeap(size_t size, MEMFLAGS flags,
+ALWAYSINLINE char* AllocateHeap(size_t size, MEMFLAGS flags,
     AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
   return AllocateHeap(size, flags, CURRENT_PC, alloc_failmode);
 }
 
-#ifdef __GNUC__
-__attribute__((always_inline))
-#endif
-inline char* ReallocateHeap(char *old, size_t size, MEMFLAGS flag,
+ALWAYSINLINE char* ReallocateHeap(char *old, size_t size, MEMFLAGS flag,
     AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
   char* p = (char*) os::realloc(old, size, flag, CURRENT_PC);
   #ifdef ASSERT
--- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	Tue Jun 21 19:25:41 2016 -0400
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	Tue Jun 21 19:29:39 2016 -0400
@@ -324,6 +324,6 @@
 
 // Inlining support
 #define NOINLINE     __attribute__ ((noinline))
-#define ALWAYSINLINE __attribute__ ((always_inline))
+#define ALWAYSINLINE inline __attribute__ ((always_inline))
 
 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
--- a/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp	Tue Jun 21 19:25:41 2016 -0400
+++ b/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp	Tue Jun 21 19:29:39 2016 -0400
@@ -279,6 +279,6 @@
 
 // Inlining support
 #define NOINLINE
-#define ALWAYSINLINE __attribute__((always_inline))
+#define ALWAYSINLINE inline __attribute__((always_inline))
 
 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_SPARCWORKS_HPP