Check-in [819eece9c9]

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

Overview
Comment:Fixups.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:819eece9c93c161bb0bfa0d17c7db5d1a65ca48c
User & Date: stephanie.gawroriski 2019-04-17 16:03:26
Context
2019-04-17
16:03
Do not hexdump code. check-in: eea1770dc7 user: stephanie.gawroriski tags: trunk
16:03
Fixups. check-in: 819eece9c9 user: stephanie.gawroriski tags: trunk
15:51
Initialization of minimized class file. check-in: c4c5ceda4f user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
...
187
188
189
190
191
192
193





194
195
196
197
198
199
200
			if ((__n & 1) != 0)
				dis.read();
			
			// Read offsets into the structure
			for (int i = 0; i < __n; i++)
				offsets[i] = dis.readUnsignedShort();
			
			// Read of all the various entries
			for (int i = 0; i < __n; i++)
				todo.DEBUG.note("%3d: %02x (@%d)", i,
					(types[i] & 0xFF), offsets[i]);
		}
		
		// {@squirreljme.error JC3z Invalid read of pool data.}
		catch (IOException e)
................................................................................
			{
				// Depends on the type
				MinimizedPoolEntryType type = MinimizedPoolEntryType.of(rtype);
				switch (type)
				{
						// Null is nothing, so do not bother
					case NULL:





						break;
						
						// Strings
					case STRING:
						part = new int[]{
								dis.readUnsignedShort(),
								dis.readUnsignedShort(),







|







 







>
>
>
>
>







136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
...
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
			if ((__n & 1) != 0)
				dis.read();
			
			// Read offsets into the structure
			for (int i = 0; i < __n; i++)
				offsets[i] = dis.readUnsignedShort();
			
			// Debug
			for (int i = 0; i < __n; i++)
				todo.DEBUG.note("%3d: %02x (@%d)", i,
					(types[i] & 0xFF), offsets[i]);
		}
		
		// {@squirreljme.error JC3z Invalid read of pool data.}
		catch (IOException e)
................................................................................
			{
				// Depends on the type
				MinimizedPoolEntryType type = MinimizedPoolEntryType.of(rtype);
				switch (type)
				{
						// Null is nothing, so do not bother
					case NULL:
						// {@squirreljme.error JC42 NULL pool entry is only
						// permitted as the first type, the class file is
						// corrupt.}
						if (i != 0)
							throw new InvalidClassFormatException("JC42");
						break;
						
						// Strings
					case STRING:
						part = new int[]{
								dis.readUnsignedShort(),
								dis.readUnsignedShort(),

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

269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
...
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
			// Actual table data
			ByteArrayOutputStream dbytes = new ByteArrayOutputStream();
			DataOutputStream ddos = new DataOutputStream(dbytes);
			
			// Guess where all the data will be written in the pool
			// tbytes + obytes + tdospadding
			int poolcount = pool.size();
			int reloff = (poolcount * 3) + (((poolcount & 1) != 0) ? 1 : 0);
			
			// Align the data table to the nearest 4-byte boundary
			while (((reloff + ddos.size()) & 3) != 0)
				ddos.write(0);
			
			// Write all the values in the pool, the value in the map is
			// ignored because that just stores the index identifier
................................................................................
				}
				
				// Round positions
				Minimizer.__dosRound(ddos);
			}
			
			// End of table padding for the type table?
			if ((tdos.size() & 1) != 0)
				tdos.writeByte(0xFF);
			
			// Merge the data bytes into the table then use the completed
			// table
			tbytes.write(obytes.toByteArray());
			tbytes.write(dbytes.toByteArray());
			return tbytes.toByteArray();







|







 







|







269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
...
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
			// Actual table data
			ByteArrayOutputStream dbytes = new ByteArrayOutputStream();
			DataOutputStream ddos = new DataOutputStream(dbytes);
			
			// Guess where all the data will be written in the pool
			// tbytes + obytes + tdospadding
			int poolcount = pool.size();
			int reloff = (poolcount * 3) + (poolcount & 1);
			
			// Align the data table to the nearest 4-byte boundary
			while (((reloff + ddos.size()) & 3) != 0)
				ddos.write(0);
			
			// Write all the values in the pool, the value in the map is
			// ignored because that just stores the index identifier
................................................................................
				}
				
				// Round positions
				Minimizer.__dosRound(ddos);
			}
			
			// End of table padding for the type table?
			if ((poolcount & 1) != 0)
				tdos.writeByte(0xFF);
			
			// Merge the data bytes into the table then use the completed
			// table
			tbytes.write(obytes.toByteArray());
			tbytes.write(dbytes.toByteArray());
			return tbytes.toByteArray();