Check-in [c2cc24e90d]

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

Overview
Comment:Remove WhereIsThis, line debug, JOp debug, and JInst debug (they are inlined with the code now rather than separate).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c2cc24e90d5c8a57fec736a57f5787fa5052d1a9
User & Date: stephanie.gawroriski 2019-05-24 17:51:24
Context
2019-05-24
18:03
Store monitor into a higher register rather than one that is dedicated for use. check-in: 884f494de5 user: stephanie.gawroriski tags: trunk
17:51
Remove WhereIsThis, line debug, JOp debug, and JInst debug (they are inlined with the code now rather than separate). check-in: c2cc24e90d user: stephanie.gawroriski tags: trunk
17:30
Add conversion for system calls. check-in: a11d27d936 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/libs/summercoat-vm/cc/squirreljme/vm/summercoat/NativeCPU.java.

790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
						spec = "pool";
						break;
					
					case NativeCode.NEXT_POOL_REGISTER:
						spec = "nextpool";
						break;
					
					case NativeCode.WHERE_IS_THIS:
						spec = "whereis";
						break;
					
					case NativeCode.VOLATILE_A_REGISTER:
						spec = "vola";
						break;
					
					case NativeCode.VOLATILE_B_REGISTER:
						spec = "volb";
						break;







<
<
<
<







790
791
792
793
794
795
796




797
798
799
800
801
802
803
						spec = "pool";
						break;
					
					case NativeCode.NEXT_POOL_REGISTER:
						spec = "nextpool";
						break;
					




					case NativeCode.VOLATILE_A_REGISTER:
						spec = "vola";
						break;
					
					case NativeCode.VOLATILE_B_REGISTER:
						spec = "volb";
						break;

Changes to runt/libs/summercoat-vm/cc/squirreljme/vm/summercoat/SummerCoatFactory.java.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import dev.shadowtail.classfile.mini.MinimizedField;
import dev.shadowtail.classfile.mini.MinimizedMethod;
import dev.shadowtail.classfile.mini.MinimizedPool;
import dev.shadowtail.classfile.nncc.AccessedField;
import dev.shadowtail.classfile.nncc.ClassPool;
import dev.shadowtail.classfile.nncc.InvokedMethod;
import dev.shadowtail.classfile.nncc.NativeCode;
import dev.shadowtail.classfile.nncc.WhereIsThis;
import dev.shadowtail.jarfile.MinimizedJarHeader;
import cc.squirreljme.runtime.cldc.vki.DefaultConfiguration;
import cc.squirreljme.runtime.cldc.vki.FixedClassIDs;
import cc.squirreljme.runtime.cldc.vki.Kernel;
import cc.squirreljme.vm.VirtualMachine;
import cc.squirreljme.vm.VMClassLibrary;
import cc.squirreljme.vm.VMException;







<







14
15
16
17
18
19
20

21
22
23
24
25
26
27
import dev.shadowtail.classfile.mini.MinimizedField;
import dev.shadowtail.classfile.mini.MinimizedMethod;
import dev.shadowtail.classfile.mini.MinimizedPool;
import dev.shadowtail.classfile.nncc.AccessedField;
import dev.shadowtail.classfile.nncc.ClassPool;
import dev.shadowtail.classfile.nncc.InvokedMethod;
import dev.shadowtail.classfile.nncc.NativeCode;

import dev.shadowtail.jarfile.MinimizedJarHeader;
import cc.squirreljme.runtime.cldc.vki.DefaultConfiguration;
import cc.squirreljme.runtime.cldc.vki.FixedClassIDs;
import cc.squirreljme.runtime.cldc.vki.Kernel;
import cc.squirreljme.vm.VirtualMachine;
import cc.squirreljme.vm.VMClassLibrary;
import cc.squirreljme.vm.VMException;

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

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
...
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264

265
266
267
268
269
270
271
272
273
274
275
276
277
 *
 * @since 2019/03/14
 */
public final class MinimizedMethod
{
	/** The size of encoded entries. */
	public static final int ENCODE_ENTRY_SIZE =
		28;
	
	/** Flags that are used for the method. */
	public final int flags;
	
	/** The index of this method in the instance table. */
	public final int index;
	
................................................................................
	
	/** The type of the method. */
	public final MethodDescriptor type;
	
	/** The code offset. */
	public final int codeoffset;
	
	/** The line offset. */
	@Deprecated
	public final int lineoffset;
	
	/** Java operation offset. */
	@Deprecated
	public final int jopsoffset;
	
	/** Java PC offset. */
	@Deprecated
	public final int jpcsoffset;
	
	/** The where offset. */
	@Deprecated
	public final int whereoffset;
	
	/** Translated method code. */
	final byte[] _code;
	
	/** Line number table. */
	@Deprecated
	final byte[] _lines;
	
	/** Java operation table. */
	@Deprecated
	final byte[] _jops;
	
	/** Java address table. */
	@Deprecated
	final byte[] _jpcs;
	
	/** Method flags. */
	private Reference<MethodFlags> _flags;
	
	/**
	 * Initializes the minimized method.
	 *
	 * @param __f The method flags.
	 * @param __o Index in the method table for instances.
	 * @param __n The method name.
	 * @param __t The method type.
	 * @param __tc Transcoded instructions.
	 * @param __ln Line number table.
	 * @param __jo Java operation table.
	 * @param __jp Java PC table.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/04/21
	 */
	public MinimizedMethod(int __f, int __o,
		MethodName __n, MethodDescriptor __t, byte[] __tc, byte[] __ln,
		byte[] __jo, byte[] __jp)
		throws NullPointerException
	{
		this(__f, __o, __n, __t, __tc, __ln, __jo, __jp, 0, 0, 0, 0, 0);
	}
	
	/**
	 * Initializes the minimized method.
	 *
	 * @param __f The method flags.
	 * @param __o Index in the method table for instances.
	 * @param __n The method name.
	 * @param __t The method type.
	 * @param __tc Transcoded instructions.
	 * @param __ln Line number table.
	 * @param __jo Java operation table.
	 * @param __jp Java PC table.
	 * @param __co The code offset.
	 * @param __lo The line offset.
	 * @param __ojo Java operations offset.
	 * @param __ojp Java addresses offset.
	 * @param __wh The where offset.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/14
	 */
	public MinimizedMethod(int __f, int __o,
		MethodName __n, MethodDescriptor __t, byte[] __tc, byte[] __ln,
		byte[] __jo, byte[] __jp, int __co, int __lo, int __ojo, int __ojp, 
		int __wh)
		throws NullPointerException
	{
		if (__n == null || __t == null)
			throw new NullPointerException("NARG");
		
		this.flags = __f;
		this.index = __o;
		this.name = __n;
		this.type = __t;
		this._code = (__tc == null ? new byte[0] : __tc.clone());
		this._lines = (__ln == null ? new byte[0] : __ln.clone());
		this._jops = (__jo == null ? new byte[0] : __jo.clone());
		this._jpcs = (__jp == null ? new byte[0] : __jp.clone());
		this.codeoffset = __co;
		this.lineoffset = __lo;
		this.jopsoffset = __ojo;
		this.jpcsoffset = __ojp;
		this.whereoffset = __wh;
	}
	
