equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2019, 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. |
27 |
27 |
28 JfrStringPoolBuffer::JfrStringPoolBuffer() : JfrBuffer(), _string_count_pos(0), _string_count_top(0) {} |
28 JfrStringPoolBuffer::JfrStringPoolBuffer() : JfrBuffer(), _string_count_pos(0), _string_count_top(0) {} |
29 |
29 |
30 void JfrStringPoolBuffer::reinitialize() { |
30 void JfrStringPoolBuffer::reinitialize() { |
31 assert(acquired_by_self() || retired(), "invariant"); |
31 assert(acquired_by_self() || retired(), "invariant"); |
32 concurrent_top(); |
|
33 set_pos((start())); |
|
34 set_string_pos(0); |
32 set_string_pos(0); |
35 set_string_top(0); |
33 set_string_top(0); |
36 set_concurrent_top(start()); |
34 JfrBuffer::reinitialize(); |
37 } |
35 } |
38 |
36 |
39 uint64_t JfrStringPoolBuffer::string_pos() const { |
37 uint64_t JfrStringPoolBuffer::string_pos() const { |
40 assert(acquired_by_self() || retired(), "invariant"); |
38 assert(acquired_by_self() || retired(), "invariant"); |
41 return _string_count_pos; |
39 return _string_count_pos; |
55 assert(acquired_by_self() || retired(), "invariant"); |
53 assert(acquired_by_self() || retired(), "invariant"); |
56 _string_count_pos = value; |
54 _string_count_pos = value; |
57 } |
55 } |
58 |
56 |
59 void JfrStringPoolBuffer::increment(uint64_t value) { |
57 void JfrStringPoolBuffer::increment(uint64_t value) { |
60 assert(acquired_by_self() || retired(), "invariant"); |
58 assert(acquired_by_self(), "invariant"); |
61 ++_string_count_pos; |
59 ++_string_count_pos; |
62 } |
60 } |
63 |
61 |
64 void JfrStringPoolBuffer::set_string_top(uint64_t value) { |
62 void JfrStringPoolBuffer::set_string_top(uint64_t value) { |
65 assert(acquired_by_self() || retired(), "invariant"); |
63 assert(acquired_by_self() || retired(), "invariant"); |