src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2002, 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. |
90 |
90 |
91 // Get a hold of the object heap |
91 // Get a hold of the object heap |
92 heap = vm.getObjectHeap(); |
92 heap = vm.getObjectHeap(); |
93 |
93 |
94 // Do each thread's roots |
94 // Do each thread's roots |
95 for (JavaThread thread = VM.getVM().getThreads().first(); |
95 Threads threads = VM.getVM().getThreads(); |
96 thread != null; |
96 for (int i = 0; i < threads.getNumberOfThreads(); i++) { |
97 thread = thread.next()) { |
97 JavaThread thread = threads.getJavaThreadAt(i); |
98 ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
98 ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
99 thread.printThreadIDOn(new PrintStream(bos)); |
99 thread.printThreadIDOn(new PrintStream(bos)); |
100 String threadDesc = |
100 String threadDesc = |
101 " in thread \"" + thread.getThreadName() + |
101 " in thread \"" + thread.getThreadName() + |
102 "\" (id " + bos.toString() + ")"; |
102 "\" (id " + bos.toString() + ")"; |