8192061: Clean up allocation.inline.hpp includes
authorstefank
Tue, 28 Nov 2017 21:43:45 +0100
changeset 48157 7c4d43c26352
parent 48156 a8f9aac3c2e5
child 48158 66622fc2e247
8192061: Clean up allocation.inline.hpp includes Reviewed-by: eosterlund, coleenp
src/hotspot/os/aix/osThread_aix.cpp
src/hotspot/os/bsd/osThread_bsd.cpp
src/hotspot/os/linux/osThread_linux.cpp
src/hotspot/share/classfile/klassFactory.hpp
src/hotspot/share/classfile/sharedPathsMiscInfo.cpp
src/hotspot/share/classfile/sharedPathsMiscInfo.hpp
src/hotspot/share/classfile/stringTable.hpp
src/hotspot/share/classfile/symbolTable.hpp
src/hotspot/share/compiler/compileTask.hpp
src/hotspot/share/compiler/methodMatcher.hpp
src/hotspot/share/compiler/oopMap.hpp
src/hotspot/share/gc/cms/allocationStats.cpp
src/hotspot/share/gc/cms/allocationStats.hpp
src/hotspot/share/gc/cms/gSpaceCounters.cpp
src/hotspot/share/gc/cms/gSpaceCounters.hpp
src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp
src/hotspot/share/gc/g1/g1FullGCCompactionPoint.hpp
src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
src/hotspot/share/gc/g1/g1ParScanThreadState.hpp
src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp
src/hotspot/share/gc/parallel/psGenerationCounters.cpp
src/hotspot/share/gc/parallel/spaceCounters.cpp
src/hotspot/share/gc/parallel/spaceCounters.hpp
src/hotspot/share/gc/serial/cSpaceCounters.cpp
src/hotspot/share/gc/serial/cSpaceCounters.hpp
src/hotspot/share/gc/shared/adaptiveSizePolicy.cpp
src/hotspot/share/gc/shared/collectorCounters.cpp
src/hotspot/share/gc/shared/gcStats.cpp
src/hotspot/share/gc/shared/gcUtil.hpp
src/hotspot/share/gc/shared/gcUtil.inline.hpp
src/hotspot/share/gc/shared/generationCounters.cpp
src/hotspot/share/gc/shared/hSpaceCounters.cpp
src/hotspot/share/gc/shared/taskqueue.hpp
src/hotspot/share/memory/resourceArea.cpp
src/hotspot/share/memory/resourceArea.hpp
src/hotspot/share/memory/resourceArea.inline.hpp
src/hotspot/share/oops/array.hpp
src/hotspot/share/oops/constantPool.cpp
src/hotspot/share/oops/constantPool.hpp
src/hotspot/share/oops/generateOopMap.cpp
src/hotspot/share/oops/generateOopMap.hpp
src/hotspot/share/opto/reg_split.cpp
src/hotspot/share/precompiled/precompiled.hpp
src/hotspot/share/prims/jvmtiEnvThreadState.hpp
src/hotspot/share/prims/jvmtiEventController.hpp
src/hotspot/share/prims/jvmtiThreadState.hpp
src/hotspot/share/prims/methodHandles.cpp
src/hotspot/share/prims/methodHandles.hpp
src/hotspot/share/runtime/arguments.cpp
src/hotspot/share/runtime/arguments.hpp
src/hotspot/share/runtime/objectMonitor.cpp
src/hotspot/share/runtime/objectMonitor.hpp
src/hotspot/share/runtime/park.cpp
src/hotspot/share/services/diagnosticArgument.cpp
src/hotspot/share/services/diagnosticArgument.hpp
src/hotspot/share/utilities/decoder.cpp
src/hotspot/share/utilities/decoder_elf.cpp
src/hotspot/share/utilities/growableArray.cpp
src/hotspot/share/utilities/growableArray.hpp
src/hotspot/share/utilities/stack.hpp
test/hotspot/gtest/logging/test_logMessageTest.cpp
--- a/src/hotspot/os/aix/osThread_aix.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/os/aix/osThread_aix.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -25,6 +25,7 @@
 
 // no precompiled headers
 
+#include "memory/allocation.inline.hpp"
 #include "runtime/handles.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/os.hpp"
--- a/src/hotspot/os/bsd/osThread_bsd.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/os/bsd/osThread_bsd.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -23,6 +23,7 @@
  */
 
 // no precompiled headers
+#include "memory/allocation.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/osThread.hpp"
 
--- a/src/hotspot/os/linux/osThread_linux.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/os/linux/osThread_linux.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -23,6 +23,7 @@
  */
 
 // no precompiled headers
+#include "memory/allocation.inline.hpp"
 #include "runtime/mutex.hpp"
 #include "runtime/osThread.hpp"
 
--- a/src/hotspot/share/classfile/klassFactory.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/classfile/klassFactory.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_CLASSFILE_KLASSFACTORY_HPP
 #define SHARE_VM_CLASSFILE_KLASSFACTORY_HPP
 
-#include "memory/allocation.inline.hpp"
+#include "memory/allocation.hpp"
 #include "runtime/handles.hpp"
 
 class ClassFileStream;
--- a/src/hotspot/share/classfile/sharedPathsMiscInfo.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/classfile/sharedPathsMiscInfo.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -34,6 +34,18 @@
 #include "runtime/arguments.hpp"
 #include "utilities/ostream.hpp"
 
+SharedPathsMiscInfo::SharedPathsMiscInfo() {
+  _buf_size = INITIAL_BUF_SIZE;
+  _cur_ptr = _buf_start = NEW_C_HEAP_ARRAY(char, _buf_size, mtClass);
+  _allocated = true;
+}
+
+SharedPathsMiscInfo::~SharedPathsMiscInfo() {
+  if (_allocated) {
+    FREE_C_HEAP_ARRAY(char, _buf_start);
+  }
+}
+
 void SharedPathsMiscInfo::add_path(const char* path, int type) {
   log_info(class, path)("type=%s ", type_name(type));
   ClassLoader::trace_class_path("add misc shared path ", path);
--- a/src/hotspot/share/classfile/sharedPathsMiscInfo.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/classfile/sharedPathsMiscInfo.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -74,11 +74,7 @@
     INITIAL_BUF_SIZE = 128
   };
   // This constructor is used when creating the misc information (during dump)