	/**
	 * Returns the method code.
	 *
	 * @return The method code.
	 * @since 2019/04/19
................................................................................
				int flags = dis.readInt(),
					offset = dis.readUnsignedShort();
				MethodName name = new MethodName(
					(String)__p._values[dis.readUnsignedShort()]);
				MethodDescriptor type =
					(MethodDescriptor)__p._values[dis.readUnsignedShort()];
				int offcode = dis.readUnsignedShort(), 
					lencode = dis.readUnsignedShort(),
					offline = dis.readUnsignedShort(),
					lenline = dis.readUnsignedShort(),
					offjops = dis.readUnsignedShort(),
					lenjops = dis.readUnsignedShort(),
					offjpcs = dis.readUnsignedShort(),
					lenjpcs = dis.readUnsignedShort(),
					offwher = dis.readUnsignedShort();
				
				// Read code?
				byte[] code = null;
				if (offcode > 0)
				{
					code = new byte[lencode];
					System.arraycopy(__b, __o + offcode, code, 0, lencode);
				}
				
				// Read lines?
				byte[] line = null;
				if (offline > 0)
				{
					line = new byte[lenline];
					System.arraycopy(__b, __o + offline, line, 0, lenline);
				}
				
				// Read Java operations
				byte[] jops = null;
				if (offjops > 0)
				{
					jops = new byte[lenjops];
					System.arraycopy(__b, __o + offjops, jops, 0, lenjops);
				}
				
				// Read Java addresses
				byte[] jpcs = null;
				if (offjpcs > 0)
				{
					jpcs = new byte[lenjpcs];
					System.arraycopy(__b, __o + offjpcs, jpcs, 0, lenjpcs);
				}
				
				// Build method
				rv[i] = new MinimizedMethod(flags, offset, name, type,
					code, line, jops, jpcs, offcode, offline, offjops,
					offjpcs, offwher);

			}
		}
		
		// {@squirreljme.error JC41 Could not read method data.}
		catch (ClassCastException|IOException|IndexOutOfBoundsException e)
		{
			throw new InvalidClassFormatException("JC41");
		}
		
		return rv;
	}
}








|







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



<
<
<
<
<
<
<
<
<
<
<
<











<
<
<




|
<


|










<
<
<

<
<
<
<




|
<
<










<
<
<

<
<
<
<







 







|
<
<
<
<
<
<
<









<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


<
<
>













26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
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
102
103
104
105
...
165
166
167
168
169
170
171
172







173
174
175
176
177
178
179
180
181
























182
183


184
185
186
187
188
189
190
191
192
193
194
195
196
197
 *
 * @since 2019/03/14
 */
public final class MinimizedMethod
{
	/** The size of encoded entries. */
	public static final int ENCODE_ENTRY_SIZE =
		14;
	
	/** Flags that are used for the method. */
	public final int flags;
	
	/** The index of this method in the instance table. */
	public final int index;
	
................................................................................
	
	/** The type of the method. */
	public final MethodDescriptor type;
	
	/** The code offset. */
	public final int codeoffset;
	
















	/** Translated method code. */
	final byte[] _code;
	












	/** Method flags. */
	private Reference<MethodFlags> _flags;
	
	/**
	 * Initializes the minimized method.
	 *
	 * @param __f The method flags.
	 * @param __o Index in the method table for instances.
	 * @param __n The method name.
	 * @param __t The method type.
	 * @param __tc Transcoded instructions.



	 * @throws NullPointerException On null arguments.
	 * @since 2019/04/21
	 */
	public MinimizedMethod(int __f, int __o,
		MethodName __n, MethodDescriptor __t, byte[] __tc)

		throws NullPointerException
	{
		this(__f, __o, __n, __t, __tc, 0);
	}
	
	/**
	 * Initializes the minimized method.
	 *
	 * @param __f The method flags.
	 * @param __o Index in the method table for instances.
	 * @param __n The method name.
	 * @param __t The method type.
	 * @param __tc Transcoded instructions.



	 * @param __co The code offset.




	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/14
	 */
	public MinimizedMethod(int __f, int __o,
		MethodName __n, MethodDescriptor __t, byte[] __tc, int __co)


		throws NullPointerException
	{
		if (__n == null || __t == null)
			throw new NullPointerException("NARG");
		
		this.flags = __f;
		this.index = __o;
		this.name = __n;
		this.type = __t;
		this._code = (__tc == null ? new byte[0] : __tc.clone());



		this.codeoffset = __co;




	}
	
