mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 00:04:10 -08:00
Fix metaprogramming support, fix calculation of virtual tables for final classes
This commit is contained in:
parent
2e59db3ab9
commit
8c15885f44
|
@ -130,9 +130,6 @@ public class VirtualTableBuilder {
|
|||
var methodsAtCallSites = methodsUsedAtCallSites.get(className);
|
||||
if (methodsAtCallSites != null) {
|
||||
for (MethodDescriptor methodDesc : methodsAtCallSites) {
|
||||
if (cls.hasModifier(ElementModifier.FINAL) && !table.entries.containsKey(methodDesc)) {
|
||||
continue;
|
||||
}
|
||||
MethodReader method = cls.getMethod(methodDesc);
|
||||
if (method != null && method.getLevel() == AccessLevel.PRIVATE) {
|
||||
continue;
|
||||
|
|
|
@ -94,10 +94,11 @@ public class MetaprogrammingDependencyListener extends AbstractDependencyListene
|
|||
if (model.getUsages().size() == 1) {
|
||||
emitSingleUsage(model, pe, paramVars);
|
||||
} else if (model.getUsages().isEmpty()) {
|
||||
if (model.getMethod().getReturnType() == ValueType.VOID) {
|
||||
var returnType = model.getMethod().getReturnType();
|
||||
if (returnType == ValueType.VOID) {
|
||||
pe.exit();
|
||||
} else {
|
||||
pe.constantNull(Object.class).returnValue();
|
||||
pe.defaultValue(returnType).returnValue();
|
||||
}
|
||||
} else {
|
||||
emitMultipleUsage(model, pe, agent, paramVars);
|
||||
|
@ -147,10 +148,11 @@ public class MetaprogrammingDependencyListener extends AbstractDependencyListene
|
|||
}
|
||||
|
||||
choice.otherwise(() -> {
|
||||
if (methodDep.getReference().getReturnType() == ValueType.VOID) {
|
||||
var returnType = methodDep.getReference().getReturnType();
|
||||
if (returnType == ValueType.VOID) {
|
||||
pe.exit();
|
||||
} else {
|
||||
pe.constantNull(Object.class).returnValue();
|
||||
pe.defaultValue(returnType).returnValue();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user