changeset 14041:f0f28425e3e8

Enable M3 translation by default Cleanup code associated with BytecodeMapping-based specialization.
author mcimadamore
date Mon, 18 Apr 2016 17:33:38 +0100
parents 76464abf8c6e
children 10e2de50a300
files src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java src/java.base/share/classes/java/lang/invoke/DispatchContext.java src/java.base/share/classes/java/lang/invoke/GenericInstanceDispatch.java src/java.base/share/classes/java/lang/invoke/GenericMethodSpecializer.java src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java src/java.base/share/classes/java/net/URLClassLoader.java src/java.base/share/classes/valhalla/classdyn/ClassDynHelper.java src/java.base/share/classes/valhalla/classdyn/Mangler.java src/java.base/share/classes/valhalla/specializer/BridgeAttribute.java src/java.base/share/classes/valhalla/specializer/BytecodeMappingAttribute.java src/java.base/share/classes/valhalla/specializer/DebuggingSignatureVisitor.java src/java.base/share/classes/valhalla/specializer/SignatureSpecializer.java src/java.base/share/classes/valhalla/specializer/Specialize.java src/java.base/share/classes/valhalla/specializer/Specializer.java src/java.base/share/classes/valhalla/specializer/SpecializerSignature.java src/java.base/share/classes/valhalla/specializer/TypeVariablesMapAttribute.java src/java.base/share/classes/valhalla/specializer/WhereAttribute.java test/valhalla/PrespecializerTest.java test/valhalla/boottest/valhalla/specializer/SignatureSpecializerTest.java test/valhalla/test/valhalla/anyutil/CollectionsTest.java test/valhalla/test/valhalla/anyutil/SimplePipelineTest.java test/valhalla/test/valhalla/classdyn/ManglerTest.java test/valhalla/test/valhalla/specializer/BoxTest.java test/valhalla/test/valhalla/specializer/DefaultValueTest.java test/valhalla/test/valhalla/specializer/GenericMethodsTest.java test/valhalla/test/valhalla/specializer/MiscManglingsTest.java test/valhalla/test/valhalla/specializer/MixedTypesTest.java test/valhalla/test/valhalla/specializer/MultiBoxTest.java test/valhalla/test/valhalla/specializer/ObjectMethodsTest.java test/valhalla/test/valhalla/specializer/SignatureVisitorTest.java test/valhalla/test/valhalla/specializer/SpecializationMetadataTest.java test/valhalla/test/valhalla/specializer/TwoBoxTest.java test/valhalla/test/valhalla/specializer/WhereTest.java
diffstat 34 files changed, 225 insertions(+), 3571 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java	Mon Apr 18 17:33:38 2016 +0100
@@ -65,7 +65,6 @@
     final boolean isSerializable;             // Should the returned instance be serializable
     final Class<?>[] markerInterfaces;        // Additional marker interfaces to be implemented
     final MethodType[] additionalBridges;     // Signatures of additional methods to bridge
-    final Object[] bsmArgs;                   // Bsm args to be used when emitting indy
 
     /**
      * Meta-factory constructor.
@@ -112,17 +111,14 @@
                                        MethodType instantiatedMethodType,
                                        boolean isSerializable,
                                        Class<?>[] markerInterfaces,
-                                       MethodType[] additionalBridges,
-                                       Object[] bsmArgs)
+                                       MethodType[] additionalBridges)
             throws LambdaConversionException {
         if ((caller.lookupModes() & MethodHandles.Lookup.PRIVATE) == 0) {
             throw new LambdaConversionException(String.format(
                     "Invalid caller: %s",
                     caller.lookupClass().getName()));
         }
-        this.targetClass = bsmArgs.length == 0 ?
-                caller.lookupClass() :
-                caller.revealDirect((MethodHandle)bsmArgs[2]).getDeclaringClass();
+        this.targetClass = caller.lookupClass();
         this.invokedType = invokedType;
 
         this.samBase = invokedType.returnType();
@@ -143,7 +139,6 @@
         this.isSerializable = isSerializable;
         this.markerInterfaces = markerInterfaces;
         this.additionalBridges = additionalBridges;
-        this.bsmArgs = bsmArgs;
 
         if (!samBase.isInterface()) {
             throw new LambdaConversionException(String.format(
@@ -250,54 +245,52 @@
             samStart = 0;
         }
 
-        if (bsmArgs.length == 0) {
-            // Check for exact match on non-receiver captured arguments
-            final int implFromCaptured = capturedArity - capturedStart;
-            for (int i=0; i<implFromCaptured; i++) {
-                Class<?> implParamType = implMethodType.parameterType(i);
-                Class<?> capturedParamType = invokedType.parameterType(i + capturedStart);
-                if (!capturedParamType.equals(implParamType)) {
-                    throw new LambdaConversionException(
-                            String.format("Type mismatch in captured lambda parameter %d: expecting %s, found %s",
-                                          i, capturedParamType, implParamType));
-                }
+        // Check for exact match on non-receiver captured arguments
+        final int implFromCaptured = capturedArity - capturedStart;
+        for (int i=0; i<implFromCaptured; i++) {
+            Class<?> implParamType = implMethodType.parameterType(i);
+            Class<?> capturedParamType = invokedType.parameterType(i + capturedStart);
+            if (!capturedParamType.equals(implParamType)) {
+                throw new LambdaConversionException(
+                        String.format("Type mismatch in captured lambda parameter %d: expecting %s, found %s",
+                                      i, capturedParamType, implParamType));
             }
+        }
 
-            // Check for adaptation match on SAM arguments
-            final int samOffset = samStart - implFromCaptured;
-            for (int i = implFromCaptured; i < implArity; i++) {
-                Class<?> implParamType = implMethodType.parameterType(i);
-                Class<?> instantiatedParamType = instantiatedMethodType.parameterType(i + samOffset);
-                if (!isAdaptableTo(instantiatedParamType, implParamType, true)) {
-                    throw new LambdaConversionException(
-                            String.format("Type mismatch for lambda argument %d: %s is not convertible to %s",
-                                    i, instantiatedParamType, implParamType));
-                }
+        // Check for adaptation match on SAM arguments
+        final int samOffset = samStart - implFromCaptured;
+        for (int i = implFromCaptured; i < implArity; i++) {
+            Class<?> implParamType = implMethodType.parameterType(i);
+            Class<?> instantiatedParamType = instantiatedMethodType.parameterType(i + samOffset);
+            if (!isAdaptableTo(instantiatedParamType, implParamType, true)) {
+                throw new LambdaConversionException(
+                        String.format("Type mismatch for lambda argument %d: %s is not convertible to %s",
+                                i, instantiatedParamType, implParamType));
             }
+        }
 
-            // Adaptation match: return type
-            Class<?> expectedType = instantiatedMethodType.returnType();
-            Class<?> actualReturnType =
-                    (implKind == MethodHandleInfo.REF_newInvokeSpecial)
-                            ? implDefiningClass
-                            : implMethodType.returnType();
-            Class<?> samReturnType = samMethodType.returnType();
-            if (!isAdaptableToAsReturn(actualReturnType, expectedType)) {
-                throw new LambdaConversionException(
-                        String.format("Type mismatch for lambda return: %s is not convertible to %s",
-                                actualReturnType, expectedType));
-            }
-            if (!isAdaptableToAsReturnStrict(expectedType, samReturnType)) {
+        // Adaptation match: return type
+        Class<?> expectedType = instantiatedMethodType.returnType();
+        Class<?> actualReturnType =
+                (implKind == MethodHandleInfo.REF_newInvokeSpecial)
+                        ? implDefiningClass
+                        : implMethodType.returnType();
+        Class<?> samReturnType = samMethodType.returnType();
+        if (!isAdaptableToAsReturn(actualReturnType, expectedType)) {
+            throw new LambdaConversionException(
+                    String.format("Type mismatch for lambda return: %s is not convertible to %s",
+                            actualReturnType, expectedType));
+        }
+        if (!isAdaptableToAsReturnStrict(expectedType, samReturnType)) {
+            throw new LambdaConversionException(
+                    String.format("Type mismatch for lambda expected return: %s is not convertible to %s",
+                            expectedType, samReturnType));
+        }
+        for (MethodType bridgeMT : additionalBridges) {
+            if (!isAdaptableToAsReturnStrict(expectedType, bridgeMT.returnType())) {
                 throw new LambdaConversionException(
                         String.format("Type mismatch for lambda expected return: %s is not convertible to %s",
-                                expectedType, samReturnType));
-            }
-            for (MethodType bridgeMT : additionalBridges) {
-                if (!isAdaptableToAsReturnStrict(expectedType, bridgeMT.returnType())) {
-                    throw new LambdaConversionException(
-                            String.format("Type mismatch for lambda expected return: %s is not convertible to %s",
-                                    expectedType, bridgeMT.returnType()));
-                }
+                                expectedType, bridgeMT.returnType()));
             }
         }
      }
--- a/src/java.base/share/classes/java/lang/invoke/DispatchContext.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/DispatchContext.java	Mon Apr 18 17:33:38 2016 +0100
@@ -1,7 +1,6 @@
 package java.lang.invoke;
 
 import valhalla.model3.Model3Converter.ParameterizedType;
-import valhalla.specializer.SignatureSpecializer;
 
 import java.lang.invoke.MethodHandles.Lookup;
 import java.net.URL;
--- a/src/java.base/share/classes/java/lang/invoke/GenericInstanceDispatch.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/GenericInstanceDispatch.java	Mon Apr 18 17:33:38 2016 +0100
@@ -1,30 +1,16 @@
 package java.lang.invoke;
 
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.Opcodes;
 import valhalla.model3.Model3Converter.ParameterizedType;
-import valhalla.specializer.SignatureSpecializer;
-import valhalla.specializer.Specializer;
-import valhalla.specializer.TypeVariablesMapAttribute;
 
 import java.util.stream.Stream;
-import java.io.IOException;
-import java.io.InputStream;
 import java.lang.invoke.MethodHandles.Lookup;
 import java.lang.reflect.Constructor;
-import java.util.List;
 
 /**
  * Metafactory for generic specializable instance callsites.
  */
 public class GenericInstanceDispatch {
 
-    static final Attribute[] ATTRIBUTE_PROTOS = new Attribute[] {
-            new TypeVariablesMapAttribute()
-    };
-
     public static CallSite metafactory(MethodHandles.Lookup caller,
                                        String invokedName,
                                        MethodType invokedType,
@@ -89,38 +75,5 @@
 
             return null;
         }
-
-        int getArity(Class<?> unspecializedImplementingClass) {
-            String implClassName = unspecializedImplementingClass.getName();
-            String implBasePath = implClassName.replace('.', '/').concat(".class");
-            try (InputStream input = getLoader().getResourceAsStream(implBasePath)) {
-                byte[] byte_arr = Specializer.toByteArray(input);
-                ClassReader cr = new ClassReader(byte_arr);
-                ReceiverArityVisitor rmv = new ReceiverArityVisitor();
-                cr.accept(rmv, ATTRIBUTE_PROTOS, ClassReader.SKIP_FRAMES);
-                return rmv.receiverOffset;
-            } catch (IOException ex) {
-                throw new AssertionError(ex);
-            }
-        }
-
-        class ReceiverArityVisitor extends ClassVisitor {
-
-            int receiverOffset;
-
-            ReceiverArityVisitor() {
-                super(Opcodes.ASM5);
-            }
-
-            @Override
-            public void visitAttribute(Attribute attr) {
-                if (attr instanceof TypeVariablesMapAttribute) {
-                    TypeVariablesMapAttribute tvma = (TypeVariablesMapAttribute) attr;
-                    receiverOffset = (int)tvma.entries[0].bitSet.stream().count();
-                } else {
-                    super.visitAttribute(attr);
-                }
-            }
-        }
     }
 }
--- a/src/java.base/share/classes/java/lang/invoke/GenericMethodSpecializer.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,283 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.lang.invoke;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.PropertyPermission;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.internal.org.objectweb.asm.Type;
-import sun.misc.Unsafe;
-import sun.security.action.GetPropertyAction;
-import valhalla.specializer.SignatureSpecializer;
-import valhalla.specializer.SignatureSpecializer.SpecializedSignature;
-import valhalla.specializer.Specializer;
-
-/**
- * GenericMethodSpecializer
- *
- * @author Brian Goetz
- */
-public class GenericMethodSpecializer {
-    private static final Unsafe UNSAFE = Unsafe.getUnsafe();
-    private static final ProxyClassesDumper dumper;
-    static {
-        final String key = "valhalla.dumpProxyClasses";
-        String path = AccessController.doPrivileged(
-                new GetPropertyAction(key), null,
-                new PropertyPermission(key, "read"));
-        dumper = (null == path) ? null : ProxyClassesDumper.getInstance(path);
-    }
-
-    public static CallSite metafactory(MethodHandles.Lookup caller,
-                                       String invokedName,
-                                       MethodType invokedType,
-                                       Object... args) throws ReflectiveOperationException {
-        List<String> tArgs = new ArrayList<>();
-        for (int i=2; i<args.length; i++) {
-            // @@@ Filter out L-types.  This is a short term hack; should change whoever is putting L-types here.
-            String s = (String) args[i];
-            if (s.startsWith("T") || s.startsWith("L"))
-                s = "";
-            tArgs.add(s);
-        }
-        return new GenericMethodContext(caller, invokedName, invokedType, (String)args[0], (MethodHandle)args[1], tArgs).makeCallsite();
-    }
-
-    public static class GenericMethodContext {
-        MethodHandles.Lookup caller;
-        String invokedName;
-        MethodType invokedType;
-        String staticReceiverDesc;
-        MethodHandle targetMethod;
-        List<String> typeArgs;
-
-        public GenericMethodContext(MethodHandles.Lookup caller, String invokedName, MethodType invokedType,
-                                    String staticReceiverDesc, MethodHandle targetMethod, List<String> typeArgs) {
-            this.caller = caller;
-            this.invokedName = invokedName;
-            this.invokedType = invokedType;
-            this.staticReceiverDesc = staticReceiverDesc;
-            this.targetMethod = targetMethod;
-            this.typeArgs = typeArgs;
-        }
-
-        String typeArgsSuffix() {
-            List<String> buf = new ArrayList<>();
-            for (int i = 0; i < typeArgs.size() ; i++) {
-                String typeArg = typeArgs.get(i);
-                if (typeArg != null && !typeArg.isEmpty() && !typeArg.startsWith("T")) {
-                    buf.add(String.format("%d=%s", i, typeArg));
-                }
-            }
-            return buf.size() == 0 ? "" : "${" + String.join(",", buf) + "}";
-        }
-
-        /**
-         * @param impl The method handle describing the method to specialize,
-         *             in the unspecialized class
-         * @param receiverClass The dynamic class of the receiver (or qualifying class for static methods)
-         * @param unspecializedImplementingClass The unspecialized class hosting the method to specialize
-         * @param specializedImplementingClass The specialization of the hosting class, as a superclass of the receiver (for instance methods only)
-         * @return
-         */
-        private MethodHandle specializedMethod(MethodHandle impl,
-                                               Class<?> receiverClass,
-                                               Class<?> unspecializedImplementingClass,
-                                               String instantiatedReceiverClassName) {
-            MethodHandleInfo mhi = caller.revealDirect(impl);
-            List<String> classSpecializations = SignatureSpecializer.extractSpecializationParams(instantiatedReceiverClassName);
-            String instantiatedReceiver = Type.getType(receiverClass).getDescriptor();
-            MethodType lookupType = invokedType;
-            boolean isStatic = (mhi.getModifiers() & Opcodes.ACC_STATIC) != 0;
-            if (!isStatic) {
-                instantiatedReceiver = new SpecializedSignature(instantiatedReceiver, Collections.emptyMap()).toDesc(Collections.emptyMap());
-                lookupType = invokedType.replaceParameterTypes(0, 1, receiverClass);
-            }
-
-            Predicate<String> trivial = s -> s == null || s.equals("") || s.startsWith("T");
-            if (classSpecializations.stream().allMatch(trivial) && typeArgs.stream().allMatch(trivial)) {
-//                System.out.printf("Short circuiting %s%s[%s][%s], nothing to specialize%n",
-//                                  mhi.getName(), mhi.getMethodType().toMethodDescriptorString(),
-//                                  classSpecializations, typeArgs);
-                return impl;
-            }
-
-            String implClassName = unspecializedImplementingClass.getName();
-            String implBasePath = SignatureSpecializer.extractBaseName(implClassName).replace('.', '/').concat(".class");
-
-            try (InputStream is = getClassAsStream(implBasePath)) {
-                String mangledName = receiverClass.getName().replace('.', '/') + "$" + invokedName + typeArgsSuffix();
-
-                byte[] bytes = Specializer.specializeMethod(mangledName, mhi.getName(),
-                                                            mhi.getMethodType().toMethodDescriptorString(),
-                                                            is, classSpecializations, typeArgs, instantiatedReceiver,
-                                                            lookupType.toMethodDescriptorString());
-                Class<?> clazz;
-                try {
-                    clazz = UNSAFE.defineAnonymousClass(
-                            findSpecializedParent(receiverClass, SignatureSpecializer.extractBaseName(implClassName)),
-                            bytes, null);
-                    if (dumper != null) {
-                        dumper.dumpClass(clazz.getName().replace("/", "."), bytes);
-                    }
-                }
-                catch (Throwable t) {
-                    if (dumper != null) {
-                        dumper.dumpClass(mangledName.replace("/", ".") + "_ERROR", bytes);
-                    }
-                    throw t;
-                }
-
-                return MethodHandles.Lookup.IMPL_LOOKUP.findStatic(clazz, mhi.getName(), lookupType);
-            } catch (Throwable t) {
-                throw new AssertionError(t);
-            }
-        }
-
-        public InputStream getClassAsStream(String path) {
-            ClassLoader lookupLoader = caller.lookupClass().getClassLoader();
-            return lookupLoader == null ?
-                    new URLClassLoader(new URL[0]).getResourceAsStream(path) :
-                    caller.lookupClass().getClassLoader().getResourceAsStream(path);
-        }
-
-        public Object resolveMethod(Object[] args) throws Throwable {
-            Class<?> receiverClass = args[0].getClass();
-            Class<?> lookupClass = receiverClass;
-            MethodType lookupType = targetMethod.type().dropParameterTypes(0, 1);
-            String receiverClassBaseName = SignatureSpecializer.extractBaseName(receiverClass.getName());
-            if (receiverClass.getName().indexOf("${") != -1) {
-                lookupClass = lookupClass(receiverClassBaseName);
-            }
-            MemberName implMember = caller.resolveOrFail((byte) MethodHandleInfo.REF_invokeVirtual, lookupClass, invokedName, lookupType);
-            Class<?> unspecializedImplementingClass = implMember.getDeclaringClass();
-            Class<?> specializedImplementingClass = receiverClass;
-
-            // If the bytecode to specialize is in a superclass, map the unspecialized
-            // superclass name (Foo) to the specialized (Foo${0=I}) so that we can
-            // extract the class specialization parameters
-            // @@@ Currently we do this with names, which is an approximation for prototyping
-            if (!receiverClassBaseName.equals(unspecializedImplementingClass.getName()))
-                specializedImplementingClass = findSpecializedParent(receiverClass, unspecializedImplementingClass.getName());
-
-            MethodHandle implMethod = caller.findVirtual(unspecializedImplementingClass, invokedName, implMember.getMethodType());
-            MethodHandle specializedMethod = specializedMethod(implMethod, receiverClass, unspecializedImplementingClass,
-                    specializedImplementingClass.getName());
-            return specializedMethod.invokeWithArguments(args);
-        }
-
-        private Class<?> findSpecializedParent(Class<?> clazz, String unspecializedParentName) {
-            if (SignatureSpecializer.extractBaseName(clazz.getName()).equals(unspecializedParentName))
-                return clazz;
-            if (clazz == Object.class)
-                return null;
-            Class<?> c = findSpecializedParent(clazz.getSuperclass(), unspecializedParentName);
-            if (c != null)
-                return c;
-
-            for (Class<?> intf : clazz.getInterfaces()) {
-                c = findSpecializedParent(intf, unspecializedParentName);
-                if (c != null)
-                    return c;
-            }
-
-            return null;
-        }
-
-        private Class<?> lookupClass(String cname) throws ReflectiveOperationException {
-            return Class.forName(cname.replaceAll("/", "."), false, caller.lookupClass().getClassLoader());
-        }
-
-        @SuppressWarnings("fallthrough")
-        CallSite makeCallsite() throws ReflectiveOperationException {
-            MethodHandleInfo mhi = caller.revealDirect(targetMethod);
-            boolean isSpecial = false;
-            switch (mhi.getReferenceKind()) {
-                case MethodHandleInfo.REF_invokeSpecial:
-                    isSpecial = true;
-                case MethodHandleInfo.REF_invokeStatic:
-                    String instReceiverDesc = new SpecializedSignature(staticReceiverDesc, Collections.emptyMap()).getDescAsClassName(Collections.emptyMap());
-                    MethodHandle mh = specializedMethod(targetMethod,
-                            isSpecial ? lookupClass(instReceiverDesc) : mhi.getDeclaringClass(),
-                            mhi.getDeclaringClass(),
-                            instReceiverDesc);
-                    return new ConstantCallSite(mh);
-                case MethodHandleInfo.REF_invokeInterface:
-                case MethodHandleInfo.REF_invokeVirtual:
-                    MethodType resType = MethodType.methodType(Object.class, Object[].class);
-                    MethodHandle res = caller.findVirtual(GenericMethodContext.class, "resolveMethod", resType);
-                    res = res.bindTo(this);
-                    res = res.asCollector(Object[].class, invokedType.parameterCount());
-                    res = res.asType(invokedType);
-                    return new ConstantCallSite(res);
-                default:
-                    throw new IllegalStateException("Bad kind: " + mhi.getReferenceKind());
-            }
-        }
-    }
-
-    static final ExecutorService logPool = Executors.newSingleThreadExecutor();
-    protected static void log(final String s) {
-        Future<?> f = logPool.submit(new Runnable() {
-            @Override
-            public void run() {
-                System.out.println(s);
-            }
-        });
-        try {
-            f.get();
-        }
-        catch (InterruptedException | ExecutionException ignored) { }
-    }
-
-    protected static void log(final String s, final Throwable e) {
-        Future<?> f = logPool.submit(new Runnable() {
-            @Override
-            public void run() {
-                System.out.println(s);
-                e.printStackTrace(System.out);
-            }
-        });
-        try {
-            f.get();
-        }
-        catch (InterruptedException | ExecutionException ignored) { }
-    }
-}
--- a/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java	Mon Apr 18 17:33:38 2016 +0100
@@ -159,12 +159,11 @@
                                        MethodType instantiatedMethodType,
                                        boolean isSerializable,
                                        Class<?>[] markerInterfaces,
