mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Fixes dependency checker bugs
This commit is contained in:
parent
181e69f72d
commit
d9b7a87784
|
@ -43,7 +43,7 @@ public class ObjectNativeGenerator implements Generator, DependencyPlugin {
|
|||
achieveClone(checker, method);
|
||||
break;
|
||||
case "getClass":
|
||||
achieveGetClass(checker);
|
||||
achieveGetClass(checker, method);
|
||||
break;
|
||||
case "wrap":
|
||||
achieveWrap(checker, method);
|
||||
|
@ -60,11 +60,12 @@ public class ObjectNativeGenerator implements Generator, DependencyPlugin {
|
|||
writer.append("return $rt_cls(").append(thisArg).append(".$class);").softNewLine();
|
||||
}
|
||||
|
||||
private void achieveGetClass(DependencyChecker checker) {
|
||||
private void achieveGetClass(DependencyChecker checker, MethodReference method) {
|
||||
String classClass = "java.lang.Class";
|
||||
MethodReference method = new MethodReference(classClass, new MethodDescriptor("createNew",
|
||||
MethodReference initMethod = new MethodReference(classClass, new MethodDescriptor("createNew",
|
||||
ValueType.object(classClass)));
|
||||
checker.addEntryPoint(method);
|
||||
checker.addEntryPoint(initMethod);
|
||||
checker.attachMethodGraph(method).getResultNode().propagate("java.lang.Class");
|
||||
}
|
||||
|
||||
private void generateHashCode(GeneratorContext context, SourceWriter writer) {
|
||||
|
|
|
@ -75,6 +75,9 @@ class DependencyGraphBuilder {
|
|||
System.out.println("Virtual call of " + methodDesc + " detected on " + node.getTag() + ". " +
|
||||
"Target class is " + className);
|
||||
}
|
||||
if (className.startsWith("[")) {
|
||||
className = "java.lang.Object";
|
||||
}
|
||||
MethodReference methodRef = new MethodReference(className, methodDesc);
|
||||
MethodHolder method = findMethod(methodRef, checker.getClassSource());
|
||||
if (method == null) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user