changeset 3284:de66408690d1

Enhancement: use Class static arg instead of String for unspecialized receiver in alt generic method bootstrap
author mcimadamore
date Fri, 15 Jan 2016 18:19:42 +0000
parents 7af97c773606
children ce45cc7d0b52
files src/jdk.compiler/share/classes/com/sun/tools/javac/comp/SpecializeTypes.java
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/SpecializeTypes.java	Mon Jan 11 14:14:35 2016 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/SpecializeTypes.java	Fri Jan 15 18:19:42 2016 +0000
@@ -275,14 +275,17 @@
                 //to the original version of the method in the template class.
                 staticArgs.head.flags &= ~BootstrapArgument.SPECIALIZABLE;
 
-                //this is ignored for alt translation
-                Type effFinalReceiverType = receiverType;
-                staticArgs = staticArgs.prepend(new BootstrapArgument<String>(Kind.STRING, types.bytecodeMappingSig(receiverType).toString()) {
-                    @Override
-                    public Optional<Type> asType() {
-                        return Optional.of(effFinalReceiverType);
-                    }
-                });
+                if (!altTranslation) {
+                    Type effFinalReceiverType = receiverType;
+                    staticArgs = staticArgs.prepend(new BootstrapArgument<String>(Kind.STRING, types.bytecodeMappingSig(receiverType).toString()) {
+                        @Override
+                        public Optional<Type> asType() {
+                            return Optional.of(effFinalReceiverType);
+                        }
+                    });
+                } else {
+                    staticArgs = staticArgs.prepend(new BootstrapArgument<ClassSymbol>(Kind.CLASS, (ClassSymbol)receiverType.tsym));
+                }
 
                 Type declared = msym.type;
                 if (!receiverType.hasTag(TypeTag.NONE)) {