-                                       MethodType[] additionalBridges,
-                                       Object[] bsmArgs)
+                                       MethodType[] additionalBridges)
             throws LambdaConversionException {
         super(caller, invokedType, samMethodName, samMethodType,
               implMethod, instantiatedMethodType,
-              isSerializable, markerInterfaces, additionalBridges, bsmArgs);
+              isSerializable, markerInterfaces, additionalBridges);
         implMethodClassName = implDefiningClass.getName().replace('.', '/');
         implMethodName = implInfo.getName();
         implMethodDesc = implMethodType.toMethodDescriptorString();
@@ -476,57 +475,22 @@
 
             convertArgumentTypes(methodType);
 
-            if (bsmArgs.length == 0) {
-                // Invoke the method we want to forward to
-                visitMethodInsn(invocationOpcode(), implMethodClassName,
-                        implMethodName, implMethodDesc,
-                        implDefiningClass.isInterface());
-            } else {
-                //indy
-                MethodType invokedType = (MethodType)bsmArgs[0];
-                Object[] staticArgs = new Object[bsmArgs.length - 1];
-                System.arraycopy(bsmArgs, 1, staticArgs, 0, staticArgs.length);
-                visitInvokeDynamicInsn(implMethodName, invokedType.toMethodDescriptorString(), methodSpecializerBSM, marshal(staticArgs));
-            }
+            // Invoke the method we want to forward to
+            visitMethodInsn(invocationOpcode(), implMethodClassName,
+                    implMethodName, implMethodDesc,
+                    implDefiningClass.isInterface());
 
             // Convert the return value (if any) and return it
             // Note: if adapting from non-void to void, the 'return'
             // instruction will pop the unneeded result
             Class<?> samReturnClass = methodType.returnType();
-            convertTypeIfNeeded(implMethodReturnClass, samReturnClass, samReturnClass);
+            convertType(implMethodReturnClass, samReturnClass, samReturnClass);
             visitInsn(getReturnOpcode(samReturnClass));
             // Maxs computed by ClassWriter.COMPUTE_MAXS,these arguments ignored
             visitMaxs(-1, -1);
             visitEnd();
         }
 
-        void convertTypeIfNeeded(Class<?> arg, Class<?> target, Class<?> functional) {
-            if (bsmArgs.length == 0) {
-                convertType(arg, target, functional);
-            }
-        }
-
-        Object[] marshal(Object[] args) {
-            for (int i = 0 ; i < args.length ; i++) {
-                args[i] = marshal(args[i]);
-            }
-            return args;
-        }
-
-        Object marshal(Object arg) {
-            if (arg instanceof MethodHandle) {
-                MethodHandleInfo mhi = MethodHandles.Lookup.IMPL_LOOKUP.revealDirect((MethodHandle)arg);
-                return new Handle(mhi.getReferenceKind(),
-                        mhi.getDeclaringClass().getName().replaceAll("\\.", "/"), mhi.getName(),
-                        mhi.getMethodType().toMethodDescriptorString());
-            } else if (arg instanceof MethodType) {
-                MethodType mt = (MethodType)arg;
-                return Type.getMethodType(mt.toMethodDescriptorString());
-            } else {
-                return arg;
-            }
-        }
-
         private void convertArgumentTypes(MethodType samType) {
             int lvIndex = 0;
             boolean samIncludesReceiver = implIsInstanceMethod &&
@@ -537,7 +501,7 @@
                 Class<?> rcvrType = samType.parameterType(0);
                 visitVarInsn(getLoadOpcode(rcvrType), lvIndex + 1);
                 lvIndex += getParameterSize(rcvrType);
-                convertTypeIfNeeded(rcvrType, implDefiningClass, instantiatedMethodType.parameterType(0));
+                convertType(rcvrType, implDefiningClass, instantiatedMethodType.parameterType(0));
             }
             int samParametersLength = samType.parameterCount();
             int argOffset = implMethodType.parameterCount() - samParametersLength;
@@ -545,7 +509,7 @@
                 Class<?> argType = samType.parameterType(i);
                 visitVarInsn(getLoadOpcode(argType), lvIndex + 1);
                 lvIndex += getParameterSize(argType);
-                convertTypeIfNeeded(argType, implMethodType.parameterType(argOffset + i), instantiatedMethodType.parameterType(i));
+                convertType(argType, implMethodType.parameterType(argOffset + i), instantiatedMethodType.parameterType(i));
             }
         }
 
--- a/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java	Mon Apr 18 17:33:38 2016 +0100
@@ -231,15 +231,8 @@
      */
     public static final int FLAG_BRIDGES = 1 << 2;
 
-    /**
-     * Flag for alternate metafactories indicating the lambda object requires
-     * indy bootstrap args
-     */
-    public static final int FLAG_INDY = 1 << 3;
-
     private static final Class<?>[] EMPTY_CLASS_ARRAY = new Class<?>[0];
     private static final MethodType[] EMPTY_MT_ARRAY = new MethodType[0];