	/**
	 * Returns the method code.
	 *
	 * @return The method code.
	 * @since 2019/04/19
................................................................................
				int flags = dis.readInt(),
					offset = dis.readUnsignedShort();
				MethodName name = new MethodName(
					(String)__p._values[dis.readUnsignedShort()]);
				MethodDescriptor type =
					(MethodDescriptor)__p._values[dis.readUnsignedShort()];
				int offcode = dis.readUnsignedShort(), 
					lencode = dis.readUnsignedShort();







				
				// Read code?
				byte[] code = null;
				if (offcode > 0)
				{
					code = new byte[lencode];
					System.arraycopy(__b, __o + offcode, code, 0, lencode);
				}
				
























				// Build method
				rv[i] = new MinimizedMethod(flags, offset, name, type,


					code, offcode);
			}
		}
		
		// {@squirreljme.error JC41 Could not read method data.}
		catch (ClassCastException|IOException|IndexOutOfBoundsException e)
		{
			throw new InvalidClassFormatException("JC41");
		}
		
		return rv;
	}
}

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

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
...
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
import dev.shadowtail.classfile.nncc.AccessedField;
import dev.shadowtail.classfile.nncc.ClassPool;
import dev.shadowtail.classfile.nncc.FieldAccessTime;
import dev.shadowtail.classfile.nncc.FieldAccessType;
import dev.shadowtail.classfile.nncc.InvokedMethod;
import dev.shadowtail.classfile.nncc.MethodIndex;
import dev.shadowtail.classfile.nncc.UsedString;
import dev.shadowtail.classfile.nncc.WhereIsThis;
import dev.shadowtail.classfile.xlate.InvokeType;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.ClassName;
................................................................................
					case CLASS_NAMES:
					case CLASS_POOL:
					case ACCESSED_FIELD:
					case INVOKED_METHOD:
					case METHOD_DESCRIPTOR:
					case LONG:
					case DOUBLE:
					case WHERE_IS_THIS:
					case USED_STRING:
					case METHOD_INDEX:
						// Wide parts
						if (iswide)
						{
							// Read length
							int np = dis.readUnsignedShort();
................................................................................
								v = Double.longBitsToDouble(
									(((long)(((Integer)values[part[0]])
										<< 32L)) |
									(((long)(((Integer)values[part[1]]) &
										0xFFFFFFFFL)))));
								break;
								
								// Where is this? The first value is special
								// and indicates the method index
							case WHERE_IS_THIS:
								v = new WhereIsThis(
									(ClassName)values[part[1]],
									new MethodName((String)values[part[2]]),
									(MethodDescriptor)values[part[3]]);
								break;
								
								// Used string
							case USED_STRING:
								v = new UsedString((String)values[part[0]]);
								break;
								
							default:
								throw new todo.OOPS(type.name());







<







 







<







 







<
<
<
<
<
<
<
<
<







12
13
14
15
16
17
18

19
20
21
22
23
24
25
...
338
339
340
341
342
343
344

345
346
347
348
349
350
351
...
447
448
449
450
451
452
453









454
455
456
457
458
459
460
import dev.shadowtail.classfile.nncc.AccessedField;
import dev.shadowtail.classfile.nncc.ClassPool;
import dev.shadowtail.classfile.nncc.FieldAccessTime;
import dev.shadowtail.classfile.nncc.FieldAccessType;
import dev.shadowtail.classfile.nncc.InvokedMethod;
import dev.shadowtail.classfile.nncc.MethodIndex;
import dev.shadowtail.classfile.nncc.UsedString;

import dev.shadowtail.classfile.xlate.InvokeType;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.ClassName;
................................................................................
					case CLASS_NAMES:
					case CLASS_POOL:
					case ACCESSED_FIELD:
					case INVOKED_METHOD:
					case METHOD_DESCRIPTOR:
					case LONG:
					case DOUBLE:

					case USED_STRING:
					case METHOD_INDEX:
						// Wide parts
						if (iswide)
						{
							// Read length
							int np = dis.readUnsignedShort();
................................................................................
								v = Double.longBitsToDouble(
									(((long)(((Integer)values[part[0]])
										<< 32L)) |
									(((long)(((Integer)values[part[1]]) &
										0xFFFFFFFFL)))));
								break;
								









								// Used string
							case USED_STRING:
								v = new UsedString((String)values[part[0]]);
								break;
								
							default:
								throw new todo.OOPS(type.name());

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

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
...
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
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
352
353
354
...
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
package dev.shadowtail.classfile.mini;

import dev.shadowtail.classfile.nncc.AccessedField;
import dev.shadowtail.classfile.nncc.ClassPool;
import dev.shadowtail.classfile.nncc.InvokedMethod;
import dev.shadowtail.classfile.nncc.MethodIndex;
import dev.shadowtail.classfile.nncc.UsedString;
import dev.shadowtail.classfile.nncc.WhereIsThis;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
................................................................................
		{
			long v = Double.doubleToRawLongBits((Double)__v);
			return this.__add(__v,
				this.add((int)(v >>> 32)),
				this.add((int)(v & 0xFFFFFFFF)));
		}
		
		// Where is this information
		else if (__v instanceof WhereIsThis)
		{
			WhereIsThis v = (WhereIsThis)__v;
			return this.__add(__v,
				0x7FFF,
				this.add(v.inclass),
				this.add(v.name.toString()),
				this.add(v.type));
		}
		
		// Used String
		else if (__v instanceof UsedString)
			return this.__add(__v,
				this.add(__v.toString()));
		
		// {@squirreljme.error JC3p Cannot add the specified entry to the
		// constant pool. (The class type)}
................................................................................
				
				// Get type and part information
				MinimizedPoolEntryType et = (pdx == 0 ?
					MinimizedPoolEntryType.NULL :
					MinimizedPoolEntryType.ofClass(value.getClass()));
				int[] part = parts.get(pdx++);
				
				// It is easiest to point to the actual method in the where
				// is this table for quick load of debugging info, so try
				// to locate the method
				if (et == MinimizedPoolEntryType.WHERE_IS_THIS)
				{
					// Load where is this info
					WhereIsThis wit = (WhereIsThis)value;
					MethodName wmname = wit.name;
					MethodDescriptor wmtype = wit.type;
					
					// Statics then instances
__outer_witlut:
					for (int z = 0; z < 2; z++)
					{
						// Go through methods
						List<MinimizedMethod> tms = __methods[z]._methods;
						for (int y = 0, yn = tms.size(); y < yn; y++)
						{
							// Get method
							MinimizedMethod xmm = tms.get(y);
							
							// Match?
							if (wmname.equals(xmm.name) &&
								wmtype.equals(xmm.type))
							{
								part[0] = y | (z * WhereIsThis.INSTANCE_BIT);
								break __outer_witlut;
							}
						}
					}
				}
				
				// Have two pool entry formats, a wide one and a narrow one
				// This is to reduce the size of the constant pool in classes
				// where small values can be used instead
				// This adds extra types for parsing because otherwise having
				// variable ints and such will be very confusing and
				// complicated!
				int faketype = et.ordinal();
................................................................................
					case CLASS_NAME:
					case CLASS_NAMES:
					case INVOKED_METHOD:
					case CLASS_POOL:
					case METHOD_DESCRIPTOR:
					case LONG:
					case DOUBLE:
					case WHERE_IS_THIS:
					case USED_STRING:
					case METHOD_INDEX:
						{
							// Write number of parts
							int npart = part.length;
							if (iswide)
								ddos.writeShort(







<







 







<
<
<
<
<
<
<
<
<
<
<







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<







11
12
13
14
15
16
17

18
19
20
21
22
23
24
...
207
208
209
210
211
212
213











214
215
216
217
218
219
220
...
297
298
299
300
301
302
303
































304
305
306
307
308
309
310
...
389
390
391
392
393
394
395

396
397
398
399
400
401
402
package dev.shadowtail.classfile.mini;

import dev.shadowtail.classfile.nncc.AccessedField;
import dev.shadowtail.classfile.nncc.ClassPool;
import dev.shadowtail.classfile.nncc.InvokedMethod;
import dev.shadowtail.classfile.nncc.MethodIndex;
import dev.shadowtail.classfile.nncc.UsedString;

import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
................................................................................
		{
			long v = Double.doubleToRawLongBits((Double)__v);
			return this.__add(__v,
				this.add((int)(v >>> 32)),
				this.add((int)(v & 0xFFFFFFFF)));
		}
		











		// Used String
		else if (__v instanceof UsedString)
			return this.__add(__v,
				this.add(__v.toString()));
		
		// {@squirreljme.error JC3p Cannot add the specified entry to the
		// constant pool. (The class type)}
................................................................................
				
				// Get type and part information
				MinimizedPoolEntryType et = (pdx == 0 ?
					MinimizedPoolEntryType.NULL :
					MinimizedPoolEntryType.ofClass(value.getClass()));
				int[] part = parts.get(pdx++);
				
































				// Have two pool entry formats, a wide one and a narrow one
				// This is to reduce the size of the constant pool in classes
				// where small values can be used instead
				// This adds extra types for parsing because otherwise having
				// variable ints and such will be very confusing and
				// complicated!
				int faketype = et.ordinal();
................................................................................
					case CLASS_NAME:
					case CLASS_NAMES:
					case INVOKED_METHOD:
					case CLASS_POOL:
					case METHOD_DESCRIPTOR:
					case LONG:
					case DOUBLE:

					case USED_STRING:
					case METHOD_INDEX:
						{
							// Write number of parts
							int npart = part.length;
							if (iswide)
								ddos.writeShort(

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

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
..
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
	
	/** Long. */
	LONG,
	
	/** Double. */
	DOUBLE,
	
	/** Where is this? */
	@Deprecated
	WHERE_IS_THIS,
	
	/** A plain string that was used. */
	USED_STRING,
	
	/** The index of a method. */
	METHOD_INDEX,
	
	/** End. */
................................................................................
			case 5:		return ACCESSED_FIELD;
			case 6:		return INVOKED_METHOD;
			case 7:		return METHOD_DESCRIPTOR;
			case 8:		return INTEGER;
			case 9:		return FLOAT;
			case 10:	return LONG;
			case 11:	return DOUBLE;
			case 12:	return WHERE_IS_THIS;
			case 13:	return USED_STRING;
			case 14:	return METHOD_INDEX;
		}
		
		// {@squirreljme.error JC3s Unknown pool type. (The type)}
		throw new IllegalArgumentException("JC3s " + __i);
	}
	
	/**
................................................................................
				return CLASS_NAME;
			case "net.multiphasicapps.classfile.ClassNames":
				return CLASS_NAMES;
			case "List net.multiphasicapps.classfile.ClassName":
				return CLASS_NAMES;
			case "net.multiphasicapps.classfile.MethodDescriptor":
				return METHOD_DESCRIPTOR;
			case "dev.shadowtail.classfile.nncc.WhereIsThis":
				return WHERE_IS_THIS;
			case "dev.shadowtail.classfile.nncc.UsedString":
				return USED_STRING;
			case "dev.shadowtail.classfile.nncc.MethodIndex":
				return METHOD_INDEX;
		}
		
		// {@squirreljme.error JC2o Class does not map to a pool entry
		// type. (The class)}
		throw new IllegalArgumentException("JC2o " + __cl);
	}
}








<
<
<
<







 







<
|
|







 







<
<












48
49
50
51
52
53
54




55
56
57
58
59
60
61
..
82
83
84
85
86
87
88

89
90
91
92
93
94
95
96
97
...
132
133
134
135
136
137
138


139
140
141
142
143
144
145
146
147
148
149
150
	
	/** Long. */
	LONG,
	
	/** Double. */
	DOUBLE,
	




	/** A plain string that was used. */
	USED_STRING,
	
	/** The index of a method. */
	METHOD_INDEX,
	
	/** End. */