-  SharedPathsMiscInfo() {
-    _buf_size = INITIAL_BUF_SIZE;
-    _cur_ptr = _buf_start = NEW_C_HEAP_ARRAY(char, _buf_size, mtClass);
-    _allocated = true;
-  }
+  SharedPathsMiscInfo();
   // This constructor is used when validating the misc info (during run time)
   SharedPathsMiscInfo(char *buff, int size) {
     _cur_ptr = _buf_start = buff;
@@ -86,11 +82,8 @@
     _buf_size = size;
     _allocated = false;
   }
-  ~SharedPathsMiscInfo() {
-    if (_allocated) {
-      FREE_C_HEAP_ARRAY(char, _buf_start);
-    }
-  }
+  ~SharedPathsMiscInfo();
+
   int get_used_bytes() {
     return _cur_ptr - _buf_start;
   }
--- a/src/hotspot/share/classfile/stringTable.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/classfile/stringTable.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_CLASSFILE_STRINGTABLE_HPP
 #define SHARE_VM_CLASSFILE_STRINGTABLE_HPP
 
-#include "memory/allocation.inline.hpp"
+#include "memory/allocation.hpp"
 #include "utilities/hashtable.hpp"
 
 template <class T, class N> class CompactHashtable;
--- a/src/hotspot/share/classfile/symbolTable.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/classfile/symbolTable.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP
 #define SHARE_VM_CLASSFILE_SYMBOLTABLE_HPP
 
-#include "memory/allocation.inline.hpp"
+#include "memory/allocation.hpp"
 #include "oops/symbol.hpp"
 #include "utilities/hashtable.hpp"
 
--- a/src/hotspot/share/compiler/compileTask.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/compiler/compileTask.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -25,10 +25,10 @@
 #ifndef SHARE_VM_COMPILER_COMPILETASK_HPP
 #define SHARE_VM_COMPILER_COMPILETASK_HPP
 
+#include "ci/ciMethod.hpp"
 #include "code/nmethod.hpp"
-#include "ci/ciMethod.hpp"
 #include "compiler/compileLog.hpp"
-#include "memory/allocation.inline.hpp"
+#include "memory/allocation.hpp"
 #include "utilities/xmlstream.hpp"
 
 // CompileTask
--- a/src/hotspot/share/compiler/methodMatcher.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/compiler/methodMatcher.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_COMPILER_METHODMATCHER_HPP
 #define SHARE_VM_COMPILER_METHODMATCHER_HPP
 
-#include "memory/allocation.inline.hpp"
+#include "memory/allocation.hpp"
 #include "runtime/handles.inline.hpp"
 #include "memory/resourceArea.hpp"
 
--- a/src/hotspot/share/compiler/oopMap.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/compiler/oopMap.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -28,6 +28,7 @@
 #include "code/compressedStream.hpp"
 #include "code/vmreg.hpp"
 #include "memory/allocation.hpp"
+#include "oops/oopsHierarchy.hpp"
 #include "utilities/growableArray.hpp"
 
 // Interface for generating the frame map for compiled code.  A frame map
@@ -42,6 +43,7 @@
 class frame;
 class RegisterMap;
 class DerivedPointerEntry;
+class OopClosure;
 
 class OopMapValue: public StackObj {
   friend class VMStructs;
--- a/src/hotspot/share/gc/cms/allocationStats.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/cms/allocationStats.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -30,3 +30,20 @@
 // Technically this should be derived from machine speed, and
 // ideally it would be dynamically adjusted.
 float AllocationStats::_threshold = ((float)CMS_SweepTimerThresholdMillis)/1000;
+
+void AllocationStats::initialize(bool split_birth)   {
+  AdaptivePaddedAverage* dummy =
+    new (&_demand_rate_estimate) AdaptivePaddedAverage(CMS_FLSWeight,
+                                                       CMS_FLSPadding);
+  _desired = 0;
+  _coal_desired = 0;
+  _surplus = 0;
+  _bfr_surp = 0;
+  _prev_sweep = 0;
+  _before_sweep = 0;
+  _coal_births = 0;
+  _coal_deaths = 0;
+  _split_births = (split_birth ? 1 : 0);
+  _split_deaths = 0;
+  _returned_bytes = 0;
+}
--- a/src/hotspot/share/gc/cms/allocationStats.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/cms/allocationStats.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -64,22 +64,7 @@
   ssize_t     _split_deaths;     // loss from splitting
   size_t      _returned_bytes;   // number of bytes returned to list.
  public:
-  void initialize(bool split_birth = false) {
-    AdaptivePaddedAverage* dummy =
-      new (&_demand_rate_estimate) AdaptivePaddedAverage(CMS_FLSWeight,
-                                                         CMS_FLSPadding);
-    _desired = 0;
-    _coal_desired = 0;
-    _surplus = 0;
-    _bfr_surp = 0;
-    _prev_sweep = 0;
-    _before_sweep = 0;
-    _coal_births = 0;
-    _coal_deaths = 0;
-    _split_births = (split_birth ? 1 : 0);
-    _split_deaths = 0;
-    _returned_bytes = 0;
-  }
+  void initialize(bool split_birth = false);
 
   AllocationStats() {
     initialize();
--- a/src/hotspot/share/gc/cms/gSpaceCounters.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/cms/gSpaceCounters.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "gc/cms/gSpaceCounters.hpp"
 #include "gc/shared/generation.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "utilities/macros.hpp"
 
@@ -71,3 +72,7 @@
                                      _gen->capacity(), CHECK);
   }
 }
+
+GSpaceCounters::~GSpaceCounters() {
+  if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
+}
--- a/src/hotspot/share/gc/cms/gSpaceCounters.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/cms/gSpaceCounters.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -52,9 +52,7 @@
   GSpaceCounters(const char* name, int ordinal, size_t max_size, Generation* g,
                  GenerationCounters* gc, bool sampled=true);
 
