55 // not otherwise protect the queue content.
56 //
57 class G1StringDedupQueue : public CHeapObj<mtGC> {
58 private:
59 typedef Stack<oop, mtGC> G1StringDedupWorkerQueue;
60
61 static G1StringDedupQueue* _queue;
62 static const size_t _max_size;
63 static const size_t _max_cache_size;
64
65 G1StringDedupWorkerQueue* _queues;
66 size_t _nqueues;
67 size_t _cursor;
68 bool _cancel;
69 volatile bool _empty;
70
71 // Statistics counter, only used for logging.
72 uintx _dropped;
73
74 G1StringDedupQueue();
75 ~G1StringDedupQueue();
76
77 static void unlink_or_oops_do(G1StringDedupUnlinkOrOopsDoClosure* cl, size_t queue);
78
79 public:
80 static void create();
81
82 // Blocks and waits for the queue to become non-empty.
83 static void wait();
84
85 // Wakes up any thread blocked waiting for the queue to become non-empty.
86 static void cancel_wait();
87
88 // Pushes a deduplication candidate onto a specific GC worker queue.
89 static void push(uint worker_id, oop java_string);
90
91 // Pops a deduplication candidate from any queue, returns NULL if
92 // all queues are empty.
93 static oop pop();
94
|
55 // not otherwise protect the queue content.
56 //
57 class G1StringDedupQueue : public CHeapObj<mtGC> {
58 private:
59 typedef Stack<oop, mtGC> G1StringDedupWorkerQueue;
60
61 static G1StringDedupQueue* _queue;
62 static const size_t _max_size;
63 static const size_t _max_cache_size;
64
65 G1StringDedupWorkerQueue* _queues;
66 size_t _nqueues;
67 size_t _cursor;
68 bool _cancel;
69 volatile bool _empty;
70
71 // Statistics counter, only used for logging.
72 uintx _dropped;
73
74 G1StringDedupQueue();
75 // Never called.
76 ~G1StringDedupQueue();
77
78 static void unlink_or_oops_do(G1StringDedupUnlinkOrOopsDoClosure* cl, size_t queue);
79
80 public:
81 static void create();
82
83 // Blocks and waits for the queue to become non-empty.
84 static void wait();
85
86 // Wakes up any thread blocked waiting for the queue to become non-empty.
87 static void cancel_wait();
88
89 // Pushes a deduplication candidate onto a specific GC worker queue.
90 static void push(uint worker_id, oop java_string);
91
92 // Pops a deduplication candidate from any queue, returns NULL if
93 // all queues are empty.
94 static oop pop();
95
|