mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
Handle also Lamba for interfaces
This commit is contained in:
parent
97f9fb39a7
commit
b4828b4659
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 - 2021 Volker Berlin (i-net software)
|
||||
Copyright 2020 - 2022 Volker Berlin (i-net software)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@ -29,18 +29,18 @@ public class BootstrapMethod {
|
||||
/**
|
||||
* Signature and return type of method to be implemented by the function object.
|
||||
*/
|
||||
private String samMethodType;
|
||||
private String samMethodType;
|
||||
|
||||
/**
|
||||
* A direct method handle describing the implementation method which should be called
|
||||
*/
|
||||
private ConstantMethodRef implMethod;
|
||||
private ConstantRef implMethod;
|
||||
|
||||
/**
|
||||
* The signature and return type that should be enforced dynamically at invocation time. This may be the same as
|
||||
* {@code samMethodType}, or may be a specialization of it.
|
||||
*/
|
||||
private String instantiatedMethodType;
|
||||
private String instantiatedMethodType;
|
||||
|
||||
/**
|
||||
* Create an instance.
|
||||
@ -54,7 +54,7 @@ public class BootstrapMethod {
|
||||
|
||||
// the 3 values
|
||||
samMethodType = (String)constantPool.get( input.readUnsignedShort() );
|
||||
implMethod = (ConstantMethodRef)constantPool.get( input.readUnsignedShort() );
|
||||
implMethod = (ConstantRef)constantPool.get( input.readUnsignedShort() );
|
||||
instantiatedMethodType = (String)constantPool.get( input.readUnsignedShort() );
|
||||
}
|
||||
|
||||
@ -71,9 +71,9 @@ public class BootstrapMethod {
|
||||
/**
|
||||
* The real method in the parent class that implements the lambda expression
|
||||
*
|
||||
* @return the method
|
||||
* @return the method (ConstantMethodRef or ConstantInterfaceRef)
|
||||
*/
|
||||
public ConstantMethodRef getImplMethod() {
|
||||
public ConstantRef getImplMethod() {
|
||||
return implMethod;
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ import de.inetsoftware.classparser.BootstrapMethod;
|
||||
import de.inetsoftware.classparser.ClassFile;
|
||||
import de.inetsoftware.classparser.ClassFile.Type;
|
||||
import de.inetsoftware.classparser.ConstantClass;
|
||||
import de.inetsoftware.classparser.ConstantMethodRef;
|
||||
import de.inetsoftware.classparser.ConstantRef;
|
||||
import de.inetsoftware.classparser.FieldInfo;
|
||||
import de.inetsoftware.classparser.MethodInfo;
|
||||
import de.inetsoftware.jwebassembly.JWebAssembly;
|
||||
@ -405,7 +405,7 @@ public class TypeManager {
|
||||
* @return the type
|
||||
*/
|
||||
LambdaType lambdaType( @Nonnull BootstrapMethod method, ArrayList<AnyType> params, StructType interfaceType, String interfaceMethodName ) {
|
||||
ConstantMethodRef implMethod = method.getImplMethod();
|
||||
ConstantRef implMethod = method.getImplMethod();
|
||||
FunctionName methodName = new FunctionName( implMethod );
|
||||
String typeName = implMethod.getClassName() + "$$" + implMethod.getName() + "/" + Math.abs( implMethod.getName().hashCode() );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user