-  ~GSpaceCounters() {
-    if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
-  }
+  ~GSpaceCounters();
 
   inline void update_capacity() {
     _capacity->set_value(_gen->capacity());
--- a/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -26,6 +26,7 @@
 #include "gc/g1/g1ConcurrentRefine.hpp"
 #include "gc/g1/g1ConcurrentRefineThread.hpp"
 #include "logging/log.hpp"
+#include "memory/allocation.inline.hpp"
 #include "runtime/java.hpp"
 #include "runtime/thread.hpp"
 #include "utilities/debug.hpp"
--- a/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/g1/g1FullGCCompactionPoint.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -26,6 +26,7 @@
 #define SHARE_GC_G1_G1FULLGCCOMPACTIONPOINT_HPP
 
 #include "memory/allocation.hpp"
+#include "oops/oopsHierarchy.hpp"
 #include "utilities/growableArray.hpp"
 
 class HeapRegion;
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -32,6 +32,7 @@
 #include "gc/g1/g1StringDedup.hpp"
 #include "gc/shared/gcTrace.hpp"
 #include "gc/shared/taskqueue.inline.hpp"
+#include "memory/allocation.inline.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/prefetch.inline.hpp"
 
@@ -390,3 +391,21 @@
   }
 }
 
+G1ParScanThreadStateSet::G1ParScanThreadStateSet(G1CollectedHeap* g1h, uint n_workers, size_t young_cset_length) :
+    _g1h(g1h),
+    _states(NEW_C_HEAP_ARRAY(G1ParScanThreadState*, n_workers, mtGC)),
+    _surviving_young_words_total(NEW_C_HEAP_ARRAY(size_t, young_cset_length, mtGC)),
+    _young_cset_length(young_cset_length),
+    _n_workers(n_workers),
+    _flushed(false) {
+  for (uint i = 0; i < n_workers; ++i) {
+    _states[i] = NULL;
+  }
+  memset(_surviving_young_words_total, 0, young_cset_length * sizeof(size_t));
+}
+
+G1ParScanThreadStateSet::~G1ParScanThreadStateSet() {
+  assert(_flushed, "thread local state from the per thread states should have been flushed");
+  FREE_C_HEAP_ARRAY(G1ParScanThreadState*, _states);
+  FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_total);
+}
--- a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -204,24 +204,8 @@
   bool _flushed;
 
  public:
-  G1ParScanThreadStateSet(G1CollectedHeap* g1h, uint n_workers, size_t young_cset_length) :
-      _g1h(g1h),
-      _states(NEW_C_HEAP_ARRAY(G1ParScanThreadState*, n_workers, mtGC)),
-      _surviving_young_words_total(NEW_C_HEAP_ARRAY(size_t, young_cset_length, mtGC)),
-      _young_cset_length(young_cset_length),
-      _n_workers(n_workers),
-      _flushed(false) {
-    for (uint i = 0; i < n_workers; ++i) {
-      _states[i] = NULL;
-    }
-    memset(_surviving_young_words_total, 0, young_cset_length * sizeof(size_t));
-  }
-
-  ~G1ParScanThreadStateSet() {
-    assert(_flushed, "thread local state from the per thread states should have been flushed");
-    FREE_C_HEAP_ARRAY(G1ParScanThreadState*, _states);
-    FREE_C_HEAP_ARRAY(size_t, _surviving_young_words_total);
-  }
+  G1ParScanThreadStateSet(G1CollectedHeap* g1h, uint n_workers, size_t young_cset_length);
+  ~G1ParScanThreadStateSet();
 
   void flush();
 
--- a/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -29,6 +29,7 @@
 #include "gc/parallel/psScavenge.hpp"
 #include "gc/shared/collectorPolicy.hpp"
 #include "gc/shared/gcCause.hpp"
+#include "gc/shared/gcUtil.inline.hpp"
 #include "gc/shared/gcPolicyCounters.hpp"
 #include "logging/log.hpp"
 #include "runtime/timer.hpp"
--- a/src/hotspot/share/gc/parallel/psGenerationCounters.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/parallel/psGenerationCounters.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -25,9 +25,9 @@
 
 #include "precompiled.hpp"
 #include "gc/parallel/psGenerationCounters.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 
-
 PSGenerationCounters::PSGenerationCounters(const char* name,
                                        int ordinal, int spaces,
                                        size_t min_capacity,
--- a/src/hotspot/share/gc/parallel/spaceCounters.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/parallel/spaceCounters.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/parallel/spaceCounters.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "utilities/macros.hpp"
 
@@ -63,3 +64,7 @@
                                      _object_space->capacity_in_bytes(), CHECK);
   }
 }
+
+SpaceCounters::~SpaceCounters() {
+  if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
+}
--- a/src/hotspot/share/gc/parallel/spaceCounters.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/parallel/spaceCounters.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -53,9 +53,7 @@
   SpaceCounters(const char* name, int ordinal, size_t max_size,
                 MutableSpace* m, GenerationCounters* gc);
 
-  ~SpaceCounters() {
-    if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
-  }
+  ~SpaceCounters();
 
   inline void update_capacity() {
     _capacity->set_value(_object_space->capacity_in_bytes());
--- a/src/hotspot/share/gc/serial/cSpaceCounters.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/serial/cSpaceCounters.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/serial/cSpaceCounters.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/metaspace.hpp"
 #include "memory/resourceArea.hpp"
 
@@ -64,6 +65,10 @@
   }
 }
 
+CSpaceCounters::~CSpaceCounters() {
+    if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
+}
+
 void CSpaceCounters::update_capacity() {
   _capacity->set_value(_space->capacity());
 }
--- a/src/hotspot/share/gc/serial/cSpaceCounters.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/serial/cSpaceCounters.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -52,9 +52,7 @@
   CSpaceCounters(const char* name, int ordinal, size_t max_size,
                  ContiguousSpace* s, GenerationCounters* gc);
 
-  ~CSpaceCounters() {
-      if (_name_space != NULL) FREE_C_HEAP_ARRAY(char, _name_space);
-  }
+  ~CSpaceCounters();
 
   virtual void update_capacity();
   virtual void update_used();