................................................................................
			case 5:		return ACCESSED_FIELD;
			case 6:		return INVOKED_METHOD;
			case 7:		return METHOD_DESCRIPTOR;
			case 8:		return INTEGER;
			case 9:		return FLOAT;
			case 10:	return LONG;
			case 11:	return DOUBLE;

			case 12:	return USED_STRING;
			case 13:	return METHOD_INDEX;
		}
		
		// {@squirreljme.error JC3s Unknown pool type. (The type)}
		throw new IllegalArgumentException("JC3s " + __i);
	}
	
	/**
................................................................................
				return CLASS_NAME;
			case "net.multiphasicapps.classfile.ClassNames":
				return CLASS_NAMES;
			case "List net.multiphasicapps.classfile.ClassName":
				return CLASS_NAMES;
			case "net.multiphasicapps.classfile.MethodDescriptor":
				return METHOD_DESCRIPTOR;


			case "dev.shadowtail.classfile.nncc.UsedString":
				return USED_STRING;
			case "dev.shadowtail.classfile.nncc.MethodIndex":
				return METHOD_INDEX;
		}
		
		// {@squirreljme.error JC2o Class does not map to a pool entry
		// type. (The class)}
		throw new IllegalArgumentException("JC2o " + __cl);
	}
}

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

398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
...
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
		{
			// These are stored in their own rows
			__TempMethods__ temp = rv[(m.flags().isStatic() ? 0 : 1)];
			
			// Need to translate and serialize the byte code into a register
			// form and remap any used references.
			MethodFlags mf = m.flags();
			byte[] transcode = null,
				tabln = null,
				tabjo = null,
				tabjp = null;
			if (!mf.isAbstract() && !mf.isNative())
			{
				// The minified classes use register code since it is easier
				// to handle by the VM
				NativeCode rc = m.nativeCode();
				
				// Encode data to bytes
				try
				{
					// Translate code
					__MappedDebugInfo__[] mdebugs = new __MappedDebugInfo__[1];
					transcode = this.__translateCode(rc, mdebugs);
					
					// Compact debug information
					__MappedDebugInfo__ mdebug = mdebugs[0];
					tabln = Minimizer.__compact(mdebug._lintable, null);
					tabjo = Minimizer.__compact(null, mdebug._joptable);
					tabjp = Minimizer.__compact(null, mdebug._jpctable);
				}
				catch (IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			// Add method
			MinimizedMethod q;
			temp._methods.add((q = new MinimizedMethod(mf.toJavaBits(),
				temp._count,
				new MethodName(pool.<String>addSelf(m.name().toString())),
				pool.<MethodDescriptor>addSelf(m.type()),
				transcode,
				tabln,
				tabjo,
				tabjp)));
			
			// Quick count for used methods
			temp._count++;
		}
		
		return rv;
	}
	
	/**
	 * Translates code.
	 *
	 * @param __rc The register code used.
	 * @param __dos The stream to write to.
	 * @param __mdbg Debug table information
	 * @return The resulting stream.
	 * @throws IOException On write errors.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/23
	 */
	private final byte[] __translateCode(NativeCode __rc,
		__MappedDebugInfo__[] __mdbg)
		throws IOException, NullPointerException
	{
		if (__rc == null || __mdbg == null)
			throw new NullPointerException("NARG");
		
		// Where stuff gets written to
		ByteArrayOutputStream baos = new ByteArrayOutputStream(256);
		DataOutputStream dos = new DataOutputStream(baos);
		
		// Positions where all the instructions are in the byte array
		int cdn = __rc.length();
		int[] indexpos = new int[cdn];
		
		// Debug line and Java PC+Addr information
		ByteArrayOutputStream dlinbaos = new ByteArrayOutputStream(256);
		ByteArrayOutputStream djopbaos = new ByteArrayOutputStream(256);
		ByteArrayOutputStream djpcbaos = new ByteArrayOutputStream(256);
		DataOutputStream dlindos = new DataOutputStream(dlinbaos);
		
		// Locations which have jump targets to be replaced
		Map<Integer, InstructionJumpTarget> jumpreps = new HashMap<>();
		
		// Operations will reference this constant pool
		MinimizedPoolBuilder pool = this.pool;
		
		// Debug line and Java PC+Addr tables
		short[] tablin = __rc.lines();
		byte[] tabjop = __rc.javaOperations(),
			tabjpc = __rc.javaAddresses();
		
		// Go through each instruction
		for (int cdx = 0; cdx < cdn; cdx++)
		{
			// Get instruction here
			NativeInstruction i = __rc.get(cdx);
			
			// Record that the instruction is at this position
................................................................................
						break;
					
						// Unknown
					default:
						throw new todo.OOPS();
				}
			}
			
			// Write output debugging information to the streams accordingly
			// for each point, the table data can just be spanned across
			// as well reducing later processing
			short uselin = tablin[cdx];
			byte usejop = tabjop[cdx],
				usejpc = tabjpc[cdx];
			for (int s = 0, sn = dos.size() - baseaddr; s < sn; s++)
			{
				dlindos.writeShort(uselin);
				djopbaos.write(usejop);
				djpcbaos.write(usejpc);
			}
		}
		
		// The line number info is stored in a byte array so it must be
		// retranslated
		byte[] rawlines = dlinbaos.toByteArray();
		int numlines = rawlines.length / 2;
		short[] dunlin = new short[numlines];
		for (int i = 0, o = 0; o < numlines; i += 2, o++)
			dunlin[o] = (short)(((rawlines[i] & 0xFF) << 8) |
				(rawlines[i + 1] & 0xFF));
		
		// Generate debug information
		__mdbg[0] = new __MappedDebugInfo__(dunlin, djopbaos.toByteArray(),
			djpcbaos.toByteArray());
		
		// Generate code array
		byte[] rv = baos.toByteArray();
		int codesize = rv.length;
		
		// Replace jumps
		for (Map.Entry<Integer, InstructionJumpTarget> e : jumpreps.entrySet())
		{







|
<
<
<










<
|
<
<
<
<
<
<













|
<
<
<













<





|
<


|










<
<
<
<
<
<






<
<
<
<
<







 







|
<
<
<
<
<
<
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







398
399
400
401
402
403
404
405



406
407
408
409
410
411
412
413
414
415

416






417
418
419
420
421
422
423
424
425
426
427
428
429
430



431
432
433
434
435
436
437
438
439
440
441
442
443

444
445
446
447
448
449

450
451
452
453
454
455
456
457
458
459
460
461
462






463
464
465
466
467
468





469
470
471
472
473
474
475
...
624
625
626
627
628
629
630
631







632



















633
634
635
636
637
638
639
		{
			// These are stored in their own rows
			__TempMethods__ temp = rv[(m.flags().isStatic() ? 0 : 1)];
			
			// Need to translate and serialize the byte code into a register
			// form and remap any used references.
			MethodFlags mf = m.flags();
			byte[] transcode = null;



			if (!mf.isAbstract() && !mf.isNative())
			{
				// The minified classes use register code since it is easier
				// to handle by the VM
				NativeCode rc = m.nativeCode();
				
				// Encode data to bytes
				try
				{
					// Translate code

					transcode = this.__translateCode(rc);






				}
				catch (IOException e)
				{
					throw new RuntimeException(e);
				}
			}
			
			// Add method
			MinimizedMethod q;
			temp._methods.add((q = new MinimizedMethod(mf.toJavaBits(),
				temp._count,
				new MethodName(pool.<String>addSelf(m.name().toString())),
				pool.<MethodDescriptor>addSelf(m.type()),
				transcode)));



			
			// Quick count for used methods
			temp._count++;
		}
		
		return rv;
	}
	
	/**
	 * Translates code.
	 *
	 * @param __rc The register code used.
	 * @param __dos The stream to write to.

	 * @return The resulting stream.
	 * @throws IOException On write errors.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/23
	 */
	private final byte[] __translateCode(NativeCode __rc)

		throws IOException, NullPointerException
	{
		if (__rc == null)
			throw new NullPointerException("NARG");
		
		// Where stuff gets written to
		ByteArrayOutputStream baos = new ByteArrayOutputStream(256);
		DataOutputStream dos = new DataOutputStream(baos);
		
		// Positions where all the instructions are in the byte array
		int cdn = __rc.length();
		int[] indexpos = new int[cdn];
		






		// Locations which have jump targets to be replaced
		Map<Integer, InstructionJumpTarget> jumpreps = new HashMap<>();
		
		// Operations will reference this constant pool
		MinimizedPoolBuilder pool = this.pool;
		





		// Go through each instruction
		for (int cdx = 0; cdx < cdn; cdx++)
		{
			// Get instruction here
			NativeInstruction i = __rc.get(cdx);
			
			// Record that the instruction is at this position
................................................................................
						break;
					
						// Unknown
					default:
						throw new todo.OOPS();
				}
			}
		}







		



















		// Generate code array
		byte[] rv = baos.toByteArray();
		int codesize = rv.length;
		
		// Replace jumps
		for (Map.Entry<Integer, InstructionJumpTarget> e : jumpreps.entrySet())
		{

Deleted runt/libs/tool-classfile/dev/shadowtail/classfile/mini/__MappedDebugInfo__.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package dev.shadowtail.classfile.mini;

/**
 * This class contains mapped debug information which is used later to
 * encode debugging information on minimization.
 *
 * @since 2019/04/26
 */
final class __MappedDebugInfo__
{
	/** Line table. */
	final short[] _lintable;
	
	/** Java operation table. */
	final byte[] _joptable;
	
	/** Java PC table. */
	final byte[] _jpctable;
	
	/**
	 * Initializes the debug information.
	 *
	 * @param __ln Line table.
	 * @param __jo Operation table.
	 * @param __jp Address table.
	 * @since 2019/04/26
	 */
	public __MappedDebugInfo__(short[] __ln, byte[] __jo, byte[] __jp)
	{
		this._lintable = (__ln == null ? new short[0] : __ln);
		this._joptable = (__jo == null ? new byte[0] : __jo);
		this._jpctable = (__jp == null ? new byte[0] : __jp);
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
























































































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

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
...
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
				cdos.write(code);
				
				// Pad with the breakpoint operation
				while ((cdos.size() & 3) != 0)
					cdos.write(0xFF);
			}
			
			// Output line/debug data
			ByteArrayOutputStream lbytes = new ByteArrayOutputStream();
			DataOutputStream ldos = new DataOutputStream(lbytes);
			
			// Write this so that way all lines are offset by 4 instead of
			// starting at zero, otherwise the first method will never have
			// debug information
			ldos.writeInt(0xFFFFFFFF);
			
			// Merge all of the debug data
			int[] offline = new int[count],
				lenline = new int[count],
				offjops = new int[count],
				lenjops = new int[count],
				offjpcs = new int[count],
				lenjpcs = new int[count];
			for (int i = 0; i < count; i++)
			{
				MinimizedMethod m = methods.get(i);
				
				// Write line data?
				byte[] lines = m._lines;
				if (lines != null)
				{
					// Offset to these lines
					offline[i] = ldos.size();
					lenline[i] = lines.length;
					
					// Write all the data
					ldos.write(lines);
					
					// Pad
					while ((ldos.size() & 1) != 0)
						ldos.write(0);
				}
				
				// Write Java operations?
				byte[] jops = m._jops;
				if (jops != null)
				{
					// Offset to these lines
					offjops[i] = ldos.size();
					lenjops[i] = lines.length;
					
					// Write all the data
					ldos.write(jops);
					
					// Pad
					while ((ldos.size() & 1) != 0)
						ldos.write(0);
				}
				
				// Write Java PCs?
				byte[] jpcs = m._jpcs;
				if (jpcs != null)
				{
					// Offset to these lines
					offjpcs[i] = ldos.size();
					lenjpcs[i] = lines.length;
					
					// Write all the data
					ldos.write(jpcs);
					
					// Pad
					while ((ldos.size() & 1) != 0)
						ldos.write(0);
				}
			}
			
			// Offset to code and line regions
			int codeoff = 4 + (count * MinimizedMethod.ENCODE_ENTRY_SIZE),
				lineoff = codeoff + cdos.size();
			
			// Build the offsets where the where is this are
			ClassName classname = this.classname;
			int[] offwhere = new int[count];
			for (int i = 0; i < count; i++)
			{
				MinimizedMethod m = methods.get(i);
				
				// Record only the size
				int wa;
				offwhere[i] = (wa = ldos.size());
				
				// If this value were to be added to the absolute position
				// of the where information here, then this will be where our
				// debug infos are stored. Zero means no debug info stored.
				int mylines = offline[i],
					myjops = offjops[i],
					myjpcs = offjpcs[i];
				ldos.writeShort((mylines == 0 ? 0 : (mylines - wa)));
				ldos.writeShort((myjops == 0 ? 0 : (myjops - wa)));
				ldos.writeShort((myjpcs == 0 ? 0 : (myjpcs - wa)));
				
				// Record the method class, name, and type
				ldos.writeUTF(classname.toString());
				ldos.writeUTF(m.name.toString());
				ldos.writeUTF(m.type.toString());
				
				// Pad
				while ((ldos.size() & 3) != 0)
					ldos.write(0);
			}
			
			// Write method information
			for (int i = 0; i < count; i++)
			{
				MinimizedMethod m = methods.get(i);
				
				// Flags, name, and type
................................................................................
				ddos.writeShort(Minimizer.__checkUShort(
					__pool.get(m.name.toString())));
				ddos.writeShort(Minimizer.__checkUShort(__pool.get(m.type)));
				
				// Code
				ddos.writeShort(Minimizer.__checkUShort(codeoff + offcode[i]));
				ddos.writeShort(Minimizer.__checkUShort(lencode[i]));
				
				// Lines
				ddos.writeShort(Minimizer.__checkUShort(lineoff + offline[i]));
				ddos.writeShort(Minimizer.__checkUShort(lenline[i]));
				
				// Java operations
				ddos.writeShort(Minimizer.__checkUShort(lineoff + offjops[i]));
				ddos.writeShort(Minimizer.__checkUShort(lenjops[i]));
				
				// Java PCs
				ddos.writeShort(Minimizer.__checkUShort(lineoff + offjpcs[i]));
				ddos.writeShort(Minimizer.__checkUShort(lenjpcs[i]));
				
				// Where
				ddos.writeShort(Minimizer.__checkUShort(
					lineoff + offwhere[i]));
			}
			
			// Write end of table
			ddos.writeInt(0xFFFFFFFF);
			
			// Merge in the code and line information
			ddos.write(cbytes.toByteArray());
			ddos.write(lbytes.toByteArray());
			return dbytes.toByteArray();
		}
		
		// Should not occur
		catch (IOException e)
		{
			throw new RuntimeException(e);
		}
	}
}








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<

