author | manc |
Mon, 14 Oct 2019 18:48:10 -0700 | |
changeset 58652 | 9b67dd88a931 |
parent 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
23472 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50574
diff
changeset
|
2 |
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. |
23472 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50574
diff
changeset
|
25 |
#ifndef SHARE_GC_G1_G1STRINGDEDUPQUEUE_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50574
diff
changeset
|
26 |
#define SHARE_GC_G1_G1STRINGDEDUPQUEUE_HPP |
23472 | 27 |
|
50574 | 28 |
#include "gc/shared/stringdedup/stringDedupQueue.hpp" |
23472 | 29 |
#include "memory/allocation.hpp" |
30 |
#include "oops/oop.hpp" |
|
31 |
#include "utilities/stack.hpp" |
|
32 |
||
50574 | 33 |
class StringDedupUnlinkOrOopsDoClosure; |
23472 | 34 |
|
35 |
// |
|
50574 | 36 |
// G1 enqueues candidates during the stop-the-world mark/evacuation phase. |
23472 | 37 |
// |
50574 | 38 |
|
39 |
class G1StringDedupQueue : public StringDedupQueue { |
|
23472 | 40 |
private: |
41 |
typedef Stack<oop, mtGC> G1StringDedupWorkerQueue; |
|
42 |
||
43 |
static const size_t _max_size; |
|
44 |
static const size_t _max_cache_size; |
|
45 |
||
46 |
G1StringDedupWorkerQueue* _queues; |
|
47 |
size_t _nqueues; |
|
48 |
size_t _cursor; |
|
24093
095cc0a63ed9
8037112: gc/g1/TestHumongousAllocInitialMark.java caused SIGSEGV
pliden
parents:
23472
diff
changeset
|
49 |
bool _cancel; |
23472 | 50 |
volatile bool _empty; |
51 |
||
52 |
// Statistics counter, only used for logging. |
|
53 |
uintx _dropped; |
|
54 |
||
55 |
~G1StringDedupQueue(); |
|
56 |
||
50574 | 57 |
void unlink_or_oops_do(StringDedupUnlinkOrOopsDoClosure* cl, size_t queue); |
23472 | 58 |
|
59 |
public: |
|
50574 | 60 |
G1StringDedupQueue(); |
61 |
||
62 |
protected: |
|
23472 | 63 |
|
64 |
// Blocks and waits for the queue to become non-empty. |
|
50574 | 65 |
void wait_impl(); |
23472 | 66 |
|
24093
095cc0a63ed9
8037112: gc/g1/TestHumongousAllocInitialMark.java caused SIGSEGV
pliden
parents:
23472
diff
changeset
|
67 |
// Wakes up any thread blocked waiting for the queue to become non-empty. |
50574 | 68 |
void cancel_wait_impl(); |
24093
095cc0a63ed9
8037112: gc/g1/TestHumongousAllocInitialMark.java caused SIGSEGV
pliden
parents:
23472
diff
changeset
|
69 |
|
23472 | 70 |
// Pushes a deduplication candidate onto a specific GC worker queue. |
50574 | 71 |
void push_impl(uint worker_id, oop java_string); |
23472 | 72 |
|
73 |
// Pops a deduplication candidate from any queue, returns NULL if |
|
74 |
// all queues are empty. |
|
50574 | 75 |
oop pop_impl(); |
23472 | 76 |
|
50574 | 77 |
size_t num_queues() const { |
78 |
return _nqueues; |
|
79 |
} |
|
23472 | 80 |
|
50574 | 81 |
void unlink_or_oops_do_impl(StringDedupUnlinkOrOopsDoClosure* cl, size_t queue); |
82 |
||
83 |
void print_statistics_impl(); |
|
84 |
void verify_impl(); |
|
23472 | 85 |
}; |
86 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50574
diff
changeset
|
87 |
#endif // SHARE_GC_G1_G1STRINGDEDUPQUEUE_HPP |