--- a/src/hotspot/share/gc/shared/adaptiveSizePolicy.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/shared/adaptiveSizePolicy.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -26,6 +26,7 @@
 #include "gc/shared/adaptiveSizePolicy.hpp"
 #include "gc/shared/collectorPolicy.hpp"
 #include "gc/shared/gcCause.hpp"
+#include "gc/shared/gcUtil.inline.hpp"
 #include "gc/shared/workgroup.hpp"
 #include "logging/log.hpp"
 #include "runtime/timer.hpp"
--- a/src/hotspot/share/gc/shared/collectorCounters.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/shared/collectorCounters.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/shared/collectorCounters.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/os.hpp"
 
--- a/src/hotspot/share/gc/shared/gcStats.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/shared/gcStats.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -24,8 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/shared/gcStats.hpp"
-#include "gc/shared/gcUtil.hpp"
-#include "memory/allocation.inline.hpp"
+#include "gc/shared/gcUtil.inline.hpp"
 
 GCStats::GCStats() {
     _avg_promoted       = new AdaptivePaddedNoZeroDevAverage(
--- a/src/hotspot/share/gc/shared/gcUtil.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/shared/gcUtil.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -146,7 +146,7 @@
   // Placement support
   void* operator new(size_t ignored, void* p) throw() { return p; }
   // Allocator
-  void* operator new(size_t size) throw() { return CHeapObj<mtGC>::operator new(size); }
+  void* operator new(size_t size) throw();
 
   // Accessor
   float padded_average() const         { return _padded_avg; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/shared/gcUtil.inline.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2002, 2015, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_SHARED_GCUTIL_INLINE_HPP
+#define SHARE_VM_GC_SHARED_GCUTIL_INLINE_HPP
+
+#include "gc/shared/gcUtil.hpp"
+#include "memory/allocation.inline.hpp"
+
+inline void* AdaptivePaddedAverage::operator new(size_t size) throw() {
+  return CHeapObj<mtGC>::operator new(size);
+}
+
+#endif // SHARE_VM_GC_SHARED_GCUTIL_INLINE_HPP
--- a/src/hotspot/share/gc/shared/generationCounters.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/shared/generationCounters.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/shared/generationCounters.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 
 void GenerationCounters::initialize(const char* name, int ordinal, int spaces,
--- a/src/hotspot/share/gc/shared/hSpaceCounters.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/shared/hSpaceCounters.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "gc/shared/hSpaceCounters.hpp"
-#include "memory/allocation.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/perfData.hpp"
 
--- a/src/hotspot/share/gc/shared/taskqueue.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/gc/shared/taskqueue.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -26,6 +26,8 @@
 #define SHARE_VM_GC_SHARED_TASKQUEUE_HPP
 
 #include "memory/allocation.hpp"
+#include "oops/oopsHierarchy.hpp"
+#include "utilities/ostream.hpp"
 #include "utilities/stack.hpp"
 
 // Simple TaskQueue stats that are collected by default in debug builds.
--- a/src/hotspot/share/memory/resourceArea.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/memory/resourceArea.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/resourceArea.hpp"
+#include "memory/resourceArea.inline.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/thread.inline.hpp"
 #include "services/memTracker.hpp"
--- a/src/hotspot/share/memory/resourceArea.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/memory/resourceArea.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -57,18 +57,7 @@
     debug_only(_nesting = 0;);
   }
 
-  char* allocate_bytes(size_t size, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM) {
-#ifdef ASSERT
-    if (_nesting < 1 && !_warned++)
-      fatal("memory leak: allocating without ResourceMark");
-    if (UseMallocOnly) {
-      // use malloc, but save pointer in res. area for later freeing
-      char** save = (char**)internal_malloc_4(sizeof(char*));
-      return (*save = (char*)os::malloc(size, mtThread, CURRENT_PC));
-    }
-#endif
-    return (char*)Amalloc(size, alloc_failmode);
-  }
+  char* allocate_bytes(size_t size, AllocFailType alloc_failmode = AllocFailStrategy::EXIT_OOM);
 
   // Bias this resource area to specific memory type
   // (by default, ResourceArea is tagged as mtThread, per-thread general purpose storage)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/memory/resourceArea.inline.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 1997, 2017, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_MEMORY_RESOURCEAREA_INLINE_HPP
+#define SHARE_VM_MEMORY_RESOURCEAREA_INLINE_HPP
+
+#include "memory/resourceArea.hpp"
+
+inline char* ResourceArea::allocate_bytes(size_t size, AllocFailType alloc_failmode) {
+#ifdef ASSERT
+  if (_nesting < 1 && !_warned++)
+    fatal("memory leak: allocating without ResourceMark");
+  if (UseMallocOnly) {
+    // use malloc, but save pointer in res. area for later freeing
+    char** save = (char**)internal_malloc_4(sizeof(char*));
+    return (*save = (char*)os::malloc(size, mtThread, CURRENT_PC));
+  }
+#endif
+  return (char*)Amalloc(size, alloc_failmode);
+}
+
+#endif // SHARE_VM_MEMORY_RESOURCEAREA_INLINE_HPP
--- a/src/hotspot/share/oops/array.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/oops/array.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -26,7 +26,6 @@
 #define SHARE_VM_OOPS_ARRAY_HPP
 
 #include "memory/allocation.hpp"
-#include "memory/allocation.inline.hpp"
 #include "memory/metaspace.hpp"
 #include "runtime/orderAccess.hpp"
 #include "utilities/align.hpp"
--- a/src/hotspot/share/oops/constantPool.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/oops/constantPool.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -31,6 +31,7 @@
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "interpreter/linkResolver.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/heapInspection.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceClosure.hpp"
@@ -2300,3 +2301,11 @@
   }
   return NULL;
 }
+
+void SymbolHashMap::initialize_table(int table_size) {
+  _table_size = table_size;
+  _buckets = NEW_C_HEAP_ARRAY(SymbolHashMapBucket, table_size, mtSymbol);
+  for (int index = 0; index < table_size; index++) {
+    _buckets[index].clear();
+  }
+}
--- a/src/hotspot/share/oops/constantPool.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/oops/constantPool.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -982,13 +982,7 @@
   int                   _table_size;
   SymbolHashMapBucket*  _buckets;
 
-  void initialize_table(int table_size) {
-    _table_size = table_size;
-    _buckets = NEW_C_HEAP_ARRAY(SymbolHashMapBucket, table_size, mtSymbol);
-    for (int index = 0; index < table_size; index++) {
-      _buckets[index].clear();
-    }
-  }
+  void initialize_table(int table_size);
 
  public:
 
--- a/src/hotspot/share/oops/generateOopMap.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/oops/generateOopMap.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -27,6 +27,7 @@
 #include "interpreter/bytecodeStream.hpp"
 #include "logging/log.hpp"
 #include "logging/logStream.hpp"
+#include "memory/allocation.inline.hpp"
 #include "oops/generateOopMap.hpp"
 #include "oops/oop.inline.hpp"
 #include "oops/symbol.hpp"
@@ -217,6 +218,12 @@
 int RetTable::_init_nof_entries = 10;
 int RetTableEntry::_init_nof_jsrs = 5;
 
+RetTableEntry::RetTableEntry(int target, RetTableEntry *next) {
+  _target_bci = target;
+  _jsrs = new GrowableArray<intptr_t>(_init_nof_jsrs);
+  _next = next;
+}
+
 void RetTableEntry::add_delta(int bci, int delta) {
   if (_target_bci > bci) _target_bci += delta;
 
--- a/src/hotspot/share/oops/generateOopMap.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/oops/generateOopMap.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -26,7 +26,7 @@
 #define SHARE_VM_OOPS_GENERATEOOPMAP_HPP
 
 #include "interpreter/bytecodeStream.hpp"
-#include "memory/allocation.inline.hpp"
+#include "memory/allocation.hpp"
 #include "memory/universe.inline.hpp"
 #include "oops/method.hpp"
 #include "oops/oopsHierarchy.hpp"
@@ -57,7 +57,7 @@
   GrowableArray<intptr_t> * _jsrs;                     // List of return addresses  (bytecode index)
   RetTableEntry *_next;                           // Link to next entry
  public:
-   RetTableEntry(int target, RetTableEntry *next)  { _target_bci=target; _jsrs = new GrowableArray<intptr_t>(_init_nof_jsrs); _next = next;  }
+   RetTableEntry(int target, RetTableEntry *next);
 
   // Query
   int target_bci() const                      { return _target_bci; }
--- a/src/hotspot/share/opto/reg_split.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/opto/reg_split.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -25,7 +25,7 @@
 #include "precompiled.hpp"
 #include "libadt/vectset.hpp"
 #include "memory/allocation.inline.hpp"
-#include "memory/resourceArea.hpp"
+#include "memory/resourceArea.inline.hpp"
 #include "opto/addnode.hpp"
 #include "opto/c2compiler.hpp"
 #include "opto/callnode.hpp"
--- a/src/hotspot/share/precompiled/precompiled.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/precompiled/precompiled.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -131,7 +131,6 @@
 # include "jvmtifiles/jvmti.h"
 # include "logging/log.hpp"
 # include "memory/allocation.hpp"
-# include "memory/allocation.inline.hpp"
 # include "memory/arena.hpp"
 # include "memory/heap.hpp"
 # include "memory/iterator.hpp"
--- a/src/hotspot/share/prims/jvmtiEnvThreadState.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/prims/jvmtiEnvThreadState.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -27,7 +27,6 @@
 
 #include "jvmtifiles/jvmti.h"
 #include "memory/allocation.hpp"
-#include "memory/allocation.inline.hpp"
 #include "oops/instanceKlass.hpp"
 #include "prims/jvmtiEventController.hpp"
 #include "utilities/globalDefinitions.hpp"
--- a/src/hotspot/share/prims/jvmtiEventController.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/prims/jvmtiEventController.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -27,7 +27,6 @@
 
 #include "jvmtifiles/jvmti.h"
 #include "memory/allocation.hpp"
-#include "memory/allocation.inline.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 // forward declaration
--- a/src/hotspot/share/prims/jvmtiThreadState.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/prims/jvmtiThreadState.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -27,7 +27,6 @@
 
 #include "jvmtifiles/jvmti.h"
 #include "memory/allocation.hpp"
-#include "memory/allocation.inline.hpp"
 #include "prims/jvmtiEventController.hpp"
 #include "runtime/thread.hpp"
 #include "utilities/growableArray.hpp"
--- a/src/hotspot/share/prims/methodHandles.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/prims/methodHandles.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -1029,6 +1029,26 @@
   }
 }
 
