Check-in [838a415bd9]

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

Overview
Comment:Pool data is read.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:838a415bd9ba98f0e3c1b3f7206ffbf06a6330cf
User & Date: stephanie.gawroriski 2019-04-17 14:00:11
Context
2019-04-17
14:15
Base calls for loading class fields and methods. check-in: 7d2c0c8082 user: stephanie.gawroriski tags: trunk
14:00
Pool data is read. check-in: 838a415bd9 user: stephanie.gawroriski tags: trunk
13:50
Read of constant pool entries. check-in: 25dba2477e 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.

31
32
33
34
35
36
37

























































38
39
40
41
42
43
44
...
249
250
251
252
253
254
255






256
257
258
259
260
261
262
263
264
265

266
267
268
/**
 * This represents the minimized constant pool.
 *
 * @since 2019/04/16
 */
public final class MinimizedPool
{

























































	
	/**
	 * Decodes the minimized constant pool.
	 *
	 * @param __n Number of entries in the pool.
	 * @param __is The bytes to decode from.
	 * @param __o The offset into the array.
................................................................................
						}
						break;
					
					default:
						throw new todo.OOPS(type.name());
				}
			}






			
			// Debug
			todo.DEBUG.note("Read %s", v);
			
			// Set data
			parts[i] = (part == null ? nopart : part);
			values[i] = v;
		}
		
		throw new todo.TODO();

	}
}








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>









|
>



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
...
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
/**
 * This represents the minimized constant pool.
 *
 * @since 2019/04/16
 */
public final class MinimizedPool
{
	/** Entry types. */
	private final byte[] _types;
	
	/** Parts. */
	private final int[][] _parts;
	
	/** Values. */
	private final Object[] _values;
	
	/**
	 * Initializes the minimized pool.
	 *
	 * @param __ts Types.
	 * @param __ps Parts.
	 * @param __vs Values.
	 * @throws IllegalArgumentException If the arrays are of a different size.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/04/17
	 */
	public MinimizedPool(byte[] __ts, int[][] __ps, Object[] __vs)
		throws IllegalArgumentException, NullPointerException
	{
		if (__ts == null || __ps == null || __vs == null)
			throw new NullPointerException("NARG");
		
		// {@squirreljme.error JC3y  Input arrays are of a different length.
		// (The expected length)}
		int n = __ts.length;
		if (__ps.length != n || __vs.length != n)
			throw new IllegalArgumentException("JC3y " + n);
		
		// Defensive copy each
		__ts = __ts.clone();
		__ps = __ps.clone();
		__vs = __vs.clone();
		
		// Clone all elements in the parts
		for (int i = 0; i < n; i++)
		{
			int[] p = __ps[i];
			
			if (p == null)
				throw new NullPointerException("NARG");
			
			__ps[i] = p.clone();
		}
		
		// Check values for null, skip entry 0
		for (int i = 1; i < n; i++)
			if (__vs[i] == null)
				throw new NullPointerException("NARG");
		
		// Set
		this._types = __ts;
		this._parts = __ps;
		this._values = __vs;
	}
	
	/**
	 * Decodes the minimized constant pool.
	 *
	 * @param __n Number of entries in the pool.
	 * @param __is The bytes to decode from.
	 * @param __o The offset into the array.
................................................................................
						}
						break;
					
					default:
						throw new todo.OOPS(type.name());
				}
			}
			
			// {@squirreljme.error JC3x Invalid read of pool data.}
			catch (IllegalArgumentException e)
			{
				throw new InvalidClassFormatException("JC3x", e);
			}
			
			// Debug
			todo.DEBUG.note("Read %s", v);
			
			// Set data
			parts[i] = (part == null ? nopart : part);
			values[i] = v;
		}
		
		// Build
		return new MinimizedPool(types, parts, values);
	}
}