-    private static final Object[] EMPTY_BSM_ARRAY = new Object[0];
 
     /**
      * Facilitates the creation of simple "function objects" that implement one
@@ -306,7 +299,7 @@
         mf = new InnerClassLambdaMetafactory(caller, invokedType,
                                              invokedName, samMethodType,
                                              implMethod, instantiatedMethodType,
-                                             false, EMPTY_CLASS_ARRAY, EMPTY_MT_ARRAY, EMPTY_BSM_ARRAY);
+                                             false, EMPTY_CLASS_ARRAY, EMPTY_MT_ARRAY);
         mf.validateMetafactoryArgs();
         return mf.buildCallSite();
     }
@@ -441,7 +434,6 @@
         int flags = (Integer) args[3];
         Class<?>[] markerInterfaces;
         MethodType[] bridges;
-        Object[] bsmArgs;
         int argIndex = 4;
         if ((flags & FLAG_MARKERS) != 0) {
             int markerCount = (Integer) args[argIndex++];
@@ -460,16 +452,6 @@
         else
             bridges = EMPTY_MT_ARRAY;
 
-        if ((flags & FLAG_INDY) != 0) {
-            //@@@: this won't be needed when alt specializable generic method translation is enabled by default
-            int bsmCount = (Integer) args[argIndex++];
-            bsmArgs = new Object[bsmCount];
-            System.arraycopy(args, argIndex, bsmArgs, 0, bsmCount);
-            argIndex += bsmCount;
-        }
-        else
-            bsmArgs = EMPTY_BSM_ARRAY;
-
         boolean isSerializable = ((flags & FLAG_SERIALIZABLE) != 0);
         if (isSerializable) {
             boolean foundSerializableSupertype = Serializable.class.isAssignableFrom(invokedType.returnType());
@@ -487,7 +469,7 @@
                                                   implMethod,
                                                   instantiatedMethodType,
                                                   isSerializable,
-                                                  markerInterfaces, bridges, bsmArgs);
+                                                  markerInterfaces, bridges);
         mf.validateMetafactoryArgs();
         return mf.buildCallSite();
     }
--- a/src/java.base/share/classes/java/net/URLClassLoader.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/src/java.base/share/classes/java/net/URLClassLoader.java	Mon Apr 18 17:33:38 2016 +0100
@@ -27,7 +27,6 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.Closeable;
-import java.io.DataInputStream;
 import java.io.File;
 import java.io.FilePermission;
 import java.io.IOException;
@@ -65,7 +64,6 @@
 import sun.security.util.SecurityConstants;
 import valhalla.model3.Model3Converter;
 import valhalla.model3.Model3Converter.ParameterizedType;
-import valhalla.specializer.SignatureSpecializer;
 
 /**
  * This class loader is used to load classes and resources from a search
@@ -444,36 +442,6 @@
                                 return null;
                         }
 
-                        // Now M1 style
-                        else if (shouldMangle && name.contains("${") && name.endsWith("}")) {
-                            String baseName = name.substring(0, name.indexOf("${"));
-                            String basePath = baseName.replace('.', '/').concat(".class");
-                            Resource baseRes = ucp.getResource(basePath);
-                            System.err.printf("Specializing %s; searching for %s (%s)%n", name, basePath, (baseRes == null) ? "not found" : "found");
-                            if (baseRes != null) {
-                                List<String> specs = SignatureSpecializer.extractSpecializationParams(name);
-                                byte[] input;
-                                byte[] mangled;
-                                try {
-                                    input = new byte[baseRes.getContentLength()];
-                                    try (DataInputStream dis = new DataInputStream(baseRes.getInputStream())) {
-                                        dis.readFully(input);
-                                    }
-                                    mangled = valhalla.specializer.Specializer.specialize(name.replace('.', '/'),
-                                                                                          new ByteArrayInputStream(input),
-                                                                                          specs, URLClassLoader.this);
-                                    if (dumper != null) {
-                                        dumper.dumpClass(name, mangled);
-                                    }
-
-                                    return defineClass(name, new ByteResource(baseRes, mangled));
-                                }
-                                catch (IOException e) {
-                                    throw new ClassNotFoundException("Error getting bytes", e);
-                                }
-                            }
-                        }
-
                         return null;
                     }
                 }, acc);
--- a/src/java.base/share/classes/valhalla/classdyn/ClassDynHelper.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/src/java.base/share/classes/valhalla/classdyn/ClassDynHelper.java	Mon Apr 18 17:33:38 2016 +0100
@@ -25,12 +25,8 @@
 package valhalla.classdyn;
 
 import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.lang.invoke.ProxyClassesDumper;
-import java.net.URL;
-import java.net.URLConnection;
 import java.security.AccessController;
 import java.security.PrivilegedExceptionAction;
 import java.util.List;
@@ -41,8 +37,6 @@
 import sun.misc.Unsafe;
 import sun.security.action.GetPropertyAction;
 import valhalla.model3.Model3Converter;
-import valhalla.specializer.SignatureSpecializer;
-import valhalla.specializer.Specializer;
 
 /**
  * Helper class for upcall from bootstrap classloader to specialize bootstrap classes
@@ -86,7 +80,7 @@
                                 Model3Converter.ParameterizedType pt = Model3Converter.ParameterizedType.decode(name);
                                 String baseName = pt.className;
                                 Resource baseRes = ucp.getResource(baseName.replace('.', '/').concat(".class"));
-                                Model3Converter.TemplateClass template = converter.find(baseName);
+                                Model3Converter.TemplateClass template;
                                 try {
                                     Class.forName(baseName.replace('/', '.'));
                                     template = converter.find(baseName);
@@ -108,32 +102,6 @@
                                     return null;
                             }
 
-                            // Now try M2 style
-                            if (name.contains("${") && name.endsWith("}")) {
-                                // @@@ Revisit when we get to inner classes; need to be careful with placement of ${...}
-                                String baseName = name.substring(0, name.indexOf("${"));
-                                String basePath = baseName.replace('.', '/').concat(".class");
-                                try {
-                                    byte[] bytes = getBootstrapResource(basePath);
-                                    if (bytes == null)
-                                        return null;
-
-                                    System.err.printf("Specializing %s (boot); searching for %s (%s)%n", name, basePath, (bytes == null) ? "not found" : "found");
-                                    List<String> specs = SignatureSpecializer.extractSpecializationParams(name);
-                                    byte[] mangled = Specializer.specialize(name.replace('.', '/'),
-                                                                            new ByteArrayInputStream(bytes),
-                                                                            specs, systemClassLoader);
-                                    if (dumper != null) {
-                                        dumper.dumpClass(name, mangled);
-                                    }
-
-                                    return Unsafe.getUnsafe().defineClass(name, mangled, 0, mangled.length, null, null);
-                                }
-                                catch (IOException e) {
-                                    throw new ClassNotFoundException("Error getting bytes", e);
-                                }
-                            }
-
                             return null;
                         }
                     });
--- a/src/java.base/share/classes/valhalla/classdyn/Mangler.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-package valhalla.classdyn;
-
-import jdk.internal.org.objectweb.asm.*;
-import jdk.internal.org.objectweb.asm.commons.Remapper;
-import jdk.internal.org.objectweb.asm.commons.RemappingClassAdapter;
-import valhalla.specializer.Specializer;
-
-import java.io.*;
-
-/**
- * Mangle compiler-generated class names into a format that is suitable for class dynamic processing.
- */
-public class Mangler {
-
-    public static void main(String[] args) throws IOException {
-        for (String inName : args)
-            mangleFile(new File(inName), new File("out"));
-    }
-
-    public static void mangleFile(File inFile, File outDir) throws IOException {
-        outDir.mkdir();
-        ClassReader cr = new ClassReader(new FileInputStream(inFile));
-        ClassWriter cw = new Specializer.SpecializerWriter();
-        ClassdynVisitor cd = new ClassdynVisitor(cw);
-        cr.accept(cd, null, ClassReader.SKIP_FRAMES);
-        File out = new File(outDir, cd.clazz + ".class");
-        out.getParentFile().mkdirs();
-        OutputStream os = new FileOutputStream(out);
-        os.write(cw.toByteArray());
-        os.close();
-    }
-
-    //Todo: what about BytecodeMapping (and others) attrs?
-    static class ClassdynVisitor extends RemappingClassAdapter {
-
-        String clazz;
-
-        public ClassdynVisitor(ClassVisitor cv) {
-            super(cv, new ClassdynRemapper());
-        }
-
-        @Override
-        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-            clazz = name;
-            super.visit(version, access, name, signature, superName, interfaces);
-        }
-    }
-
-    /**
-     * A mangler that turns javac-generated names into classdyn-ready names. The resulting mangled names are as follows:
-     * {@code PREFIX SEPARATOR BOOTSTRAP_CLASS SEPARATOR BASE_CLASS TYPE_ARG_1 TYPE_ARG_2 ... TYPE_ARG_N}
-     *
-     * Example: {@code Box${0=B,2=F} -> Dyn$valhalla_specializer_Specializer$(Box)(B)()(F)}
-     *
-     * Each of the above component can be customize by tweaking the corresponding method defined below.
-     * Note that any given type argument can be either a full argument (if it's specialized) or an 'hole' (i.e. missing,
-     * if it's a reference type-argument).
-     */
-    public static class ClassdynRemapper extends Remapper {
-        @Override
-        public String map(String type) {
-            if (type.contains("${")) {
-                String[] baseAndArgs = type.split("\\$\\{");
-                StringBuilder sb = new StringBuilder();
-                sb.append(prefix());
-                sb.append(sep());
-                sb.append(bootstrap());
-                sb.append(sep());
-                sb.append(formatType(baseAndArgs[0]));
-                String[] args = baseAndArgs[1].substring(0, baseAndArgs[1].length() - 1).split(",");
-                int cur = 0;
-                for (int i = 0 ; i < args.length ; i++) {
-                    String[] posAndType = args[i].split("=");
-                    int pos = Integer.parseInt(posAndType[0]);
-                    while (cur != pos) {
-                        //Todo: traling holes are a problem here since we don't know arity
-                        sb.append(formatMissingType());
-                        cur++;
-                    }
-                    sb.append(formatType(posAndType[1]));
-                    cur++;
-                }
-                return sb.toString();
-            } else {
-                return type;
-            }
-        }
-
-        /**
-         * Generate a separator sequence in the mangled name
-         */
-        protected String sep() {
-            return "$";
-        }
-
-        /**
-         * Generate a prefix sequence in the mangled name
-         */
-        protected String prefix() {
-            return "Dyn";
-        }
-
-        protected String bootstrap() {
-            return normalize("valhalla/specializer/Specializer");
-        }
-
-        /**
-         * Format type arguments in the resulting mangled name
-         */
-        protected String formatType(String s) {
-            return wrap(normalize(s));
-        }
-
-        /**
-         * Format missing type arguments (holes) in the resulting mangled name
-         */
-        protected String formatMissingType() {
-            return wrap("");
-        }
-
-        /**
-         * Normalize types in the resulting mangled names
-         */
-        protected String normalize(String s) {
-            return s.replaceAll("/", "_");
-        }
-
-        /**
-         * Wrap type arguments in the resulting mangled name
-         */
-        protected String wrap(String s) {
-            return "(" + s + ")";
-        }
-    }
-}
--- a/src/java.base/share/classes/valhalla/specializer/BridgeAttribute.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package valhalla.specializer;
-
-import java.util.Arrays;
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ByteVector;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Handle;
-import jdk.internal.org.objectweb.asm.Label;
-        
-/**
- * BridgeAttribute
- */
-public class BridgeAttribute extends Attribute {
-    
-    Handle bridged_method;
-    
-    private byte[] bytes;
-    
-    protected BridgeAttribute() {
-        super("Bridge");
-    }
-    
-    @Override
-    protected Attribute read(ClassReader reader,
-                             int offset,
-                             int len,
-                             char[] chars,
-                             int codeOff,
-                             Label[] labels) {
-        BridgeAttribute a = new BridgeAttribute();
-        a.bridged_method = (Handle)reader.readConst(reader.readShort(offset), chars);
-        a.bytes = Arrays.copyOfRange(reader.b, offset, offset + len);
-        return a;
-    }
-    
-    @Override
-    protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) {
-        ByteVector v = new ByteVector(bytes.length);
-        v.putByteArray(bytes, 0, bytes.length);
-        return v;
-    }
-    
-    public String toString() {
-        return String.format("Bridge[bridgedMethod=%s]", bridged_method);
-    }
-}
--- a/src/java.base/share/classes/valhalla/specializer/BytecodeMappingAttribute.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package valhalla.specializer;
-
-import java.lang.Override;import java.lang.String;import java.util.Arrays;
-
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ByteVector;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Label;
-
-/**
- * BytecodeMappingAttribute
- *
- * @author Brian Goetz
- */
-public class BytecodeMappingAttribute extends Attribute {
-    int[] offsets;
-    String[] signatures;
-    private byte[] bytes;
-
-    protected BytecodeMappingAttribute() {
-        super("BytecodeMapping");
-    }
-
-    @Override
-    protected Attribute read(ClassReader reader,
-                             int offset,
-                             int len,
-                             char[] chars,
-                             int codeOff,
-                             Label[] labels) {
-        BytecodeMappingAttribute a = new BytecodeMappingAttribute();
-        int count = reader.readShort(offset);
-        a.offsets = new int[count];
-        a.signatures = new String[count];
-        for (int i=0; i<count; i++) {
-            a.offsets[i] = reader.readShort(offset + 2 + 4*i);
-            a.signatures[i] = reader.readUTF8(offset + 2 + 4*i + 2, chars);
-        }
-        a.bytes = Arrays.copyOfRange(reader.b, offset, offset + len);
-        return a;
-    }
-
-    @Override
-    protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) {
-        ByteVector v = new ByteVector(bytes.length);
-        v.putByteArray(bytes, 0, bytes.length);
-        return v;
-    }
-
-    public String toString() {
-        return String.format("BytecodeMapping[offsets=%s, sigs=%s]",
-                             Arrays.toString(offsets), Arrays.toString(signatures));
-    }
-
-}
--- a/src/java.base/share/classes/valhalla/specializer/DebuggingSignatureVisitor.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package valhalla.specializer;
-
-import java.lang.Override;import java.lang.String;import java.lang.System;
-import java.util.HashMap;
-import java.util.Map;
-
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.internal.org.objectweb.asm.signature.SignatureReader;
-import jdk.internal.org.objectweb.asm.signature.SignatureVisitor;
-import jdk.internal.org.objectweb.asm.signature.SignatureWriter;
-import valhalla.specializer.SignatureSpecializer.SpecializedSignature;
-
-/**
- * DebuggingSignatureVisitor
- *
- * @author Brian Goetz
- */
-public class DebuggingSignatureVisitor extends SignatureVisitor {
-    SignatureWriter sw = new SignatureWriter();
-
-    public DebuggingSignatureVisitor() {
-        super(Opcodes.ASM5);
-    }
-
-    private void log(String method, String extra) {
-        System.out.printf("%s(%s):  [%s]%n", method, extra, sw.toString());
-    }
-
-    private void log(String method, char c) {
-        log(method, String.valueOf(c));
-    }
-
-    private void log(String method) {
-        log(method, "");
-    }
-
-    @Override
-    public void visitFormalTypeParameter(String s) {
-        log("visitFormalTypeParam ", s);
-        sw.visitFormalTypeParameter(s);
-    }
-
-    @Override
-    public SignatureVisitor visitClassBound() {
-        log("visitClassBound");
-        sw.visitClassBound();
-        return this;
-    }
-
-    @Override
-    public SignatureVisitor visitInterfaceBound() {
-        log("visitInterfaceBound");
-        sw.visitInterfaceBound();
-        return this;
-    }
-
-    @Override
-    public SignatureVisitor visitSuperclass() {
-        log("visitSuperclass");
-        sw.visitSuperclass();
-        return this;
-    }
-
-    @Override
-    public SignatureVisitor visitInterface() {
-        log("visitInterface");
-        sw.visitInterface();
-        return this;
-    }
-
-    @Override
-    public SignatureVisitor visitParameterType() {
-        log("visitParameterType");
-        sw.visitParameterType();
-        return this;
-    }
-
-    @Override
-    public SignatureVisitor visitReturnType() {
-        log("visitReturnType");
-        sw.visitReturnType();
-        return this;
-    }
-
-    @Override
-    public SignatureVisitor visitExceptionType() {
-        log("visitExceptionType");
-        sw.visitExceptionType();
-        return this;
-    }
-
-    @Override
-    public void visitBaseType(char c) {
-        log("visitBaseType ", c);
-        sw.visitBaseType(c);
-    }
-
-    @Override
-    public void visitTypeVariable(String s) {
-        log("visitTypeVariable ", s);
-        sw.visitTypeVariable(s);
-    }
-
-    @Override
-    public SignatureVisitor visitArrayType() {
-        log("visitArrayType");
-        sw.visitArrayType();
-        return this;
-    }
-
-    @Override
-    public void visitClassType(String s) {
-        log("visitClassType ", s);
-        sw.visitClassType(s);
-    }
-
-    @Override
-    public void visitInnerClassType(String s) {
-        log("visitInnerClassType ", s);
-        sw.visitInnerClassType(s);
-    }
-
-    @Override
-    public void visitTypeArgument() {
-        log("visitTypeArgument");
-        sw.visitTypeArgument();
-    }
-
-    @Override
-    public SignatureVisitor visitTypeArgument(char c) {
-        log("visitTypeArgument ", c);
-        sw.visitTypeArgument(c);
-        return this;
-    }
-
-    @Override
-    public void visitEnd() {
-        log("visitEnd");
-        sw.visitEnd();
-    }
-
-    public static void main(String[] args) {
-        SignatureReader r = new SignatureReader(args[0]);
-        r.accept(new DebuggingSignatureVisitor());
-
-        Map<String, String> tInt = new HashMap<>();
-        tInt.put("T", "I");
-        SpecializedSignature sp = new SpecializedSignature(args[0], tInt);
-        System.out.println(sp.toString());
-    }
-}
--- a/src/java.base/share/classes/valhalla/specializer/SignatureSpecializer.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,389 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package valhalla.specializer;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.internal.org.objectweb.asm.Type;
-import jdk.internal.org.objectweb.asm.signature.SignatureReader;
-import jdk.internal.org.objectweb.asm.signature.SignatureVisitor;
-import jdk.internal.org.objectweb.asm.signature.SignatureWriter;
-import valhalla.specializer.SignatureSpecializer.BoundInfo;
-
-/**
- * Takes a signature and substitutes specializations, then substitutes classes
- * with specialized type arguments for the corresponding mangled names.
- *
- * @author Brian Goetz
- */
-public class SignatureSpecializer {
-    static final SignatureVisitor NULL_SIGNATURE_VISITOR = new SignatureVisitor(Specializer.ASM_VER) {};
-    private static final Pattern specPattern = Pattern.compile("(\\d+)=([IJFDZBCS])");
-
-    /**
-     * Keeps track of typevar bound info, such as (i) descriptor associated with instantiated bound and
-     * (ii) as to whether a type substitution occurred in the instantiation process (see
-     * {@link valhalla.specializer.SignatureSpecializer.SpecializedSignature#anyChanges}).
-     */
-    public static class BoundInfo {
-
-        String instBound;
-        boolean anyChanges;
-
-        public BoundInfo(String boundSig, Map<String, String> specializations) {
-            SpecializedSignature ft = new SpecializedSignature(boundSig, specializations);
-            instBound = ft.toString();
-            anyChanges = ft.anyChanges;
-        }
-    }
-
-    public static String asClassName(String s) {
-        if (s.startsWith("L") && s.endsWith(";")) {
-            return s.substring(1, s.length() - 1);
-        } else if (s.startsWith("[")) {
-            return s;
-        } else {
-            throw new IllegalStateException(s);
-        }
-    }
-
-    public static String asBoxedClassName(String s) {
-        switch (s) {
-            case "B" : return "java/lang/Byte";
-            case "C" : return "java/lang/Character";
-            case "S" : return "java/lang/Short";
-            case "I" : return "java/lang/Integer";
-            case "J" : return "java/lang/Long";
-            case "F" : return "java/lang/Float";
-            case "D" : return "java/lang/Double";
-            case "Z" : return "java/lang/Boolean";
-            default:
-                throw new IllegalStateException(s);
-        }
-    }
-
-    public static String asUnboxMethodName(String s) {
-        switch (s) {
-            case "B" : return "byteValue";
-            case "C" : return "charValue";
-            case "S" : return "shortValue";
-            case "I" : return "intValue";
-            case "J" : return "longValue";
-            case "F" : return "floatValue";
-            case "D" : return "doubleValue";
-            case "Z" : return "booleanValue";
-            default:
-                throw new IllegalStateException(s);
-        }
-    }
-
-    public static List<String> extractTVars(String classSig) {
-        TVarExtractor extractor = new TVarExtractor();
-        new SignatureReader(classSig).accept(extractor);
-        return extractor.tVars;
-    }
-
-    public static String extractTVarName(String tvarSig) {
-        TVarSigToName tvarSigToName = new TVarSigToName();
-        new SignatureReader(tvarSig).accept(tvarSigToName);
-        return tvarSigToName.tvarName;
-    }
-
-    public static String extractBaseName(String className) {
-        return className.contains("${") && className.endsWith("}")
-               ? className.substring(0, className.indexOf("${"))
-               : className;
-    }
-
-    public static List<String> extractSpecializationParams(String className) {
-        List<String> result = new ArrayList<>();
-
-        if (className.contains("${") && className.endsWith("}")) {
-            String innards = className.substring(className.indexOf("${") + 2, className.length() - 1);
-            if (innards.length() > 0) {
-                String[] parts = innards.split(",");
-                for (String part : parts) {
-                    Matcher m = specPattern.matcher(part);
-                    if (m.matches()) {
-                        int num = Integer.valueOf(m.group(1));
-                        String type = m.group(2);
-                        while (result.size() < num)
-                            result.add(null);
-                        result.add(type);
-                    }
-                    else
-                        throw new IllegalStateException(String.format("error matching %s of %s", part, innards));
-                }
-            }
-        }
-
-        return result;
-    }
-
-    static class TVarExtractor extends SignatureVisitor {
-        List<String> tVars = new ArrayList<>();
-
-        TVarExtractor() {
-            super(Specializer.ASM_VER);
-        }
-
-        @Override
-        public void visitFormalTypeParameter(String name) {
-            tVars.add(name);
-        }
-    }
-
-    static class TVarSigToName extends SignatureVisitor {
-        String tvarName;
-
-        TVarSigToName() {
-            super(Specializer.ASM_VER);
-        }
-
-        @Override
-        public void visitTypeVariable(String name) {
-            tvarName = name;
-        }
-    }
-
-    public static class SpecializedSignature extends SignatureWriter {
-
-        boolean anyChanges = false;
-        Map<String, String> specializations;
-        private boolean skipFormal = false;
-
-        public SpecializedSignature(String sig, Map<String, String> specializations) {
-            this.specializations = specializations;
-            new SignatureReader(sig).accept(this);
-        }
-
-        public boolean isAnyChanges(Map<String, BoundInfo> bounds) {
-            if (anyChanges) {
-                //if a direct subst occurred, return true
-                return true;
-            } else {
-                //otherwise, look for all vars that have been left unspecialized; if any one of them required subst
-                //during bound instantiation, also return true.
-                for (Map.Entry<String, BoundInfo> e : bounds.entrySet()) {
-                    if (toString().contains(String.format("T%s;", e.getKey())) && e.getValue().anyChanges) {
-                        return true;
-                    }
-                }
-                return false;
-            }
-        }
-
-        @Override
-        public void visitTypeVariable(String s) {
-            String specialized = specializations.get(s);
-            if (specialized != null) {
-                //TODO: this doesn't work for values, which aren't 'baseType's
-                anyChanges = true;
-                super.visitBaseType(specialized.charAt(0));
-            } else {
-                super.visitTypeVariable(s);
-            }
-        }
-
-        @Override
-        public void visitFormalTypeParameter(String s) {
-            skipFormal = specializations.containsKey(s);
-            if (!skipFormal) {
-                super.visitFormalTypeParameter(s);
-            }
-        }
-
-        @Override
-        public SignatureVisitor visitClassBound() {
-            return skipFormal ?
-                    NULL_SIGNATURE_VISITOR :
-                    super.visitClassBound();
-        }
-
-        @Override
-        public SignatureVisitor visitInterfaceBound() {
-            return skipFormal ?
-                    NULL_SIGNATURE_VISITOR :
-                    super.visitInterfaceBound();
-        }
-
-        class SpecializedDescriptorWriter extends SignatureWriter {
-            Map<String, BoundInfo> bounds;
-            TypeArgAccumulator targAccumulator = new TypeArgAccumulator();
-
-            public SpecializedDescriptorWriter(Map<String, BoundInfo> bounds) {
-                this.bounds = bounds;
-            }
-
-            @Override
-            public void visitFormalTypeParameter(String s) {
-                //do nothing (skip all formal parameter decls)
-            }
-
-            @Override
-            public SignatureVisitor visitExceptionType() {
-                return NULL_SIGNATURE_VISITOR;
-            }
-
-            @Override
-            public SignatureVisitor visitClassBound() {
-                return NULL_SIGNATURE_VISITOR;
-            }
-
-            @Override
-            public SignatureVisitor visitInterfaceBound() {
-                return NULL_SIGNATURE_VISITOR;
-            }
-
-            @Override
-            public SignatureVisitor visitTypeArgument(char c) {
-                return targAccumulator;
-            }
-
-            @Override
-            public void visitTypeArgument() {
-                targAccumulator.visitTypeArgument();
-            }
-
-            @Override
-            public void visitTypeVariable(String s) {
-                BoundInfo bi = bounds.get(s);
-                if (bi == null) {
-                    throw new IllegalStateException("unerased tvar: " + s);
-                } else {
-                    SignatureReader r = new SignatureReader(bi.instBound);
-                    r.accept(this);
-                }
-            }
-
-            @Override
-            public void visitEnd() {
-                if (!targAccumulator.specializedArgs.isEmpty()) {
-                    String specializedArgs = targAccumulator.specializedArgs.entrySet().stream()
-                            .map(e -> String.format("%d=%s", e.getKey(), e.getValue()))
-                            .collect(Collectors.joining(",", "${", "}"));
-                    buf.append(specializedArgs);
-                }
-                super.visitEnd();
-                targAccumulator = new TypeArgAccumulator();
-            }
-
-            class TypeArgAccumulator extends SignatureVisitor {
-                Map<Integer, String> specializedArgs = new LinkedHashMap<>();
-                int index = 0;
-
-                public TypeArgAccumulator() {
-                    super(Opcodes.ASM5);
-                }
-
-                @Override
-                public void visitBaseType(char c) {
-                    specializedArgs.put(index++, String.valueOf(c));
-                }
-
-                @Override
-                public void visitTypeVariable(String s) {
-                    index++;
-                }
-
-                @Override
-                public SignatureVisitor visitArrayType() {
-                    index++;
-                    return NULL_SIGNATURE_VISITOR;
-                }
-
-                @Override
-                public void visitEnd() {
-                    index++;
-                }
-
-                @Override
-                public SignatureVisitor visitTypeArgument(char c) {
-                    return NULL_SIGNATURE_VISITOR;
-                }
-
-                @Override
-                public void visitTypeArgument() {
-                    index++;
-                }
-            }
-        }
-
-        public String toDesc(Map<String, BoundInfo> bounds) {
-            SpecializedDescriptorWriter descWriter = new SpecializedDescriptorWriter(bounds);
-            new SignatureReader(toString()).accept(descWriter);
-            return descWriter.toString().replaceAll("\\.", "\\$");
-        }
-
-        public String getDescAsClassName(Map<String, BoundInfo> bounds) {
-            return asClassName(toDesc(bounds));
-        }
-
-        public String getDescAsBoxedClassName(Map<String, BoundInfo> bounds) {
-            return asBoxedClassName(toDesc(bounds));
-        }
-
-        public String toSuperClassName(Map<String, BoundInfo> bounds) {
-            SpecializedDescriptorWriter descWriter = new SpecializedDescriptorWriter(bounds);
-            SignatureVisitor sv = new SignatureVisitor(Opcodes.ASM5) {
-                @Override
-                public SignatureVisitor visitSuperclass() {
-                    return descWriter;
-                }
-            };
-            new SignatureReader(toString()).accept(sv);
-            return asClassName(descWriter.toString().replaceAll("\\.", "\\$"));
-        }
-
-        public String[] toInterfaceNames(Map<String, BoundInfo> bounds) {
-            List<SpecializedDescriptorWriter> descWriters = new ArrayList<>();
-            SignatureVisitor sv = new SignatureVisitor(Opcodes.ASM5) {
-                @Override
-                public SignatureVisitor visitInterface() {
-                    SpecializedDescriptorWriter descWriter = new SpecializedDescriptorWriter(bounds);
-                    descWriters.add(descWriter);
-                    return descWriter;
-                }
-            };
-            new SignatureReader(toString()).accept(sv);
-            return descWriters.stream()
-                    .map(d -> asClassName(d.toString().replaceAll("\\.", "\\$")))
-                    .toArray(String[]::new);
-        }
-    }
-}
-
--- a/src/java.base/share/classes/valhalla/specializer/Specialize.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package valhalla.specializer;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.internal.org.objectweb.asm.signature.SignatureReader;
-import jdk.internal.org.objectweb.asm.signature.SignatureVisitor;
-
-import static java.util.stream.Collectors.toList;
-
-/**
- * Specialize
- *
- * @author Brian Goetz
- */
-public class Specialize {
-    private static String[] targets = { null, "I", "J", "B", "S", "C", "Z", "F", "D" };
-
-    private static File outDir = new File("out");
-
-    public static void main(String[] args) throws IOException {
-        for (int i=0; i<args.length; i++) {
-            if (args[i].equals("-o")) {
-                outDir = new File(args[++i]);
-                continue;
-            }
-
-            String c = args[i];
-            outDir.mkdirs();
-            specializeFile(new File(c), outDir);
-        }
-    }
-
-    public static void specializeFile(File inFile, File outDir) throws IOException {
-        NameAndSigVisitor visitor = NameAndSigVisitor.forFile(inFile);
-
-        if (visitor.classAnyVars.size() > 0) {
-            List<Map<String, String>> specMap = generateAllSpecializations(new ArrayList<>(visitor.classAnyVars));
-            for (Map<String, String> m : specMap) {
-                if (m.size() > 0) {
-                    String mangledClassName = visitor.mangledName(m);
-                    List<String> indexedSpecializations = visitor.classTVars.stream().map(m::get).collect(toList());
-                    File out = new File(outDir, mangledClassName + ".class");
-                    out.getParentFile().mkdirs();
-
-                    byte[] bytes = Specializer.specialize(mangledClassName, new FileInputStream(inFile), indexedSpecializations, Specializer.class.getClassLoader());
-                    OutputStream os = new FileOutputStream(out);
-                    os.write(bytes);
-                    os.close();
-                }
-            }
-        }
-    }
-
-    private static void specializeMethod(File inFile, File outDir, String methodName, String methodDesc) throws IOException {
-        outDir.mkdir();
-
-        NameAndSigVisitor visitor = NameAndSigVisitor.forMethod(inFile, methodName, methodDesc);
-        String baseClassName = visitor.className;
-
-        if (visitor.classAnyVars.size() > 0) {
-            List<Map<String, String>> specMap = generateAllSpecializations(new ArrayList<>(visitor.methodAnyVars));
-            for (Map<String, String> m : specMap) {
-                if (m.size() > 0) {
-                    String mangledClassName = visitor.mangledName(m);
-                    List<String> indexedSpecializations = visitor.methodTVars.stream().map(m::get).collect(toList());
-                    File out = new File(outDir, mangledClassName + ".class");
-                    out.getParentFile().mkdirs();
-
-                    byte[] bytes = Specializer.specializeMethod(baseClassName, methodName, methodDesc, new FileInputStream(inFile), Collections.emptyList(), indexedSpecializations, "", "");
-                    OutputStream os = new FileOutputStream(out);
-                    os.write(bytes);
-                    os.close();
-                }
-            }
-        }
-    }
-
-    static class NameAndSigVisitor extends ClassVisitor {
-        private String className;
-        private String methodName;
-        private String methodDesc;
-        private List<String> classTVars;
-        private List<String> classAnyVars = new ArrayList<>();
-        private List<String> methodTVars;
-        private List<String> methodAnyVars = new ArrayList<>();
-
-        public NameAndSigVisitor() {
-            super(Opcodes.ASM5);
-        }
-
-        public static NameAndSigVisitor forFile(File inFile) throws IOException {
-            NameAndSigVisitor visitor = new NameAndSigVisitor();
-            try (FileInputStream fis = new FileInputStream(inFile)) {
-                new ClassReader(fis)
-                        .accept(visitor,
-                                new Attribute[] {new TypeVariablesMapAttribute() },
-                                ClassReader.SKIP_FRAMES + ClassReader.SKIP_CODE);
-            }
-            return visitor;
-        }
-
-        public static NameAndSigVisitor forMethod(File inFile, String methodName, String methodDesc) throws IOException {
-            NameAndSigVisitor visitor = new NameAndSigVisitor();
-            visitor.methodName = methodName;
-            visitor.methodDesc = methodDesc;
-            try (FileInputStream fis = new FileInputStream(inFile)) {
-                new ClassReader(fis)
-                        .accept(visitor,
-                                new Attribute[] {new TypeVariablesMapAttribute() },
-                                ClassReader.SKIP_FRAMES + ClassReader.SKIP_CODE);
-            }
-            return visitor;
-        }
-
-        String mangledName(Map<String, String> specializations) {
-            boolean first = true;
-            StringBuilder sb = new StringBuilder(className);
-            sb.append("${");
-            for (int varIdx=0; varIdx< classTVars.size(); varIdx++) {
-                String var = classTVars.get(varIdx);
-                if (!classAnyVars.contains(var) || !specializations.containsKey(var))
-                    continue;
-                if (!first)
-                    sb.append(",");
-                first = false;
-                sb.append(varIdx);
-                sb.append("=");
-                sb.append(specializations.get(var));
-            }
-            sb.append("}");
-
-            return sb.toString();
-        }
-
-        @Override
-        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-            className = name;
-            classTVars = tVars(signature);
-        }
-
-        @Override
-        public void visitAttribute(Attribute attr) {
-            if (attr instanceof TypeVariablesMapAttribute) {
-                TypeVariablesMapAttribute tvm = (TypeVariablesMapAttribute) attr;
-                tvm.entries[0].bitSet.stream().forEach(i -> classAnyVars.add(classTVars.get(i)));
-            }
-        }
-
-        @Override
-        public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
-            if (name.equals(methodName) && desc.equals(methodDesc)) {
-                methodTVars = tVars(signature);
-                return new MethodVisitor(Opcodes.ASM5) {
-                    @Override
-                    public void visitAttribute(Attribute attr) {
-                        if (attr instanceof TypeVariablesMapAttribute) {
-                            TypeVariablesMapAttribute tvm = (TypeVariablesMapAttribute) attr;
-                            tvm.entries[0].bitSet.stream().forEach(i -> methodAnyVars.add(methodTVars.get(i)));
-                        }
-                    }
-                };
-            }
-            else
-                return null;
-        }
-    }
-
-    private static List<String> tVars(String sig) {
-        if (sig == null)
-            return Collections.emptyList();
-        List<String> list = new ArrayList<>();
-        new SignatureReader(sig).accept(
-                new SignatureVisitor(Opcodes.ASM5) {
-                    @Override
-                    public void visitFormalTypeParameter(String s) {
-                        list.add(s);
-                    }
-                });
-        return list;
-    }
-
-    static List<Map<String, String>> generateAllSpecializations(List<String> tVars) {
-        if (tVars.size() == 0)
-            return Collections.emptyList();
-        else if (tVars.size() == 1) {
-            String var = tVars.get(0);
-            ArrayList<Map<String, String>> res = new ArrayList<>();
-            for (String c : targets) {
-                HashMap<String, String> m = new HashMap<>();
-                if (c != null)
-                    m.put(var, c);
-                res.add(m);
-            }
-            return res;
-        }
-        else {
-            String var = tVars.get(0);
-            ArrayList<Map<String, String>> res = new ArrayList<>();
-            List<String> cdr = new ArrayList<>(tVars);
-            cdr.remove(0);
-            List<Map<String, String>> next = generateAllSpecializations(cdr);
-            for (String c : targets) {
-                for (Map<String, String> m : next) {
-                    HashMap<String, String> mm = new HashMap<>(m);
-                    if (c != null)
-                        mm.put(var, c);
-                    res.add(mm);
-                }
-            }
-            return res;
-        }
-    }
-
-}
--- a/src/java.base/share/classes/valhalla/specializer/Specializer.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1108 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package valhalla.specializer;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.invoke.CallSite;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodType;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassVisitor;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.FieldVisitor;
-import jdk.internal.org.objectweb.asm.Handle;
-import jdk.internal.org.objectweb.asm.Label;
-import jdk.internal.org.objectweb.asm.MethodVisitor;
-import jdk.internal.org.objectweb.asm.Opcodes;
-import jdk.internal.org.objectweb.asm.Type;
-
-import valhalla.specializer.SignatureSpecializer.BoundInfo;
-
-import valhalla.specializer.SignatureSpecializer.BoundInfo;
-import valhalla.specializer.SignatureSpecializer.SpecializedSignature;
-
-import static jdk.internal.org.objectweb.asm.Opcodes.ACC_INTERFACE;
-import static jdk.internal.org.objectweb.asm.Opcodes.ALOAD;
-import static jdk.internal.org.objectweb.asm.Opcodes.IRETURN;
-
-/**
- * Specializer
- *
- * @author Brian Goetz
- */
-public class Specializer {
-    static final int OPCODE_ADJ = (Opcodes.ALOAD - Opcodes.ILOAD);
-    static final int ASM_VER = Opcodes.ASM5;
-    static final Attribute[] ATTRIBUTE_PROTOS = new Attribute[] {
-            new TypeVariablesMapAttribute(),
-            new BytecodeMappingAttribute(),
-            new WhereAttribute(),
-            new BridgeAttribute(),
-            new SpecializerSignature()
-    };
-
-    static final Handle methodSpecializerBSM
-            = new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/GenericMethodSpecializer", "metafactory",
-                         MethodType.methodType(CallSite.class,
-                                               MethodHandles.Lookup.class,
-                                               String.class,
-                                               MethodType.class,
-                                               Object[].class).toMethodDescriptorString());
-
-    public static class SpecializerWriter extends ClassWriter {
-        public SpecializerWriter() {
-            super(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);
-        }
-
-        @Override
-        protected String getCommonSuperClass(String type1, String type2) {
-            try {
-                return super.getCommonSuperClass(type1, type2);
-            } catch (RuntimeException | LinkageError ex) {
-                // @@@: avoid recursive dependencies on specializer
-                return "java/lang/Object";
-            }
-        }
-    }
-
-    public static byte[] specialize(String mangledClassName,
-                                    InputStream input,
-                                    List<String> specializations,
-                                    ClassLoader cl) throws IOException {
-        byte[] byte_arr = toByteArray(input);
-        ClassReader cr = new ClassReader(byte_arr);
-        NameAndSigVisitor nameAndSig = new NameAndSigVisitor();
-        cr.accept(nameAndSig, ATTRIBUTE_PROTOS, ClassReader.SKIP_FRAMES);
-
-        cr = new ClassReader(byte_arr);
-        ClassWriter cw = new SpecializerWriter();
-        cr.accept(new ManglingAdapter(cr, cw, mangledClassName, specializations, nameAndSig, cl),
-                  ATTRIBUTE_PROTOS, ClassReader.SKIP_FRAMES);
-
-        return cw.toByteArray();
-    }
-    //where
-        public static byte[] toByteArray(InputStream is) throws IOException {
-            byte[] buffer = new byte[8192];
-            ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
-            int n;
-            while ((n = is.read(buffer)) != -1) {
-                baos.write(buffer, 0, n);
-            }
-            return baos.toByteArray();
-        }
-
-    public static byte[] specializeMethod(String mangledClassName,
-                                          String methodName,
-                                          String methodDesc,
-                                          InputStream input,
-                                          List<String> classSpecializations,
-                                          List<String> methodSpecializations,
-                                          String instantiatedReceiver,
-                                          String instantiatedMethodDesc) throws IOException {
-        System.out.printf("Specializing method %s.%s%s with class=%s and method=%s%n", mangledClassName, methodName, methodDesc, classSpecializations, methodSpecializations);
-        ClassReader cr = new ClassReader(input);
-        // Pre-visit base class, extract method+BMA, method TVMA, class TVMA into temporary structure ?
-        while (true) {
-            ClassWriter cw = new SpecializerWriter();
-            MethodManglingAdapter visitor = new MethodManglingAdapter(cr, cw, mangledClassName,
-                                                                      methodName, methodDesc,
-                                                                      classSpecializations, methodSpecializations,
-                                                                      instantiatedReceiver, instantiatedMethodDesc);
-            cr.accept(visitor, ATTRIBUTE_PROTOS, ClassReader.SKIP_FRAMES);
-            if (visitor.bridgeAttr != null) {
-                byte[] bytes = cr.b;
-                cr = new ClassReader(bytes);
-                // @@@ Doesn't deal with case where bridge is outside of the class!
-                methodName = visitor.bridgeAttr.bridged_method.getName();
-                methodDesc = visitor.bridgeAttr.bridged_method.getDesc();
-                continue;
-            }
-
-            return cw.toByteArray();
-        }
-    }
-
-    private static class MethodManglingAdapter extends ClassVisitor {
-        protected final ClassReader cr;
-        private final String mangledClassName;
-        private final String targetMethodName;
-        private final String targetMethodDesc;
-        private final String instantiatedReceiver;
-        private final String instantiatedMethodDesc;
-        private final List<String> indexedClassSpecializations;   // passed in
-        private final List<String> indexedMethodSpecializations;  // passed in
-        private final Map<String, String> methodSpecializations;  // filled in during initial visit
-
-        private final List<String> methodAnyVars = new ArrayList<>();
-        private TypeVariablesMapAttribute tvma;
-        private BridgeAttribute bridgeAttr;
-        private SpecializerSignature specializerSig;
-        private List<String> methodTVars;
-        private Map<String, BoundInfo> bounds = new HashMap<>();
-
-        public MethodManglingAdapter(ClassReader cr,
-                                     ClassWriter cw,
-                                     String mangledClassName,
-                                     String methodName,
-                                     String methodDesc,
-                                     List<String> classSpecializations,
-                                     List<String> methodSpecializations,
-                                     String instantiatedReceiver,
-                                     String instantiatedMethodDesc) {
-            super(ASM_VER, cw);
-            this.mangledClassName = mangledClassName;
-            this.targetMethodName = methodName;
-            this.targetMethodDesc = methodDesc;
-            this.instantiatedReceiver = instantiatedReceiver;
-            this.instantiatedMethodDesc = instantiatedMethodDesc;
-            this.indexedMethodSpecializations = methodSpecializations;
-            this.indexedClassSpecializations = classSpecializations;
-            this.methodSpecializations = new HashMap<>();
-            this.cr = cr;
-        }
-
-        @Override
-        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-            // System.out.printf("Class: %s, sig=%s, searching for %s %s%n", name, signature, targetMethodName, targetMethodDesc);
-            if (signature != null) {
-                List<String> tVars = SignatureSpecializer.extractTVars(signature);
-                for (int i = 0; i < tVars.size(); i++) {
-                    String spec = (i < indexedClassSpecializations.size()) ? indexedClassSpecializations.get(i) : null;
-                    if (spec != null && !spec.isEmpty())
-                        methodSpecializations.put(tVars.get(i), spec);
-                }
-            }
-            super.visit(version, access, mangledClassName, null, "java/lang/Object", null);
-        }
-
-        @Override
-        public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
-            // Strip all fields
-            return null;
-        }
-
-        @Override
-        public void visitInnerClass(String name, String outerName, String innerName, int access) {
-            // Strip IC attribute
-        }
-
-        @Override
-        public void visitOuterClass(String owner, String name, String desc) {
-            // Strip OC attribute
-        }
-
-        @Override
-        public void visitAttribute(Attribute attr) {
-            // Strip all class attributes
-        }
-
-        @Override
-        public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
-            // Strip all methods that are not the target method
-            if (!name.equals(targetMethodName) || !desc.equals(targetMethodDesc))
-                return null;
-
-            // Pre-visit to pick up TVMA and bridge attribute
-            preVisitMethod();
-
-            if ((access & Opcodes.ACC_BRIDGE) != 0) {
-//                System.out.printf("Found bridge method: %s%s -> %s%n", name, desc, bridgeAttr);
-                return null;
-            }
-
-            if (specializerSig != null) {
-                signature = specializerSig.signature;
-            }
-
-            methodTVars = SignatureSpecializer.extractTVars(signature);
-            for (int i = 0; i < methodTVars.size(); i++) {
-                String spec = (i < indexedMethodSpecializations.size()) ? indexedMethodSpecializations.get(i) : null;
-                if (spec != null && !spec.isEmpty()) {
-                    // If the specialization is Tx;, then that means we inherit a class tvar without specialization, so we ignore it
-                    if (!spec.startsWith("T"))
-                        methodSpecializations.put(methodTVars.get(i), spec);
-                }
-            }
-
-            // Add in erasures for all known tVars
-            if (tvma != null) {
-                for (TypeVariablesMapAttribute.Entry e : tvma.entries) {
-                    for (int i=0; i<e.nVars; i++)
-                        bounds.putIfAbsent(e.names[i], new BoundInfo(e.bounds[i], methodSpecializations));
-                }
-            }
-
-            // For instance methods, remap to static with receiver
-            if ((access & Opcodes.ACC_STATIC) == 0) {
-                access |= Opcodes.ACC_STATIC;
-                int index = signature.indexOf('(');
-                signature = signature.substring(0, index+1) + instantiatedReceiver + signature.substring(index + 1);
-                index = desc.indexOf('(');
-                desc = desc.substring(0, index+1) + instantiatedReceiver + desc.substring(index + 1);
-            }
-
-            // Adjust method sig to remove specialized tvars
-            SpecializedSignature v = new SpecializedSignature(signature, methodSpecializations);
-            signature = v.toString();
-
-            return new ManglingMethodVisitor(super.visitMethod(access, name, instantiatedMethodDesc, signature, exceptions),
-                                             cr, methodTVars, methodSpecializations, bounds);
-        }
-
-        private void preVisitMethod() {
-            cr.revisitCurrentMethod(new MethodVisitor(ASM_VER) {
-                @Override
-                public void visitAttribute(Attribute attr) {
-                    if (attr instanceof TypeVariablesMapAttribute)
-                        tvma = (TypeVariablesMapAttribute) attr;
-                    else if (attr instanceof BridgeAttribute)
-                        bridgeAttr = (BridgeAttribute) attr;
-                    else if (attr instanceof SpecializerSignature) {
-                        specializerSig = (SpecializerSignature)attr;
-                    }
-                }
-            }, ATTRIBUTE_PROTOS, ClassReader.SKIP_FRAMES);
-        }
-    }
-
-    public static InputStream getStreamForClass(String classname, ClassLoader cl) {
-        String classfile = classname.replace('.', '/').concat(".class");
-        return (cl != null) ?
-                cl.getResourceAsStream(classfile) :
-                ClassLoader.getSystemResourceAsStream(classfile);
-    }
-
-    public static class NameAndSigVisitor extends ClassVisitor {
-        protected List<String> classTVars;
-        protected List<String> classAnyVars = new ArrayList<>();
-
-        public NameAndSigVisitor() {
-            super(Opcodes.ASM5);
-        }
-
-        @Override
-        public void visitAttribute(Attribute attr) {
-            if (attr instanceof TypeVariablesMapAttribute) {
-                TypeVariablesMapAttribute tvm = (TypeVariablesMapAttribute) attr;
-                classTVars = new ArrayList<>();
-                int offset = 0;
-                for (int i = tvm.entries.length - 1; i >= 0; i--) {
-                    TypeVariablesMapAttribute.Entry entry = tvm.entries[i];
-                    int offsetFinal = offset;
-                    Stream.of(entry.names).forEach(classTVars::add);
-                    entry.bitSet.stream().forEach(i2 -> classAnyVars.add(classTVars.get(i2 + offsetFinal)));
-                    offset += classTVars.size();
-                }
-            }
-        }
-    }
-
-    public static class MethodExtractorVisitor extends ClassVisitor {
-        Map<String, String> methodDescriptors = new HashMap<>();
-
-        public MethodExtractorVisitor() {
-            super(Opcodes.ASM5);
-        }
-
-        public static MethodExtractorVisitor forClass(String classname, ClassLoader cl) throws IOException {
-            MethodExtractorVisitor visitor = new MethodExtractorVisitor();
-            if (classname != null) {
-                String classfile = classname.replace('.', '/').concat(".class");
-                InputStream is = null;
-                if (cl != null) {
-                    is = cl.getResourceAsStream(classfile);
-                }
-                if (is == null) {
-                    //try with system classloader
-                    is = ClassLoader.getSystemResourceAsStream(classfile);
-                }
-                new ClassReader(is)
-                        .accept(visitor, ClassReader.SKIP_FRAMES + ClassReader.SKIP_CODE);
-            }
-            return visitor;
-        }
-
-        @Override
-        public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
-            methodDescriptors.put(name, desc);
-            return super.visitMethod(access, name, desc, signature, exceptions);
-        }
-    }
-
-    private static class ManglingAdapter extends ClassVisitor {
-        protected final ClassReader cr;
-        private final String mangledClassName;
-        private final List<String> indexedSpecializations;    // passed in
-        protected final Map<String, String> specializations;  // filled in during initial visit
-        private String baseClassName;
-        private ClassLoader cl;
-        private Map<String, String> virtualMethods;
-        NameAndSigVisitor nameAndSig;
-        
-        private List<String> tVars;
-        private List<String> anyVars;
-        private final Map<String, BoundInfo> bounds = new HashMap<>();
-
-        Map<String, String> mangledFields = new HashMap<>();
-
-        /**
-         * regex for matching template method names
-         */
-        public static Pattern templateMatcher = Pattern.compile("^(template)(\\$+)(.*)");
-
-        public ManglingAdapter(ClassReader cr,
-                               ClassWriter cw,
-                               String mangledClassName,
-                               List<String> indexedSpecializations,
-                               NameAndSigVisitor nameAndSig,
-                               ClassLoader cl) {
-            super(ASM_VER, cw);
-            this.cr = cr;
-            this.indexedSpecializations = indexedSpecializations;
-            this.specializations = new HashMap<>();
-            this.mangledClassName = mangledClassName;
-            this.nameAndSig = nameAndSig;
-            this.cl = cl;
-        }
-
-        @Override
-        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-            baseClassName = name;
-            String virtualIntf = null;
-            for (String intf : interfaces) {
-                if (intf.endsWith("$any")) {
-                    virtualIntf = intf;
-                    break;
-                }
-            }
-
-            try {
-                virtualMethods = MethodExtractorVisitor.forClass(virtualIntf, cl).methodDescriptors;
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-
-            // Need to make a pass on the signature first to extract tVars
-            tVars = nameAndSig.classTVars;
-            anyVars = nameAndSig.classAnyVars;
-            for (int i = 0; i < tVars.size(); i++) {
-                String spec = (i < indexedSpecializations.size()) ? indexedSpecializations.get(i) : null;
-                if (spec != null && !spec.isEmpty())
-                    specializations.put(tVars.get(i), spec);
-            }
-
-            if (signature != null) {
-                // Now we can actually specialize it
-                SpecializedSignature v = new SpecializedSignature(signature, specializations);
-                signature = v.toString();
-                if (v.isAnyChanges(bounds)) {
-                    superName = v.toSuperClassName(bounds);
-                    interfaces = v.toInterfaceNames(bounds);
-                }
-            }
-            super.visit(version, access, mangledClassName, signature, superName, interfaces);
-        }
-
-        @Override
-        public void visitAttribute(Attribute attr) {
-            if (attr instanceof TypeVariablesMapAttribute) {
-                TypeVariablesMapAttribute tvma = (TypeVariablesMapAttribute) attr;
-                for (TypeVariablesMapAttribute.Entry e : tvma.entries) {
-                    for (int i = 0; i < e.nVars; i++)
-                        bounds.putIfAbsent(e.names[i], new BoundInfo(e.bounds[i], specializations));
-                }
-
-                for (String s : specializations.keySet())
-                    if (!anyVars.contains(s))
-                        throw new IllegalStateException(String.format("Type variable %s is not an any-variable", s));
-            } else {
-                super.visitAttribute(attr);
-            }
-        }
-
-        @Override
-        public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
-            // Strip static fields
-            if ((access & Opcodes.ACC_STATIC) != 0)
-                return null;
-
-            FieldAttributeExtractor attrs = new FieldAttributeExtractor();
-            cr.revisitCurrentField(attrs, ATTRIBUTE_PROTOS, ClassReader.SKIP_FRAMES + ClassReader.SKIP_DEBUG);
-
-            if (attrs.specializerSignature != null) {
-                signature = attrs.specializerSignature;
-            }
-
-            if (signature != null) {
-                SpecializedSignature v = new SpecializedSignature(signature, specializations);
-                if (v.isAnyChanges(bounds)) {
-                    signature = v.toString();
-                    desc = v.toDesc(bounds);
-                    mangledFields.put(name, desc);
-                }
-            }
-            return super.visitField(access, name, desc, signature, value);
-        }
-
-        @Override
-        public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
-            // Strip nonsynthetic static methods
-            if ((access & Opcodes.ACC_STATIC) != 0 && (access & Opcodes.ACC_SYNTHETIC) == 0)
-                return null;
-
-            MethodAttributeExtractor attrs = new MethodAttributeExtractor();
-            cr.revisitCurrentMethod(attrs, ATTRIBUTE_PROTOS, ClassReader.SKIP_FRAMES + ClassReader.SKIP_DEBUG);
-
-            if (attrs.specializerSignature != null) {
-                signature = attrs.specializerSignature;
-            }
-
-            // is given method compatible with its where clauses?
-            if (attrs.whereClauses != null) {
-                for (Map.Entry<String, Character> whereClause : attrs.whereClauses.entrySet()) {
-                    String tvarName = whereClause.getKey();
-                    char code = whereClause.getValue();
-                    String spec = specializations.get(tvarName);
-                    if ((spec == null) ? code == 'Q' : code == 'L') {
-                        //specialization doesn't match where clause constraint;
-                        //skip the method.
-                        return null;
-                    }
-                }
-                name = baseName(name);
-            }
-
-            // Rename constructors
-            if (name.equals(baseClassName))
-                name = mangledClassName;
-
-            // Add in erasures for all known tVars
-            Map<String, BoundInfo> classAndMethodErasures = bounds;
-            if (attrs.typeVariablesMapAttribute != null) {
-                classAndMethodErasures = new HashMap<>(bounds);
-                for (TypeVariablesMapAttribute.Entry e : attrs.typeVariablesMapAttribute.entries) {
-                    for (int i = 0; i < e.nVars; i++)
-                        classAndMethodErasures.putIfAbsent(e.names[i], new BoundInfo(e.bounds[i], specializations));
-                }
-            }
-
-            String instDesc = desc;
-            // Adjust signature and descriptor
-            if (signature != null) {
-                SpecializedSignature v = new SpecializedSignature(signature, specializations);
-                if (v.isAnyChanges(classAndMethodErasures)) {
-                    signature = v.toString();
-                    instDesc = v.toDesc(classAndMethodErasures);
-                    String virtualSig = virtualMethods.get(name);
-                    if (virtualSig != null &&
-                            !virtualSig.equals(instDesc) &&
-                            virtualSig.equals(desc)) {
-                        if (name.endsWith("$get")) {
-                            createGetter(name, desc, instDesc);
-                        } else if (name.endsWith("$set")) {
-                            createSetter(name, desc, instDesc);
-                        } else {
-                            bridgeVirtualMethod(name, virtualSig, instDesc);
-                        }
-                    }
-                }
-            }
-
-
-            return new ManglingMethodVisitor(super.visitMethod(access, name, instDesc, signature, exceptions),
-                    cr, specializations, classAndMethodErasures);
-        }
-
-        public String baseName(String name) {
-            Matcher nameMatcher = templateMatcher.matcher(name);
-            return nameMatcher.matches() ? nameMatcher.group(3) : name;
-        }
-
-        private void createSetter(String methodName, String erasedSig, String specializedSig) {
-            String specializedType = Type.getArgumentTypes(specializedSig)[0].getDescriptor();
-            String boxedType = SignatureSpecializer.asBoxedClassName(specializedType);
-            String propertyName = methodName.split("\\$set")[0];
-            MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC, methodName, erasedSig, null, null);
-            mv.visitVarInsn(Opcodes.ALOAD, 0);
-            mv.visitVarInsn(Opcodes.ALOAD, 1);
-            mv.visitTypeInsn(Opcodes.CHECKCAST, boxedType);
-            mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, boxedType, SignatureSpecializer.asUnboxMethodName(specializedType), "()" + specializedType, false);
-            mv.visitFieldInsn(Opcodes.PUTFIELD, mangledClassName, propertyName, specializedType);
-            mv.visitVarInsn(Opcodes.ALOAD, 1);
-            mv.visitInsn(Opcodes.ARETURN);
-            mv.visitMaxs(0, 0);
-        }
-
-        private void createGetter(String methodName, String erasedSig, String specializedSig) {
-            String specializedType = Type.getReturnType(specializedSig).getDescriptor();
-            String boxedType = SignatureSpecializer.asBoxedClassName(specializedType);
-            String propertyName = methodName.split("\\$get")[0];
-            MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC, methodName, erasedSig, null, null);
-            mv.visitVarInsn(Opcodes.ALOAD, 0);
-            mv.visitFieldInsn(Opcodes.GETFIELD, mangledClassName, propertyName, specializedType);
-            mv.visitMethodInsn(Opcodes.INVOKESTATIC, boxedType, "valueOf", "(" + specializedType + ")L" + boxedType + ";", false);
-            mv.visitInsn(Opcodes.ARETURN);
-            mv.visitMaxs(0, 0);
-        }
-
-        private void bridgeVirtualMethod(String methodName, String boxedDesc, String instDesc) {
-
-            MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC, methodName, boxedDesc, null, null);
-
-            Type[] fromArgTypes = Type.getArgumentTypes(boxedDesc);
-            Type[] toArgTypes = Type.getArgumentTypes(instDesc);
-            Type fromRetType = Type.getReturnType(boxedDesc);
-            Type toRetType = Type.getReturnType(instDesc);
-
-            mv.visitVarInsn(ALOAD, 0);
-
-            for (int i = 0; i < fromArgTypes.length ; i++) {
-                Type from = fromArgTypes[i];
-                Type to = toArgTypes[i];
-                mv.visitVarInsn(from.getOpcode(Opcodes.ILOAD), i + 1);
-                if (!from.equals(to)) {
-                    String specializedDesc = to.getDescriptor();
-                    if (to.getDescriptor().length() == 1) {
-                        //primitive specialized argument
-                        String boxedClass = SignatureSpecializer.asBoxedClassName(specializedDesc);
-                        mv.visitTypeInsn(Opcodes.CHECKCAST, boxedClass);
-                        mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
-                                boxedClass,
-                                SignatureSpecializer.asUnboxMethodName(specializedDesc), "()" + specializedDesc, false);
-                    } else {
-                        mv.visitTypeInsn(Opcodes.CHECKCAST, SignatureSpecializer.asClassName(to.getDescriptor()));
-                    }
-                }
-            }
-
-            // Invoke the method we want to forward to
-            mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, mangledClassName,
-                    methodName, instDesc,
-                    false);
-
-            // Convert the return value (if any) and return it
-            if (!fromRetType.equals(toRetType) && toRetType.getDescriptor().length() == 1) {
-                //primitive specialized return
-                String specializedDesc = toRetType.getDescriptor();
-                String boxedClass = SignatureSpecializer.asBoxedClassName(specializedDesc);
-                mv.visitMethodInsn(Opcodes.INVOKESTATIC,
-                        boxedClass, "valueOf", "(" + specializedDesc + ")L" + boxedClass + ";", false);
-            }
-            mv.visitInsn(fromRetType.getOpcode(IRETURN));
-            // Maxs computed by ClassWriter.COMPUTE_MAXS,these arguments ignored
-            mv.visitMaxs(-1, -1);
-            mv.visitEnd();
-        }
-    }
-
-    private static class MethodAttributeExtractor extends MethodVisitor {
-
-        Map<String, Character> whereClauses;
-        TypeVariablesMapAttribute typeVariablesMapAttribute;
-        String specializerSignature;
-
-        public MethodAttributeExtractor() {
-            super(ASM_VER);
-        }
-
-        @Override
-        public void visitAttribute(Attribute attr) {
-            if (attr instanceof WhereAttribute) {
-                WhereAttribute whereAttr = (WhereAttribute) attr;
-                whereClauses = new HashMap<>();
-                for (int i = 0; i < whereAttr.codes.length; i++) {
-                    String tvarName = SignatureSpecializer.extractTVarName(whereAttr.tvarNames[i]);
-                    char code = whereAttr.codes[i];
-                    whereClauses.put(tvarName, code);
-                }
-            } else if (attr instanceof TypeVariablesMapAttribute) {
-                typeVariablesMapAttribute = (TypeVariablesMapAttribute) attr;
-            } else if (attr instanceof SpecializerSignature) {
-                specializerSignature = ((SpecializerSignature)attr).signature;
-            } else {
-                super.visitAttribute(attr);
-            }
-        }
-    }
-
-    private static class FieldAttributeExtractor extends FieldVisitor {
-
-        Map<String, Character> whereClauses;
-        TypeVariablesMapAttribute typeVariablesMapAttribute;
-        String specializerSignature;
-
-        public FieldAttributeExtractor() {
-            super(ASM_VER);
-        }
-
-        @Override
-        public void visitAttribute(Attribute attr) {
-            if (attr instanceof WhereAttribute) {
-                WhereAttribute whereAttr = (WhereAttribute) attr;
-                whereClauses = new HashMap<>();
-                for (int i = 0; i < whereAttr.codes.length; i++) {
-                    String tvarName = SignatureSpecializer.extractTVarName(whereAttr.tvarNames[i]);
-                    char code = whereAttr.codes[i];
-                    whereClauses.put(tvarName, code);
-                }
-            } else if (attr instanceof TypeVariablesMapAttribute) {
-                typeVariablesMapAttribute = (TypeVariablesMapAttribute) attr;
-            } else if (attr instanceof SpecializerSignature) {
-                specializerSignature = ((SpecializerSignature)attr).signature;
-            } else {
-                super.visitAttribute(attr);
-            }
-        }
-    }
-
-    private static class ManglingMethodVisitor extends MethodVisitor {
-        final boolean manglingGenericMethod;
-        final ClassReader classReader;
-        final List<String> methodTVars;
-        final Map<String, String> specializations;
-        final Map<String, BoundInfo> bounds;
-        final boolean anyLongSpecializations;
-        final Set<String> longTVars;
-
-        TypeVariablesMapAttribute tvma;
-        BytecodeMappingAttribute bma;
-        int bmaIdx = 0;
-        String curSig;
-        int[] lvOffsets; // only used if anyLongSpecializations is true
-
-        private ManglingMethodVisitor(boolean manglingGenericMethod,
-                                      MethodVisitor downstreamVisitor,
-                                      ClassReader classReader,
-                                      List<String> methodTVars,
-                                      Map<String, String> specializations,
-                                      Map<String, BoundInfo> bounds) {
-            super(ASM_VER, downstreamVisitor);
-            this.manglingGenericMethod = manglingGenericMethod;
-            this.classReader = classReader;
-            this.specializations = specializations;
-            this.methodTVars = methodTVars;
-            this.bounds = bounds;
-            anyLongSpecializations = specializations.values().stream()
-                                                    .anyMatch(s -> s.equals("J") || s.equals("D"));
-            longTVars = anyLongSpecializations
-                        ? specializations.entrySet().stream()
-                                         .filter(e -> e.getValue().equals("J") || e.getValue().equals("D"))
-                                         .map(Map.Entry::getKey)
-                                         .map(s -> "T" + s + ";")
-                                         .collect(Collectors.toSet())
-                        : Collections.emptySet();
-        }
-
-
-        ManglingMethodVisitor(MethodVisitor downstreamVisitor,
-                              ClassReader classReader,
-                              List<String> methodTVars,
-                              Map<String, String> specializations,
-                              Map<String, BoundInfo> bounds) {
-            this(true, downstreamVisitor, classReader, methodTVars, specializations, bounds);
-        }
-
-        ManglingMethodVisitor(MethodVisitor downstreamVisitor,
-                              ClassReader classReader,
-                              Map<String, String> specializations,
-                              Map<String, BoundInfo> bounds) {
-            this(false, downstreamVisitor, classReader, null, specializations, bounds);
-        }
-
-
-        // If the current bytecode offset is in the BMA table, translate
-        // to a Type, and advance to the next BMA bytecode
-        private boolean advanceBMA() {
-            if (bma != null && bmaIdx < bma.offsets.length
-                && bma.offsets[bmaIdx] == classReader.getCurBytecodeOffset()) {
-                curSig = bma.signatures[bmaIdx++];
-                return true;
-            }
-            else
-                return false;
-        }
-
-        private Type advanceType() {
-            return advanceBMA() ? Type.getType(new SpecializedSignature(curSig, specializations).toDesc(bounds)) : null;
-        }
-
-        @Override
-        public void visitAttribute(Attribute attr) {
-            if (attr instanceof BytecodeMappingAttribute) {
-                bma = (BytecodeMappingAttribute) attr;
-                if (anyLongSpecializations)
-                    preVisitForLVOffsets();
-            }
-            else if (attr instanceof TypeVariablesMapAttribute) {
-                //skip
-            }
-            else if (attr instanceof WhereAttribute) {
-                //skip
-            }
-            else if (attr instanceof SpecializerSignature) {
-                //skip
-            }
-            else if (attr instanceof BridgeAttribute) {
-                //skip
-            }
-            else
-                super.visitAttribute(attr);
-        }
-
-        @Override
-        public void visitVarInsn(int opcode, int var) {
-            Type t = advanceType();
-            if (t != null)
-                opcode = t.getOpcode(opcode - OPCODE_ADJ);
-            if (bma != null && anyLongSpecializations)
-                var += lvOffsets[var];
-            super.visitVarInsn(opcode, var);
-        }
-
-        @Override
-        public void visitIincInsn(int var, int increment) {
-            if (bma != null && anyLongSpecializations)
-                var += lvOffsets[var];
-            super.visitIincInsn(var, increment);
-        }
-
-        @Override
-        public void visitInsn(int opcode) {
-            switch (opcode) {
-                case Opcodes.AALOAD:
-                case Opcodes.AASTORE:
-                case Opcodes.ARETURN: {
-                    Type t = advanceType();
-                    if (t != null)
-                        opcode = t.getOpcode(opcode - OPCODE_ADJ);
-                }
-                break;
-
-                case Opcodes.DUP: {
-                    Type t = advanceType();
-                    if (t == Type.LONG_TYPE || t == Type.DOUBLE_TYPE)
-                        opcode = Opcodes.DUP2;
-                }
-                break;
-
-                case Opcodes.POP: {
-                    Type t = advanceType();
-                    if (t == Type.LONG_TYPE || t == Type.DOUBLE_TYPE)
-                        opcode = Opcodes.POP2;
-                }
-                break;
-
-                case Opcodes.DUP_X1: {
-                    Type t = advanceType();
-                    if (t == Type.LONG_TYPE || t == Type.DOUBLE_TYPE)
-                        opcode = Opcodes.DUP2_X1;
-                }
-                break;
-
-                case Opcodes.DUP_X2: {
-                    Type t = advanceType();
-                    if (t == Type.LONG_TYPE || t == Type.DOUBLE_TYPE)
-                        opcode = Opcodes.DUP2_X2;
-                }
-                break;
-
-                case Opcodes.ACONST_NULL: {
-                    Type t = advanceType();
-                    if (t == Type.FLOAT_TYPE) {
-                        opcode = Opcodes.FCONST_0;
-                    } else if (t == Type.LONG_TYPE) {
-                        opcode = Opcodes.LCONST_0;
-                    } else if (t == Type.DOUBLE_TYPE) {
-                        opcode = Opcodes.DCONST_0;
-                    } else if (t == Type.INT_TYPE ||
-                               t == Type.SHORT_TYPE ||
-                               t == Type.BYTE_TYPE ||
-                               t == Type.CHAR_TYPE ||
-                               t == Type.BOOLEAN_TYPE) {
-                        opcode = Opcodes.ICONST_0;
-                    }
-                }
-                break;
-            }
-            super.visitInsn(opcode);
-        }
-
-        @Override
-        public void visitLdcInsn(Object cst) {
-            if (cst instanceof Type) {
-                if (advanceBMA())
-                    cst = Type.getObjectType(new SpecializedSignature(curSig, specializations).getDescAsClassName(bounds));
-            }
-            super.visitLdcInsn(cst);
-        }
-
-        @Override
-        public void visitTypeInsn(int opcode, String desc) {
-            switch (opcode) {
-                case Opcodes.NEW:
-                case Opcodes.CHECKCAST:
-                case Opcodes.INSTANCEOF:
-                    if (advanceBMA())
-                        desc = new SpecializedSignature(curSig, specializations).getDescAsClassName(bounds);
-                    // @@@ In case of CHECKCAST / INSTANCEOF, if resulting type is not a reference, eliminate op
-                    break;
-
-                case Opcodes.ANEWARRAY:
-                    if (advanceBMA()) {
-                        String s = new SpecializedSignature(curSig, specializations).toDesc(bounds);
-                        // s either holds: "[*LBlah;" or "[*I" (some number of leading [ characters)
-                        int index = 0;
-                        char letter;
-                        while ((letter = s.charAt(index)) == '[')
-                            index++;
-                        if (letter != 'L') {
-                            int typeCode = "ZCFDBSIJ".indexOf(letter) + 4;
-                            if (typeCode < 4)
-                                throw new IllegalStateException("Unknown primitive descriptor " + letter);
-                            if (index == 1)
-                                super.visitIntInsn(Opcodes.NEWARRAY, typeCode);
-                            else {
-                                // To create a [[I, we do ANEWARRAY [I, so we lop off one layer of [
-                                super.visitTypeInsn(Opcodes.ANEWARRAY, s.substring(1));
-                            }
-                            return;
-                        }
-                        else {
-                            desc = new SpecializedSignature(curSig.substring(1), specializations).getDescAsClassName(bounds);
-                            super.visitTypeInsn(opcode, desc);
-                            return;
-                        }
-                    }
-                    break;
-            }
-            super.visitTypeInsn(opcode, desc);
-        }
-
-        @Override
-        public void visitMultiANewArrayInsn(String desc, int dims) {
-            if (advanceBMA())
-                desc = new SpecializedSignature(curSig, specializations).toDesc(bounds);
-
-            super.visitMultiANewArrayInsn(desc, dims);
-        }
-
-        @Override
-        public void visitFieldInsn(int opcode, String owner, String name, String desc) {
-            switch (opcode) {
-                case Opcodes.GETFIELD:
-                case Opcodes.PUTFIELD:
-                    if (advanceBMA()) {
-                        String[] parts = curSig.split("::");
-                        owner = new SpecializedSignature(parts[0], specializations).getDescAsClassName(bounds);
-                        SpecializedSignature v = new SpecializedSignature(parts[1], specializations);
-                        if (v.isAnyChanges(bounds))
-                            desc = v.toDesc(bounds);
-                    }
-                    break;
-            }
-            super.visitFieldInsn(opcode, owner, name, desc);
-        }
-
-        @Override
-        public void visitMethodInsn(int opcode, String owner, String name,
-                                    String desc, boolean itf) {
-            switch (opcode) {
-                case Opcodes.INVOKESTATIC:
-                case Opcodes.INVOKESPECIAL:
-                case Opcodes.INVOKEINTERFACE:
-                case Opcodes.INVOKEVIRTUAL:
-                    if (advanceBMA()) {
-                        String[] parts = curSig.split("::");
-                        SpecializedSignature v = new SpecializedSignature(parts[1], specializations);
-                        if (v.isAnyChanges(bounds))
-                            desc = v.toDesc(bounds);
-                        if (isObjectMethod(owner, name)) {
-                            SpecializedSignature specializedOwner = new SpecializedSignature(parts[0], specializations);
-                            String specializedOwnerDesc = specializedOwner.toDesc(bounds);
-                            if (specializedOwnerDesc.length() == 1) {
-                                owner = name.equals("equals") ?
-                                        "valhalla/runtime/EqualsHelper" :
-                                        specializedOwner.getDescAsBoxedClassName(bounds);
-                                desc = prependArg(specializedOwnerDesc, desc);
-                                opcode = Opcodes.INVOKESTATIC;
-                            }
-                        } else {
-                            owner = new SpecializedSignature(parts[0], specializations).getDescAsClassName(bounds);
-                        }
-                    }
-                    break;
-            }
-            super.visitMethodInsn(opcode, owner, name, desc, itf);
-        }
-
-        boolean isObjectMethod(String owner, String name) {
-            if (!owner.equals("java/lang/Object")) {
-                return false;
-            } else {
-                switch (name) {
-                    case "toString":
-                    case "hashCode":
-                    case "equals":
-                    case "getClass":
-                        return true;
-                    default:
-                        return false;
-                }
-            }
-        }
-
-        String prependArg(String arg, String desc) {
-            String parts[] = desc.split("\\(");
-            return parts[0] + "(" + arg + parts[1];
-        }
-
-        @Override
-        public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) {
-            if (advanceBMA()) {
-                String[] sigAndArgs = curSig.split("::", 2);
-                SpecializedSignature v = new SpecializedSignature(sigAndArgs[0], specializations);
-                // Adjust signature regardless of bootstrap
-                if (v.isAnyChanges(bounds))
-                    desc = v.toDesc(bounds);
-
-                if (sigAndArgs.length > 1) {
-                    //patch static args
-                    String argSigs = sigAndArgs[1].substring(1, sigAndArgs[1].length() - 1);
-                    String[] argsSigs2 = argSigs.split("&");
-                    Map<Integer, String> sigs = new HashMap<>();
-                    for (String s : argsSigs2) {
-                        String[] posAndSig = s.split("=", 2);
-                        sigs.put(Integer.valueOf(posAndSig[0]), posAndSig[1]);
-                    }
-                    for (int i = 0; i < bsmArgs.length; i++) {
-                        String curSig = sigs.get(i);
-                        if (curSig != null) {
-                            if (bsmArgs[i] instanceof Type) {
-                                bsmArgs[i] = Type.getType(new SpecializedSignature(curSig, specializations).toDesc(bounds));
-                            } else if (bsmArgs[i] instanceof Handle) {
-                                Handle oldHandle = (Handle) bsmArgs[i];
-                                String[] ownerAndDesc = curSig.split("::", 2);
-                                bsmArgs[i] = new Handle(oldHandle.getTag(),
-                                        new SpecializedSignature(ownerAndDesc[0], specializations).getDescAsClassName(bounds),
-                                        oldHandle.getName(),
-                                        new SpecializedSignature(ownerAndDesc[1], specializations).toDesc(bounds));
-                            } else if (bsmArgs[i] instanceof String) {
-                                v = new SpecializedSignature(curSig, specializations);
-                                if (v.isAnyChanges(bounds))
-                                    bsmArgs[i] = v.toString();
-                            } else {
-                                throw new IllegalStateException("Illegal BMA entry for static arg " + bsmArgs[i]);
-                            }
-                        }
-                    }
-                }
-            }
-
-            super.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
-        }
-
-        @Override
-        public void visitJumpInsn(int opcode, Label label) {
-            switch (opcode) {
-                case Opcodes.IF_ACMPEQ:
-                case Opcodes.IF_ACMPNE:
-                    Type t = advanceType();
-                    if (t != null) {
-                        if (t == Type.INT_TYPE
-                            || t == Type.SHORT_TYPE
-                            || t == Type.BYTE_TYPE
-                            || t == Type.CHAR_TYPE
-                            || t == Type.BOOLEAN_TYPE) {
-                            super.visitJumpInsn((opcode == Opcodes.IF_ACMPEQ) ? Opcodes.IF_ICMPEQ : Opcodes.IF_ICMPNE, label);
-                            return;
-                        }
-                        else if (t == Type.LONG_TYPE) {
-                            super.visitInsn(Opcodes.LCMP);
-                            super.visitJumpInsn((opcode == Opcodes.IF_ACMPEQ) ? Opcodes.IFEQ : Opcodes.IFNE, label);
-                            return;
-                        }
-                        else if (t == Type.FLOAT_TYPE) {
-                            super.visitInsn(Opcodes.FCMPL);
-                            super.visitJumpInsn((opcode == Opcodes.IF_ACMPEQ) ? Opcodes.IFEQ : Opcodes.IFNE, label);
-                            return;
-                        }
-                        else if (t == Type.DOUBLE_TYPE) {
-                            super.visitInsn(Opcodes.DCMPL);
-                            super.visitJumpInsn((opcode == Opcodes.IF_ACMPEQ) ? Opcodes.IFEQ : Opcodes.IFNE, label);
-                            return;
-                        }
-                    }
-                    break;
-            }
-            super.visitJumpInsn(opcode, label);
-        }
-
-        @Override
-        public void visitEnd() {
-            if (bma != null && bmaIdx != bma.offsets.length)
-                throw new IllegalStateException("Didn't consume all BMA entries");
-        }
-
-        private void preVisitForLVOffsets() {
-            lvOffsets = new int[8];
-            classReader.revisitCurrentMethod(new MethodVisitor(ASM_VER) {
-                int pvIndex = 0;
-
-                @Override
-                public void visitVarInsn(int opcode, int var) {
-                    if (var >= lvOffsets.length)
-                        lvOffsets = Arrays.copyOf(lvOffsets, Math.min(var*2, 255));
-                    while (pvIndex < bma.offsets.length
-                           && bma.offsets[pvIndex] < classReader.getCurBytecodeOffset())
-                        pvIndex++;
-                    if (pvIndex < bma.offsets.length
-                        && bma.offsets[pvIndex] == classReader.getCurBytecodeOffset()
-                        && longTVars.contains(bma.signatures[pvIndex])) {
-                        lvOffsets[var] = 1;
-                    }
-
-                    super.visitVarInsn(opcode, var);
-                }
-            }, ATTRIBUTE_PROTOS, ClassReader.SKIP_FRAMES + ClassReader.SKIP_DEBUG);
-            int sum = 0;
-            for (int i=0; i<lvOffsets.length; i++) {
-                int t = sum + lvOffsets[i];
-                lvOffsets[i] = sum;
-                sum = t;
-            }
-        }
-    }
-}
--- a/src/java.base/share/classes/valhalla/specializer/SpecializerSignature.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package valhalla.specializer;
-
-import java.util.Arrays;
-
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ByteVector;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Label;
-
-/**
- * BridgeAttribute
- */
-public class SpecializerSignature extends Attribute {
-
-    String signature;
-
-    private byte[] bytes;
-
-    protected SpecializerSignature() {
-        super("SpecializerSignature");
-    }
-
-    @Override
-    protected Attribute read(ClassReader reader,
-                             int offset,
-                             int len,
-                             char[] chars,
-                             int codeOff,
-                             Label[] labels) {
-        SpecializerSignature a = new SpecializerSignature();
-        a.signature = reader.readUTF8(offset, new char[256]);
-        a.bytes = Arrays.copyOfRange(reader.b, offset, offset + len);
-        return a;
-    }
-
-    @Override
-    protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) {
-        ByteVector v = new ByteVector(bytes.length);
-        v.putByteArray(bytes, 0, bytes.length);
-        return v;
-    }
-
-    public String toString() {
-        return String.format("SpecializerSignature[sig=%s]", signature);
-    }
-}
\ No newline at end of file
--- a/src/java.base/share/classes/valhalla/specializer/TypeVariablesMapAttribute.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package valhalla.specializer;
-
-import java.lang.Override;import java.lang.String;
-import java.util.Arrays;
-import java.util.BitSet;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ByteVector;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Label;
-
-/**
- * TypeVariablesMapAttribute
- *
- * @author Brian Goetz
- */
-public class TypeVariablesMapAttribute extends Attribute {
-
-    public Entry[] entries;
-    private byte[] bytes;
-
-    public static class Entry {
-        public final String cpOwner;
-        public final int nVars;
-        public final BitSet bitSet = new BitSet();
-        public final String[] names;
-        public final String[] bounds;
-        final int length;
-
-        Entry(ClassReader reader, int offset, char[] chars){
-            this.cpOwner = reader.readUTF8(offset, chars);
-            this.nVars = reader.readByte(offset + 2);
-            bounds = new String[nVars];
-            names = new String[nVars];
-            for (int i=0; i<nVars; i++) {
-                int b = reader.readByte(offset + 3 + 5*i);
-                if (b != 0)
-                    bitSet.set(i);
-                names[i] = reader.readUTF8(offset + 3 + 5*i + 1, chars);
-                bounds[i] = reader.readUTF8(offset + 3 + 5*i + 3, chars);
-            }
-            length = 3 + nVars * 5;
-        }
-
-        public String toString() {
-            return String.format("Entry[n=%d, b=%s]", nVars, bitSet);
-        }
-    }
-
-
-
-    public TypeVariablesMapAttribute() {
-        super("TypeVariablesMap");
-    }
-
-    @Override
-    protected Attribute read(ClassReader reader,
-                             int offset,
-                             int len,
-                             char[] chars,
-                             int codeOff,
-                             Label[] labels) {
-        TypeVariablesMapAttribute a = new TypeVariablesMapAttribute();
-        int nEntries = reader.readByte(offset);
-        a.entries = new Entry[nEntries];
-        int prevOffset = 0;
-        for (int i=0; i<nEntries; i++) {
-            a.entries[i] = new Entry(reader, offset + 1 + prevOffset, chars);
-            prevOffset += a.entries[i].length;
-        }
-        a.bytes = Arrays.copyOfRange(reader.b, offset, offset + len);
-        return a;
-    }
-
-    @Override
-    protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) {
-        ByteVector v = new ByteVector(bytes.length);
-        v.putByteArray(bytes, 0, bytes.length);
-        return v;
-    }
-
-    public String toString() {
-        return String.format("TypeVariablesMap[%s]",
-                Stream.of(entries).map(Entry::toString).collect(Collectors.joining(",")));
-    }
-}
--- a/src/java.base/share/classes/valhalla/specializer/WhereAttribute.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package valhalla.specializer;
-
-import java.util.Arrays;
-
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ByteVector;
-import jdk.internal.org.objectweb.asm.ClassReader;
-import jdk.internal.org.objectweb.asm.ClassWriter;
-import jdk.internal.org.objectweb.asm.Label;
-
-/**
- * WhereAttribute
- */
-public class WhereAttribute extends Attribute {
-
-    int flags;
-    String[] tvarNames;
-    char[] codes;
-
-    private byte[] bytes;
-
-    protected WhereAttribute() {
-        super("Where");
-    }
-
-    @Override
-    protected Attribute read(ClassReader reader,
-                             int offset,
-                             int len,
-                             char[] chars,
-                             int codeOff,
-                             Label[] labels) {
-        WhereAttribute a = new WhereAttribute();
-        a.flags = reader.readByte(offset);
-        int count = reader.readByte(offset + 1);
-        a.tvarNames = new String[count];
-        a.codes = new char[count];
-        for (int i=0; i<count; i++) {
-            a.tvarNames[i] = reader.readUTF8(offset + 2 + 4*i, chars);
-            a.codes[i] = (char)reader.readShort(offset + 2 + 4*i + 2);
-        }
-        a.bytes = Arrays.copyOfRange(reader.b, offset, offset + len);
-        return a;
-    }
-
-    @Override
-    protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) {
-        ByteVector v = new ByteVector(bytes.length);
-        v.putByteArray(bytes, 0, bytes.length);
-        return v;
-    }
-
-    public String toString() {
-        return String.format("Where[tvarNames=%s, codes=%s]",
-                             Arrays.toString(tvarNames), Arrays.toString(codes));
-    }
-}
--- a/test/valhalla/PrespecializerTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/PrespecializerTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -22,6 +22,7 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.net.URI;
 import java.nio.file.DirectoryStream;
