947 ss = ss.tail; |
947 ss = ss.tail; |
948 } |
948 } |
949 return ts.tail == null && ss.tail == null; |
949 return ts.tail == null && ss.tail == null; |
950 /*inlined: ts.isEmpty() && ss.isEmpty();*/ |
950 /*inlined: ts.isEmpty() && ss.isEmpty();*/ |
951 } |
951 } |
|
952 |
|
953 /** |
|
954 * A polymorphic signature method (JLS SE 7, 8.4.1) is a method that |
|
955 * (i) is declared in the java.lang.invoke.MethodHandle class, (ii) takes |
|
956 * a single variable arity parameter (iii) whose declared type is Object[], |
|
957 * (iv) has a return type of Object and (v) is native. |
|
958 */ |
|
959 public boolean isSignaturePolymorphic(MethodSymbol msym) { |
|
960 List<Type> argtypes = msym.type.getParameterTypes(); |
|
961 return (msym.flags_field & NATIVE) != 0 && |
|
962 msym.owner == syms.methodHandleType.tsym && |
|
963 argtypes.tail.tail == null && |
|
964 argtypes.head.hasTag(TypeTag.ARRAY) && |
|
965 msym.type.getReturnType().tsym == syms.objectType.tsym && |
|
966 ((ArrayType)argtypes.head).elemtype.tsym == syms.objectType.tsym; |
|
967 } |
952 |
968 |
953 /** |
969 /** |
954 * Is t the same type as s? |
970 * Is t the same type as s? |
955 */ |
971 */ |
956 public boolean isSameType(Type t, Type s) { |
972 public boolean isSameType(Type t, Type s) { |