changeset 408:a436cf481411

meth-lazy: probably missed during last merge
author twisti
date Fri, 13 Jul 2012 11:18:57 -0700
parents 22468f6f518d
children 56879e348afe
files meth-lazy-7023639.patch
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/meth-lazy-7023639.patch	Fri Jul 13 02:35:31 2012 -0700
+++ b/meth-lazy-7023639.patch	Fri Jul 13 11:18:57 2012 -0700
@@ -8476,7 +8476,7 @@
 -        //    where select(z) = select(z, t, f).bindTo(t, f) => z ? t f
 -        // [tailcall]=> tf(arg...)
 -        assert(test.type().returnType() == boolean.class);
-         MethodType targetType = target.type();
+-        MethodType targetType = target.type();
 -        MethodType foldTargetType = targetType.insertParameterTypes(0, boolean.class);
 -        assert(AdapterMethodHandle.canCollectArguments(foldTargetType, test.type(), 0, true));
 -        // working backwards, as usual:
@@ -8490,10 +8490,11 @@
 -        assert(filter.type().parameterType(0) == boolean.class);
 -        MethodHandle fold = foldArguments(filter, filter.type().dropParameterTypes(0, 1), 0, test);
 -        return fold;
-+        MethodHandle invokeBasic = MethodHandles.basicInvoker(targetType);
-+        int arity = targetType.parameterCount();
++        MethodType basicType = target.type().basicType();
++        MethodHandle invokeBasic = MethodHandles.basicInvoker(basicType);
++        int arity = basicType.parameterCount();
 +        int extraNames = 3;
-+        MethodType lambdaType = targetType.invokerType();
++        MethodType lambdaType = basicType.invokerType();
 +        Name[] names = arguments(extraNames, lambdaType);
 +
 +        Object[] testArgs   = Arrays.copyOfRange(names, 1, 1 + arity, Object[].class);
@@ -8511,7 +8512,7 @@
 +        names[arity + 3] = new Name(new NamedFunction(invokeBasic), targetArgs);
 +
 +        LambdaForm form = new LambdaForm("guard", lambdaType.parameterCount(), names);
-+        return new SimpleMethodHandle(targetType, form);
++        return new SimpleMethodHandle(target.type(), form);
      }
  
 -    private static class GuardWithCatch extends BoundMethodHandle {
@@ -10229,7 +10230,7 @@
 +    }
 +
 +    public MethodHandle basicInvoker() {
-+        assert(erasedType == basicType);  // primitives must be flattened also
++        assert(erasedType == basicType) : "erasedType: " + erasedType + " != basicType: " + basicType;  // primitives must be flattened also
 +        MethodHandle invoker = basicInvoker;
 +        if (invoker != null)  return invoker;
 +        invoker = basicType.invokers().makeBasicInvoker();