equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2000, 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. |
54 Assert.that(loc.gen != null, "Should have found this in a generation"); |
54 Assert.that(loc.gen != null, "Should have found this in a generation"); |
55 } |
55 } |
56 |
56 |
57 if (VM.getVM().getUseTLAB()) { |
57 if (VM.getVM().getUseTLAB()) { |
58 // Try to find thread containing it |
58 // Try to find thread containing it |
59 for (JavaThread t = VM.getVM().getThreads().first(); t != null; t = t.next()) { |
59 Threads threads = VM.getVM().getThreads(); |
|
60 for (int i = 0; i < threads.getNumberOfThreads(); i++) { |
|
61 JavaThread t = threads.getJavaThreadAt(i); |
60 ThreadLocalAllocBuffer tlab = t.tlab(); |
62 ThreadLocalAllocBuffer tlab = t.tlab(); |
61 if (tlab.contains(a)) { |
63 if (tlab.contains(a)) { |
62 loc.inTLAB = true; |
64 loc.inTLAB = true; |
63 loc.tlabThread = t; |
65 loc.tlabThread = t; |
64 loc.tlab = tlab; |
66 loc.tlab = tlab; |
123 if ((storage != null) && storage.findOop(a)) { |
125 if ((storage != null) && storage.findOop(a)) { |
124 loc.inWeakGlobalJNIHandles = true; |
126 loc.inWeakGlobalJNIHandles = true; |
125 return loc; |
127 return loc; |
126 } |
128 } |
127 // Look in thread-local handles |
129 // Look in thread-local handles |
128 for (JavaThread t = VM.getVM().getThreads().first(); t != null; t = t.next()) { |
130 Threads threads = VM.getVM().getThreads(); |
|
131 for (int i = 0; i < threads.getNumberOfThreads(); i++) { |
|
132 JavaThread t = threads.getJavaThreadAt(i); |
129 JNIHandleBlock handleBlock = t.activeHandles(); |
133 JNIHandleBlock handleBlock = t.activeHandles(); |
130 if (handleBlock != null) { |
134 if (handleBlock != null) { |
131 handleBlock = handleBlock.blockContainingHandle(a); |
135 handleBlock = handleBlock.blockContainingHandle(a); |
132 if (handleBlock != null) { |
136 if (handleBlock != null) { |
133 loc.inLocalJNIHandleBlock = true; |
137 loc.inLocalJNIHandleBlock = true; |