+void MethodHandles::trace_method_handle_interpreter_entry(MacroAssembler* _masm, vmIntrinsics::ID iid) {
+  if (TraceMethodHandles) {
+    const char* name = vmIntrinsics::name_at(iid);
+    if (*name == '_')  name += 1;
+    const size_t len = strlen(name) + 50;
+    char* qname = NEW_C_HEAP_ARRAY(char, len, mtInternal);
+    const char* suffix = "";
+    if (is_signature_polymorphic(iid)) {
+      if (is_signature_polymorphic_static(iid))
+        suffix = "/static";
+      else
+        suffix = "/private";
+    }
+    jio_snprintf(qname, len, "MethodHandle::interpreter_entry::%s%s", name, suffix);
+    trace_method_handle(_masm, qname);
+    // Note:  Don't free the allocated char array because it's used
+    // during runtime.
+  }
+}
+
 //
 // Here are the native methods in java.lang.invoke.MethodHandleNatives
 // They are the private interface between this JVM and the HotSpot-specific
--- a/src/hotspot/share/prims/methodHandles.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/prims/methodHandles.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -195,25 +195,7 @@
 
   // Tracing
   static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
-  static void trace_method_handle_interpreter_entry(MacroAssembler* _masm, vmIntrinsics::ID iid) {
-    if (TraceMethodHandles) {
-      const char* name = vmIntrinsics::name_at(iid);
-      if (*name == '_')  name += 1;
-      const size_t len = strlen(name) + 50;
-      char* qname = NEW_C_HEAP_ARRAY(char, len, mtInternal);
-      const char* suffix = "";
-      if (is_signature_polymorphic(iid)) {
-        if (is_signature_polymorphic_static(iid))
-          suffix = "/static";
-        else
-          suffix = "/private";
-      }
-      jio_snprintf(qname, len, "MethodHandle::interpreter_entry::%s%s", name, suffix);
-      trace_method_handle(_masm, qname);
-      // Note:  Don't free the allocated char array because it's used
-      // during runtime.
-    }
-  }
+  static void trace_method_handle_interpreter_entry(MacroAssembler* _masm, vmIntrinsics::ID iid);
 };
 
 //------------------------------------------------------------------------------
