mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
optimization trick: on debugger attach invoke vm.allClasses() to cache loaded classes inside JDI, which makes operations involving class search work faster
This commit is contained in:
@@ -68,6 +68,8 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
|
||||
canWatchFieldModification();
|
||||
canPopFrames();
|
||||
|
||||
virtualMachine.allClasses(); // this will cache classes inside JDI and enable faster search of classes later
|
||||
|
||||
List<ThreadGroupReference> groups = virtualMachine.topLevelThreadGroups();
|
||||
for (ThreadGroupReference threadGroupReference : groups) {
|
||||
threadGroupCreated(threadGroupReference);
|
||||
@@ -120,10 +122,11 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
|
||||
}
|
||||
|
||||
public List<ReferenceType> allClasses() {
|
||||
if (myAllClasses == null) {
|
||||
myAllClasses = myVirtualMachine.allClasses();
|
||||
List<ReferenceType> allClasses = myAllClasses;
|
||||
if (allClasses == null) {
|
||||
myAllClasses = allClasses = myVirtualMachine.allClasses();
|
||||
}
|
||||
return myAllClasses;
|
||||
return allClasses;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
||||
Reference in New Issue
Block a user