|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







<











99
100
101
102
103
104
105





































































106
107
































108
109
110
111
112
113
114
...
117
118
119
120
121
122
123
















124
125
126
127
128
129
130

131
132
133
134
135
136
137
138
139
140
141
				cdos.write(code);
				
				// Pad with the breakpoint operation
				while ((cdos.size() & 3) != 0)
					cdos.write(0xFF);
			}
			





































































			// Offset to code and line regions
			int codeoff = 4 + (count * MinimizedMethod.ENCODE_ENTRY_SIZE);
































			
			// Write method information
			for (int i = 0; i < count; i++)
			{
				MinimizedMethod m = methods.get(i);
				
				// Flags, name, and type
................................................................................
				ddos.writeShort(Minimizer.__checkUShort(
					__pool.get(m.name.toString())));
				ddos.writeShort(Minimizer.__checkUShort(__pool.get(m.type)));
				
				// Code
				ddos.writeShort(Minimizer.__checkUShort(codeoff + offcode[i]));
				ddos.writeShort(Minimizer.__checkUShort(lencode[i]));
















			}
			
			// Write end of table
			ddos.writeInt(0xFFFFFFFF);
			
			// Merge in the code and line information
			ddos.write(cbytes.toByteArray());

			return dbytes.toByteArray();
		}
		
		// Should not occur
		catch (IOException e)
		{
			throw new RuntimeException(e);
		}
	}
}

Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/nncc/NativeCode.java.

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
...
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
...
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
	public static final int POOL_REGISTER =
		9;
	
	/** The register which contains the next pool pointer to use. */
	public static final int NEXT_POOL_REGISTER =
		10;
	
	/** Contains the information address of the current method. */
	@Deprecated
	public static final int WHERE_IS_THIS =
		11;
	
	/** Volatile A register. */
	public static final int VOLATILE_A_REGISTER =
		12;
	
	/** Volatile B register. */
	public static final int VOLATILE_B_REGISTER =
		13;
