changeset 53178:6c828d9cf6e8 lworld

Minor patch to ASM for Q-Type support
author mchung
date Wed, 12 Dec 2018 10:07:38 -0800
parents a2d1bb5a17dc
children 5853bd189392
files src/java.base/share/classes/jdk/internal/org/objectweb/asm/Frame.java src/java.base/share/classes/jdk/internal/org/objectweb/asm/Type.java src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/CheckClassAdapter.java
diffstat 3 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Frame.java	Wed Dec 12 13:12:17 2018 +0530
+++ b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Frame.java	Wed Dec 12 10:07:38 2018 -0800
@@ -353,6 +353,7 @@
             case 'D':
                 return DOUBLE;
             case 'L':
+            case 'Q':
                 internalName = buffer.substring(offset + 1, buffer.length() - 1);
                 return REFERENCE_KIND | symbolTable.addType(internalName);
             case '[':
@@ -387,6 +388,7 @@
                         typeValue = DOUBLE;
                         break;
                     case 'L':
+                    case 'Q':
                         internalName = buffer.substring(elementDescriptorOffset + 1, buffer.length() - 1);
                         typeValue = REFERENCE_KIND | symbolTable.addType(internalName);
                         break;
--- a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Type.java	Wed Dec 12 13:12:17 2018 +0530
+++ b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Type.java	Wed Dec 12 10:07:38 2018 -0800
@@ -334,7 +334,8 @@
             while (methodDescriptor.charAt(currentOffset) == '[') {
                 currentOffset++;
             }
-            if (methodDescriptor.charAt(currentOffset++) == 'L') {
+            char c = methodDescriptor.charAt(currentOffset++);
+            if (c == 'L' || c == 'Q') {
                 // Skip the argument descriptor content.
                 currentOffset = methodDescriptor.indexOf(';', currentOffset) + 1;
             }
@@ -352,7 +353,8 @@
             while (methodDescriptor.charAt(currentOffset) == '[') {
                 currentOffset++;
             }
-            if (methodDescriptor.charAt(currentOffset++) == 'L') {
+            char c = methodDescriptor.charAt(currentOffset++);
+            if (c == 'L' || c == 'Q') {
                 // Skip the argument descriptor content.
                 currentOffset = methodDescriptor.indexOf(';', currentOffset) + 1;
             }
@@ -401,7 +403,8 @@
             while (methodDescriptor.charAt(currentOffset) == '[') {
                 currentOffset++;
             }
-            if (methodDescriptor.charAt(currentOffset++) == 'L') {
+            char c = methodDescriptor.charAt(currentOffset++);
+            if (c == 'L' || c == 'Q') {
                 // Skip the argument descriptor content.
                 currentOffset = methodDescriptor.indexOf(';', currentOffset) + 1;
             }
@@ -774,7 +777,8 @@
                 while (methodDescriptor.charAt(currentOffset) == '[') {
                     currentOffset++;
                 }
-                if (methodDescriptor.charAt(currentOffset++) == 'L') {
+                char c = methodDescriptor.charAt(currentOffset++);
+                if (c == 'L' || c == 'Q') {
                     // Skip the argument descriptor content.
                     currentOffset = methodDescriptor.indexOf(';', currentOffset) + 1;
                 }
--- a/src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/CheckClassAdapter.java	Wed Dec 12 13:12:17 2018 +0530
+++ b/src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/CheckClassAdapter.java	Wed Dec 12 10:07:38 2018 -0800
@@ -624,7 +624,7 @@
             pos = checkTypeParameters(signature, pos);
         }
         pos = checkChar('(', signature, pos);
-        while ("ZCBSIFJDL[T".indexOf(getChar(signature, pos)) != -1) {
+        while ("ZCBSIFJDLQ[T".indexOf(getChar(signature, pos)) != -1) {
             pos = checkJavaTypeSignature(signature, pos);
         }
         pos = checkChar(')', signature, pos);
@@ -635,7 +635,7 @@
         }
         while (getChar(signature, pos) == '^') {
             ++pos;
-            if (getChar(signature, pos) == 'L') {
+            if (getChar(signature, pos) == 'L' || getChar(signature, pos) == 'Q') {
                 pos = checkClassTypeSignature(signature, pos);
             } else {
                 pos = checkTypeVariableSignature(signature, pos);
@@ -751,7 +751,12 @@
         // ClassTypeSignatureSuffix:
         //   . SimpleClassTypeSignature
         int pos = startPos;
-        pos = checkChar('L', signature, pos);
+        if (getChar(signature, pos) == 'L' || getChar(signature, pos) == 'Q') {
+            pos = pos + 1;
+        } else {
+            throw new IllegalArgumentException(signature + ": 'L' or 'Q' expected at index " + pos);
+        }
+
         pos = checkSignatureIdentifier(signature, pos);
         while (getChar(signature, pos) == '/') {
             pos = checkSignatureIdentifier(signature, pos + 1);