From 790c95bbcb52a2c6f21c236729a828d8522eb0d5 Mon Sep 17 00:00:00 2001
From: log2 <logtwo2@gmail.com>
Date: Sat, 15 Nov 2014 23:09:37 +0100
Subject: [PATCH] Fixed method reference across superclasses
---
.../amd/aparapi/internal/model/ClassModel.java | 18 ++++++++++--------
.../aparapi/internal/model/MethodModel.java | 5 ++++-
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/com.amd.aparapi/src/java/com/amd/aparapi/internal/model/ClassModel.java b/com.amd.aparapi/src/java/com/amd/aparapi/internal/model/ClassModel.java
index 95c362a3..e4728c5e 100644
--- a/com.amd.aparapi/src/java/com/amd/aparapi/internal/model/ClassModel.java
+++ b/com.amd.aparapi/src/java/com/amd/aparapi/internal/model/ClassModel.java
@@ -2715,9 +2715,7 @@ public class ClassModel{
* @return The Method or null if we fail to locate a given method.
*/
public ClassModelMethod getMethod(MethodEntry _methodEntry, boolean _isSpecial) {
- NameAndTypeEntry nameAndTypeEntry = _methodEntry.getNameAndTypeEntry();
- String utf8Name = nameAndTypeEntry.getNameUTF8Entry().getUTF8();
- final String entryClassNameInDotForm = utf8Name.replace('/', '.');
+ final String entryClassNameInDotForm = _methodEntry.getClassEntry().getNameUTF8Entry().getUTF8().replace('/', '.');
// Shortcut direct calls to supers to allow "foo() { super.foo() }" type stuff to work
if (_isSpecial && (superClazz != null) && superClazz.isSuperClass(entryClassNameInDotForm)) {
@@ -2728,7 +2726,9 @@ public class ClassModel{
return superClazz.getMethod(_methodEntry, false);
}
- ClassModelMethod methodOrNull = getMethodOrNull(utf8Name, nameAndTypeEntry.getDescriptorUTF8Entry().getUTF8());
+ NameAndTypeEntry nameAndTypeEntry = _methodEntry.getNameAndTypeEntry();
+ ClassModelMethod methodOrNull = getMethodOrNull(nameAndTypeEntry.getNameUTF8Entry().getUTF8(), nameAndTypeEntry
+ .getDescriptorUTF8Entry().getUTF8());
if (methodOrNull == null)
return superClazz != null ? superClazz.getMethod(_methodEntry, false) : (null);
return methodOrNull;
@@ -2737,8 +2737,7 @@ public class ClassModel{
// private ValueCache<MethodKey, MethodModel, AparapiException> methodModelCache = ValueCache.on(this::computeMethodModel);
private ValueCache<MethodKey, MethodModel, AparapiException> methodModelCache = ValueCache
.on(new ThrowingValueComputer<MethodKey, MethodModel, AparapiException>(){
- @Override
- public MethodModel compute(MethodKey key) throws AparapiException {
+ @Override public MethodModel compute(MethodKey key) throws AparapiException {
return computeMethodModel(key);
}
});
@@ -2797,8 +2796,7 @@ public class ClassModel{
// private final ValueCache<EntrypointKey, Entrypoint, AparapiException> entrypointCache = ValueCache.on(this::computeBasicEntrypoint);
private final ValueCache<EntrypointKey, Entrypoint, AparapiException> entrypointCache = ValueCache
.on(new ThrowingValueComputer<EntrypointKey, Entrypoint, AparapiException>(){
- @Override
- public Entrypoint compute(EntrypointKey key) throws AparapiException {
+ @Override public Entrypoint compute(EntrypointKey key) throws AparapiException {
return computeBasicEntrypoint(key);
}
});
@@ -2834,4 +2832,8 @@ public class ClassModel{
public static void invalidateCaches() {
classModelCache.invalidate();
}
+
+ @Override public String toString() {
+ return "ClassModel of " + getClassWeAreModelling();
+ }
}
diff --git a/com.amd.aparapi/src/java/com/amd/aparapi/internal/model/MethodModel.java b/com.amd.aparapi/src/java/com/amd/aparapi/internal/model/MethodModel.java
index c6d7fc9b..a629c97e 100644
--- a/com.amd.aparapi/src/java/com/amd/aparapi/internal/model/MethodModel.java
+++ b/com.amd.aparapi/src/java/com/amd/aparapi/internal/model/MethodModel.java
@@ -98,7 +98,6 @@ public class MethodModel{
return noCL;
}
-
public boolean isPrivateMemoryGetter() {
return methodIsPrivateMemoryGetter;
}
@@ -1727,4 +1726,8 @@ public class MethodModel{
public Instruction getExprHead() {
return (expressionList.getHead());
}
+
+ @Override public String toString() {
+ return "MethodModel of " + method;
+ }
}
--
GitLab