changeset 52964:dbc996b567d4 asm-condy

modifying regression tests to adapt them to the new ASM 7
author vromero
date Sat, 03 Nov 2018 17:37:21 -0400
parents 74a30fa0d1e5
children 11d1fd3caa66
files src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java test/hotspot/jtreg/compiler/jvmci/common/CTVMUtilities.java test/hotspot/jtreg/runtime/RedefineTests/RedefineAnnotations.java test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenCPFullOfMH.java test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenCPFullOfMT.java test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenManyIndyCorrectBootstrap.java test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenManyIndyIncorrectBootstrap.java test/hotspot/jtreg/vmTestbase/vm/mlvm/patches/java.base/jdk/internal/org/objectweb/asm/ClassWriterExt.java
diffstat 8 files changed, 5 insertions(+), 95 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java	Mon Oct 29 22:22:46 2018 -0400
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventClassBuilder.java	Sat Nov 03 17:37:21 2018 -0400
@@ -57,7 +57,7 @@
 
     public EventClassBuilder(List<AnnotationElement> annotationElements, List<ValueDescriptor> fields) {
         this.fullClassName = "jdk.jfr.DynamicEvent" + idCounter.incrementAndGet();
-        this.type = Type.getType(fullClassName.replace(".", "/"));
+        this.type = Type.getType("L" + fullClassName.replace(".", "/") + ";");
         this.fields = fields;
         this.annotationElements = annotationElements;
     }
