Mercurial > hg > truffle
changeset 20861:ce38ee1b67ab
fix check for registering multiple InvocationPlugins for one method
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 09 Apr 2015 09:17:04 +0200 |
parents | dc795777f789 |
children | 2228b4368946 |
files | graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathIntrinsicNode.java graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathSubstitutions.java |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java Thu Apr 09 08:54:09 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java Thu Apr 09 09:17:04 2015 +0200 @@ -421,6 +421,11 @@ } public static boolean check(InvocationPlugins plugins, MethodInfo method, InvocationPlugin plugin) { + InvocationPlugins p = plugins; + while (p != null) { + assert !p.registrations.contains(method) : "a plugin is already registered for " + method; + p = p.parent; + } if (plugin instanceof ForeignCallPlugin) { return true; } @@ -429,11 +434,6 @@ msplugin.getJavaSubstitute(); return true; } - InvocationPlugins p = plugins; - while (p != null) { - assert !p.registrations.contains(method) : "a plugin is already registered for " + method; - p = p.parent; - } int arguments = method.isStatic ? method.argumentTypes.length : method.argumentTypes.length - 1; assert arguments < SIGS.length : format("need to extend %s to support method with %d arguments: %s", InvocationPlugin.class.getSimpleName(), arguments, method); for (Method m : plugin.getClass().getDeclaredMethods()) {