................................................................................
	/** Mask to access the offset value. */
	public static final int MEMORY_OFF_VALUE_MASK =
		0x7FFFFFFF;
	
	/** Instructions for this code. */
	private final NativeInstruction[] _instructions;
	
	/** Line number table. */
	@Deprecated
	private final short[] _lines;
	
	/** Java operation table. */
	@Deprecated
	private final byte[] _jops;
	
	/** Java PC table. */
	@Deprecated
	private final byte[] _jpcs;
	
	/**
	 * Initializes the register code.
	 *
	 * @param __i The associated instructions.
	 * @param __l The lines for each instruction.
	 * @param __jo Java operation index.
	 * @param __jp Java PC addresses.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/22
	 */
	public NativeCode(NativeInstruction[] __i, short[] __l, byte[] __jo,
		byte[] __jp)
		throws NullPointerException
	{
		__i = (__i == null ? new NativeInstruction[0] : __i.clone());
		for (NativeInstruction i : __i)
			if (i == null)
				throw new NullPointerException("NARG");
		
		this._instructions = __i;
		this._lines = (__l == null ? new short[0] : __l.clone());
		this._jops = (__jo == null ? new byte[0] : __jo.clone());
		this._jpcs = (__jp == null ? new byte[0] : __jp.clone());
	}
	
	/**
	 * Gets the instruction at this index.
	 *
	 * @param __dx The index to get.
	 * @return The register at this index.
................................................................................
	@Override
	public final Iterator<NativeInstruction> iterator()
	{
		return UnmodifiableIterator.<NativeInstruction>of(
			this._instructions);
	}
	
	/**
	 * The table containing which instructions map to which Java address.
	 *
	 * @return The Java address table.
	 * @since 2019/04/26
	 */
	@Deprecated
	public final byte[] javaAddresses()
	{
		return this._jpcs.clone();
	}
	
	/**
	 * The table containing the table of instructions that map to which
	 * Java instruction.
	 *
	 * @return The Java operation table.
	 * @since 2019/04/26
	 */
	@Deprecated
	public final byte[] javaOperations()
	{
		return this._jops.clone();
	}
	
	/**
	 * Returns the length of the register code.
	 *
	 * @return The register code length.
	 * @since 2019/03/26
	 */
	public final int length()
	{
		return this._instructions.length;
	}
	
	/**
	 * The line number table.
	 *
	 * @return The line number table.
	 * @since 2018/03/24
	 */
	@Deprecated
	public final short[] lines()
	{
		return this._lines.clone();
	}
}








<
<
<
<
<







 







<
<
<
<
<
<
<
<
<
<
<
<




<
<
<



|
<








<
<
<







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










|
<
<
|
<
<
<
<
<
<
<
<
<
<
60
61
62
63
64
65
66





67
68
69
70
71
72
73
...
100
101
102
103
104
105
106












107
108
109
110



111
112
113
114

115
116
117
118
119
120
121
122



123
124
125
126
127
128
129
...
141
142
143
144
145
146
147

























148
149
150
151
152
153
154
155
156
157
158


159










	public static final int POOL_REGISTER =
		9;
	
	/** The register which contains the next pool pointer to use. */
	public static final int NEXT_POOL_REGISTER =
		10;
	





	/** Volatile A register. */
	public static final int VOLATILE_A_REGISTER =
		12;
	
	/** Volatile B register. */
	public static final int VOLATILE_B_REGISTER =
		13;
................................................................................
	/** Mask to access the offset value. */
	public static final int MEMORY_OFF_VALUE_MASK =
		0x7FFFFFFF;
	
	/** Instructions for this code. */
	private final NativeInstruction[] _instructions;
	












	/**
	 * Initializes the register code.
	 *
	 * @param __i The associated instructions.



	 * @throws NullPointerException On null arguments.
	 * @since 2019/03/22
	 */
	public NativeCode(NativeInstruction[] __i)

		throws NullPointerException
	{
		__i = (__i == null ? new NativeInstruction[0] : __i.clone());
		for (NativeInstruction i : __i)
			if (i == null)
				throw new NullPointerException("NARG");
		
		this._instructions = __i;



	}
	
	/**
	 * Gets the instruction at this index.
	 *
	 * @param __dx The index to get.
	 * @return The register at this index.
................................................................................
	@Override
	public final Iterator<NativeInstruction> iterator()
	{
		return UnmodifiableIterator.<NativeInstruction>of(
			this._instructions);
	}
	

























	/**
	 * Returns the length of the register code.
	 *
	 * @return The register code length.
	 * @since 2019/03/26
	 */
	public final int length()
	{
		return this._instructions.length;
	}
}













Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/nncc/NativeCodeBuilder.java.

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
...
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
...
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
...
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
	/** Temporary instruction layout. */
	final Map<Integer, Point> _points =
		new LinkedHashMap<>();
	
	/** Next address to use. */
	int _nextaddr;
	
	/** Current line address. */
	@Deprecated
	int _cursrcline =
		-1;
	
	/** Current Java instruction type. */
	@Deprecated
	int _cursrcjop =
		-1;
	
	/** Current Java PC address. */
	@Deprecated
	int _cursrcjpc =
		-1;
	
	/**
	 * Initializes the code builder at the default start address.
	 *
	 * @since 2019/03/22
	 */
	public NativeCodeBuilder()
	{
................................................................................
		
		// Debug
		if (__Debug__.ENABLED)
			todo.DEBUG.note("@%d -> %s %s", atdx,
				NativeInstruction.mnemonic(__op), Arrays.asList(__args));
			
		// Store all information
		this._points.put(atdx, new Point(rv, this._cursrcline,
			this._cursrcjop, this._cursrcjpc));
		return rv;
	}
	
	/**
	 * Adds conversion from one type to another.
	 *
	 * @param __fromt The source type.
................................................................................
					int val = e.getValue();
					if (val > i)
						e.setValue(val - 1);
				}
			}
		}
		
		// Resulting tables of instructions, line, JIs, and JPCs
		int n = in.size();
		NativeInstruction[] tabni = new NativeInstruction[n];
		short[] tabjl = new short[n];
		byte[] tabji = new byte[n];
		byte[] tabjp = new byte[n];
		
		// Go through input instructions and map them to real instructions
		for (int i = 0; i < n; i++)
		{
			// Get input point
			Point point = in.get(i);
			
			// Initialize debug table information
			tabjl[i] = (short)point.line;
			tabji[i] = (byte)point.jop;
			tabjp[i] = (byte)point.jpc;
			
			// The instruction is re-processed potentially
			NativeInstruction inst = point.instruction;
			
			// Used to detect if the instruction actually changed
			boolean didchange = false;
			
			// Arguments may be re-translated if they contain jumps
................................................................................
			
			// If the instruction changed, use the new one
			tabni[i] = (didchange ? new NativeInstruction(inst.op, args) :
				inst);
		}
		
		// Build
		return new NativeCode(tabni, tabjl, tabji, tabjp);
	}
	
	/**
	 * Adds a label at the current position.
	 *
	 * @param __lo The locality.
	 * @param __dx The index.
................................................................................
		if (__l == null)
			throw new NullPointerException("NARG");
		
		Integer rv = this._labels.get(__l);
		return (rv == null ? -1 : rv);
	}
	
	/**
	 * Sets the current byte code address.
	 *
	 * @param __jpc The byte code address to use.
	 * @since 2019/04/26
	 */
	@Deprecated
	public final void setByteCodeAddress(int __jpc)
	{
		this._cursrcjpc = __jpc;
	}
	
	/**
	 * Sets the current byte code operation.
	 *
	 * @param __jo The byte code operation to use.
	 * @since 2019/04/26
	 */
	@Deprecated
	public final void setByteCodeOperation(int __jo)
	{
		this._cursrcjop = __jo;
	}
	
	/**
	 * Sets the current source line.
	 *
	 * @param __l The line to set.
	 * @since 2019/03/23
	 */
	@Deprecated
	public final void setSourceLine(int __l)
	{
		this._cursrcline = __l;
	}
	
	/**
	 * This stores the information for a single point in the native code.
	 *
	 * @since 2019/04/26
	 */
	public static final class Point
	{
		/** The instruction used. */
		public final NativeInstruction instruction;
		
		/** Current line. */
		public final int line;
		
		/** Current Java operation. */
		public final int jop;
		
		/** Current Java address. */
		public final int jpc;
		
		/**
		 * Initializes the instruction point.
		 *
		 * @param __i The instruction.
		 * @param __line The line.
		 * @param __jop The Java operation.
		 * @param __jpc The Java PC address.
		 * @throws NullPointerException On null arguments.
		 * @since 2019/04/26
		 */
		public Point(NativeInstruction __i, int __line, int __jop, int __jpc)
			throws NullPointerException
		{
			if (__i == null)
				throw new NullPointerException("NARG");
			
			this.instruction = __i;
			this.line = __line;
			this.jop = __jop;
			this.jpc = __jpc;
		}
	}
}








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







