Check-in [8fd9c6daec]

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

Overview
Comment:Setting of various class properties.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8fd9c6daec307e0b5a663c7a94ec2be7d7e3d672
User & Date: stephanie.gawroriski 2019-12-01 15:35:51
Context
2019-12-01
15:44
Add methods to help for the allocation of objects and arrays. check-in: 8f2394f21a user: stephanie.gawroriski tags: trunk
15:35
Setting of various class properties. check-in: 8fd9c6daec user: stephanie.gawroriski tags: trunk
08:02
Backup developer notes. check-in: 1e7d0af871 user: squirreljme tags: trunk, x-date-201912
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/klib/supervisor/cc/squirreljme/jvm/io/MemoryBlob.java.

39
40
41
42
43
44
45







































46
47
48
49
50
51
52
		// {@squirreljme.error SV06 Negative memory blob size.}
		if (__size < 0)
			throw new IllegalArgumentException("SV06");
		
		this.base = __base;
		this.size = __size;
	}







































	
	/**
	 * {@inheritDoc}
	 * @since 2019/09/22
	 */
	@Override
	public byte readByte(int __o)







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







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
		// {@squirreljme.error SV06 Negative memory blob size.}
		if (__size < 0)
			throw new IllegalArgumentException("SV06");
		
		this.base = __base;
		this.size = __size;
	}
	
	/**
	 * Returns the base address of this blob.
	 *
	 * @return The base address of this blob.
	 * @since 2019/12/01
	 */
	public final int baseAddress()
	{
		return this.base;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/12/01
	 */
	@Override
	public final boolean equals(Object __o)
	{
		if (this == __o)
			return true;
		
		if (!(__o instanceof MemoryBlob))
			return false;
		
		MemoryBlob o = (MemoryBlob)__o;
		return this.base == o.base &&
			this.size == o.size;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/12/01
	 */
	@Override
	public final int hashCode()
	{
		return this.base ^ (-this.size);
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/09/22
	 */
	@Override
	public byte readByte(int __o)

Changes to runt/klib/supervisor/cc/squirreljme/jvm/lib/ClassDualPoolParser.java.

138
139
140
141
142
143
144
145


146

















	 * @since 2019/11/24
	 */
	public final String entryAsString(boolean __rt, int __dx)
		throws IndexOutOfBoundsException, InvalidClassFormatException
	{
		return (String)this.entry(__rt, __dx);
	}
}



























|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
	 * @since 2019/11/24
	 */
	public final String entryAsString(boolean __rt, int __dx)
		throws IndexOutOfBoundsException, InvalidClassFormatException
	{
		return (String)this.entry(__rt, __dx);
	}
	
	/**
	 * Returns the data to the given entry.
	 *
	 * @param __rt Read from the run-time pool?
	 * @param __dx The index to read.
	 * @param __ft Would the entry be forwarded through to the actual
	 * pool implementation?
	 * @return The data to the entry.
	 * @throws IndexOutOfBoundsException If the given entry is out of bounds.
	 * @throws InvalidClassFormatException If the pool is not valid.
	 * @since 2019/12/01
	 */
	public final BinaryBlob entryData(boolean __rt, int __dx, boolean __ft)
		throws IndexOutOfBoundsException, InvalidClassFormatException
	{
		return (__rt ? this.runtimepool : this.classpool).
			entryData(__dx, __ft);
	}
}

Changes to runt/klib/supervisor/cc/squirreljme/jvm/lib/ClassFileParser.java.

6
7
8
9
10
11
12

13
14
15
16
17
18
19
..
57
58
59
60
61
62
63














64
65
66
67
68
69
70
...
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
...
185
186
187
188
189
190
191














192
193
194
195
196
197
198
...
275
276
277
278
279
280
281
282


283
























// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm.lib;

import cc.squirreljme.jvm.io.BinaryBlob;


/**
 * This utility exists for the parsing of SquirrelJME's class files and allows
 * the bootstrap and class loaders the ability to read them.
 *
 * @since 2019/10/06
 */
................................................................................
		if (__blob == null)
			throw new NullPointerException("NARG");
		
		this.blob = __blob;
		this.rootstaticpool = __sp;
		this.rootruntimepool = __rp;
	}














	
	/**
	 * Returns the number of fields in the class.
	 *
	 * @param __is Get the static field count.
	 * @return The number of fields in the class.
	 * @since 2019/10/26
................................................................................
		BinaryBlob blob = this.blob;
		return new ClassFieldsParser(this.pool(),
			this.blob.subSection(this.fieldDataOffset(__is),
				this.fieldDataSize(__is)), this.fieldCount(__is));
	}
	
	/**
	 * Returns the size of all of the fields.
	 *
	 * @param __is Get the size of static fields?
	 * @return The number of bytes the field requires for consumption.
	 * @since 2019/10/21
	 */
	public final int fieldSize(boolean __is)
	{
		return this.blob.readJavaUnsignedShort(
			(__is ? ClassFileConstants.OFFSET_OF_USHORT_SFBYTES :
			ClassFileConstants.OFFSET_OF_USHORT_IFBYTES));
	}












	
	/**
	 * Returns the number of methods in the class.
	 *
	 * @param __is Get the static method count.
	 * @return The number of methods in the class.
	 * @since 2019/11/29
................................................................................
	public final ClassMethodsParser methods(boolean __is)
	{
		BinaryBlob blob = this.blob;
		return new ClassMethodsParser(this.pool(),
			this.blob.subSection(this.methodDataOffset(__is),
				this.methodDataSize(__is)), this.methodCount(__is));
	}














	
	/**
	 * Returns a dual pool parser for this class.
	 *
	 * @return The dual pool parser.
	 * @since 2019/10/13
	 */
