Mercurial > hg > graal-compiler
comparison 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 |
comparison
equal
deleted
inserted
replaced
20730:8210e5f2e21b | 20731:42c091d63c72 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
63 | 63 |
64 // If there is a lock associated with this buffer, this is that lock. | 64 // If there is a lock associated with this buffer, this is that lock. |
65 Mutex* _lock; | 65 Mutex* _lock; |
66 | 66 |
67 PtrQueueSet* qset() { return _qset; } | 67 PtrQueueSet* qset() { return _qset; } |
68 bool is_permanent() const { return _perm; } | |
69 | |
70 // Process queue entries and release resources, if not permanent. | |
71 void flush_impl(); | |
68 | 72 |
69 public: | 73 public: |
70 // Initialize this queue to contain a null buffer, and be part of the | 74 // Initialize this queue to contain a null buffer, and be part of the |
71 // given PtrQueueSet. | 75 // given PtrQueueSet. |
72 PtrQueue(PtrQueueSet* qset, bool perm = false, bool active = false); | 76 PtrQueue(PtrQueueSet* qset, bool perm = false, bool active = false); |
73 // Release any contained resources. | 77 |
74 virtual void flush(); | 78 // Requires queue flushed or permanent. |
75 // Calls flush() when destroyed. | 79 ~PtrQueue(); |
76 ~PtrQueue() { flush(); } | |
77 | 80 |
78 // Associate a lock with a ptr queue. | 81 // Associate a lock with a ptr queue. |
79 void set_lock(Mutex* lock) { _lock = lock; } | 82 void set_lock(Mutex* lock) { _lock = lock; } |
80 | 83 |
81 void reset() { if (_buf != NULL) _index = _sz; } | 84 void reset() { if (_buf != NULL) _index = _sz; } |