mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
speedup emulated method breakpoints
This commit is contained in:
@@ -156,33 +156,35 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
|
||||
for (Method method : classType.methods()) {
|
||||
if (getMethodName().equals(method.name()) && mySignature.getName(debugProcess).equals(method.signature())) {
|
||||
List<Location> allLineLocations = method.allLineLocations();
|
||||
if (isWatchEntry()) {
|
||||
createLocationBreakpointRequest(ContainerUtil.getFirstItem(allLineLocations), debugProcess);
|
||||
}
|
||||
if (isWatchExit()) {
|
||||
MethodBytecodeUtil.visit(classType, method, new MethodVisitor(Opcodes.API_VERSION) {
|
||||
int myLastLine = 0;
|
||||
@Override
|
||||
public void visitLineNumber(int line, Label start) {
|
||||
myLastLine = line;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitInsn(int opcode) {
|
||||
switch (opcode) {
|
||||
case Opcodes.RETURN:
|
||||
case Opcodes.IRETURN:
|
||||
case Opcodes.FRETURN:
|
||||
case Opcodes.ARETURN:
|
||||
case Opcodes.LRETURN:
|
||||
case Opcodes.DRETURN:
|
||||
//case Opcodes.ATHROW:
|
||||
allLineLocations.stream()
|
||||
.filter(l -> l.lineNumber() == myLastLine)
|
||||
.findFirst().ifPresent(location -> createLocationBreakpointRequest(location, debugProcess));
|
||||
if (!allLineLocations.isEmpty()) {
|
||||
if (isWatchEntry()) {
|
||||
createLocationBreakpointRequest(ContainerUtil.getFirstItem(allLineLocations), debugProcess);
|
||||
}
|
||||
if (isWatchExit()) {
|
||||
MethodBytecodeUtil.visit(classType, method, new MethodVisitor(Opcodes.API_VERSION) {
|
||||
int myLastLine = 0;
|
||||
@Override
|
||||
public void visitLineNumber(int line, Label start) {
|
||||
myLastLine = line;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@Override
|
||||
public void visitInsn(int opcode) {
|
||||
switch (opcode) {
|
||||
case Opcodes.RETURN:
|
||||
case Opcodes.IRETURN:
|
||||
case Opcodes.FRETURN:
|
||||
case Opcodes.ARETURN:
|
||||
case Opcodes.LRETURN:
|
||||
case Opcodes.DRETURN:
|
||||
//case Opcodes.ATHROW:
|
||||
allLineLocations.stream()
|
||||
.filter(l -> l.lineNumber() == myLastLine)
|
||||
.findFirst().ifPresent(location -> createLocationBreakpointRequest(location, debugProcess));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if (base) {
|
||||
// desired class found - now also track all new classes
|
||||
|
||||
Reference in New Issue
Block a user