................................................................................
	 */
	public final PoolClassName superClassName()
	{
		return this.pool().entryAsClassName(false,
			this.blob.readJavaUnsignedShort(
				ClassFileConstants.OFFSET_OF_USHORT_CLASSSUPER));
	}
}


































>







 







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







 







|











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







 







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







 







|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
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
...
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
...
212
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
...
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
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm.lib;

import cc.squirreljme.jvm.io.BinaryBlob;
import cc.squirreljme.jvm.io.MemoryBlob;

/**
 * This utility exists for the parsing of SquirrelJME's class files and allows
 * the bootstrap and class loaders the ability to read them.
 *
 * @since 2019/10/06
 */
................................................................................
		if (__blob == null)
			throw new NullPointerException("NARG");
		
		this.blob = __blob;
		this.rootstaticpool = __sp;
		this.rootruntimepool = __rp;
	}
	
	/**
	 * Returns the base address of the class if it is known.
	 *
	 * @return The base address or {@code 0} if it is not known.
	 * @since 2019/12/01
	 */
	public final int baseAddress()
	{
		BinaryBlob blob = this.blob;
		if (blob instanceof MemoryBlob)
			return ((MemoryBlob)blob).baseAddress();
		return 0;
	}
	
	/**
	 * Returns the number of fields in the class.
	 *
	 * @param __is Get the static field count.
	 * @return The number of fields in the class.
	 * @since 2019/10/26
................................................................................
		BinaryBlob blob = this.blob;
		return new ClassFieldsParser(this.pool(),
			this.blob.subSection(this.fieldDataOffset(__is),
				this.fieldDataSize(__is)), this.fieldCount(__is));
	}
	
	/**
	 * Returns the size of all of the fields in bytes.
	 *
	 * @param __is Get the size of static fields?
	 * @return The number of bytes the field requires for consumption.
	 * @since 2019/10/21
	 */
	public final int fieldSize(boolean __is)
	{
		return this.blob.readJavaUnsignedShort(
			(__is ? ClassFileConstants.OFFSET_OF_USHORT_SFBYTES :
			ClassFileConstants.OFFSET_OF_USHORT_IFBYTES));
	}
	
	/**
	 * Returns the raw class flags.
	 *
	 * @return The class flags.
	 * @since 2019/12/01
	 */
	public final int flags()
	{
		return this.blob.readJavaInt(
			ClassFileConstants.OFFSET_OF_INT_CLASSFLAGS);
	}
	
	/**
	 * Returns the number of methods in the class.
	 *
	 * @param __is Get the static method count.
	 * @return The number of methods in the class.
	 * @since 2019/11/29
................................................................................
	public final ClassMethodsParser methods(boolean __is)
	{
		BinaryBlob blob = this.blob;
		return new ClassMethodsParser(this.pool(),
			this.blob.subSection(this.methodDataOffset(__is),
				this.methodDataSize(__is)), this.methodCount(__is));
	}
	
	/**
	 * Returns the number of objects in the class.
	 *
	 * @param __is Get the static object count.
	 * @return The number of objects in the class.
	 * @since 2019/11/29
	 */
	public final int objectCount(boolean __is)
	{
		return this.blob.readJavaUnsignedShort(
			(__is ? ClassFileConstants.OFFSET_OF_USHORT_SFOBJS :
			ClassFileConstants.OFFSET_OF_USHORT_IFOBJS));
	}
	
	/**
	 * Returns a dual pool parser for this class.
	 *
	 * @return The dual pool parser.
	 * @since 2019/10/13
	 */
