Check-in [df13b978a5]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:FieldDescriptor becomes ClassName since they are similar.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: df13b978a53876288c65234425b02a3b5e24477a
User & Date: stephanie.gawroriski 2019-04-17 01:20:28
Context
2019-04-17
01:30
Base dump of pool. check-in: 6f8bfc8ece user: stephanie.gawroriski tags: trunk
01:20
FieldDescriptor becomes ClassName since they are similar. check-in: df13b978a5 user: stephanie.gawroriski tags: trunk
01:14
Reduce the number of pool items that are used by removing names and handles. check-in: 9d0c6d9c70 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/mini/MinimizedPoolBuilder.java.

    78     78   			AccessedField af = (AccessedField)__v;
    79     79   			FieldReference fr = af.field();
    80     80   			return this.__add(__v,
    81     81   				af.time().ordinal(),
    82     82   				af.type().ordinal(),
    83     83   				this.add(fr.className()),
    84     84   				this.add(fr.memberName().toString()),
    85         -				this.add(fr.memberType()));
           85  +				this.add(fr.memberType().className()));
    86     86   		}
    87     87   		
    88     88   		// Class name
    89     89   		else if (__v instanceof ClassName)
    90     90   		{
    91     91   			// Write representation of array type and its component type to
    92     92   			// make sure they are always added
................................................................................
   127    127   				iv.type().ordinal(),
   128    128   				this.add(mh.outerClass()),
   129    129   				this.add(mh.name().toString()),
   130    130   				this.add(mh.descriptor()));
   131    131   		}
   132    132   		
   133    133   		// Field descriptor
   134         -		else if (__v instanceof FieldDescriptor)
          134  +		/*else if (__v instanceof FieldDescriptor)
   135    135   			return this.__add(__v,
   136    136   				this.add(__v.toString()), this.add(
   137         -					((FieldDescriptor)__v).className()));
          137  +					((FieldDescriptor)__v).className()));*/
   138    138   		
   139    139   		// Field/Method name
   140    140   		/*else if (__v instanceof FieldName ||
   141    141   			__v instanceof MethodName)
   142    142   			return this.__add(__v,
   143    143   				this.add(__v.toString()));*/
   144    144   		
................................................................................
   163    163   			
   164    164   			// Put in argument count
   165    165   			FieldDescriptor[] args = md.arguments();
   166    166   			sub.add(args.length);
   167    167   			
   168    168   			// Add return value
   169    169   			FieldDescriptor rv = md.returnValue();
   170         -			sub.add((rv == null ? 0 : this.add(rv)));
          170  +			sub.add((rv == null ? 0 : this.add(rv.className())));
   171    171   			
   172    172   			// Fill in arguments
   173    173   			FieldDescriptor[] margs = md.arguments();
   174    174   			for (FieldDescriptor marg : margs)
   175         -				sub.add(this.add(marg));
          175  +				sub.add(this.add(marg.className()));
   176    176   			
   177    177   			// Convert to integer
   178    178   			int n = sub.size();
   179    179   			int[] isubs = new int[n];
   180    180   			for (int i = 0; i < n; i++)
   181    181   				isubs[i] = sub.get(i);
   182    182   			

Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/mini/Minimizer.java.

   268    268   			// Build field information
   269    269   			MinimizedField q;
   270    270   			temp._fields.add((q = new MinimizedField(
   271    271   				f.flags().toJavaBits(),
   272    272   				basep,
   273    273   				fsz,
   274    274   				new FieldName(pool.<String>addSelf(f.name().toString())),
   275         -				pool.<FieldDescriptor>addSelf(f.type()),
          275  +				pool.<ClassName>addSelf(f.type().className()).field(),
   276    276   				(cval == null ? null :
   277    277   					pool.<Object>addSelf(cval.boxedValue())))));
   278    278   			
   279    279   			// Debug
   280    280   			todo.DEBUG.note("Add field %s", q);
   281    281   			
   282    282   			// Handle table sizes

Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/mini/__TempFields__.java.

    63     63   			{
    64     64   				// 16-bytes
    65     65   				ddos.writeInt(m.flags);
    66     66   				ddos.writeShort(Minimizer.__checkUShort(m.offset));
    67     67   				ddos.writeShort(Minimizer.__checkUShort(m.size));
    68     68   				ddos.writeShort(Minimizer.__checkUShort(
    69     69   					__pool.get(m.name.toString())));
    70         -				ddos.writeShort(Minimizer.__checkUShort(__pool.get(m.type)));
           70  +				ddos.writeShort(Minimizer.__checkUShort(
           71  +					__pool.get(m.type.className())));
    71     72   				ddos.writeShort(Minimizer.__checkUShort(__pool.get(m.value)));
    72     73   				ddos.writeByte(m.datatype.ordinal());
    73     74   				ddos.writeByte(0);
    74     75   			}
    75     76   			
    76     77   			// Write end of table
    77     78   			ddos.writeInt(0xFFFFFFFF);