equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2011, 2018, 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. |
48 if (loader_data) { |
48 if (loader_data) { |
49 return loader_data; |
49 return loader_data; |
50 } |
50 } |
51 return ClassLoaderDataGraph::add(loader, false, THREAD); |
51 return ClassLoaderDataGraph::add(loader, false, THREAD); |
52 } |
52 } |
|
53 |
|
54 size_t ClassLoaderDataGraph::num_instance_classes() { |
|
55 return _num_instance_classes; |
|
56 } |
|
57 |
|
58 size_t ClassLoaderDataGraph::num_array_classes() { |
|
59 return _num_array_classes; |
|
60 } |
|
61 |
|
62 void ClassLoaderDataGraph::inc_instance_classes(size_t count) { |
|
63 Atomic::add(count, &_num_instance_classes); |
|
64 } |
|
65 |
|
66 void ClassLoaderDataGraph::dec_instance_classes(size_t count) { |
|
67 assert(count <= _num_instance_classes, "Sanity"); |
|
68 Atomic::sub(count, &_num_instance_classes); |
|
69 } |
|
70 |
|
71 void ClassLoaderDataGraph::inc_array_classes(size_t count) { |
|
72 Atomic::add(count, &_num_array_classes); |
|
73 } |
|
74 |
|
75 void ClassLoaderDataGraph::dec_array_classes(size_t count) { |
|
76 assert(count <= _num_array_classes, "Sanity"); |
|
77 Atomic::sub(count, &_num_array_classes); |
|
78 } |
|
79 |