|
<







 







|


<
<
<







<
<
<
<
<







 







|







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










<
<
<
<
<
<
<
<
<




<
<
<



|






<
<
<




37
38
39
40
41
42
43















44
45
46
47
48
49
50
..
91
92
93
94
95
96
97
98

99
100
101
102
103
104
105
...
488
489
490
491
492
493
494
495
496
497



498
499
500
501
502
503
504





505
506
507
508
509
510
511
...
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
...
628
629
630
631
632
633
634




































635
636
637
638
639
640
641
642
643
644









645
646
647
648



649
650
651
652
653
654
655
656
657
658



659
660
661
662
	/** Temporary instruction layout. */
	final Map<Integer, Point> _points =
		new LinkedHashMap<>();
	
	/** Next address to use. */
	int _nextaddr;
	















	/**
	 * Initializes the code builder at the default start address.
	 *
	 * @since 2019/03/22
	 */
	public NativeCodeBuilder()
	{
................................................................................
		
		// Debug
		if (__Debug__.ENABLED)
			todo.DEBUG.note("@%d -> %s %s", atdx,
				NativeInstruction.mnemonic(__op), Arrays.asList(__args));
			
		// Store all information
		this._points.put(atdx, new Point(rv));

		return rv;
	}
	
	/**
	 * Adds conversion from one type to another.
	 *
	 * @param __fromt The source type.
................................................................................
					int val = e.getValue();
					if (val > i)
						e.setValue(val - 1);
				}
			}
		}
		
		// Resulting tables of instructions
		int n = in.size();
		NativeInstruction[] tabni = new NativeInstruction[n];



		
		// Go through input instructions and map them to real instructions
		for (int i = 0; i < n; i++)
		{
			// Get input point
			Point point = in.get(i);
			





			// The instruction is re-processed potentially
			NativeInstruction inst = point.instruction;
			
			// Used to detect if the instruction actually changed
			boolean didchange = false;
			
			// Arguments may be re-translated if they contain jumps
................................................................................
			
			// If the instruction changed, use the new one
			tabni[i] = (didchange ? new NativeInstruction(inst.op, args) :
				inst);
		}
		
		// Build
		return new NativeCode(tabni);
	}
	
	/**
	 * Adds a label at the current position.
	 *
	 * @param __lo The locality.
	 * @param __dx The index.
................................................................................
		if (__l == null)
			throw new NullPointerException("NARG");
		
		Integer rv = this._labels.get(__l);
		return (rv == null ? -1 : rv);
	}
	




































	/**
	 * This stores the information for a single point in the native code.
	 *
	 * @since 2019/04/26
	 */
	public static final class Point
	{
		/** The instruction used. */
		public final NativeInstruction instruction;
		









		/**
		 * Initializes the instruction point.
		 *
		 * @param __i The instruction.



		 * @throws NullPointerException On null arguments.
		 * @since 2019/04/26
		 */
		public Point(NativeInstruction __i)
			throws NullPointerException
		{
			if (__i == null)
				throw new NullPointerException("NARG");
			
			this.instruction = __i;



		}
	}
}

Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/nncc/NearNativeByteCodeHandler.java.

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
...
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
....
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
....
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
	/** Default field access type, to determine how fields are accessed. */
	protected final FieldAccessTime defaultfieldaccesstime;
	
	/** The type of the current class being processed. */
	@Deprecated
	protected final ClassName thistype;
	
	/** Where is this method? */
	@Deprecated
	protected final WhereIsThis whereisthis;
	
	/** Is this method synchronized? */
	protected final boolean issynchronized;
	
	/** Is this an instance method? */
	protected final boolean isinstance;
	
	/** Standard exception handler table. */
................................................................................
		this.exceptionranges = new ExceptionHandlerRanges(__bc);
		this.defaultfieldaccesstime = ((__bc.isInstanceInitializer() ||
			__bc.isStaticInitializer()) ? FieldAccessTime.INITIALIZER :
			FieldAccessTime.NORMAL);
		this.thistype = __bc.thisType();
		this.issynchronized = __bc.isSynchronized();
		this.isinstance = __bc.isInstance();
		
		// Use for debugging and stack traces
		this.whereisthis = new WhereIsThis(__bc.thisType(),
			__bc.name(), __bc.type());
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/04/12
	 */
	@Override
................................................................................
		}
		
		// Debug single instruction point
		codebuilder.add(NativeInstructionType.DEBUG_POINT,
			state.line & 0x7FFF, state.instruction.operation() & 0xFF,
			state.instruction.address() & 0x7FFF);
		
		// Set source line and instruction operation
		codebuilder.setSourceLine(state.line);
		codebuilder.setByteCodeAddress(state.instruction.address());
		codebuilder.setByteCodeOperation(state.instruction.operation());
		
		// Check if there are operations that need to be performed to make
		// sure the stack state is morphed into correctly
		StateOperations poison = state.stackpoison.get(addr);
		if (poison != null)
			this.doStateOperations(poison);
		
		// Setup a label for this current position, this is done after
................................................................................
		// Setup state
		ByteCodeState state = this.state;
		state.addr = __ed.addr;
		state.line = __ed.line;
		
		// Setup code builder
		NativeCodeBuilder codebuilder = this.codebuilder;
		codebuilder.setSourceLine(__ed.line);
		codebuilder.setByteCodeAddress(__ed.jpc);
		codebuilder.setByteCodeOperation(__ed.jop);
		
		// And return the label
		return __ed.label;
	}
}








<
<
<
<







 







<
<
<
<







 







<
<
<
<
<







 







|

|






71
72
73
74
75
76
77




78
79
80
81
82
83
84
...
126
127
128
129
130
131
132




133
134
135
136
137
138
139
....
1371
1372
1373
1374
1375
1376
1377





1378
1379
1380
1381
1382
1383
1384
....
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
	/** Default field access type, to determine how fields are accessed. */
	protected final FieldAccessTime defaultfieldaccesstime;
	
	/** The type of the current class being processed. */
	@Deprecated
	protected final ClassName thistype;
	




	/** Is this method synchronized? */
	protected final boolean issynchronized;
	
	/** Is this an instance method? */
	protected final boolean isinstance;
	
	/** Standard exception handler table. */
................................................................................
		this.exceptionranges = new ExceptionHandlerRanges(__bc);
		this.defaultfieldaccesstime = ((__bc.isInstanceInitializer() ||
			__bc.isStaticInitializer()) ? FieldAccessTime.INITIALIZER :
			FieldAccessTime.NORMAL);
		this.thistype = __bc.thisType();
		this.issynchronized = __bc.isSynchronized();
		this.isinstance = __bc.isInstance();




	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/04/12
	 */
	@Override
