changeset 18:51618da7aecc

Change from CONSTANT_ConstantDynamic to CONSTANT_Dynamic in accordance with the latest VM spec changes.
author psandoz
date Wed, 08 Nov 2017 16:44:53 -0800
parents e3e13e71f94d
children f788f629bb40
files src/org/openjdk/asmtools/jasm/ClassData.java src/org/openjdk/asmtools/jasm/ConstantPool.java src/org/openjdk/asmtools/jasm/ParserCP.java src/org/openjdk/asmtools/jasm/Tables.java src/org/openjdk/asmtools/jcoder/JcodTokens.java src/org/openjdk/asmtools/jdec/ClassData.java src/org/openjdk/asmtools/jdis/ConstantPool.java
diffstat 7 files changed, 24 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/openjdk/asmtools/jasm/ClassData.java	Tue Nov 07 15:28:57 2017 -0800
+++ b/src/org/openjdk/asmtools/jasm/ClassData.java	Wed Nov 08 16:44:53 2017 -0800
@@ -25,7 +25,6 @@
 import java.io.*;
 import java.util.ArrayList;
 
-import static org.openjdk.asmtools.jasm.Constants.*;
 import static org.openjdk.asmtools.jasm.Tables.*;
 
 /**
@@ -146,7 +145,7 @@
 
     /*
      * After a constant pool has been explicitly declared,
-     * this method links the Constant_InvokeDynamic Constant_ConstantDynamic
+     * this method links the Constant_InvokeDynamic Constant_Dynamic
      * constants with any bootstrap methods that they index in the
      * Bootstrap Methods Attribute
      */
