in src/main/java/com/intellij/rt/debugger/agent/StateFlowTransformer.java [27:55]
public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
MethodVisitor mv = super.visitMethod(access, name, descriptor, signature, exceptions);
switch (name) {
case "<init>":
return new WrappingTransformer(mv, 1);
case "updateInner": {
// the method is only present in the IJ version of the coroutines library
// (other versions don't have methods the instrumenter adds)
isIjFork[0] = true;
return new WrappingTransformer(mv, 1);
}
case "emitInner": {
// the method is not present in the latest IJ version of the coroutines library
isLatestStableIjFork[0] = false;
break;
}
case "getValue":
case "updateState":
return new UnwrappingTransformer(mv, new Predicate() {
@Override
public boolean test(int opcode, String owner, String name, String descriptor) {
return isAtomicGet(opcode, owner, name);
}
});
case "collect":
return new CompareUnwrappedTransformer(mv);
}
return mv;
}