................................................................................
		}
		
		// Debug single instruction point
		codebuilder.add(NativeInstructionType.DEBUG_POINT,
			state.line & 0x7FFF, state.instruction.operation() & 0xFF,
			state.instruction.address() & 0x7FFF);
		





		// Check if there are operations that need to be performed to make
		// sure the stack state is morphed into correctly
		StateOperations poison = state.stackpoison.get(addr);
		if (poison != null)
			this.doStateOperations(poison);
		
		// Setup a label for this current position, this is done after
................................................................................
		// Setup state
		ByteCodeState state = this.state;
		state.addr = __ed.addr;
		state.line = __ed.line;
		
		// Setup code builder
		NativeCodeBuilder codebuilder = this.codebuilder;
		/*codebuilder.setSourceLine(__ed.line);
		codebuilder.setByteCodeAddress(__ed.jpc);
		codebuilder.setByteCodeOperation(__ed.jop);*/
		
		// And return the label
		return __ed.label;
	}
}

Deleted runt/libs/tool-classfile/dev/shadowtail/classfile/nncc/WhereIsThis.java.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// Multi-Phasic Applications: SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package dev.shadowtail.classfile.nncc;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import net.multiphasicapps.classfile.ClassName;
import net.multiphasicapps.classfile.MethodDescriptor;
import net.multiphasicapps.classfile.MethodName;

/**
 * This stores information on where an object is located.
 *
 * @since 2019/04/22
 */
@Deprecated
public final class WhereIsThis
{
	/** The bit used to indicate an instance method for where is this. */
	public static final int INSTANCE_BIT =
		0x4000;
	
	/** The name of the class. */
	public final ClassName inclass;
	
	/** The method name. */
	public final MethodName name;
	
	/** The method type. */
	public final MethodDescriptor type;
	
	/** The hashcode. */
	private int _hash;
	
	/** The string form. */
	private Reference<String> _string;
	
	/**
	 * Initializes the where is this information.
	 *
	 * @param __cl The class this is in.
	 * @param __n The name of the method.
	 * @param __t The method type.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/04/22
	 */
	public WhereIsThis(ClassName __cl, MethodName __n, MethodDescriptor __t)
		throws NullPointerException
	{
		if (__cl == null || __n == null || __t == null)
			throw new NullPointerException("NARG");
		
		this.inclass = __cl;
		this.name = __n;
		this.type = __t;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/04/22
	 */
	@Override
	public final boolean equals(Object __o)
	{
		if (this == __o)
			return true;
		
		if (!(__o instanceof WhereIsThis))
			return false;
		
		if (this.hashCode() != __o.hashCode())
			return false;
		
		WhereIsThis o = (WhereIsThis)__o;
		return this.inclass.equals(o.inclass) &&
			this.name.equals(o.name) &&
			this.type.equals(o.type);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/04/22
	 */
	@Override
	public final int hashCode()
	{
		int rv = this._hash;
		if (rv == 0)
			this._hash = (rv = this.inclass.hashCode() ^
				this.name.hashCode() ^ this.type.hashCode());
		return rv;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/04/22
	 */
	@Override
	public final String toString()
	{
		Reference<String> ref = this._string;
		String rv;
		
		if (ref == null || null == (rv = ref.get()))
			this._string = new WeakReference<>((rv = String.format(
				"%s::%s:%s", this.inclass, this.name, this.type)));
		
		return rv;
	}
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































































































Changes to runt/libs/tool-jarfile/dev/shadowtail/jarfile/JarMinimizer.java.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
...
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
...
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
import dev.shadowtail.classfile.mini.MinimizedPool;
import dev.shadowtail.classfile.mini.MinimizedPoolEntryType;
import dev.shadowtail.classfile.mini.Minimizer;
import dev.shadowtail.classfile.nncc.AccessedField;
import dev.shadowtail.classfile.nncc.ClassPool;
import dev.shadowtail.classfile.nncc.InvokedMethod;
import dev.shadowtail.classfile.nncc.MethodIndex;
import dev.shadowtail.classfile.nncc.WhereIsThis;
import dev.shadowtail.classfile.nncc.UsedString;
import dev.shadowtail.classfile.xlate.InvokeType;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
................................................................................
			return bi._classoffset + mcf.header.smoff + mm.codeoffset;
		
		// Otherwise fallback to instance methods
		return bi._classoffset + mcf.header.imoff +
			mcf.method(false, __mn, __mt).codeoffset;
	}
	
	/**
	 * Returns the pointer where the class where information is stored.
	 *
	 * @param __wit Where is this?
	 * @return The offset to the information from the JAR.
	 * @since 2019/04/30
	 */
	private final int __classWhere(WhereIsThis __wit)
		throws NullPointerException
	{
		if (__wit == null)
			throw new NullPointerException("NARG");
			
		// Get base class
		__BootInfo__ bi = this._boots.get(__wit.inclass);
		MinimizedClassFile mcf = bi._class;
		
		// Find method
		MinimizedMethod mm = bi._class.method(__wit.name, __wit.type);
		if (mm == null)
			return 0;
		
		// Use the where of any found method
		return bi._classoffset + (mm.flags().isStatic() ? bi._class.header.
			smoff : bi._class.header.imoff) + mm.whereoffset;
	}
	
	/**
	 * Returns the initialize sequence that is needed for execution.
	 *
	 * @param __poolp The output pointer of the initial constant pool.
	 * @param __ksfa Output static field area.
	 * @return The initialization sequence needed to start the kernel properly.
	 * @since 2019/04/30
................................................................................
						InvokedMethod im = (InvokedMethod)pv;
						__init.memWriteInt(Modifier.JAR_OFFSET,
							ep, this.__classMethodCodeAddress(im.handle.
								outerClass(), im.handle.name(),
								im.handle.descriptor()));
					}
					break;
					
					// Where is this class? Used for tracing
				case WHERE_IS_THIS:
					__init.memWriteInt(Modifier.JAR_OFFSET,
						ep, this.__classWhere((WhereIsThis)pv));
					break;
				
				default:
					throw new todo.OOPS(pt.name());
			}
		}
		
		// Return the pointer where the pool was allocated







<







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<
<
<
<
<
<







19
20
21
22
23
24
25

26
27
28
29
30
31
32
...
232
233
234
235
236
237
238



























239
240
241
242
243
244
245
...
403
404
405
406
407
408
409






410
411
412
413
414
415
416
import dev.shadowtail.classfile.mini.MinimizedPool;
import dev.shadowtail.classfile.mini.MinimizedPoolEntryType;
import dev.shadowtail.classfile.mini.Minimizer;
import dev.shadowtail.classfile.nncc.AccessedField;
import dev.shadowtail.classfile.nncc.ClassPool;
import dev.shadowtail.classfile.nncc.InvokedMethod;
import dev.shadowtail.classfile.nncc.MethodIndex;

import dev.shadowtail.classfile.nncc.UsedString;
import dev.shadowtail.classfile.xlate.InvokeType;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
................................................................................
			return bi._classoffset + mcf.header.smoff + mm.codeoffset;
		
		// Otherwise fallback to instance methods
		return bi._classoffset + mcf.header.imoff +
			mcf.method(false, __mn, __mt).codeoffset;
	}
	



























	/**
	 * Returns the initialize sequence that is needed for execution.
	 *
	 * @param __poolp The output pointer of the initial constant pool.
	 * @param __ksfa Output static field area.
	 * @return The initialization sequence needed to start the kernel properly.
	 * @since 2019/04/30
................................................................................
						InvokedMethod im = (InvokedMethod)pv;
						__init.memWriteInt(Modifier.JAR_OFFSET,
							ep, this.__classMethodCodeAddress(im.handle.
								outerClass(), im.handle.name(),
								im.handle.descriptor()));
					}
					break;






				
				default:
					throw new todo.OOPS(pt.name());
			}
		}
		
		// Return the pointer where the pool was allocated