................................................................................
	 */
	public final PoolClassName superClassName()
	{
		return this.pool().entryAsClassName(false,
			this.blob.readJavaUnsignedShort(
				ClassFileConstants.OFFSET_OF_USHORT_CLASSSUPER));
	}
	
	/**
	 * Returns the name of this class.
	 *
	 * @return The name of this class.
	 * @since 2019/11/25
	 */
	public final PoolClassName thisName()
	{
		return this.pool().entryAsClassName(false,
			this.blob.readJavaUnsignedShort(
				ClassFileConstants.OFFSET_OF_USHORT_CLASSNAME));
	}
	
	/**
	 * Returns the name of this class.
	 *
	 * @return The name of this class.
	 * @since 2019/11/25
	 */
	public final BinaryBlob thisNameAsBinaryBlob()
	{
		return this.pool().entryData(false,
			this.blob.readJavaUnsignedShort(
				ClassFileConstants.OFFSET_OF_USHORT_CLASSNAME), false);
	}
}

Changes to runt/klib/supervisor/cc/squirreljme/jvm/lib/ClassInfoUtility.java.

5
6
7
8
9
10
11

12

13
14
15
16
17
18
19
..
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
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm.lib;


import cc.squirreljme.jvm.Constants;


/**
 * This is a utility which allows access to the various fields within
 * {@link cc.squirreljme.jvm.ClassInfo}.
 *
 * @since 2019/11/30
 */
................................................................................
		
		int[] properties = new int[ClassInfoProperty.NUM_PROPERTIES];
		for (int i = 0, lim = Math.min(__props.length,
			ClassInfoProperty.NUM_PROPERTIES); i < lim; i++)
			properties[i] = __props[i];
		this.properties = properties;
	}














	
	/**
	 * Returns the allocation size of instances of this class.
	 *
	 * @return The allocation size of this.
	 * @since 2019/11/30
	 */
	public final int allocationSize()
	{
		return this.allocationsize;
	}













































































































































































































	
	/**
	 * Initializes the {@code ClassInfo} utility.
	 *
	 * @param __cfp The class info parser to use.
	 * @return The utility for {@code ClassInfo}.
	 * @throws NullPointerException On null arguments.







>

>







 







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







|



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







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
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
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
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
278
279
280
281
282
283
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm.lib;

import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.Constants;
import cc.squirreljme.jvm.task.TaskClass;

/**
 * This is a utility which allows access to the various fields within
 * {@link cc.squirreljme.jvm.ClassInfo}.
 *
 * @since 2019/11/30
 */
