public static MethodDefinition getLambdaMethod(Lambda l) { Object arg = l.getCallSite().getBootstrapArguments().get(1); if (arg instanceof MethodHandle) { MethodDefinition lm = ((MethodHandle) arg).getMethod().resolve(); if (lm != null) return lm; } throw new InternalError("Unable to determine original method for lambda " + l); }
public static void writeDynamicCallSite(final ITextOutput output, final DynamicCallSite operand) { output.writeReference(operand.getMethodName(), operand.getMethodType()); output.writeDelimiter(":"); writeMethodSignature(output, operand.getMethodType()); }
public static MethodHandle getMethodHandle(DynamicCallSite dcs) { MethodHandle mh = dcs.getBootstrapMethodHandle(); if (mh.getMethod().getDeclaringType().getInternalName().equals("java/lang/invoke/LambdaMetafactory")) { List<Object> args = dcs.getBootstrapArguments(); if (args.size() > 1 && args.get(1) instanceof MethodHandle) { MethodHandle actualHandle = (MethodHandle) args.get(1); return actualHandle; } } return null; }
@Override public void visitDynamicCallSite(final OpCode op, final DynamicCallSite callSite) { printOpCode(op); _output.write(' '); _output.writeAttribute("BootstrapMethod "); _output.writeDelimiter("#"); _output.writeLiteral(callSite.getBootstrapMethodIndex()); _output.writeDelimiter(", "); _output.writeReference(callSite.getMethodName(), callSite.getMethodType()); _output.writeDelimiter(":"); DecompilerHelpers.writeMethodSignature(_output, callSite.getMethodType()); _output.writeLine(); }
inferredType = callSite.getMethodType().getReturnType(); final MethodReference bootstrapMethod = callSite.getBootstrapMethod(); callSite.getBootstrapArguments().size() == 3 && callSite.getBootstrapArguments().get(1) instanceof MethodHandle) { final MethodHandle targetHandle = (MethodHandle) callSite.getBootstrapArguments().get(1); final MethodReference targetMethod = targetHandle.getMethod(); final Map<TypeReference, TypeReference> expectedMappings = new HashMap<>(); MetadataFilters.matchName(callSite.getMethodName()) );
protected ResolveResult resolveLambda(final AstNode node) { final TypeReference lambdaType = node.getUserData(Keys.TYPE_REFERENCE); if (lambdaType != null) { return resolveType(lambdaType); } final DynamicCallSite callSite = node.getUserData(Keys.DYNAMIC_CALL_SITE); if (callSite != null) { return resolveType(callSite.getMethodType().getReturnType()); } return null; }
return (IMethodSignature) callSite.getBootstrapArguments().get(2); return (IMethodSignature) callSite.getBootstrapArguments().get(2); callSite != null ? MetadataFilters.matchName(callSite.getMethodName()) : Predicates.<MemberReference>alwaysTrue() );
final MethodReference bootstrapMethod = callSite.getBootstrapMethod(); callSite.getBootstrapArguments().size() >= 3 && callSite.getBootstrapArguments().get(1) instanceof MethodHandle) { final MethodHandle targetMethodHandle = (MethodHandle) callSite.getBootstrapArguments().get(1); final MethodReference targetMethod = targetMethodHandle.getMethod(); final TypeReference declaringType = targetMethod.getDeclaringType();
@Override public DynamicCallSite lookupDynamicCallSite(final int token) { final ConstantPool.InvokeDynamicInfoEntry entry = _constantPool.getEntry(token); final BootstrapMethodsAttribute attribute = SourceAttribute.find(AttributeNames.BootstrapMethods, _typeDefinition.getSourceAttributes()); final BootstrapMethodsTableEntry bootstrapMethod = attribute.getBootstrapMethods() .get(entry.bootstrapMethodAttributeIndex); final ConstantPool.NameAndTypeDescriptorEntry nameAndType = _constantPool.getEntry(entry.nameAndTypeDescriptorIndex); return new DynamicCallSite( bootstrapMethod.getMethod(), bootstrapMethod.getArguments(), nameAndType.getName(), _parser.parseMethodSignature(nameAndType.getType()) ); }
inferredType = callSite.getMethodType().getReturnType(); final MethodReference bootstrapMethod = callSite.getBootstrapMethod(); callSite.getBootstrapArguments().size() == 3 && callSite.getBootstrapArguments().get(1) instanceof MethodHandle) { final MethodHandle targetHandle = (MethodHandle) callSite.getBootstrapArguments().get(1); final MethodReference targetMethod = targetHandle.getMethod(); final Map<TypeReference, TypeReference> expectedMappings = new HashMap<>(); MetadataFilters.matchName(callSite.getMethodName()) );
protected ResolveResult resolveLambda(final AstNode node) { final TypeReference lambdaType = node.getUserData(Keys.TYPE_REFERENCE); if (lambdaType != null) { return resolveType(lambdaType); } final DynamicCallSite callSite = node.getUserData(Keys.DYNAMIC_CALL_SITE); if (callSite != null) { return resolveType(callSite.getMethodType().getReturnType()); } return null; }
return (IMethodSignature) callSite.getBootstrapArguments().get(2); return (IMethodSignature) callSite.getBootstrapArguments().get(2); callSite != null ? MetadataFilters.matchName(callSite.getMethodName()) : Predicates.<MemberReference>alwaysTrue() );
final MethodReference bootstrapMethod = callSite.getBootstrapMethod(); callSite.getBootstrapArguments().size() >= 3 && callSite.getBootstrapArguments().get(1) instanceof MethodHandle) { final MethodHandle targetMethodHandle = (MethodHandle) callSite.getBootstrapArguments().get(1); final MethodReference targetMethod = targetMethodHandle.getMethod(); final TypeReference declaringType = targetMethod.getDeclaringType();
@Override public DynamicCallSite lookupDynamicCallSite(final int token) { final ConstantPool.InvokeDynamicInfoEntry entry = _constantPool.getEntry(token); final BootstrapMethodsAttribute attribute = SourceAttribute.find(AttributeNames.BootstrapMethods, _typeDefinition.getSourceAttributes()); final BootstrapMethodsTableEntry bootstrapMethod = attribute.getBootstrapMethods() .get(entry.bootstrapMethodAttributeIndex); final ConstantPool.NameAndTypeDescriptorEntry nameAndType = _constantPool.getEntry(entry.nameAndTypeDescriptorIndex); return new DynamicCallSite( bootstrapMethod.getMethod(), bootstrapMethod.getArguments(), nameAndType.getName(), _parser.parseMethodSignature(nameAndType.getType()) ); }
inferredType = callSite.getMethodType().getReturnType(); final MethodReference bootstrapMethod = callSite.getBootstrapMethod(); callSite.getBootstrapArguments().size() == 3 && callSite.getBootstrapArguments().get(1) instanceof MethodHandle) { final MethodHandle targetHandle = (MethodHandle) callSite.getBootstrapArguments().get(1); final MethodReference targetMethod = targetHandle.getMethod(); final Map<TypeReference, TypeReference> expectedMappings = new HashMap<>(); MetadataFilters.matchName(callSite.getMethodName()) );
public static void writeDynamicCallSite(final ITextOutput output, final DynamicCallSite operand) { output.writeReference(operand.getMethodName(), operand.getMethodType()); output.writeDelimiter(":"); writeMethodSignature(output, operand.getMethodType()); }
protected ResolveResult resolveLambda(final AstNode node) { final TypeReference lambdaType = node.getUserData(Keys.TYPE_REFERENCE); if (lambdaType != null) { return resolveType(lambdaType); } final DynamicCallSite callSite = node.getUserData(Keys.DYNAMIC_CALL_SITE); if (callSite != null) { return resolveType(callSite.getMethodType().getReturnType()); } return null; }
return (IMethodSignature) callSite.getBootstrapArguments().get(2); return (IMethodSignature) callSite.getBootstrapArguments().get(2); callSite != null ? MetadataFilters.matchName(callSite.getMethodName()) : Predicates.<MemberReference>alwaysTrue() );
final MethodReference bootstrapMethod = callSite.getBootstrapMethod(); callSite.getBootstrapArguments().size() >= 3 && callSite.getBootstrapArguments().get(1) instanceof MethodHandle) { final MethodHandle targetMethodHandle = (MethodHandle) callSite.getBootstrapArguments().get(1); final MethodReference targetMethod = targetMethodHandle.getMethod(); final TypeReference declaringType = targetMethod.getDeclaringType();
callSite.getBootstrapArguments().size() >= 3 && callSite.getBootstrapArguments().get(2) instanceof IMethodSignature) { final IMethodSignature signature = (IMethodSignature) callSite.getBootstrapArguments().get(2);