@@ -163,7 +162,7 @@
                 ref = cell.ref;
             }
             if (ref != null
-                    && (ref.tag == ConstType.CONSTANT_INVOKEDYNAMIC || ref.tag == ConstType.CONSTANT_CONSTANTDYNAMIC)) {
+                    && (ref.tag == ConstType.CONSTANT_INVOKEDYNAMIC || ref.tag == ConstType.CONSTANT_DYNAMIC)) {
                 // Find only the Constant
                 ConstantPool.ConstValue_IndyOrCondyPair refval = (ConstantPool.ConstValue_IndyOrCondyPair) ref;
                 BootstrapMethodData bsmdata = refval.bsmData;
--- a/src/org/openjdk/asmtools/jasm/ConstantPool.java	Tue Nov 07 15:28:57 2017 -0800
+++ b/src/org/openjdk/asmtools/jasm/ConstantPool.java	Wed Nov 08 16:44:53 2017 -0800
@@ -376,7 +376,7 @@
 
         protected ConstValue_IndyOrCondyPair(ConstType tag, BootstrapMethodData bsmdata, ConstCell napeCell) {
             super(tag);
-            assert (tag == ConstType.CONSTANT_CONSTANTDYNAMIC && ConstValue_CondyPair.class.isAssignableFrom(getClass())) ||
+            assert (tag == ConstType.CONSTANT_DYNAMIC && ConstValue_CondyPair.class.isAssignableFrom(getClass())) ||
                    tag == ConstType.CONSTANT_INVOKEDYNAMIC && ConstValue_IndyPair.class.isAssignableFrom(getClass());
 
             this.bsmData = bsmdata;
@@ -422,7 +422,7 @@
     static public class ConstValue_CondyPair extends ConstValue_IndyOrCondyPair {
 
         public ConstValue_CondyPair(BootstrapMethodData bsmdata, ConstCell napeCell) {
-            super(ConstType.CONSTANT_CONSTANTDYNAMIC, bsmdata, napeCell);
+            super(ConstType.CONSTANT_DYNAMIC, bsmdata, napeCell);
         }
     }
 
@@ -559,8 +559,8 @@
                 case CONSTANT_METHODHANDLE:
                     retVal = visitMethodhandle(tag);
                     break;
-                case CONSTANT_CONSTANTDYNAMIC:
-                    retVal = visitConstantdynamic(tag);
+                case CONSTANT_DYNAMIC:
+                    retVal = visitDynamic(tag);
                     break;
                 case CONSTANT_INVOKEDYNAMIC:
                     retVal = visitInvokedynamic(tag);
@@ -636,7 +636,7 @@
         }
 
         ;
-        public R visitConstantdynamic(ConstType tag) {
+        public R visitDynamic(ConstType tag) {
             return null;
         }
 
@@ -713,8 +713,8 @@
                 case CONSTANT_METHODHANDLE:
                     retVal = visitMethodhandle((ConstValue_Pair) val);
                     break;
-                case CONSTANT_CONSTANTDYNAMIC:
-                    retVal = visitConstantdynamic((ConstValue_CondyPair) val);
+                case CONSTANT_DYNAMIC:
+                    retVal = visitDynamic((ConstValue_CondyPair) val);
                     break;
                 case CONSTANT_INVOKEDYNAMIC:
                     retVal = visitInvokedynamic((ConstValue_IndyPair) val);
@@ -796,7 +796,7 @@
         }
 
         ;
-        public R visitConstantdynamic(ConstValue_CondyPair p) { return null;}
+        public R visitDynamic(ConstValue_CondyPair p) { return null;}
 
         ;
         public R visitInvokedynamic(ConstValue_IndyPair p) { return null;}
@@ -1010,7 +1010,7 @@
 
         ;
         @Override
-        public Void visitConstantdynamic(ConstValue_CondyPair p) {
+        public Void visitDynamic(ConstValue_CondyPair p) {
             return null;
         }
 
--- a/src/org/openjdk/asmtools/jasm/ParserCP.java	Tue Nov 07 15:28:57 2017 -0800
+++ b/src/org/openjdk/asmtools/jasm/ParserCP.java	Wed Nov 08 16:44:53 2017 -0800
@@ -468,8 +468,8 @@
         }
 
         @Override
-        public ConstantPool.ConstValue_CondyPair visitConstantdynamic(ConstType tag) {
-            debugStr("------- [ParserCPVisitor.visitConstantDynamic]: ");
+        public ConstantPool.ConstValue_CondyPair visitDynamic(ConstType tag) {
+            debugStr("------- [ParserCPVisitor.visitDynamic]: ");
             ConstantPool.ConstValue_CondyPair obj = null;
             try {
                 if (scanner.token == Token.INTVAL) {
--- a/src/org/openjdk/asmtools/jasm/Tables.java	Tue Nov 07 15:28:57 2017 -0800
+++ b/src/org/openjdk/asmtools/jasm/Tables.java	Wed Nov 08 16:44:53 2017 -0800
@@ -127,7 +127,7 @@
         // Constant 14 reserved
         CONSTANT_METHODHANDLE               (15, "CONSTANT_METHODHANDLE", "MethodHandle"),
         CONSTANT_METHODTYPE                 (16, "CONSTANT_METHODTYPE", "MethodType"),
-        CONSTANT_CONSTANTDYNAMIC            (17, "CONSTANT_CONSTANTDYNAMIC", "ConstantDynamic"),
+        CONSTANT_DYNAMIC                    (17, "CONSTANT_DYNAMIC", "Dynamic"),
         CONSTANT_INVOKEDYNAMIC              (18, "CONSTANT_INVOKEDYNAMIC", "InvokeDynamic"),
         CONSTANT_MODULE                     (19, "CONSTANT_MODULE",        "Module"),
         CONSTANT_PACKAGE                    (20, "CONSTANT_PACKAGE",       "Package");
--- a/src/org/openjdk/asmtools/jcoder/JcodTokens.java	Tue Nov 07 15:28:57 2017 -0800
+++ b/src/org/openjdk/asmtools/jcoder/JcodTokens.java	Wed Nov 08 16:44:53 2017 -0800
@@ -304,7 +304,7 @@
         // Constant 14 reserved
         CONSTANT_METHODHANDLE               (15, "CONSTANT_METHODHANDLE", "MethodHandle"),
         CONSTANT_METHODTYPE                 (16, "CONSTANT_METHODTYPE", "MethodType"),
-        CONSTANT_CONSTANTDYNAMIC            (17, "CONSTANT_CONSTANTDYNAMIC", "ConstantDynamic"),
+        CONSTANT_DYNAMIC                    (17, "CONSTANT_DYNAMIC", "Dynamic"),
         CONSTANT_INVOKEDYNAMIC              (18, "CONSTANT_INVOKEDYNAMIC", "InvokeDynamic"),
         CONSTANT_MODULE                     (19, "CONSTANT_MODULE",  "Module"),
         CONSTANT_MODULE_PACKAGE             (20, "CONSTANT_PACKAGE", "Package");
--- a/src/org/openjdk/asmtools/jdec/ClassData.java	Tue Nov 07 15:28:57 2017 -0800
+++ b/src/org/openjdk/asmtools/jdec/ClassData.java	Wed Nov 08 16:44:53 2017 -0800
@@ -33,7 +33,6 @@
 import static java.lang.String.format;
 import static org.openjdk.asmtools.jasm.Tables.*;
 import static org.openjdk.asmtools.jasm.Tables.AnnotElemType.AE_UNKNOWN;
-import static org.openjdk.asmtools.jasm.Tables.StackMapType.ITEM_UNKNOWN;
 import static org.openjdk.asmtools.jasm.TypeAnnotationUtils.*;
 
 /**
@@ -231,7 +230,7 @@
                 case CONSTANT_NAMEANDTYPE:
                     cpool[i] = "#" + in.readUnsignedShort() + " #" + in.readUnsignedShort();
                     break;
-                case CONSTANT_CONSTANTDYNAMIC:
+                case CONSTANT_DYNAMIC:
                 case CONSTANT_INVOKEDYNAMIC:
                     cpool[i] = in.readUnsignedShort() + "s #" + in.readUnsignedShort();
                     break;
@@ -343,7 +342,7 @@
                     case CONSTANT_METHODTYPE:
                         valstr = (String) cpool[i];
                         break;
-                    case CONSTANT_CONSTANTDYNAMIC:
+                    case CONSTANT_DYNAMIC:
                         valstr = (String) cpool[i];
                         break;
                     case CONSTANT_INVOKEDYNAMIC:
--- a/src/org/openjdk/asmtools/jdis/ConstantPool.java	Tue Nov 07 15:28:57 2017 -0800
+++ b/src/org/openjdk/asmtools/jdis/ConstantPool.java	Wed Nov 08 16:44:53 2017 -0800
@@ -29,7 +29,6 @@
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Hashtable;
-import java.util.IllegalFormatException;
 
 /**
  *
@@ -68,7 +67,7 @@
         CONSTANT_NAMEANDTYPE        ((byte) 12, "NameAndType", "CONSTANT_NAMEANDTYPE"),
         CONSTANT_METHODHANDLE       ((byte) 15, "MethodHandle", "CONSTANT_METHODHANDLE"),
         CONSTANT_METHODTYPE         ((byte) 16, "MethodType", "CONSTANT_METHODTYPE"),
-        CONSTANT_CONSTANTDYNAMIC    ((byte) 17, "ConstantDynamic", "CONSTANT_CONSTANTDYNAMIC"),
+        CONSTANT_DYNAMIC            ((byte) 17, "Dynamic", "CONSTANT_DYNAMIC"),
         CONSTANT_INVOKEDYNAMIC      ((byte) 18, "InvokeDynamic", "CONSTANT_INVOKEDYNAMIC"),
         CONSTANT_MODULE             ((byte) 19, "Module", "CONSTANT_MODULE"),
         CONSTANT_PACKAGE            ((byte) 20, "Package", "CONSTANT_PACKAGE");
@@ -168,7 +167,7 @@
         taghash.put(new Byte(TAG.CONSTANT_NAMEANDTYPE.value()), TAG.CONSTANT_NAMEANDTYPE);
         taghash.put(new Byte(TAG.CONSTANT_METHODHANDLE.value()), TAG.CONSTANT_METHODHANDLE);
         taghash.put(new Byte(TAG.CONSTANT_METHODTYPE.value()), TAG.CONSTANT_METHODTYPE);
-        taghash.put(new Byte(TAG.CONSTANT_CONSTANTDYNAMIC.value()), TAG.CONSTANT_CONSTANTDYNAMIC);
+        taghash.put(new Byte(TAG.CONSTANT_DYNAMIC.value()), TAG.CONSTANT_DYNAMIC);
         taghash.put(new Byte(TAG.CONSTANT_INVOKEDYNAMIC.value()), TAG.CONSTANT_INVOKEDYNAMIC);
         taghash.put(new Byte(TAG.CONSTANT_MODULE.value()), TAG.CONSTANT_MODULE);
         taghash.put(new Byte(TAG.CONSTANT_PACKAGE.value()), TAG.CONSTANT_PACKAGE);
@@ -502,7 +501,7 @@
      *
      * Constant entries that contain two constant-pool indices. Usually, this includes:
      * CONSTANT_FIELD CONSTANT_METHOD CONSTANT_INTERFACEMETHOD CONSTANT_NAMEANDTYPE
-     * CONSTANT_METHODHANDLE CONSTANT_CONSTANTDYNAMIC CONSTANT_INVOKEDYNAMIC
+     * CONSTANT_METHODHANDLE CONSTANT_DYNAMIC CONSTANT_INVOKEDYNAMIC
      *
      */
     class CPX2 extends Constant {
@@ -531,7 +530,7 @@
                 case CONSTANT_METHODHANDLE:
                     str = subtagToString(value1) + ":" + StringValue(value2);
                     break;
-                case CONSTANT_CONSTANTDYNAMIC:
+                case CONSTANT_DYNAMIC:
                 case CONSTANT_INVOKEDYNAMIC:
                     int bsm_attr_idx = value1;
                     int nape_idx = value2;
@@ -591,7 +590,7 @@
                 case CONSTANT_NAMEANDTYPE:
                     out.println("#" + value1 + ":#" + value2 + ";\t//  " + stringVal());
                     break;
-                case CONSTANT_CONSTANTDYNAMIC:
+                case CONSTANT_DYNAMIC:
                 case CONSTANT_INVOKEDYNAMIC:
                     out.println(value1 + ":#" + value2 + ";\t//  " + stringVal());
                     break;
@@ -676,7 +675,7 @@
                 case CONSTANT_METHOD:
                 case CONSTANT_INTERFACEMETHOD:
                 case CONSTANT_NAMEANDTYPE:
-                case CONSTANT_CONSTANTDYNAMIC:
+                case CONSTANT_DYNAMIC:
                 case CONSTANT_INVOKEDYNAMIC:
                     pool.add(i, new CPX2(tagobj, in.readUnsignedShort(), in.readUnsignedShort()));
                     break;
@@ -1001,7 +1000,7 @@
         }
         switch (cns.tag) {
             case CONSTANT_METHODHANDLE:
-            case CONSTANT_CONSTANTDYNAMIC:
+            case CONSTANT_DYNAMIC:
             case CONSTANT_INVOKEDYNAMIC:
             case CONSTANT_METHOD:
             case CONSTANT_INTERFACEMETHOD: