diff src/share/vm/gc_implementation/g1/ptrQueue.hpp @ 20731:42c091d63c72

8048949: Requeue queue implementation Summary: devirtualize flush and move calls Reviewed-by: brutisso, tschatzl, mschoene Contributed-by: kim.barrett@oracle.com
author tschatzl
date Mon, 04 Aug 2014 10:49:40 -0400
parents 55fb97c4c58d
children 7848fc12602b
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/ptrQueue.hpp	Tue Aug 12 17:46:16 2014 -0400
+++ b/src/share/vm/gc_implementation/g1/ptrQueue.hpp	Mon Aug 04 10:49:40 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, 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
@@ -65,15 +65,18 @@
   Mutex* _lock;
 
   PtrQueueSet* qset() { return _qset; }
+  bool is_permanent() const { return _perm; }
+
+  // Process queue entries and release resources, if not permanent.
+  void flush_impl();
 
 public:
   // Initialize this queue to contain a null buffer, and be part of the
   // given PtrQueueSet.
   PtrQueue(PtrQueueSet* qset, bool perm = false, bool active = false);
-  // Release any contained resources.
-  virtual void flush();
-  // Calls flush() when destroyed.
-  ~PtrQueue() { flush(); }
+
+  // Requires queue flushed or permanent.
+  ~PtrQueue();
 
   // Associate a lock with a ptr queue.
   void set_lock(Mutex* lock) { _lock = lock; }