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
25 #include "precompiled.hpp"
26 #include "classfile/classLoaderDataGraph.hpp"
27 #include "classfile/dictionary.hpp"
28 #include "classfile/systemDictionary.hpp"
29 #include "gc/shared/collectedHeap.hpp"
30 #include "memory/universe.hpp"
31 #include "prims/jvmtiGetLoadedClasses.hpp"
32 #include "runtime/handles.inline.hpp"
33 #include "runtime/jniHandles.inline.hpp"
34 #include "runtime/thread.hpp"
35 #include "utilities/stack.inline.hpp"
36
37 // The closure for GetLoadedClasses
38 class LoadedClassesClosure : public KlassClosure {
39 private:
40 Stack<jclass, mtInternal> _classStack;
41 JvmtiEnv* _env;
42 Thread* _cur_thread;
43 bool _dictionary_walk;
44
45 int extract(jclass* result_list) {
46 // The size of the Stack will be 0 after extract, so get it here
47 int count = (int)_classStack.size();
48 int i = count;
49
50 // Pop all jclasses, fill backwards
51 while (!_classStack.is_empty()) {
52 result_list[--i] = _classStack.pop();
|
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
25 #include "precompiled.hpp"
26 #include "classfile/classLoaderDataGraph.hpp"
27 #include "classfile/dictionary.hpp"
28 #include "classfile/systemDictionary.hpp"
29 #include "gc/shared/collectedHeap.hpp"
30 #include "memory/universe.hpp"
31 #include "prims/jvmtiGetLoadedClasses.hpp"
32 #include "runtime/handles.inline.hpp"
33 #include "runtime/mutexLocker.inline.hpp"
34 #include "runtime/jniHandles.inline.hpp"
35 #include "runtime/thread.hpp"
36 #include "utilities/stack.inline.hpp"
37
38 // The closure for GetLoadedClasses
39 class LoadedClassesClosure : public KlassClosure {
40 private:
41 Stack<jclass, mtInternal> _classStack;
42 JvmtiEnv* _env;
43 Thread* _cur_thread;
44 bool _dictionary_walk;
45
46 int extract(jclass* result_list) {
47 // The size of the Stack will be 0 after extract, so get it here
48 int count = (int)_classStack.size();
49 int i = count;
50
51 // Pop all jclasses, fill backwards
52 while (!_classStack.is_empty()) {
53 result_list[--i] = _classStack.pop();
|