It seem it's possible to canonicalize Class.getClass() intrinsic method when the receiver is type of InstanceConstant:
e.g. case#1
B b = B.default;
Class s = b.getClass(); // canonicalize to constant
case#2
public static B foo(){
return B.default;
}
public static boolean test1() {
B b = foo();
Class s = b.getClass();
return true;
}
e.g. case#1
B b = B.default;
Class s = b.getClass(); // canonicalize to constant
case#2
public static B foo(){
return B.default;
}
public static boolean test1() {
B b = foo();
Class s = b.getClass();
return true;
}