@@ -33,11 +34,12 @@
 import java.util.*;
 import java.util.HashSet;
 
-import jdk.internal.org.objectweb.asm.Attribute;
-import jdk.internal.org.objectweb.asm.ClassReader;
-
-import valhalla.specializer.Specializer.NameAndSigVisitor;
-import valhalla.specializer.TypeVariablesMapAttribute;
+import valhalla.model3.Model3Converter;
+import valhalla.model3.Model3Converter.ParameterizedType;
+import valhalla.model3.classfile.ClassFile;
+import valhalla.model3.classfile.ConstantPool;
+import valhalla.model3.classfile.ConstantPoolException;
+import valhalla.model3.classfile.TypeVariablesMap_attribute;
 
 /*
  * @test
@@ -45,7 +47,7 @@
  * @run main PrespecializerTest
  */
 public class PrespecializerTest {
-    private static String[] targets = { null, "Z", "I", "J", "D" };
+    private static String[] targets = { "_", "Z", "I" };
 
     private static String[] packages = { "java.anyutil", "java.anyutil.function", "java.anyutil.stream", "java.anyutil.concurrent" };
 
@@ -58,10 +60,23 @@
     private static Set<String> errors = new HashSet<>();
     
     static {
-//        problemList.add("foo/bar/baz"); //insert problematic classes here
+        problemList.add("java/anyutil/function/DoubleFunction"); //double slot
+        problemList.add("java/anyutil/function/LongFunction"); //double slot
+        problemList.add("java/anyutil/function/ObjDoubleConsumer"); //double slot
+        problemList.add("java/anyutil/function/ObjLongConsumer"); //double slot
+        problemList.add("java/anyutil/function/ToDoubleFunction"); //double slot
+        problemList.add("java/anyutil/function/ToLongFunction"); //double slot
+        problemList.add("java/anyutil/function/ToDoubleBiFunction"); //double slot
+        problemList.add("java/anyutil/function/ToLongBiFunction"); //double slot
+        problemList.add("java/anyutil/function/DoubleSupplier"); //double slot
+        problemList.add("java/anyutil/function/LongSupplier"); //double slot
+        problemList.add("java/anyutil/function/DoubleBinaryOperator"); //double slot
+        problemList.add("java/anyutil/function/LongBinaryOperator"); //double slot
+        problemList.add("java/anyutil/function/DoubleConsumer"); //double slot
+        problemList.add("java/anyutil/function/LongConsumer"); //double slot
     }
 
-    public static void main(String[] args) throws IOException, ClassNotFoundException {
+    public static void main(String[] args) throws IOException, ConstantPoolException, ClassNotFoundException {
         FileSystem jrtfs = FileSystems.getFileSystem(URI.create("jrt:/"));
         for (String pkg : packages) {
 			Path pkgPath = jrtfs.getPath("/modules/" + module + "/" + pkg.replace(".", "/"));
@@ -87,20 +102,22 @@
         }
     }
 
-    public static void specializeClassIfNeeded(InputStream is) throws IOException, ClassNotFoundException {
-        PrespecializerExtractor visitor = PrespecializerExtractor.forStream(is);
+    public static void specializeClassIfNeeded(InputStream is) throws IOException, ConstantPoolException, ClassNotFoundException {
+        M3PrespecializerExtractor visitor = new M3PrespecializerExtractor(is);
         if (visitor.needsSpecialization()) {
-            List<Map<String, String>> specMap = visitor.generateAllSpecializations();
-            for (Map<String, String> m : specMap) {
+            List<List<String>> specMap = visitor.generateAllSpecializations();
+            for (List<String> m : specMap) {
                 if (m.size() > 0) {
                     String mangledClassName = visitor.mangledName(m);
                     try {
+                        System.err.println("trying: " + mangledClassName + " from: " + visitor.stereotype + " with spec: " + m + " from class: " + visitor.classname);
                         Class.forName(mangledClassName.replace("/", ".")); //this will trigger specialization
-                    } catch (VerifyError ex) {
+                    } catch (Throwable ex) {
                         if (problemList.contains(visitor.classname)) {
                             System.err.println("Skipping " + visitor.classname);
                         } else {
                             errors.add(ex.getMessage());
+                            throw ex;
                         }
                         return;
                     }
@@ -112,77 +129,70 @@
         }
     }
 
-    static class PrespecializerExtractor extends NameAndSigVisitor {
+    static class M3PrespecializerExtractor {
 
-        private String classname;
+        ParameterizedType stereotype;
+        String classname;
 
-        @Override
-        public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-            classname = name;
-        }
-
-        public static PrespecializerExtractor forStream(InputStream is) throws IOException {
-            PrespecializerExtractor visitor = new PrespecializerExtractor();
-            new ClassReader(is)
-                    .accept(visitor,
-                            new Attribute[] {new TypeVariablesMapAttribute() },
-                            ClassReader.SKIP_FRAMES + ClassReader.SKIP_CODE);
-            return visitor;
+        M3PrespecializerExtractor(InputStream is) throws IOException, ConstantPoolException {
+            ClassFile cf = ClassFile.read(is);
+            ConstantPool cp = cf.constant_pool;
+            TypeVariablesMap_attribute tvma = (TypeVariablesMap_attribute) cf.attributes.get(valhalla.model3.classfile.Attribute.TypeVariablesMap);
+            if (tvma != null) {
+                stereotype = Model3Converter.stereotype(cp, tvma);
+            }
+            classname = cf.getName();
+            if (classname.contains("<")) {
+                classname = classname.substring(0, classname.indexOf('<'));
+            }
         }
 
         boolean needsSpecialization() {
-            return classAnyVars.size() > 0;
+            return stereotype != null && stereotype.toString().contains("#");
         }
 
-        String mangledName(Map<String, String> specializations) {
-            boolean first = true;
-            StringBuilder sb = new StringBuilder(classname);
-            sb.append("${");
-            for (int varIdx=0; varIdx< classTVars.size(); varIdx++) {
-                String var = classTVars.get(varIdx);
-                if (!classAnyVars.contains(var) || !specializations.containsKey(var))
-                    continue;
-                if (!first)
-                    sb.append(",");
-                first = false;
-                sb.append(varIdx);
-                sb.append("=");
-                sb.append(specializations.get(var));
+        String mangledName(List<String> specializations) {
+            String ss = stereotype.toString();
+            if (specializations.stream().allMatch(s -> s.equals("_"))) {
+                //do not use stereotype for all erased case
+                return classname;
+            } else {
+                for (int i = 0 ; i < specSize() ; i++) {
+                    ss = ss.replaceFirst("#", specializations.get(i));
+                }
+                ss = ss.replaceAll("\\$\\$\\{_+\\}", ""); //drop empty specializations
+                return ss;
             }
-            sb.append("}");
-
-            return sb.toString();
         }
 
-        List<Map<String, String>> generateAllSpecializations() {
-            return generateAllSpecializationsInternal(new ArrayList<>(classAnyVars));
+        int specSize() {
+            String ss = stereotype.toString();
+            return ss.length() - ss.replace("#", "").length();
         }
 
-        private List<Map<String, String>> generateAllSpecializationsInternal(List<String> tVars) {
-            if (tVars.size() == 0)
+        List<List<String>> generateAllSpecializations() {
+            return generateAllSpecializationsInternal(specSize());
+        }
+
+        private List<List<String>> generateAllSpecializationsInternal(int size) {
+            if (size == 0)
                 return Collections.emptyList();
-            else if (tVars.size() == 1) {
-                String var = tVars.get(0);
-                ArrayList<Map<String, String>> res = new ArrayList<>();
+            else if (size == 1) {
+                ArrayList<List<String>> res = new ArrayList<>();
                 for (String c : targets) {
-                    HashMap<String, String> m = new HashMap<>();
-                    if (c != null)
-                        m.put(var, c);
+                    ArrayList<String> m = new ArrayList<>();
+                    m.add(c);
                     res.add(m);
                 }
                 return res;
             }
             else {
-                String var = tVars.get(0);
-                ArrayList<Map<String, String>> res = new ArrayList<>();
-                List<String> cdr = new ArrayList<>(tVars);
-                cdr.remove(0);
-                List<Map<String, String>> next = generateAllSpecializationsInternal(cdr);
+                ArrayList<List<String>> res = new ArrayList<>();
+                List<List<String>> next = generateAllSpecializationsInternal(size - 1);
                 for (String c : targets) {
-                    for (Map<String, String> m : next) {
-                        HashMap<String, String> mm = new HashMap<>(m);
-                        if (c != null)
-                            mm.put(var, c);
+                    for (List<String> m : next) {
+                        List<String> mm = new ArrayList<>(m);
+                        mm.add(c);
                         res.add(mm);
                     }
                 }
--- a/test/valhalla/boottest/valhalla/specializer/SignatureSpecializerTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package valhalla.specializer;
-
-import jdk.internal.org.objectweb.asm.signature.SignatureReader;
-import org.testng.Assert;
-import org.testng.annotations.Test;
-import valhalla.specializer.SignatureSpecializer.SpecializedSignature;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.testng.Assert.assertEquals;
-
-/**
- * SignatureSpecializerTest
- *
- * @author Brian Goetz
- */
-@Test
-public class SignatureSpecializerTest {
-    static Map<String, String> tInt = new HashMap<>();
-    static {
-        tInt.put("T", "I");
-    }
-
-    private void assertErased(String in, String out, Map<String, String> specializations) {
-        SpecializedSignature spec = new SignatureSpecializer.SpecializedSignature(in, specializations);
-        Assert.assertEquals(out, spec.getDescAsClassName(Collections.emptyMap()));
-    }
-
-    public void testErased() {
-        assertErased("LFoo;", "Foo", tInt);
-        assertErased("LFoo<LString;>;", "Foo", tInt);
-        assertErased("LFoo<TU;>;", "Foo", tInt);
-
-        assertErased("LBox<TT;>;", "Box${0=I}", tInt);
-        assertErased("LBox<TT;TU;>;", "Box${0=I}", tInt);
-
-        assertErased("LPair<ITT;>;", "Pair${0=I,1=I}", tInt);
-        assertErased("LPair<TT;TT;>;", "Pair${0=I,1=I}", tInt);
-
-        assertErased("LPair<ILBox<TT;>;>;", "Pair${0=I}", tInt);
-
-        assertErased("LPair<TT;LBox<TR;>;>;", "Pair${0=I}", tInt);
-    }
-
-    private void assertExtractedSpecializations(String sig, String... types) {
-        List<String> params = SignatureSpecializer.extractSpecializationParams(sig);
-        assertEquals(Arrays.asList(types), params);
-    }
-
-    public void testSpecializationExtractor() {
-        assertExtractedSpecializations("I");
-        assertExtractedSpecializations("[I");
-        assertExtractedSpecializations("java/lang/String");
-        assertExtractedSpecializations("java/lang/String${}");
-
-        assertExtractedSpecializations("java/lang/String${0=I}", "I");
-        assertExtractedSpecializations("java/lang/String${0=I,1=J}", "I", "J");
-        assertExtractedSpecializations("java/lang/String${1=J}", null, "J");
-    }
-}
--- a/test/valhalla/test/valhalla/anyutil/CollectionsTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/anyutil/CollectionsTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -137,9 +137,9 @@
 
     public void testHashMap() {
         //primitive primitive
-        Map<int, long> mil = new HashMap<>();
-        mil.put(1, 2L);
-        assertEquals(mil.map(1).get(), 2L);
+        Map<int, float> mil = new HashMap<>();
+        mil.put(1, 2f);
+        assertEquals(mil.map(1).get(), 2f);
         assertEquals(1, mil.keySet().size());
         assertEquals(1, mil.values().size());
         assertEquals(1, mil.entrySet().size());
@@ -153,9 +153,9 @@
         assertEquals(1, mis.entrySet().size());
 
         //erased primitive
-        Map<String, long> msl = new HashMap<>();
-        msl.put("Hello!", 2L);
-        assertEquals(msl.map("Hello!").get(), 2L);
+        Map<String, float> msl = new HashMap<>();
+        msl.put("Hello!", 2f);
+        assertEquals(msl.map("Hello!").get(), 2f);
         assertEquals(1, msl.keySet().size());
         assertEquals(1, msl.values().size());
         assertEquals(1, msl.entrySet().size());
@@ -171,9 +171,9 @@
 
     public void testLinkedHashMap() {
         //primitive primitive
-        Map<int, long> mil = new LinkedHashMap<>();
-        mil.put(1, 2L);
-        assertEquals(mil.map(1).get(), 2L);
+        Map<int, float> mil = new LinkedHashMap<>();
+        mil.put(1, 2f);
+        assertEquals(mil.map(1).get(), 2f);
         assertEquals(1, mil.keySet().size());
         assertEquals(1, mil.values().size());
         assertEquals(1, mil.entrySet().size());
@@ -187,9 +187,9 @@
         assertEquals(1, mis.entrySet().size());
 
         //erased primitive
-        Map<String, long> msl = new LinkedHashMap<>();
-        msl.put("Hello!", 2L);
-        assertEquals(msl.map("Hello!").get(), 2L);
+        Map<String, float> msl = new LinkedHashMap<>();
+        msl.put("Hello!", 2f);
+        assertEquals(msl.map("Hello!").get(), 2f);
         assertEquals(1, msl.keySet().size());
         assertEquals(1, msl.values().size());
         assertEquals(1, msl.entrySet().size());
--- a/test/valhalla/test/valhalla/anyutil/SimplePipelineTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/anyutil/SimplePipelineTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -55,15 +55,15 @@
         assertTrue(res.equals(Arrays.asList("aax", "bbx", "ccx")));
     }
 
-    //int -> long pipeline
-    public void testIL() {
-        List<Long> res = new ArrayList<>();
+    //int -> float pipeline
+    public void testIF() {
+        List<Float> res = new ArrayList<>();
         Stream.of(ints)
               .filter(i -> i > 1)
               .map(i -> i + 2)
-              .map(i -> 5L * i)
+              .map(i -> 5f * i)
               .forEach(x -> res.add(x));
-        assertTrue(res.equals(Arrays.asList(20L, 25L, 30L)));
+        assertTrue(res.equals(Arrays.asList(20f, 25f, 30f)));
     }
 
     //string -> int pipeline
@@ -75,12 +75,12 @@
         assertTrue(res.equals(Arrays.asList(1, 1, 1, 2, 2, 2)));
     }
 
-    //string -> int -> long -> int -> string pipeline
-    public void testSILIS() {
+    //string -> int -> float -> int -> string pipeline
+    public void testSIFIS() {
         List<String> res = new ArrayList<>();
         Stream.of(strings)
               .map(String::length)
-              .map(i -> 5L * i)
+              .map(i -> 5f * i)
               .map(l -> (int) l)
               .map(i -> "" + i)
               .forEach(s -> res.add(s));
--- a/test/valhalla/test/valhalla/classdyn/ManglerTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package valhalla.classdyn;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-/**
- * ManglerTest
- */
-
-@Test
-public class ManglerTest {
-    static Mangler.ClassdynRemapper remapper = new Mangler.ClassdynRemapper();
-
-    private void assertMangledType(String in, String out) {
-        Assert.assertEquals(remapper.mapType(in), out);
-    }
-
-    private void assertMangledDesc(String in, String out) {
-        Assert.assertEquals(remapper.mapDesc(in), out);
-    }
-
-    private void assertMangledMethodDesc(String in, String out) {
-        Assert.assertEquals(remapper.mapMethodDesc(in), out);
-    }
-
-    private void assertMangledTypeSig(String in, String out) {
-        Assert.assertEquals(remapper.mapSignature(in, true), out);
-    }
-
-    private void assertMangledMethodSig(String in, String out) {
-        Assert.assertEquals(remapper.mapSignature(in, false), out);
-    }
-
-    public void testBasicTypes() {
-        assertMangledType("B", "B");
-        assertMangledType("C", "C");
-        assertMangledType("D", "D");
-        assertMangledType("F", "F");
-        assertMangledType("I", "I");
-        assertMangledType("J", "J");
-        assertMangledType("Z", "Z");
-        assertMangledType("V", "V");
-
-        assertMangledType("Ljava/lang/Object;", "Ljava/lang/Object;");
-    }
-
-    public void testBasicMangling() {
-        assertMangledType("Box${0=B}", "Dyn$valhalla_specializer_Specializer$(Box)(B)");
-        assertMangledType("Box${0=C}", "Dyn$valhalla_specializer_Specializer$(Box)(C)");
-        assertMangledType("Box${0=D}", "Dyn$valhalla_specializer_Specializer$(Box)(D)");
-        assertMangledType("Box${0=F}", "Dyn$valhalla_specializer_Specializer$(Box)(F)");
-        assertMangledType("Box${0=I}", "Dyn$valhalla_specializer_Specializer$(Box)(I)");
-        assertMangledType("Box${0=J}", "Dyn$valhalla_specializer_Specializer$(Box)(J)");
-        assertMangledType("Box${0=Z}", "Dyn$valhalla_specializer_Specializer$(Box)(Z)");
-    }
-
-    public void testManglingPackage() {
-        assertMangledType("foo/bar/Box${0=B}", "Dyn$valhalla_specializer_Specializer$(foo_bar_Box)(B)");
-        assertMangledType("foo/bar/Box${0=C}", "Dyn$valhalla_specializer_Specializer$(foo_bar_Box)(C)");
-        assertMangledType("foo/bar/Box${0=D}", "Dyn$valhalla_specializer_Specializer$(foo_bar_Box)(D)");
-        assertMangledType("foo/bar/Box${0=F}", "Dyn$valhalla_specializer_Specializer$(foo_bar_Box)(F)");
-        assertMangledType("foo/bar/Box${0=I}", "Dyn$valhalla_specializer_Specializer$(foo_bar_Box)(I)");
-        assertMangledType("foo/bar/Box${0=J}", "Dyn$valhalla_specializer_Specializer$(foo_bar_Box)(J)");
-        assertMangledType("foo/bar/Box${0=Z}", "Dyn$valhalla_specializer_Specializer$(foo_bar_Box)(Z)");
-    }
-
-    public void testManglingHoles() {
-        assertMangledType("Box${0=B,2=F}", "Dyn$valhalla_specializer_Specializer$(Box)(B)()(F)");
-        assertMangledType("Box${0=C,2=F}", "Dyn$valhalla_specializer_Specializer$(Box)(C)()(F)");
-        assertMangledType("Box${0=D,2=F}", "Dyn$valhalla_specializer_Specializer$(Box)(D)()(F)");
-        assertMangledType("Box${0=F,2=F}", "Dyn$valhalla_specializer_Specializer$(Box)(F)()(F)");
-        assertMangledType("Box${0=I,2=F}", "Dyn$valhalla_specializer_Specializer$(Box)(I)()(F)");
-        assertMangledType("Box${0=J,2=F}", "Dyn$valhalla_specializer_Specializer$(Box)(J)()(F)");
-        assertMangledType("Box${0=Z,2=F}", "Dyn$valhalla_specializer_Specializer$(Box)(Z)()(F)");
-    }
-
-    public void testBasicArrays() {
-        assertMangledDesc("[B", "[B");
-        assertMangledDesc("[C", "[C");
-        assertMangledDesc("[D", "[D");
-        assertMangledDesc("[F", "[F");
-        assertMangledDesc("[I", "[I");
-        assertMangledDesc("[J", "[J");
-        assertMangledDesc("[Z", "[Z");
-
-        assertMangledType("[Ljava/lang/Object;", "[Ljava/lang/Object;");
-    }
-
-    public void testManglingArrays() {
-        assertMangledDesc("[LBox${0=B};", "[LDyn$valhalla_specializer_Specializer$(Box)(B);");
-        assertMangledDesc("[LBox${0=C};", "[LDyn$valhalla_specializer_Specializer$(Box)(C);");
-        assertMangledDesc("[LBox${0=D};", "[LDyn$valhalla_specializer_Specializer$(Box)(D);");
-        assertMangledDesc("[LBox${0=F};", "[LDyn$valhalla_specializer_Specializer$(Box)(F);");
-        assertMangledDesc("[LBox${0=I};", "[LDyn$valhalla_specializer_Specializer$(Box)(I);");
-        assertMangledDesc("[LBox${0=J};", "[LDyn$valhalla_specializer_Specializer$(Box)(J);");
-        assertMangledDesc("[LBox${0=Z};", "[LDyn$valhalla_specializer_Specializer$(Box)(Z);");
-    }
-
-    public void testManglingMethodParam() {
-        assertMangledMethodDesc("(LBox${0=B};)V", "(LDyn$valhalla_specializer_Specializer$(Box)(B);)V");
-        assertMangledMethodDesc("(LBox${0=C};)V", "(LDyn$valhalla_specializer_Specializer$(Box)(C);)V");
-        assertMangledMethodDesc("(LBox${0=D};)V", "(LDyn$valhalla_specializer_Specializer$(Box)(D);)V");
-        assertMangledMethodDesc("(LBox${0=F};)V", "(LDyn$valhalla_specializer_Specializer$(Box)(F);)V");
-        assertMangledMethodDesc("(LBox${0=I};)V", "(LDyn$valhalla_specializer_Specializer$(Box)(I);)V");
-        assertMangledMethodDesc("(LBox${0=J};)V", "(LDyn$valhalla_specializer_Specializer$(Box)(J);)V");
-        assertMangledMethodDesc("(LBox${0=Z};)V", "(LDyn$valhalla_specializer_Specializer$(Box)(Z);)V");
-    }
-
-    public void testManglingMethodReturn() {
-        assertMangledMethodDesc("()LBox${0=B};", "()LDyn$valhalla_specializer_Specializer$(Box)(B);");
-        assertMangledMethodDesc("()LBox${0=C};", "()LDyn$valhalla_specializer_Specializer$(Box)(C);");
-        assertMangledMethodDesc("()LBox${0=D};", "()LDyn$valhalla_specializer_Specializer$(Box)(D);");
-        assertMangledMethodDesc("()LBox${0=F};", "()LDyn$valhalla_specializer_Specializer$(Box)(F);");
-        assertMangledMethodDesc("()LBox${0=I};", "()LDyn$valhalla_specializer_Specializer$(Box)(I);");
-        assertMangledMethodDesc("()LBox${0=J};", "()LDyn$valhalla_specializer_Specializer$(Box)(J);");
-        assertMangledMethodDesc("()LBox${0=Z};", "()LDyn$valhalla_specializer_Specializer$(Box)(Z);");
-    }
-
-    public void testManglingHolesPartial() {
-        assertMangledTypeSig("LBox${0=B,2=F}<Ljava/lang/String;>;", "LDyn$valhalla_specializer_Specializer$(Box)(B)()(F)<Ljava/lang/String;>;");
-        assertMangledTypeSig("LBox${0=C,2=F}<Ljava/lang/String;>;", "LDyn$valhalla_specializer_Specializer$(Box)(C)()(F)<Ljava/lang/String;>;");
-        assertMangledTypeSig("LBox${0=D,2=F}<Ljava/lang/String;>;", "LDyn$valhalla_specializer_Specializer$(Box)(D)()(F)<Ljava/lang/String;>;");
-        assertMangledTypeSig("LBox${0=F,2=F}<Ljava/lang/String;>;", "LDyn$valhalla_specializer_Specializer$(Box)(F)()(F)<Ljava/lang/String;>;");
-        assertMangledTypeSig("LBox${0=I,2=F}<Ljava/lang/String;>;", "LDyn$valhalla_specializer_Specializer$(Box)(I)()(F)<Ljava/lang/String;>;");
-        assertMangledTypeSig("LBox${0=J,2=F}<Ljava/lang/String;>;", "LDyn$valhalla_specializer_Specializer$(Box)(J)()(F)<Ljava/lang/String;>;");
-        assertMangledTypeSig("LBox${0=Z,2=F}<Ljava/lang/String;>;", "LDyn$valhalla_specializer_Specializer$(Box)(Z)()(F)<Ljava/lang/String;>;");
-    }
-
-    public void testWildcard() {
-        assertMangledTypeSig("LBox<+LBox${0=B};>;", "LBox<+LDyn$valhalla_specializer_Specializer$(Box)(B);>;");
-        assertMangledTypeSig("LBox<+LBox${0=C};>;", "LBox<+LDyn$valhalla_specializer_Specializer$(Box)(C);>;");
-        assertMangledTypeSig("LBox<+LBox${0=D};>;", "LBox<+LDyn$valhalla_specializer_Specializer$(Box)(D);>;");
-        assertMangledTypeSig("LBox<+LBox${0=F};>;", "LBox<+LDyn$valhalla_specializer_Specializer$(Box)(F);>;");
-        assertMangledTypeSig("LBox<+LBox${0=I};>;", "LBox<+LDyn$valhalla_specializer_Specializer$(Box)(I);>;");
-        assertMangledTypeSig("LBox<+LBox${0=J};>;", "LBox<+LDyn$valhalla_specializer_Specializer$(Box)(J);>;");
-        assertMangledTypeSig("LBox<+LBox${0=Z};>;", "LBox<+LDyn$valhalla_specializer_Specializer$(Box)(Z);>;");
-    }
-
-    public void testBound() {
-        assertMangledMethodSig("<TT:LBox${0=B};>()V", "<TT:LDyn$valhalla_specializer_Specializer$(Box)(B);>()V");
-        assertMangledMethodSig("<TT:LBox${0=C};>()V", "<TT:LDyn$valhalla_specializer_Specializer$(Box)(C);>()V");
-        assertMangledMethodSig("<TT:LBox${0=D};>()V", "<TT:LDyn$valhalla_specializer_Specializer$(Box)(D);>()V");
-        assertMangledMethodSig("<TT:LBox${0=F};>()V", "<TT:LDyn$valhalla_specializer_Specializer$(Box)(F);>()V");
-        assertMangledMethodSig("<TT:LBox${0=I};>()V", "<TT:LDyn$valhalla_specializer_Specializer$(Box)(I);>()V");
-        assertMangledMethodSig("<TT:LBox${0=J};>()V", "<TT:LDyn$valhalla_specializer_Specializer$(Box)(J);>()V");
-        assertMangledMethodSig("<TT:LBox${0=Z};>()V", "<TT:LDyn$valhalla_specializer_Specializer$(Box)(Z);>()V");
-    }
-}
--- a/test/valhalla/test/valhalla/specializer/BoxTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/specializer/BoxTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -54,11 +54,11 @@
         Box<int> box = new Box<>();
         box.set(3);
         assertEquals(3, box.get());
-        assertEquals("Box${0=I}", box.getClass().getSimpleName());
+        assertEquals("Box$${I}", box.getClass().getSimpleName());
         assertEquals(Box<int>.class, box.getClass());
 
         Box<int> dup = box.dup();
-        assertEquals("Box${0=I}", dup.getClass().getSimpleName());
+        assertEquals("Box$${I}", dup.getClass().getSimpleName());
     }
 
     public void testBoxSubclass() {
@@ -93,7 +93,7 @@
         box.set(2, 2);
         assertEquals(1, box.get(1));
         assertEquals(2, box.get(2));
-        assertEquals("ArrayBox${0=I}", box.getClass().getSimpleName());
+        assertEquals("ArrayBox$${I}", box.getClass().getSimpleName());
         assertEquals(ArrayBox<int>.class, box.getClass());
 
         box = new ArrayBox<int>(10);
--- a/test/valhalla/test/valhalla/specializer/DefaultValueTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/specializer/DefaultValueTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -56,9 +56,9 @@
         execTest((byte) 1);
         execTest((short) 1);
         execTest((int) 1);
-        execTest(1L);
+        //execTest(1L); double slot not supported
         execTest(1f);
-        execTest(1d);
+        //execTest(1d); double slot not supported
         execTest((char) 1);
         execTest(true);
         execTest("Hello!");
--- a/test/valhalla/test/valhalla/specializer/GenericMethodsTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/specializer/GenericMethodsTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -47,8 +47,8 @@
     }
 
     public void testStatic() {
-        Helper<long> h = Helper.factory(Long.MAX_VALUE);
-        assertEquals(Long.MAX_VALUE, h.state);
+        Helper<int> h = Helper.factory(Integer.MAX_VALUE);
+        assertEquals(Integer.MAX_VALUE, h.state);
     }
 
     public void testNoSpecialization() {
@@ -58,9 +58,9 @@
     }
 
     public void testInstance() {
-        Helper<long> h = new Helper<>(Long.MAX_VALUE);
-        assertEquals(Long.MAX_VALUE, h.state);
-        assertEquals(Long.MAX_VALUE, h.withId());
+        Helper<int> h = new Helper<>(Integer.MAX_VALUE);
+        assertEquals(Integer.MAX_VALUE, h.state);
+        assertEquals(Integer.MAX_VALUE, h.withId());
     }
 
     public void testGenericDirect() {
@@ -69,12 +69,12 @@
 
         assertEquals("foo", Helper.<String>id("foo"));
 
-        long y = Helper.id(0xffffffffffffffffL);
-        assertEquals(0xffffffffffffffffL, y);
+//        long y = Helper.id(0xffffffffffffffffL);
+//        assertEquals(0xffffffffffffffffL, y);
 
         // Same, but in method invocation context with explicit witnesses
         assertEquals(3, Helper.<int>id(3));
-        assertEquals(0xffffffffffffffffL, Helper.<long>id(0xffffffffffffffffL));
+        //assertEquals(0xffffffffffffffffL, Helper.<long>id(0xffffffffffffffffL));
     }
 
     public void testGenericIndirectUnspecialized() {
@@ -91,12 +91,12 @@
 
         assertEquals("foo", Helper.<String>id2("foo"));
 
-        long y = Helper.id2(0xffffffffffffffffL);
-        assertEquals(0xffffffffffffffffL, y);
+//        long y = Helper.id2(0xffffffffffffffffL);
+//        assertEquals(0xffffffffffffffffL, y);
 
         // Same, but in method invocation context with explicit witnesses
         assertEquals(3, Helper.<int>id2(3));
-        assertEquals(0xffffffffffffffffL, Helper.<long>id2(0xffffffffffffffffL));
+        //assertEquals(0xffffffffffffffffL, Helper.<long>id2(0xffffffffffffffffL));
 
         assertEquals(3, Helper.<int>box(3).get());
     }
@@ -116,9 +116,9 @@
         assertEquals(Helper2<byte>.class, Helper2.<byte>test1());
         assertEquals(Helper2<short>.class, Helper2.<short>test1());
         assertEquals(Helper2<int>.class, Helper2.<int>test1());
-        assertEquals(Helper2<long>.class, Helper2.<long>test1());
+        //assertEquals(Helper2<long>.class, Helper2.<long>test1());
         assertEquals(Helper2<float>.class, Helper2.<float>test1());
-        assertEquals(Helper2<double>.class, Helper2.<double>test1());
+        //assertEquals(Helper2<double>.class, Helper2.<double>test1());
         assertEquals(Helper2<char>.class, Helper2.<char>test1());
         assertEquals(Helper2.class, Helper2.<Object>test1());
         assertEquals(Helper2.class, Helper2.<String>test1());
--- a/test/valhalla/test/valhalla/specializer/MiscManglingsTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/specializer/MiscManglingsTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -43,8 +43,8 @@
         Dup<int> dt2 = new Dup<>();
         dt2.test(3, 4, 5);
 
-        Dup<long> dt3 = new Dup<>();
-        dt3.test(3L, 4L, 5L);
+        Dup<float> dt3 = new Dup<>();
+        dt3.test(3f, 4f, 5f);
 
     }
 
@@ -55,8 +55,8 @@
         Ldc<int> dt2 = new Ldc<>();
         assertEquals(Ldc<int>.class, dt2.getClazz());
 
-        Ldc<long> dt3 = new Ldc<>();
-        assertEquals(Ldc<long>.class, dt3.getClazz());
+        Ldc<float> dt3 = new Ldc<>();
+        assertEquals(Ldc<float>.class, dt3.getClazz());
     }
 
     public void testNewArray() {
--- a/test/valhalla/test/valhalla/specializer/MixedTypesTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/specializer/MixedTypesTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -36,33 +36,33 @@
 @Test
 public class MixedTypesTest {
     public void testMixedTypes() {
-        MixedTypes<int, long, double, boolean> mt = new MixedTypes<>(0xffffffff, 0xEEEEEEEEEEEEEEEEL, 0.1234567812345678d, true);
+        MixedTypes<int, short, float, boolean> mt = new MixedTypes<>(0xffffffff, (short)0xfff, 0.1234567812345678f, true);
 
         assertEquals(mt.a, 0xffffffff);
-        assertEquals(mt.b, 0xEEEEEEEEEEEEEEEEL);
-        assertEquals(mt.c, 0.1234567812345678d);
+        assertEquals(mt.b, 0xfff);
+        assertEquals(mt.c, 0.1234567812345678f);
         assertEquals(mt.d, true);
 
-        MixedTypes<long, int, char, double> mt2 = new MixedTypes<>(0xEEEEEEEEEEEEEEEEL, 0xffffffff, 'x', 0.1234567812345678d);
+        MixedTypes<short, int, char, float> mt2 = new MixedTypes<>((short)0xfff, 0xffffffff, 'x', 0.1234567812345678f);
 
-        assertEquals(mt2.a, 0xEEEEEEEEEEEEEEEEL);
+        assertEquals(mt2.a, 0xfff);
         assertEquals(mt2.b, 0xffffffff);
         assertEquals(mt2.c, 'x');
-        assertEquals(mt2.d, 0.1234567812345678d);
+        assertEquals(mt2.d, 0.1234567812345678f);
 
-        MixedTypes<long, long, long, long> mt3 = new MixedTypes<>(0xaaaaaaaaaaaaaaaaL, 0xbbbbbbbbbbbbbbbbL, 0xccccccccccccccccL, 0xddddddddddddddddL);
+        MixedTypes<short, short, short, short> mt3 = new MixedTypes<>((short)0xaaa, (short)0xbbb, (short)0xccc, (short)0xddd);
 
-        assertEquals(mt3.a, 0xaaaaaaaaaaaaaaaaL);
-        assertEquals(mt3.b, 0xbbbbbbbbbbbbbbbbL);
-        assertEquals(mt3.c, 0xccccccccccccccccL);
-        assertEquals(mt3.d, 0xddddddddddddddddL);
+        assertEquals(mt3.a, 0xaaa);
+        assertEquals(mt3.b, 0xbbb);
+        assertEquals(mt3.c, 0xccc);
+        assertEquals(mt3.d, 0xddd);
 
-        MixedTypes<double, double, double, double> mt4 = new MixedTypes<>(0.12345678901234567890D, 0.2345678901234567890D, 0.345678901234567890D, 0.45678901234567890D);
+        MixedTypes<float, float, float, float> mt4 = new MixedTypes<>(0.12345678901234567890f, 0.2345678901234567890f, 0.345678901234567890f, 0.45678901234567890f);
 
-        assertEquals(mt4.a, 0.12345678901234567890D);
-        assertEquals(mt4.b, 0.2345678901234567890D);
-        assertEquals(mt4.c, 0.345678901234567890D);
-        assertEquals(mt4.d, 0.45678901234567890D);
+        assertEquals(mt4.a, 0.12345678901234567890f);
+        assertEquals(mt4.b, 0.2345678901234567890f);
+        assertEquals(mt4.c, 0.345678901234567890f);
+        assertEquals(mt4.d, 0.45678901234567890f);
     }
 }
 
--- a/test/valhalla/test/valhalla/specializer/MultiBoxTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/specializer/MultiBoxTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -41,20 +41,20 @@
     }
 
     <any A, any B, any C, any D, any E> void testForward(MultiBox<A, B, C, D, E> mb_abcde) {
-        MultiBox<int, long, float, double, boolean> mb_ilfdb =
+        MultiBox<int, short, float, char, boolean> mb_ilfdb =
                 mb_abcde.withA(0)
-                        .withB(0L)
+                        .withB((short)0)
                         .withC(0f)
-                        .withD(0d)
+                        .withD('d')
                         .withE(false);
     }
 
     <any A, any B, any C, any D, any E> void testBackwards(MultiBox<A, B, C, D, E> mb_abcde) {
-        MultiBox<int, long, float, double, boolean> mb_ilfdb =
+        MultiBox<int, short, float, char, boolean> mb_ilfdb =
                 mb_abcde.withE(false)
-                        .withD(0d)
+                        .withD('d')
                         .withC(0f)
-                        .withB(0L)
+                        .withB((short)0)
                         .withA(0);
     }
 
--- a/test/valhalla/test/valhalla/specializer/ObjectMethodsTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/specializer/ObjectMethodsTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -92,12 +92,12 @@
                 i -> Integer.valueOf(i).hashCode());
     }
 
-    public void testLong() {
-        testNumericType(0L, 100,
-                l -> (long)(l + 1),
-                l -> Long.valueOf(l).toString(),
-                l -> Long.valueOf(l).hashCode());
-    }
+//    public void testLong() {
+//        testNumericType(0L, 100,
+//                l -> (long)(l + 1),
+//                l -> Long.valueOf(l).toString(),
+//                l -> Long.valueOf(l).hashCode());
+//    }
 
     public void testFloat() {
         testNumericType(0f, 100,
@@ -106,12 +106,12 @@
                 f -> Float.valueOf(f).hashCode());
     }
 
-    public void testDouble() {
-        testNumericType(0d, 100,
-                d -> (double)(d + 1),
-                d -> Double.valueOf(d).toString(),
-                d -> Double.valueOf(d).hashCode());
-    }
+//    public void testDouble() {
+//        testNumericType(0d, 100,
+//                d -> (double)(d + 1),
+//                d -> Double.valueOf(d).toString(),
+//                d -> Double.valueOf(d).hashCode());
+//    }
 
     public void testChar() {
         testNumericType((char)0, 100,
--- a/test/valhalla/test/valhalla/specializer/SignatureVisitorTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package valhalla.specializer;
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-import valhalla.specializer.SignatureSpecializer.BoundInfo;
-import valhalla.specializer.SignatureSpecializer.SpecializedSignature;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * SignatureVisitorTest
- *
- * @author Brian Goetz
- */
-
-@Test
-public class SignatureVisitorTest {
-    static Map<String, String> tInt = new HashMap<>();
-    static Map<String, String> uInt = new HashMap<>();
-    static Map<String, BoundInfo> bounds = new HashMap<>();
-
-    static {
-        tInt.put("T", "I");
-        uInt.put("U", "I");
-        bounds.put("T", new BoundInfo("Ljava/lang/Object;", tInt));
-        bounds.put("U", new BoundInfo("Ljava/lang/Object;", tInt));
-    }
-
-    private void assertClassSig(String in, String out, Map<String, String> specializations) {
-        Assert.assertEquals(out, new SpecializedSignature(in, specializations).toString());
-    }
-
-    private void assertMethodSig(String in, String out, Map<String, String> specializations) {
-        Assert.assertEquals(out, new SignatureSpecializer.SpecializedSignature(in, specializations).toDesc(bounds));
-    }
-
-    private void assertTypeSig(String in, String out, Map<String, String> specializations) {
-        Assert.assertEquals(out, new SignatureSpecializer.SpecializedSignature(in, specializations).toDesc(bounds));
-    }
-
-    private void assertMethodSig(String in, String out,
-                                 String descIn, String descOut,
-                                 Map<String, String> specializations) {
-        SpecializedSignature mangled = new SpecializedSignature(in, specializations);
-        Assert.assertEquals(out, mangled.toString());
-        Assert.assertEquals(descOut, mangled.toDesc(Collections.emptyMap()));
-    }
-
-    public void testRemoveTVar() {
-        // No tvars; signature unchanged
-        assertClassSig("Ljava/lang/Object;",
-                       "Ljava/lang/Object;", tInt);
-        // Only T; make sure to drop <>
-        assertClassSig("<T:Ljava/lang/Object;>Ljava/lang/Object;",
-                       "Ljava/lang/Object;", tInt);
-
-        // Only U; unchanged
-        assertClassSig("<U:Ljava/lang/Object;>Ljava/lang/Object;",
-                       "<U:Ljava/lang/Object;>Ljava/lang/Object;", tInt);
-
-        // T and U; only remove T
-        assertClassSig("<T:Ljava/lang/Object;U:Ljava/lang/Object;>Ljava/lang/Object;",
-                       "<U:Ljava/lang/Object;>Ljava/lang/Object;", tInt);
-
-        // T bound is Foo<[I>
-        assertClassSig("<T:LFoo<[I>;U:Ljava/lang/Object;>Ljava/lang/Object;",
-                       "<U:Ljava/lang/Object;>Ljava/lang/Object;", tInt);
-
-    }
-
-    public void testSuperclass() {
-        // Class Foo<T> extends Super<T>
-        assertClassSig("<T:Ljava/lang/Object;>LSuper<TT;>;", "LSuper<I>;", tInt);
-        assertClassSig("<T:Ljava/lang/Object;>LSuper<TU;>;", "LSuper<TU;>;", tInt);
-
-        assertClassSig("<T:Ljava/lang/Object;U:Ljava/lang/Object;>LSuper<TT;>;", "<T:Ljava/lang/Object;>LSuper<TT;>;", uInt);
-        assertClassSig("<T:Ljava/lang/Object;U:Ljava/lang/Object;>LSuper<TT;>;", "<U:Ljava/lang/Object;>LSuper<I>;", tInt);
-        assertClassSig("<T:Ljava/lang/Object;U:Ljava/lang/Object;>LSuper<ITT;>;", "<T:Ljava/lang/Object;>LSuper<ITT;>;", uInt);
-        assertClassSig("<T:Ljava/lang/Object;U:Ljava/lang/Object;>LSuper<ITT;>;", "<U:Ljava/lang/Object;>LSuper<II>;", tInt);
-        assertClassSig("<T:Ljava/lang/Object;U:Ljava/lang/Object;>LSuper<ITU;>;", "<T:Ljava/lang/Object;>LSuper<II>;", uInt);
-    }
-
-    public void testSpecializedSuperclass() {
-        SpecializedSignature v = new SpecializedSignature("<T:Ljava/lang/Object;U:Ljava/lang/Object;>LA<ITU;>;", uInt);
-        Assert.assertEquals(v.toSuperClassName(Collections.emptyMap()), "A${0=I,1=I}");
-    }
-
-    public void testField() {
-        assertTypeSig("TT;", "I", tInt);
-        assertTypeSig("[TT;", "[I", tInt);
-        assertTypeSig("[[TT;", "[[I", tInt);
-        assertTypeSig("TU;", "Ljava/lang/Object;", tInt);
-        assertTypeSig("LFoo<TT;>;", "LFoo${0=I};", tInt);
-        assertTypeSig("LFoo<I>;", "LFoo${0=I};", tInt);
-        assertTypeSig("LFoo<TT;TT;TT;>;", "LFoo${0=I,1=I,2=I};", tInt);
-        assertTypeSig("LFoo<ITT;TT;>;", "LFoo${0=I,1=I,2=I};", tInt);
-        assertTypeSig("LFoo<TT;LString;>;", "LFoo${0=I};", tInt);
-        assertTypeSig("LFoo<ILString;>;", "LFoo${0=I};", tInt);
-        assertTypeSig("LFoo<ILBar<TT;>;>;", "LFoo${0=I};", tInt);
-    }
-
-    public void testMethod() {
-        assertMethodSig("()TT;", "()I", tInt);
-        assertMethodSig("()LList<TT;>;", "()LList${0=I};", tInt);
-        assertMethodSig("()[TT;", "()[I", tInt);
-        assertMethodSig("()TU;", "()Ljava/lang/Object;", tInt);
-        assertMethodSig("(TT;)V", "(I)V", tInt);
-        assertMethodSig("(LList<TT;>;)V", "(LList${0=I};)V", tInt);
-        assertMethodSig("([TT;)V", "([I)V", tInt);
-        assertMethodSig("(TU;)V", "(Ljava/lang/Object;)V", tInt);
-    }
-
-    public void testMethodDescriptor() {
-        assertMethodSig("(LObject;)TT;", "(LObject;)I", "(LObject;)LObject;", "(LObject;)I", tInt);
-        assertMethodSig("(TT;)LObject;", "(I)LObject;", "(LObject;)LObject;", "(I)LObject;", tInt);
-        assertMethodSig("(LBox<TT;>;)LObject;", "(LBox<I>;)LObject;", "(LBox;)LObject;", "(LBox${0=I};)LObject;", tInt);
-    }
-
-    public void testWildcards() {
-        assertTypeSig("LFoo<+TU;>;", "LFoo;", tInt);
-        assertTypeSig("LFoo<-TU;>;", "LFoo;", tInt);
-        assertTypeSig("LFoo<+TT;>;", "LFoo${0=I};", tInt);
-        assertTypeSig("LFoo<-TT;>;", "LFoo${0=I};", tInt);
-        assertTypeSig("LFoo<I+TT;+TT;>;", "LFoo${0=I,1=I,2=I};", tInt);
-        assertMethodSig("()LList<+TT;>;", "()LList${0=I};", tInt);
-        assertMethodSig("()LList<-TT;>;", "()LList${0=I};", tInt);
-        assertMethodSig("(LList<+TT;>;)V", "(LList${0=I};)V", tInt);
-        assertMethodSig("(LList<-TT;>;)V", "(LList${0=I};)V", tInt);
-    }
-}
--- a/test/valhalla/test/valhalla/specializer/SpecializationMetadataTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/specializer/SpecializationMetadataTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -41,8 +41,8 @@
         assertEquals(ts.foo("foo"), 1);
         Target<int> ti = new Target<>();
         assertEquals(ti.foo(7), 1);
-        Target<long> tl = new Target<>();
-        assertEquals(tl.foo(7L), 1);
+        Target<float> tl = new Target<>();
+        assertEquals(tl.foo(7f), 1);
     }
 
     static class Target<any T> {
--- a/test/valhalla/test/valhalla/specializer/TwoBoxTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/specializer/TwoBoxTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -86,35 +86,35 @@
     }
 
     public void testIntPair() {
-        TwoBox<int, long> tb = new IntPair<long>();
+        TwoBox<int, float> tb = new IntPair<float>();
         tb.t = 3;
         tb.u = 4L;
         assertEquals(tb.t, 3);
-        assertEquals(tb.u, 4L);
+        assertEquals(tb.u, 4f);
         tb.setT(5);
-        tb.setU(6L);
+        tb.setU(6f);
         assertEquals(tb.getT(), 5);
-        assertEquals(tb.getU(), 6L);
-        assertTrue(TwoBox<int,long>.class.isAssignableFrom(tb.getClass()));
-        tb.set(7, 8L);
+        assertEquals(tb.getU(), 6f);
+        assertTrue(TwoBox<int,float>.class.isAssignableFrom(tb.getClass()));
+        tb.set(7, 8f);
 
-        tb = new IntLongPair();
+        tb = new IntFloatPair();
         tb.t = 3;
-        tb.u = 4L;
+        tb.u = 4f;
         assertEquals(tb.t, 3);
-        assertEquals(tb.u, 4L);
+        assertEquals(tb.u, 4f);
         tb.setT(5);
-        tb.setU(6L);
+        tb.setU(6f);
         assertEquals(tb.getT(), 5);
-        assertEquals(tb.getU(), 6L);
+        assertEquals(tb.getU(), 6f);
         tb.setTIndirectField(7);
         assertEquals(tb.getTIndirectField(), 7);
         tb.setTIndirectSetter(9);
         assertEquals(tb.getTIndirectGetter(), 9);
-        assertTrue(TwoBox<int,long>.class.isAssignableFrom(tb.getClass()));
+        assertTrue(TwoBox<int,float>.class.isAssignableFrom(tb.getClass()));
 
-        assertTrue(IntPair<long>.class.isAssignableFrom(IntLongPair.class));
-        assertTrue(!IntPair<int>.class.isAssignableFrom(IntLongPair.class));
+        assertTrue(IntPair<float>.class.isAssignableFrom(IntFloatPair.class));
+        assertTrue(!IntPair<int>.class.isAssignableFrom(IntFloatPair.class));
     }
 
     // Test that use of U in field access / invocation *within* the specialized class is properly erased
@@ -131,13 +131,13 @@
 
     public void testSpecializedGenericMethod() {
         TwoBox<int, int> b = TwoBox.make(3, 4);
-        assertEquals("TwoBox${0=I,1=I}", b.getClass().getSimpleName());
+        assertEquals("TwoBox$${II}", b.getClass().getSimpleName());
         assertNotSame(TwoBox.class, b.getClass());
         assertEquals(b.t, 3);
         assertEquals(b.u, 4);
 
         TwoBox<int, String> b2 = TwoBox.make(3, "foo");
-        assertEquals("TwoBox${0=I}", b2.getClass().getSimpleName());
+        assertEquals("TwoBox$${I_}", b2.getClass().getSimpleName());
         assertNotSame(TwoBox.class, b2.getClass());
         assertEquals(b2.t, 3);
         assertEquals(b2.u, "foo");
@@ -159,7 +159,7 @@
 
 }
 
-class IntLongPair extends IntPair<long> {
+class IntFloatPair extends IntPair<float> {
 
 }
 
--- a/test/valhalla/test/valhalla/specializer/WhereTest.java	Thu Mar 17 12:59:56 2016 +0100
+++ b/test/valhalla/test/valhalla/specializer/WhereTest.java	Mon Apr 18 17:33:38 2016 +0100
@@ -40,12 +40,12 @@
     }
 
     public void testWhereRef() {
-        Test<int, long> ti = new Test<>(); //second targs is used to trigger specialization
+        Test<int, float> ti = new Test<>(); //second targs is used to trigger specialization
         lookup(ti.getClass(), "val");
     }
 
     public void testWhereVal() {
-        Test<Integer, long> ti = new Test<>(); //second targs is used to trigger specialization
+        Test<Integer, float> ti = new Test<>(); //second targs is used to trigger specialization
         lookup(ti.getClass(), "ref");
     }