Check-in [ba772e3cac]

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

Overview
Comment:Cleanup some old fields and methods; Add constant type for class names.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ba772e3caca9ad679fa058b613990a36268ab619
User & Date: stephanie.gawroriski 2019-12-01 16:46:41
Context
2019-12-01
16:53
Add missing Jar Index for the run-time ClassInfo. check-in: ec1724f28d user: stephanie.gawroriski tags: trunk
16:46
Cleanup some old fields and methods; Add constant type for class names. check-in: ba772e3cac user: stephanie.gawroriski tags: trunk
16:43
Add base TODOs for parts that need to be done. check-in: fa307fb8b0 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

100
101
102
103
104
105
106




107
108
109
110
111
112
113
				
				// Name of class
			case ClassPoolConstants.TYPE_CLASSNAME:
				return new PoolClassName(
					(String)this.entry(false, eparts[0] & 0xFFFF, true),
					(PoolClassName)this.entry(false, eparts[1] & 0xFFFF,
						true));




			
				// Unknown
			default:
				throw new todo.TODO("Pool " + etype);
		}
	}
	







>
>
>
>







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
				
				// Name of class
			case ClassPoolConstants.TYPE_CLASSNAME:
				return new PoolClassName(
					(String)this.entry(false, eparts[0] & 0xFFFF, true),
					(PoolClassName)this.entry(false, eparts[1] & 0xFFFF,
						true));
					
				// Names of multiple classes
			case ClassPoolConstants.TYPE_CLASSNAMES:
				throw new todo.TODO();
			
				// Unknown
			default:
				throw new todo.TODO("Pool " + etype);
		}
	}
	

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

39
40
41
42
43
44
45
46



47

	/** String type. */
	public static final byte TYPE_STRING =
		1;
	
	/** Class name. */
	public static final byte TYPE_CLASSNAME =
		2;
}












|
>
>
>
|
>
39
40
41
42
43
44
45
46
47
48
49
50
51
	/** String type. */
	public static final byte TYPE_STRING =
		1;
	
	/** Class name. */
	public static final byte TYPE_CLASSNAME =
		2;
	
	/** Class names. */
	public static final byte TYPE_CLASSNAMES =
		3;
}

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

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
...
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
...
288
289
290
291
292
293
294
295

296
297
298
299
300
301
302
{
	/** The index of the class in the resource table. */
	protected final int resourceindex;
	
	/** The allocated class information. */
	private int _infopointer;
	
	/** The run-time constant pool pointer. */
	@Deprecated
	private int _poolpointer;
	
	/** Method VTables for this class. */
	@Deprecated
	private int _vtablemethodpointer;
	
	/** Pool VTables for this class. */
	@Deprecated
	private int _vtablepoolpointer;
	
	/**
	 * Initializes the class container.
	 *
	 * @param __cldx The class path resource index.
	 * @since 2019/10/19
	 */
	public TaskClass(int __cldx)
................................................................................
		else if (ClassNameUtils.isPrimitiveType(__cl))
			return this.__initializeClassInfoPrimitive(__task, __cl);
		
		// Otherwise initialize a standard class
		return this.__initializeClassInfoClass(__task, __cl);
	}
	
	/**
	 * Allocates the constant pool data area.
	 *
	 * @param __task The task owning this.
	 * @param __cfp The class file parser for this class.
	 * @return The pointer to the pool area.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/11/25
	 */
	private final int __allocatePool(Task __task, ClassFileParser __cfp)
		throws NullPointerException
	{
		if (__task == null || __cfp == null)
			throw new NullPointerException("NARG");
		
		// Was this already allocated? Do not do it again
		int rv = this._poolpointer;
		if (rv != 0)
			return rv;
		
		// Allocate memory region
		rv = __task.allocator.allocatePool(__cfp.splitPool(true).count());
		this._poolpointer = rv;
		
		return rv;
	}
	
	/**
	 * Builds the VTable for this class.
	 *
	 * @param __task The owning task.
	 * @param __cfp The class file parser for this class.
	 * @param __rvpool Should the pool be returned?
	 * @return The method or pool vtable array depending on {@code __rvpool}.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/11/28
	 */

	private final int __buildVTable(Task __task, ClassFileParser __cfp,
		boolean __rvpool)
		throws NullPointerException
	{
		if (__task == null)
			throw new NullPointerException("NARG");
		
		// Pre-cached?
		int vtmp = this._vtablemethodpointer,
			vtpp = this._vtablepoolpointer;
		if (vtmp > 0 && vtpp > 0)
			return (__rvpool ? vtpp : vtmp);
		
		throw new todo.TODO();
	}
	
	/**
	 * Initializes an array class.
	 *
	 * @param __task The creating task.
................................................................................
		// 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));







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







 







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










>







<
<
<
<
<
<







 







|
>







30
31
32
33
34
35
36












37
38
39
40
41
42
43
...
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
...
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
{
	/** The index of the class in the resource table. */
	protected final int resourceindex;
	
	/** The allocated class information. */
	private int _infopointer;
	












	/**
	 * Initializes the class container.
	 *
	 * @param __cldx The class path resource index.
	 * @since 2019/10/19
	 */
	public TaskClass(int __cldx)
................................................................................
		else if (ClassNameUtils.isPrimitiveType(__cl))
			return this.__initializeClassInfoPrimitive(__task, __cl);
		
		// Otherwise initialize a standard class
		return this.__initializeClassInfoClass(__task, __cl);
	}
	



























	/**
	 * Builds the VTable for this class.
	 *
	 * @param __task The owning task.
	 * @param __cfp The class file parser for this class.
	 * @param __rvpool Should the pool be returned?
	 * @return The method or pool vtable array depending on {@code __rvpool}.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/11/28
	 */
	@Deprecated
	private final int __buildVTable(Task __task, ClassFileParser __cfp,
		boolean __rvpool)
		throws NullPointerException
	{
		if (__task == null)
			throw new NullPointerException("NARG");
		






		throw new todo.TODO();
	}
	
	/**
	 * Initializes an array class.
	 *
	 * @param __task The creating task.
................................................................................
		// 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 = __task.allocator.allocatePool(
			thisparser.splitPool(true).count());
		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));