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 Unified Diffs Ignore Whitespace Patch

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

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







|







 







|


|







 







|




|







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

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

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







|







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

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

63
64
65
66
67
68
69
70

71
72
73
74
75
76
77
			{
				// 16-bytes
				ddos.writeInt(m.flags);
				ddos.writeShort(Minimizer.__checkUShort(m.offset));
				ddos.writeShort(Minimizer.__checkUShort(m.size));
				ddos.writeShort(Minimizer.__checkUShort(
					__pool.get(m.name.toString())));
				ddos.writeShort(Minimizer.__checkUShort(__pool.get(m.type)));

				ddos.writeShort(Minimizer.__checkUShort(__pool.get(m.value)));
				ddos.writeByte(m.datatype.ordinal());
				ddos.writeByte(0);
			}
			
			// Write end of table
			ddos.writeInt(0xFFFFFFFF);







|
>







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