Check-in [8076e8f622]

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

Overview
Comment:Corrections to pool writing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:8076e8f62214846bcc37c262a263ccea3ef4c5df
User & Date: stephanie.gawroriski 2019-04-17 01:45:55
Context
2019-04-17
01:55
Correct relative offset for constant pools and such being off. check-in: 5dc108ae42 user: stephanie.gawroriski tags: trunk
01:45
Corrections to pool writing. check-in: 8076e8f622 user: stephanie.gawroriski tags: trunk
01:30
Base dump of pool. check-in: 6f8bfc8ece 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.

266
267
268
269
270
271
272
273
274
275
276
277
278
279

280
281
282
283
284
285
286
287
...
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344

345
346
347
348
349
350
351
			ByteArrayOutputStream obytes = new ByteArrayOutputStream();
			DataOutputStream odos = new DataOutputStream(obytes);
			
			// Actual table data
			ByteArrayOutputStream dbytes = new ByteArrayOutputStream();
			DataOutputStream ddos = new DataOutputStream(dbytes);
			
			// Write the number of entries in the pool
			int poolcount = pool.size();
			tdos.writeInt(poolcount);
			
			// Guess where all the data will be written in the pool
			// poolcount + tbytes + obytes + tdospadding
			int reloff = 4 + (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
................................................................................
							{
								faketype |= 0x80;
								break;
							}
						break;
				}
				
				// Is wide being used?
				boolean iswide = ((faketype & 0x80) != 0);
				
				// Write position and the entry type, use 24-bits for the
				// entry offset just to use the space since maybe the pool
				// will get pretty big? It is Java ME though so hopefully
				// the pool never exceeds 65K.
				int dxo = reloff + ddos.size();
				tdos.writeByte(faketype);
				odos.writeShort(Minimizer.__checkUShort(dxo & 0xFFFF));
				
				// Depends on the type used

				switch (et)
				{
					// Just write a zero for null, just in case!
					case NULL:
						ddos.writeInt(0);
						break;
					







<
<
<
<

|
<
>
|







 







|
|

|
<
<
<

<
|


>







266
267
268
269
270
271
272




273
274

275
276
277
278
279
280
281
282
283
...
322
323
324
325
326
327
328
329
330
331
332



333

334
335
336
337
338
339
340
341
342
343
344
			ByteArrayOutputStream obytes = new ByteArrayOutputStream();
			DataOutputStream odos = new DataOutputStream(obytes);
			
			// 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
................................................................................
							{
								faketype |= 0x80;
								break;
							}
						break;
				}
				
				// Write entry type
				tdos.writeByte(faketype);
				
				// Write position of the pool entry



				int dxo = reloff + ddos.size();

				odos.writeShort(Minimizer.__checkUShort(dxo));
				
				// Depends on the type used
				boolean iswide = ((faketype & 0x80) != 0);
				switch (et)
				{
					// Just write a zero for null, just in case!
					case NULL:
						ddos.writeInt(0);
						break;