Represents method references in IR.
| 46 | * Represents method references in IR. |
| 47 | */ |
| 48 | @InternalCanonicalized |
| 49 | public class MethodRef extends MemberRef { |
| 50 | |
| 51 | private static final Logger logger = LogManager.getLogger(MethodRef.class); |
| 52 | |
| 53 | private static final ConcurrentMap<Key, MethodRef> map = |
| 54 | Maps.newConcurrentMap(4096); |
| 55 | |
| 56 | /** |
| 57 | * Records the MethodRef that fails to be resolved. |
| 58 | */ |
| 59 | private static final Set<MethodRef> resolveFailures = |
| 60 | Sets.newConcurrentSet(); |
| 61 | |
| 62 | static { |
| 63 | World.registerResetCallback(map::clear); |
| 64 | World.registerResetCallback(resolveFailures::clear); |
| 65 | } |
| 66 | |
| 67 | // Method names of polymorphic signature methods. |
| 68 | private static final Set<String> METHOD_HANDLE_METHODS = Set.of( |
| 69 | "invokeExact", |
| 70 | "invoke", |
| 71 | "invokeBasic", |
| 72 | "linkToVirtual", |
| 73 | "linkToStatic", |
| 74 | "linkToSpecial", |
| 75 | "linkToInterface" |
| 76 | ); |
| 77 | |
| 78 | private static final Set<String> VAR_HANDLE_METHODS = Set.of( |
| 79 | "get", |
| 80 | "set", |
| 81 | "getVolatile", |
| 82 | "setVolatile", |
| 83 | "getOpaque", |
| 84 | "setOpaque", |
| 85 | "getAcquire", |
| 86 | "setRelease", |
| 87 | "compareAndSet", |
| 88 | "compareAndExchange", |
| 89 | "compareAndExchangeAcquire", |
| 90 | "compareAndExchangeRelease", |
| 91 | "weakCompareAndSetPlain", |
| 92 | "weakCompareAndSet", |
| 93 | "weakCompareAndSetAcquire", |
| 94 | "weakCompareAndSetRelease", |
| 95 | "getAndSet", |
| 96 | "getAndSetAcquire", |
| 97 | "getAndSetRelease", |
| 98 | "getAndAdd", |
| 99 | "getAndAddAcquire", |
| 100 | "getAndAddRelease", |
| 101 | "getAndBitwiseOr", |
| 102 | "getAndBitwiseOrAcquire", |
| 103 | "getAndBitwiseOrRelease", |
| 104 | "getAndBitwiseAnd", |
| 105 | "getAndBitwiseAndAcquire", |
nothing calls this directly
no test coverage detected