--- a/test/hotspot/jtreg/compiler/jvmci/common/CTVMUtilities.java	Mon Oct 29 22:22:46 2018 -0400
+++ b/test/hotspot/jtreg/compiler/jvmci/common/CTVMUtilities.java	Sat Nov 03 17:37:21 2018 -0400
@@ -111,7 +111,7 @@
 
         public ClassVisitorForLabels(ClassWriter cw, Map<Label, Integer> lines,
                                      Executable target) {
-            super(Opcodes.ASM5, cw);
+            super(Opcodes.ASM7, cw);
             this.lineNumbers = lines;
 
             StringBuilder builder = new StringBuilder("(");
@@ -137,7 +137,7 @@
             MethodVisitor mv = cv.visitMethod(access, name, desc, signature,
                     exceptions);
             if (targetDesc.equals(desc) && targetName.equals(name)) {
-                return new MethodVisitor(Opcodes.ASM5, mv) {
+                return new MethodVisitor(Opcodes.ASM7, mv) {
                     @Override
                     public void visitLineNumber(int i, Label label) {
                         super.visitLineNumber(i, label);
--- a/test/hotspot/jtreg/runtime/RedefineTests/RedefineAnnotations.java	Mon Oct 29 22:22:46 2018 -0400
+++ b/test/hotspot/jtreg/runtime/RedefineTests/RedefineAnnotations.java	Sat Nov 03 17:37:21 2018 -0400
@@ -63,7 +63,7 @@
 import jdk.internal.org.objectweb.asm.ClassVisitor;
 import jdk.internal.org.objectweb.asm.ClassWriter;
 import jdk.internal.org.objectweb.asm.FieldVisitor;
-import static jdk.internal.org.objectweb.asm.Opcodes.ASM5;
+import static jdk.internal.org.objectweb.asm.Opcodes.ASM7;
 
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.TYPE_USE)
@@ -85,7 +85,7 @@
             throws IllegalClassFormatException {
 
             ClassWriter cw = new ClassWriter(0);
-            ClassVisitor cv = new ReAddDummyFieldsClassVisitor(ASM5, cw) { };
+            ClassVisitor cv = new ReAddDummyFieldsClassVisitor(ASM7, cw) { };
             ClassReader cr = new ClassReader(classfileBuffer);
             cr.accept(cv, 0);
             return cw.toByteArray();
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenCPFullOfMH.java	Mon Oct 29 22:22:46 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenCPFullOfMH.java	Sat Nov 03 17:37:21 2018 -0400
@@ -40,8 +40,6 @@
 
     @Override
     protected void generateCommonData(ClassWriterExt cw) {
-        cw.setCacheMHandles(false);
-
         cw.visitField(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC,
                 STATIC_FIELD_NAME,
                 STATIC_FIELD_SIGNATURE, null, false);
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenCPFullOfMT.java	Mon Oct 29 22:22:46 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenCPFullOfMT.java	Sat Nov 03 17:37:21 2018 -0400
@@ -39,7 +39,6 @@
 
     @Override
     protected void generateCommonData(ClassWriterExt cw) {
-        cw.setCacheMTypes(false);
         super.generateCommonData(cw);
     }
 
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenManyIndyCorrectBootstrap.java	Mon Oct 29 22:22:46 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenManyIndyCorrectBootstrap.java	Sat Nov 03 17:37:21 2018 -0400
@@ -80,7 +80,6 @@
      */
     @Override
     protected void generateCommonData(ClassWriterExt cw) {
-        cw.setCacheInvokeDynamic(false);
         super.generateCommonData(cw);
     }
 
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenManyIndyIncorrectBootstrap.java	Mon Oct 29 22:22:46 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/cp/share/GenManyIndyIncorrectBootstrap.java	Sat Nov 03 17:37:21 2018 -0400
@@ -115,8 +115,6 @@
      */
     @Override
     protected void generateCommonData(ClassWriterExt cw) {
-        cw.setCacheInvokeDynamic(false);
-
         cw.visitField(Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC,
                 STATIC_BOOTSTRAP_FIELD_NAME,
                 STATIC_BOOTSTRAP_FIELD_SIGNATURE, null, null);
--- a/test/hotspot/jtreg/vmTestbase/vm/mlvm/patches/java.base/jdk/internal/org/objectweb/asm/ClassWriterExt.java	Mon Oct 29 22:22:46 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/vm/mlvm/patches/java.base/jdk/internal/org/objectweb/asm/ClassWriterExt.java	Sat Nov 03 17:37:21 2018 -0400
@@ -26,11 +26,6 @@
 import java.lang.reflect.InaccessibleObjectException;
 
 public class ClassWriterExt extends ClassWriter {
-    private boolean cacheInvokeDynamic = true;
-    private boolean cacheMTypes = true;
-    private boolean cacheMHandles = true;
-
-    private final Item key = new Item();
 
     public ClassWriterExt(ClassReader cr, int flags) {
         super(cr, flags);
@@ -40,85 +35,6 @@
         super(flags);
     }
 
-    @Override
-    Item newInvokeDynamicItem(final String name, final String desc,
-                    final Handle bsm, final Object... bsmArgs) {
-        if (cacheInvokeDynamic) {
-            return super.newInvokeDynamicItem(name, desc, bsm, bsmArgs);
-        }
-        int type = ClassWriter.INDY;
-        disableItemHashTableFor(type);
-        Item result;
-        try {
-            return super.newInvokeDynamicItem(name, desc, bsm, bsmArgs);
-        } finally {
-            restoreItemHashTableFor(type);
-        }
-    }
-
-    @Override
-    Item newStringishItem(final int type, final String value) {
-        if (type != ClassWriter.MTYPE) {
-            return super.newStringishItem(type, value);
-        }
-        if (cacheMTypes) {
-            return super.newStringishItem(type, value);
-        }
-        disableItemHashTableFor(type);
-        try {
-            return super.newStringishItem(type, value);
-        } finally {
-            restoreItemHashTableFor(type);
-        }
-    }
-
-    @Override
-    Item newHandleItem(final int tag, final String owner, final String name,
-            final String desc, final boolean itf) {
-        if (cacheMHandles) {
-            return super.newHandleItem(tag, owner, name, desc, itf);
-        }
-        int type = ClassWriter.HANDLE_BASE + tag;
-        disableItemHashTableFor(type);
-        try {
-            return super.newHandleItem(tag, owner, name, desc, itf);
-        } finally {
-            restoreItemHashTableFor(type);
-        }
-    }
-
-    private void disableItemHashTableFor(int type) {
-        for (Item i : items) {
-            while (i != null) {
-                if (i.type == type) {
-                    i.type = -type;
-                }
-                i = i.next;
-            }
-        }
-    }
-
-    private void restoreItemHashTableFor(int type) {
-        for (Item i : items) {
-            while (i != null) {
-                if (i.type == -type) {
-                    i.type = type;
-                }
-                i = i.next;
-            }
-        }
-    }
-
-    public void setCacheInvokeDynamic(boolean value) {
-        cacheInvokeDynamic = value;
-    }
-    public void setCacheMTypes(boolean value) {
-        cacheMTypes = value;
-    }
-    public void setCacheMHandles(boolean value) {
-        cacheMHandles = value;
-    }
-
     public int getBytecodeLength(MethodVisitor mv) {
         ByteVector code;
         try {