--- a/src/hotspot/share/runtime/arguments.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/runtime/arguments.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -114,6 +114,108 @@
 
 char* Arguments::_ext_dirs = NULL;
 
+bool PathString::set_value(const char *value) {
+  if (_value != NULL) {
+    FreeHeap(_value);
+  }
+  _value = AllocateHeap(strlen(value)+1, mtArguments);
+  assert(_value != NULL, "Unable to allocate space for new path value");
+  if (_value != NULL) {
+    strcpy(_value, value);
+  } else {
+    // not able to allocate
+    return false;
+  }
+  return true;
+}
+
+void PathString::append_value(const char *value) {
+  char *sp;
+  size_t len = 0;
+  if (value != NULL) {
+    len = strlen(value);
+    if (_value != NULL) {
+      len += strlen(_value);
+    }
+    sp = AllocateHeap(len+2, mtArguments);
+    assert(sp != NULL, "Unable to allocate space for new append path value");
+    if (sp != NULL) {
+      if (_value != NULL) {
+        strcpy(sp, _value);
+        strcat(sp, os::path_separator());
+        strcat(sp, value);
+        FreeHeap(_value);
+      } else {
+        strcpy(sp, value);
+      }
+      _value = sp;
+    }
+  }
+}
+
+PathString::PathString(const char* value) {
+  if (value == NULL) {
+    _value = NULL;
+  } else {
+    _value = AllocateHeap(strlen(value)+1, mtArguments);
+    strcpy(_value, value);
+  }
+}
+
+PathString::~PathString() {
+  if (_value != NULL) {
+    FreeHeap(_value);
+    _value = NULL;
+  }
+}
+
+ModulePatchPath::ModulePatchPath(const char* module_name, const char* path) {
+  assert(module_name != NULL && path != NULL, "Invalid module name or path value");
+  size_t len = strlen(module_name) + 1;
+  _module_name = AllocateHeap(len, mtInternal);
+  strncpy(_module_name, module_name, len); // copy the trailing null
+  _path =  new PathString(path);
+}
+
+ModulePatchPath::~ModulePatchPath() {
+  if (_module_name != NULL) {
+    FreeHeap(_module_name);
+    _module_name = NULL;
+  }
+  if (_path != NULL) {
+    delete _path;
+    _path = NULL;
+  }
+}
+
+SystemProperty::SystemProperty(const char* key, const char* value, bool writeable, bool internal) : PathString(value) {
+  if (key == NULL) {
+    _key = NULL;
+  } else {
+    _key = AllocateHeap(strlen(key)+1, mtArguments);
+    strcpy(_key, key);
+  }
+  _next = NULL;
+  _internal = internal;
+  _writeable = writeable;
+}
+
+AgentLibrary::AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) {
+  _name = AllocateHeap(strlen(name)+1, mtArguments);
+  strcpy(_name, name);
+  if (options == NULL) {
+    _options = NULL;
+  } else {
+    _options = AllocateHeap(strlen(options)+1, mtArguments);
+    strcpy(_options, options);
+  }
+  _is_absolute_path = is_absolute_path;
+  _os_lib = os_lib;
+  _next = NULL;
+  _state = agent_invalid;
+  _is_static_lib = false;
+}
+
 // Check if head of 'option' matches 'name', and sets 'tail' to the remaining
 // part of the option string.
 static bool match_option(const JavaVMOption *option, const char* name,
@@ -180,6 +282,23 @@
 #define UPGRADE_PATH "upgrade.path"
 #define UPGRADE_PATH_LEN 12
 
+void Arguments::add_init_library(const char* name, char* options) {
+  _libraryList.add(new AgentLibrary(name, options, false, NULL));
+}
+
+void Arguments::add_init_agent(const char* name, char* options, bool absolute_path) {
+  _agentList.add(new AgentLibrary(name, options, absolute_path, NULL));
+}
+
+// Late-binding agents not started via arguments
+void Arguments::add_loaded_agent(AgentLibrary *agentLib) {
+  _agentList.add(agentLib);
+}
+
+void Arguments::add_loaded_agent(const char* name, char* options, bool absolute_path, void* os_lib) {
+  _agentList.add(new AgentLibrary(name, options, absolute_path, os_lib));
+}
+
 // Return TRUE if option matches 'property', or 'property=', or 'property.'.
 static bool matches_property_suffix(const char* option, const char* property, size_t len) {
   return ((strncmp(option, property, len) == 0) &&
--- a/src/hotspot/share/runtime/arguments.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/runtime/arguments.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -27,7 +27,7 @@
 
 #include "logging/logLevel.hpp"
 #include "logging/logTag.hpp"
-#include "memory/allocation.inline.hpp"
+#include "memory/allocation.hpp"
 #include "runtime/java.hpp"
 #include "runtime/os.hpp"
 #include "runtime/perfData.hpp"
@@ -60,60 +60,11 @@
  public:
   char* value() const { return _value; }
 
-  bool set_value(const char *value) {
-    if (_value != NULL) {
-      FreeHeap(_value);
-    }
-    _value = AllocateHeap(strlen(value)+1, mtArguments);
-    assert(_value != NULL, "Unable to allocate space for new path value");
-    if (_value != NULL) {
-      strcpy(_value, value);
-    } else {
-      // not able to allocate
-      return false;
-    }
-    return true;
-  }
+  bool set_value(const char *value);
+  void append_value(const char *value);
 
-  void append_value(const char *value) {
-    char *sp;
-    size_t len = 0;
-    if (value != NULL) {
-      len = strlen(value);
-      if (_value != NULL) {
-        len += strlen(_value);
-      }
-      sp = AllocateHeap(len+2, mtArguments);
-      assert(sp != NULL, "Unable to allocate space for new append path value");
-      if (sp != NULL) {
-        if (_value != NULL) {
-          strcpy(sp, _value);
-          strcat(sp, os::path_separator());
-          strcat(sp, value);
-          FreeHeap(_value);
-        } else {
-          strcpy(sp, value);
-        }
-        _value = sp;
-      }
-    }
-  }
-
-  PathString(const char* value) {
-    if (value == NULL) {
-      _value = NULL;
-    } else {
-      _value = AllocateHeap(strlen(value)+1, mtArguments);
-      strcpy(_value, value);
-    }
-  }
-
-  ~PathString() {
-    if (_value != NULL) {
-      FreeHeap(_value);
-      _value = NULL;
-    }
-  }
+  PathString(const char* value);
+  ~PathString();
 };
 
 // ModulePatchPath records the module/path pair as specified to --patch-module.
@@ -122,24 +73,8 @@
   char* _module_name;
   PathString* _path;
 public:
-  ModulePatchPath(const char* module_name, const char* path) {
-    assert(module_name != NULL && path != NULL, "Invalid module name or path value");
-    size_t len = strlen(module_name) + 1;
-    _module_name = AllocateHeap(len, mtInternal);
-    strncpy(_module_name, module_name, len); // copy the trailing null
-    _path =  new PathString(path);
-  }
-
-  ~ModulePatchPath() {
-    if (_module_name != NULL) {
-      FreeHeap(_module_name);
-      _module_name = NULL;
-    }
-    if (_path != NULL) {
-      delete _path;
-      _path = NULL;
-    }
-  }
+  ModulePatchPath(const char* module_name, const char* path);
+  ~ModulePatchPath();
 
   inline void set_path(const char* path) { _path->set_value(path); }
   inline const char* module_name() const { return _module_name; }
@@ -186,17 +121,7 @@
   }
 
   // Constructor
-  SystemProperty(const char* key, const char* value, bool writeable, bool internal = false) : PathString(value) {
-    if (key == NULL) {
-      _key = NULL;
-    } else {
-      _key = AllocateHeap(strlen(key)+1, mtArguments);
-      strcpy(_key, key);
-    }
-    _next = NULL;
-    _internal = internal;
-    _writeable = writeable;
-  }
+  SystemProperty(const char* key, const char* value, bool writeable, bool internal = false);
 };
 
 
