8197845: Remove unnecessary method G1CollectedHeap::create_g1_policy
authorehelin
Mon, 05 Mar 2018 13:07:04 +0100
changeset 49338 41e7a68fbf45
parent 49337 e4fdca451542
child 49339 e651c3ea6ea8
8197845: Remove unnecessary method G1CollectedHeap::create_g1_policy Reviewed-by: tschatzl, sjohanss
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
src/hotspot/share/gc/g1/g1CollectedHeap.hpp
src/hotspot/share/gc/g1/g1CollectedHeap_ext.cpp
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Mon Mar 05 11:32:17 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Mon Mar 05 13:07:04 2018 +0100
@@ -37,6 +37,7 @@
 #include "gc/g1/g1CollectorState.hpp"
 #include "gc/g1/g1ConcurrentRefine.hpp"
 #include "gc/g1/g1ConcurrentRefineThread.hpp"
+#include "gc/g1/g1DefaultPolicy.hpp"
 #include "gc/g1/g1EvacStats.inline.hpp"
 #include "gc/g1/g1FullCollector.hpp"
 #include "gc/g1/g1GCPhaseTimes.hpp"
@@ -1459,7 +1460,7 @@
   _old_pool(NULL),
   _gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()),
   _gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()),
-  _g1_policy(create_g1_policy(_gc_timer_stw)),
+  _g1_policy(new G1DefaultPolicy(_gc_timer_stw)),
   _collection_set(this, _g1_policy),
   _dirty_card_queue_set(false),
   _is_alive_closure_cm(this),
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Mon Mar 05 11:32:17 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp	Mon Mar 05 13:07:04 2018 +0100
@@ -313,8 +313,6 @@
                                                          size_t size,
                                                          size_t translation_factor);
 
-  static G1Policy* create_g1_policy(STWGCTimer* gc_timer);
-
   void trace_heap(GCWhen::Type when, const GCTracer* tracer);
 
   // These are macros so that, if the assert fires, we get the correct
--- a/src/hotspot/share/gc/g1/g1CollectedHeap_ext.cpp	Mon Mar 05 11:32:17 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "gc/g1/g1CollectedHeap.hpp"
-#include "gc/g1/g1DefaultPolicy.hpp"
-#include "gc/g1/g1ParScanThreadState.hpp"
-#include "gc/g1/heapRegion.inline.hpp"
-
-class STWGCTimer;
-
-G1Policy* G1CollectedHeap::create_g1_policy(STWGCTimer* gc_timer) {
-  return new G1DefaultPolicy(gc_timer);
-}