................................................................................
		
		int[] properties = new int[ClassInfoProperty.NUM_PROPERTIES];
		for (int i = 0, lim = Math.min(__props.length,
			ClassInfoProperty.NUM_PROPERTIES); i < lim; i++)
			properties[i] = __props[i];
		this.properties = properties;
	}
	
	/**
	 * Returns the class allocation size.
	 *
	 * @param __cl The class.
	 * @return The class allocation size.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final int classAllocationSize(TaskClass __cl)
		throws NullPointerException
	{
		return this.property(__cl, ClassInfoProperty.INT_SIZE);
	}
	
	/**
	 * Returns the allocation size of instances of this class.
	 *
	 * @return The allocation size of this.
	 * @since 2019/11/30
	 */
	public final int classInfoAllocationSize()
	{
		return this.allocationsize;
	}
	
	/**
	 * Returns the object count of the class.
	 *
	 * @param __cl The class.
	 * @return The class object count.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final int objectCount(TaskClass __cl)
		throws NullPointerException
	{
		return this.property(__cl, ClassInfoProperty.INT_NUMOBJECTS);
	}
	
	/**
	 * Returns the specified property.
	 *
	 * @param __cl The class.
	 * @param __prop The property to return.
	 * @return The property value.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final int property(TaskClass __cl, int __prop)
		throws NullPointerException
	{
		if (__cl == null)
			throw new NullPointerException("NARG");
		
		return Assembly.memReadInt(__cl.infoPointer(),
			this.properties[__prop]);
	}
	
	/**
	 * Sets the the base of the class.
	 *
	 * @param __cl The class.
	 * @param __v The value to set.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setBaseSize(TaskClass __cl, int __v)
		throws NullPointerException
	{
		this.setProperty(__cl, ClassInfoProperty.INT_BASE,
			__v);
	}
	
	/**
	 * Sets the allocation size.
	 *
	 * @param __cl The class.
	 * @param __v The value to set.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setClassAllocationSize(TaskClass __cl, int __v)
		throws NullPointerException
	{
		this.setProperty(__cl, ClassInfoProperty.INT_SIZE,
			__v);
	}
	
	/**
	 * Sets the flags.
	 *
	 * @param __cl The class.
	 * @param __v The value to set.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setFlags(TaskClass __cl, int __v)
		throws NullPointerException
	{
		this.setProperty(__cl, ClassInfoProperty.INT_FLAGS,
			__v);
	}
	
	/**
	 * Sets the class magic number.
	 *
	 * @param __cl The class.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setMagicNumber(TaskClass __cl)
		throws NullPointerException
	{
		this.setProperty(__cl, ClassInfoProperty.INT_MAGIC,
			ClassFileConstants.MAGIC_NUMBER);
	}
	
	/**
	 * Sets the mini class pointer.
	 *
	 * @param __cl The class.
	 * @param __v The value to set.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setMiniClassPointer(TaskClass __cl, int __v)
		throws NullPointerException
	{
		this.setProperty(__cl, ClassInfoProperty.INT_MINIPTR,
			__v);
	}
	
	/**
	 * Sets the name pointer.
	 *
	 * @param __cl The class.
	 * @param __v The value to set.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setNamePointer(TaskClass __cl, int __v)
		throws NullPointerException
	{
		this.setProperty(__cl, ClassInfoProperty.INT_NAMEP,
			__v);
	}
	
	/**
	 * Sets the object count.
	 *
	 * @param __cl The class.
	 * @param __v The value to set.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setObjectCount(TaskClass __cl, int __v)
		throws NullPointerException
	{
		this.setProperty(__cl, ClassInfoProperty.INT_NUMOBJECTS,
			__v);
	}
	
	/**
	 * Sets the pool pointer.
	 *
	 * @param __cl The class.
	 * @param __v The value to set.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setPoolPointer(TaskClass __cl, int __v)
		throws NullPointerException
	{
		this.setProperty(__cl, ClassInfoProperty.INT_POOL,
			__v);
	}
	
	/**
	 * Sets the value of the given property.
	 *
	 * @param __cl The class to set.
	 * @param __prop The property to set.
	 * @param __v The value to set.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setProperty(TaskClass __cl, int __prop, int __v)
		throws NullPointerException
	{
		if (__cl == null)
			throw new NullPointerException("NARG");
		
		// Write value
		Assembly.memWriteInt(__cl.infoPointer(),
			this.properties[__prop], __v);
	}
	
	/**
	 * Sets the self pointer value.
	 *
	 * @param __cl The class.
	 * @param __v The value to set.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setSelfPointer(TaskClass __cl, int __v)
		throws NullPointerException
	{
		this.setProperty(__cl, ClassInfoProperty.INT_SELFPTR,
			__v);
	}
	
	/**
	 * Sets the super class.
	 *
	 * @param __cl The class.
	 * @param __su The super class.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/12/01
	 */
	public final void setSuperClass(TaskClass __cl, TaskClass __su)
		throws NullPointerException
	{
		if (__su == null)
			throw new NullPointerException("NARG");
		
		this.setProperty(__cl, ClassInfoProperty.CLASSINFO_SUPERCLASS,
			__su.infoPointer());
	}
	
	/**
	 * Initializes the {@code ClassInfo} utility.
	 *
	 * @param __cfp The class info parser to use.
	 * @return The utility for {@code ClassInfo}.
	 * @throws NullPointerException On null arguments.

Changes to runt/klib/supervisor/cc/squirreljme/jvm/task/TaskClass.java.

7
8
9
10
11
12
13


14
15

16
17
18
19
20
21
22
...
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
...
215
216
217
218
219
220
221




222
223
224
225
226
227
228
...
258
259
260
261
262
263
264




















265
266
267
268

269
270
271
272
273
274


275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
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
333
334
335
336
337
338
339
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm.task;

import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.Constants;


import cc.squirreljme.jvm.lib.ClassFieldsParser;
import cc.squirreljme.jvm.lib.ClassFileParser;

import cc.squirreljme.jvm.lib.ClassInfoUtility;
import cc.squirreljme.jvm.lib.ClassMethodsParser;
import cc.squirreljme.jvm.lib.ClassNameUtils;
import java.util.Objects;

/**
 * This represents a class of a task.
................................................................................
		
		// We need the parser for class info so that we can initialize the
		// classes, however every variant of the loader can use this.
		ClassInfoUtility ciutil = __task.classInfoUtility();
		
		// All branches require the info
		int infopointer = __task.allocator.allocateObject(
			ciutil.allocationSize());
		this._infopointer = infopointer;
		
		// This object has the class type of ClassInfo so it must always point
		// to the ClassInfo instance of ClassInfo, however if we are loading
		// ClassInfo then we just use our own pointer
		Assembly.memWriteInt(infopointer, Constants.OBJECT_CLASS_OFFSET,
			(ClassNameUtils.isClassInfo(__cl) ? infopointer :
................................................................................
		// We need to handle the component type
		TaskClass comptype = __task.loadClass(
			ClassNameUtils.componentType(__cl));
		
		throw new todo.TODO();
		
		/*




		// If this is an array or primitive type, just use the vtables for
		// the Object class because these are purely virtual!
		if (ClassNameUtils.isArray(__cl) || ClassNameUtils.isPrimitive(__cl))
		{
			// Load object class
			TaskClass tc = __task.loadClass("java/lang/Object");
			
................................................................................
		// First we load the base class because it will contain information
		// about the class that we need
		ClassFileParser thisparser = __task.classpath.classParser(
			this.resourceindex);
		
		// Pointer to self
		int infopointer = this._infopointer;




















		
		// The run-time pool is initialized later, but we need to allocate it
		// now!
		int poolpointer = this.__allocatePool(__task, thisparser);

		
		// Load super class if there is one
		String superclassname = Objects.toString(thisparser.superClassName(),
			null);
		TaskClass superclass = (superclassname == null ? null :
			__task.loadClass(superclassname));


		
		/*
		// Process every field that is defined within the information structure
		ClassFieldsParser cifs = __cip.fields(false);
		for (int cif = 0, cifn = cifs.count(); cif < cifn; cif++)
		{
			// Read field properties
			int ffl = cifs.flags(cif),
				fof = cifs.offset(cif),
				fsz = cifs.size(cif);
			
			// Determine where we write the data to!
			int wb = infopointer + Constants.OBJECT_BASE_SIZE;
			
			// Debug
			todo.DEBUG.note("fl=%sh of=%d sz=%d",
				Integer.toString(ffl, 16), fof, fsz);
			
			// Depends on the field name and type
			String nat = cifs.name(cif) + ":" + cifs.type(cif);
			switch (nat)
			{
					// Class object pointer, is created dynamically!
				case "classobjptr:java/lang/Class":
					Assembly.memWriteInt(wb, fof,
						0);
					break;
				
					// The component of this class
				case "componentclass:cc/squirreljme/jvm/ClassInfo":
					Assembly.memWriteInt(wb, fof,
						(!ClassNameUtils.isArray(__cl) ? 0 :
						__task.loadClass(ClassNameUtils.componentType(__cl)).
						_infopointer));
					break;
					
					// Super class of this class
				case "superclass:cc/squirreljme/jvm/ClassInfo":
					Assembly.memWriteInt(wb, fof,
						(superclass == null ? 0 : superclass._infopointer));
					break;


				
					// VTable for pools
				case "vtablepool:[I":
					Assembly.memWriteInt(wb, fof,
						this.__buildVTable(__task, thisparser, true));
					break;



					
					// VTable for methods
				case "vtablevirtual:[I":
					Assembly.memWriteInt(wb, fof,
						this.__buildVTable(__task, thisparser, false));
					break;


				
				default:
					throw new todo.TODO(nat);
			}




		}*/
		
		throw new todo.TODO();
		
		/*
		// {@squirreljme.error SV0l Task does not have ClassInfo in its
		// class path.}
		int cidx = classpath.resourceClassFind("cc/squirreljme/jvm/ClassInfo");







>
>


>







 







|







 







>
>
>
>







 







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




>






>
>

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<
|
<
>
>
|
<
<
<
<
<
>
>
>
|
<
<
<
<
<
>
>
|
<
<
<
>
>
>
>
|







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
...
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
...
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305



































306


307

308
309
310





311
312
313
314





315
316
317



318
319
320
321
322
323
324
325
326
327
328
329
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.jvm.task;

import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.Constants;
import cc.squirreljme.jvm.io.BinaryBlob;
import cc.squirreljme.jvm.io.MemoryBlob;
import cc.squirreljme.jvm.lib.ClassFieldsParser;
import cc.squirreljme.jvm.lib.ClassFileParser;
import cc.squirreljme.jvm.lib.ClassInfoProperty;
import cc.squirreljme.jvm.lib.ClassInfoUtility;
import cc.squirreljme.jvm.lib.ClassMethodsParser;
import cc.squirreljme.jvm.lib.ClassNameUtils;
import java.util.Objects;

/**
 * This represents a class of a task.
................................................................................
		
		// We need the parser for class info so that we can initialize the
		// classes, however every variant of the loader can use this.
		ClassInfoUtility ciutil = __task.classInfoUtility();
		
		// All branches require the info
		int infopointer = __task.allocator.allocateObject(
			ciutil.classInfoAllocationSize());
		this._infopointer = infopointer;
		
		// This object has the class type of ClassInfo so it must always point
		// to the ClassInfo instance of ClassInfo, however if we are loading
		// ClassInfo then we just use our own pointer
		Assembly.memWriteInt(infopointer, Constants.OBJECT_CLASS_OFFSET,
			(ClassNameUtils.isClassInfo(__cl) ? infopointer :
................................................................................
		// We need to handle the component type
		TaskClass comptype = __task.loadClass(
			ClassNameUtils.componentType(__cl));
		
		throw new todo.TODO();
		
		/*
		INT_CELLSIZE
		CLASSINFO_COMPONENTCLASS
		INT_DIMENSIONS
		
		// If this is an array or primitive type, just use the vtables for
		// the Object class because these are purely virtual!
		if (ClassNameUtils.isArray(__cl) || ClassNameUtils.isPrimitive(__cl))
		{
			// Load object class
			TaskClass tc = __task.loadClass("java/lang/Object");
			
................................................................................
		// First we load the base class because it will contain information
		// about the class that we need
		ClassFileParser thisparser = __task.classpath.classParser(
			this.resourceindex);
		
		// Pointer to self
		int infopointer = this._infopointer;
		ciutil.setSelfPointer(this, infopointer);
		
		// Set pointer to the mini-class which may or may not be valid at all
		ciutil.setMiniClassPointer(this, thisparser.baseAddress());
		
		// Set magic number
		ciutil.setMagicNumber(this);
		
		// Set flags
		ciutil.setFlags(this, thisparser.flags());
		
		// Set self name
		BinaryBlob name = thisparser.thisNameAsBinaryBlob();
		if (name instanceof MemoryBlob)
			ciutil.setNamePointer(this, ((MemoryBlob)name).baseAddress() + 4);
		
		// Need to store the name elsewhere, since we do not have a direct
		// pointer to the name
		else
			throw new todo.TODO();
		
		// The run-time pool is initialized later, but we need to allocate it
		// now!
		int poolpointer = this.__allocatePool(__task, thisparser);
		ciutil.setPoolPointer(this, poolpointer);
		
		// Load super class if there is one
		String superclassname = Objects.toString(thisparser.superClassName(),
			null);
		TaskClass superclass = (superclassname == null ? null :
			__task.loadClass(superclassname));
		if (superclass != null)
			ciutil.setSuperClass(this, superclass);
		



































		// The base for this class


		int basesize = (superclass == null ? 0 :

			ciutil.classAllocationSize(superclass));
		ciutil.setBaseSize(this, basesize);
		





		// Allocation size of this class
		ciutil.setClassAllocationSize(this,
			basesize + thisparser.fieldSize(false));
		





		// Set number of objects this has, for garbage collection
		ciutil.setObjectCount(this, thisparser.objectCount(false));
		



		/*
		CLASSINFO_ARRAY_INTERFACECLASSES
		INT_ARRAY_VTABLEVIRTUAL
		INT_ARRAY_VTABLEPOOL
		*/
		
		throw new todo.TODO();
		
		/*
		// {@squirreljme.error SV0l Task does not have ClassInfo in its
		// class path.}
		int cidx = classpath.resourceClassFind("cc/squirreljme/jvm/ClassInfo");