changeset 35927:58bbbbb4a8c7

8148944: CollectorPolicy methods for memory allocations are specific to GenCollectorPolicy Reviewed-by: jwilhelm, kbarrett
author mgerdin
date Wed, 03 Feb 2016 11:33:33 +0100
parents ff7661fb8171
children 084d5cb04276
files hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp hotspot/src/share/vm/gc/shared/collectorPolicy.hpp hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp
diffstat 4 files changed, 14 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Thu Feb 04 08:36:38 2016 +0100
+++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp	Wed Feb 03 11:33:33 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, 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
@@ -736,22 +736,6 @@
   }
 }
 
-HeapWord* G1CollectorPolicy::mem_allocate_work(size_t size,
-                                               bool is_tlab,
-                                               bool* gc_overhead_limit_was_exceeded) {
-  guarantee(false, "Not using this policy feature yet.");
-  return NULL;
-}
-
-// This method controls how a collector handles one or more
-// of its generations being fully allocated.
-HeapWord* G1CollectorPolicy::satisfy_failed_allocation(size_t size,
-                                                       bool is_tlab) {
-  guarantee(false, "Not using this policy feature yet.");
-  return NULL;
-}
-
-
 #ifndef PRODUCT
 bool G1CollectorPolicy::verify_young_ages() {
   HeapRegion* head = _g1->young_list()->first_region();
--- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp	Thu Feb 04 08:36:38 2016 +0100
+++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp	Wed Feb 03 11:33:33 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, 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
@@ -621,15 +621,6 @@
   // Create jstat counters for the policy.
   virtual void initialize_gc_policy_counters();
 
-  virtual HeapWord* mem_allocate_work(size_t size,
-                                      bool is_tlab,
-                                      bool* gc_overhead_limit_was_exceeded);
-
-  // This method controls how a collector handles one or more
-  // of its generations being fully allocated.
-  virtual HeapWord* satisfy_failed_allocation(size_t size,
-                                              bool is_tlab);
-
   bool need_to_start_conc_mark(const char* source, size_t alloc_word_size = 0);
 
   bool about_to_start_mixed_phase() const;
--- a/hotspot/src/share/vm/gc/shared/collectorPolicy.hpp	Thu Feb 04 08:36:38 2016 +0100
+++ b/hotspot/src/share/vm/gc/shared/collectorPolicy.hpp	Wed Feb 03 11:33:33 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, 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
@@ -145,24 +145,9 @@
 
   virtual CardTableRS* create_rem_set(MemRegion reserved);
 
-  // This method controls how a collector satisfies a request
-  // for a block of memory.  "gc_time_limit_was_exceeded" will
-  // be set to true if the adaptive size policy determine that
-  // an excessive amount of time is being spent doing collections
-  // and caused a NULL to be returned.  If a NULL is not returned,
-  // "gc_time_limit_was_exceeded" has an undefined meaning.
-  virtual HeapWord* mem_allocate_work(size_t size,
-                                      bool is_tlab,
-                                      bool* gc_overhead_limit_was_exceeded) = 0;
-
-  // This method controls how a collector handles one or more
-  // of its generations being fully allocated.
-  virtual HeapWord *satisfy_failed_allocation(size_t size, bool is_tlab) = 0;
-  // This method controls how a collector handles a metadata allocation
-  // failure.
-  virtual MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,
-                                                       size_t size,
-                                                       Metaspace::MetadataType mdtype);
+  MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,
+                                               size_t size,
+                                               Metaspace::MetadataType mdtype);
 
   // Performance Counter support
   GCPolicyCounters* counters()     { return _gc_policy_counters; }
--- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp	Thu Feb 04 08:36:38 2016 +0100
+++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp	Wed Feb 03 11:33:33 2016 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, 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
@@ -289,9 +289,9 @@
 
 HeapWord* GenCollectedHeap::mem_allocate(size_t size,
                                          bool* gc_overhead_limit_was_exceeded) {
-  return collector_policy()->mem_allocate_work(size,
-                                               false /* is_tlab */,
-                                               gc_overhead_limit_was_exceeded);
+  return gen_policy()->mem_allocate_work(size,
+                                         false /* is_tlab */,
+                                         gc_overhead_limit_was_exceeded);
 }
 
 bool GenCollectedHeap::must_clear_all_soft_refs() {
@@ -551,7 +551,7 @@
 }
 
 HeapWord* GenCollectedHeap::satisfy_failed_allocation(size_t size, bool is_tlab) {
-  return collector_policy()->satisfy_failed_allocation(size, is_tlab);
+  return gen_policy()->satisfy_failed_allocation(size, is_tlab);
 }
 
 #ifdef ASSERT
@@ -988,9 +988,9 @@
 
 HeapWord* GenCollectedHeap::allocate_new_tlab(size_t size) {
   bool gc_overhead_limit_was_exceeded;
-  return collector_policy()->mem_allocate_work(size /* size */,
-                                               true /* is_tlab */,
-                                               &gc_overhead_limit_was_exceeded);
+  return gen_policy()->mem_allocate_work(size /* size */,
+                                         true /* is_tlab */,
+                                         &gc_overhead_limit_was_exceeded);
 }
 
 // Requires "*prev_ptr" to be non-NULL.  Deletes and a block of minimal size