@@ -235,21 +160,7 @@
   void set_invalid()                        { _state = agent_invalid; }
 
   // Constructor
-  AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) {
-    _name = AllocateHeap(strlen(name)+1, mtArguments);
-    strcpy(_name, name);
-    if (options == NULL) {
-      _options = NULL;
-    } else {
-      _options = AllocateHeap(strlen(options)+1, mtArguments);
-      strcpy(_options, options);
-    }
-    _is_absolute_path = is_absolute_path;
-    _os_lib = os_lib;
-    _next = NULL;
-    _state = agent_invalid;
-    _is_static_lib = false;
-  }
+  AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib);
 };
 
 // maintain an order of entry list of AgentLibrary
@@ -421,19 +332,15 @@
 
   // -Xrun arguments
   static AgentLibraryList _libraryList;
-  static void add_init_library(const char* name, char* options)
-    { _libraryList.add(new AgentLibrary(name, options, false, NULL)); }
+  static void add_init_library(const char* name, char* options);
 
   // -agentlib and -agentpath arguments
   static AgentLibraryList _agentList;
-  static void add_init_agent(const char* name, char* options, bool absolute_path)
-    { _agentList.add(new AgentLibrary(name, options, absolute_path, NULL)); }
+  static void add_init_agent(const char* name, char* options, bool absolute_path);
 
   // Late-binding agents not started via arguments
-  static void add_loaded_agent(AgentLibrary *agentLib)
-    { _agentList.add(agentLib); }
-  static void add_loaded_agent(const char* name, char* options, bool absolute_path, void* os_lib)
-    { _agentList.add(new AgentLibrary(name, options, absolute_path, os_lib)); }
+  static void add_loaded_agent(AgentLibrary *agentLib);
+  static void add_loaded_agent(const char* name, char* options, bool absolute_path, void* os_lib);
 
   // Operation modi
   static Mode _mode;
--- a/src/hotspot/share/runtime/objectMonitor.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/runtime/objectMonitor.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/markOop.hpp"
 #include "oops/oop.inline.hpp"
@@ -242,6 +243,19 @@
 // * See also http://blogs.sun.com/dave
 
 
+void* ObjectMonitor::operator new (size_t size) throw() {
+  return AllocateHeap(size, mtInternal);
+}
+void* ObjectMonitor::operator new[] (size_t size) throw() {
+  return operator new (size);
+}
+void ObjectMonitor::operator delete(void* p) {
+  FreeHeap(p);
+}
+void ObjectMonitor::operator delete[] (void *p) {
+  operator delete(p);
+}
+
 // -----------------------------------------------------------------------------
 // Enter support
 
--- a/src/hotspot/share/runtime/objectMonitor.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/runtime/objectMonitor.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -25,7 +25,7 @@
 #ifndef SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
 #define SHARE_VM_RUNTIME_OBJECTMONITOR_HPP
 
-#include "memory/allocation.inline.hpp"
+#include "memory/allocation.hpp"
 #include "memory/padded.hpp"
 #include "runtime/os.hpp"
 #include "runtime/park.hpp"
@@ -213,18 +213,10 @@
   static int Knob_VerifyMatch;
   static int Knob_SpinLimit;
 
-  void* operator new (size_t size) throw() {
-    return AllocateHeap(size, mtInternal);
-  }
-  void* operator new[] (size_t size) throw() {
-    return operator new (size);
-  }
-  void operator delete(void* p) {
-    FreeHeap(p);
-  }
-  void operator delete[] (void *p) {
-    operator delete(p);
-  }
+  void* operator new (size_t size) throw();
+  void* operator new[] (size_t size) throw();
+  void operator delete(void* p);
+  void operator delete[] (void *p);
 
   // TODO-FIXME: the "offset" routines should return a type of off_t instead of int ...
   // ByteSize would also be an appropriate type.
--- a/src/hotspot/share/runtime/park.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/runtime/park.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -23,10 +23,9 @@
  */
 
 #include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
 #include "runtime/thread.hpp"
 
-
-
 // Lifecycle management for TSM ParkEvents.
 // ParkEvents are type-stable (TSM).
 // In our particular implementation they happen to be immortal.
--- a/src/hotspot/share/services/diagnosticArgument.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/services/diagnosticArgument.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -29,6 +29,29 @@
 #include "runtime/thread.hpp"
 #include "services/diagnosticArgument.hpp"
 
+StringArrayArgument::StringArrayArgument() {
+  _array = new(ResourceObj::C_HEAP, mtInternal)GrowableArray<char *>(32, true);
+  assert(_array != NULL, "Sanity check");
+}
+
+StringArrayArgument::~StringArrayArgument() {
+  for (int i=0; i<_array->length(); i++) {
+    if(_array->at(i) != NULL) { // Safety check
+      FREE_C_HEAP_ARRAY(char, _array->at(i));
+    }
+  }
+  delete _array;
+}
+
+void StringArrayArgument::add(const char* str, size_t len) {
+  if (str != NULL) {
+    char* ptr = NEW_C_HEAP_ARRAY(char, len+1, mtInternal);
+    strncpy(ptr, str, len);
+    ptr[len] = 0;
+    _array->append(ptr);
+  }
+}
+
 void GenDCmdArgument::read_value(const char* str, size_t len, TRAPS) {
   /* NOTE:Some argument types doesn't require a value,
    * for instance boolean arguments: "enableFeatureX". is
--- a/src/hotspot/share/services/diagnosticArgument.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/services/diagnosticArgument.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -35,29 +35,14 @@
 private:
   GrowableArray<char*>* _array;
 public:
-  StringArrayArgument() {
-    _array = new(ResourceObj::C_HEAP, mtInternal)GrowableArray<char *>(32, true);
-    assert(_array != NULL, "Sanity check");
-  }
-  void add(const char* str, size_t len) {
-    if (str != NULL) {
-      char* ptr = NEW_C_HEAP_ARRAY(char, len+1, mtInternal);
-      strncpy(ptr, str, len);
-      ptr[len] = 0;
-      _array->append(ptr);
-    }
-  }
+  StringArrayArgument();
+  ~StringArrayArgument();
+
+  void add(const char* str, size_t len);
+
   GrowableArray<char*>* array() {
     return _array;
   }
-  ~StringArrayArgument() {
-    for (int i=0; i<_array->length(); i++) {
-      if(_array->at(i) != NULL) { // Safety check
-        FREE_C_HEAP_ARRAY(char, _array->at(i));
-      }
-    }
-    delete _array;
-  }
 };
 
 class NanoTimeArgument {
--- a/src/hotspot/share/utilities/decoder.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/utilities/decoder.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "jvm.h"
+#include "memory/allocation.inline.hpp"
 #include "runtime/os.hpp"
 #include "utilities/decoder.hpp"
 #include "utilities/vmError.hpp"
--- a/src/hotspot/share/utilities/decoder_elf.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/utilities/decoder_elf.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -26,6 +26,7 @@
 
 #if !defined(_WINDOWS) && !defined(__APPLE__)
 #include "decoder_elf.hpp"
+#include "memory/allocation.inline.hpp"
 
 ElfDecoder::~ElfDecoder() {
   if (_opened_elf_files != NULL) {
--- a/src/hotspot/share/utilities/growableArray.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/utilities/growableArray.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "memory/allocation.inline.hpp"
 #include "memory/resourceArea.hpp"
 #include "runtime/thread.inline.hpp"
 #include "utilities/growableArray.hpp"
@@ -56,3 +57,7 @@
     return _arena->Amalloc(byte_size);
   }
 }
+
+void GenericGrowableArray::free_C_heap(void* elements) {
+  FreeHeap(elements);
+}
--- a/src/hotspot/share/utilities/growableArray.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/utilities/growableArray.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -26,9 +26,9 @@
 #define SHARE_VM_UTILITIES_GROWABLEARRAY_HPP
 
 #include "memory/allocation.hpp"
-#include "memory/allocation.inline.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/ostream.hpp"
 
 // A growable array.
 
@@ -144,6 +144,8 @@
     assert(on_stack(), "fast ResourceObj path only");
     return (void*)resource_allocate_bytes(thread, elementSize * _max);
   }
+
+  void free_C_heap(void* elements);
 };
 
 template<class E> class GrowableArrayIterator;
@@ -451,7 +453,7 @@
     for (     ; i < _max; i++) ::new ((void*)&newData[i]) E();
     for (i = 0; i < old_max; i++) _data[i].~E();
     if (on_C_heap() && _data != NULL) {
-      FreeHeap(_data);
+      free_C_heap(_data);
     }
     _data = newData;
 }
@@ -475,7 +477,7 @@
     clear();
     if (_data != NULL) {
       for (int i = 0; i < _max; i++) _data[i].~E();
-      FreeHeap(_data);
+      free_C_heap(_data);
       _data = NULL;
     }
 }
--- a/src/hotspot/share/utilities/stack.hpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/src/hotspot/share/utilities/stack.hpp	Tue Nov 28 21:43:45 2017 +0100
@@ -26,7 +26,6 @@
 #define SHARE_VM_UTILITIES_STACK_HPP
 
 #include "memory/allocation.hpp"
-#include "memory/allocation.inline.hpp"
 
 // Class Stack (below) grows and shrinks by linking together "segments" which
 // are allocated on demand.  Segments are arrays of the element type (E) plus an
--- a/test/hotspot/gtest/logging/test_logMessageTest.cpp	Wed Nov 29 18:43:35 2017 -0800
+++ b/test/hotspot/gtest/logging/test_logMessageTest.cpp	Tue Nov 28 21:43:45 2017 +0100
@@ -27,6 +27,7 @@
 #include "logTestUtils.inline.hpp"
 #include "logging/log.hpp"
 #include "logging/logMessage.hpp"
+#include "memory/allocation.inline.hpp"
 #include "unittest.hpp"
 #include "utilities/globalDefinitions.hpp"