Check-in [a161e4896b]

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

Overview
Comment:Write of class name.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a161e4896bdc464b58994b13c6f7776087dca7d7
User & Date: stephanie.gawroriski 2019-09-15 01:37:27
Context
2019-09-15
07:05
Backup developer notes. check-in: 8a29272858 user: squirreljme tags: trunk
01:37
Write of class name. check-in: a161e4896b user: stephanie.gawroriski tags: trunk
01:27
Write object count. check-in: 66a100c9ec user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/libs/tool-classfile/dev/shadowtail/classfile/pool/DualClassRuntimePool.java.

64
65
66
67
68
69
70













71
72
73
74
75
76
77
78
79
80
81
82
83
	 * @since 2019/09/07
	 */
	public final BasicPoolEntry getByIndex(boolean __rt, int __dx)
		throws IndexOutOfBoundsException
	{
		return (__rt ? this.runpool : this.classpool).byIndex(__dx);
	}













	
	/**
	 * Returns the runtime class pool.
	 *
	 * @return The pool.
	 * @since 2019/09/14
	 */
	public final BasicPool runtimePool()
	{
		return this.runpool;
	}
}








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













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
	 * @since 2019/09/07
	 */
	public final BasicPoolEntry getByIndex(boolean __rt, int __dx)
		throws IndexOutOfBoundsException
	{
		return (__rt ? this.runpool : this.classpool).byIndex(__dx);
	}
	
	/**
	 * Loads a value from the pool by its value.
	 *
	 * @param __rt Read from the run-time pool?
	 * @param __v The value to get.
	 * @return The entry for the given value or {@code null} if not found.
	 * @since 2019/09/14
	 */
	public final BasicPoolEntry getByValue(boolean __rt, Object __v)
	{
		return (__rt ? this.runpool : this.classpool).byValue(__v);
	}
	
	/**
	 * Returns the runtime class pool.
	 *
	 * @return The pool.
	 * @since 2019/09/14
	 */
	public final BasicPool runtimePool()
	{
		return this.runpool;
	}
}

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

318
319
320
321
322
323
324







325
326
327
328
329
330
331
...
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
...
696
697
698
699
700
701
702





























703
704
705
706
707
708
709
			// The write pointer of this data
			int wp = bootstrap.findClass(cn).baseOffset() + mf.offset;
			
			// Depends on the key (specified where and its type)
			String key = mf.name + ":" + mf.type;
			switch (key)
			{







					// The number of objects in this class
				case "numobjects:I":
					initializer.memWriteInt(
						wp, this._class.header.ifobjs);
					break;
					
					// Pointer to our own class info
................................................................................
						}
						break;
						
						// Pointer to the class data in ROM
					case "miniptr:I":
						initializer.memWriteInt(Modifier.JAR_OFFSET,
							wp, bi._classoffset);
						break;
						
						// Pointer to the class name
					case "namep:I":
						if (true)
							throw new todo.TODO();
						/*
						__init.memWriteInt(Modifier.JAR_OFFSET,
							wp, bi._classoffset + bi._class.header.pooloff +
								bi._class.pool.offset(bi._class.pool.part(
								bi._class.header.classname, 0)) + 4);
						* /
						break;
						
						// Super class info
					case "superclass:Lcc/squirreljme/jvm/ClassInfo;":
						{
							ClassName sn = bi._class.superName();
							if (sn == null)
................................................................................
		if (supername == null)
			return bi._class.header.imcount;
		
		// Otherwise include the super class count as well
		return this.__classMethodSize(supername) + bi._class.header.imcount;
		*/
	}





























	
	/**
	 * Returns a pointer to the class's constant pool.
	 *
	 * @return The pointer to the class constant pool.
	 * @since 2019/09/14
	 */







>
>
>
>
>
>
>







 







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







 







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







318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
...
415
416
417
418
419
420
421












422
423
424
425
426
427
428
...
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
			// The write pointer of this data
			int wp = bootstrap.findClass(cn).baseOffset() + mf.offset;
			
			// Depends on the key (specified where and its type)
			String key = mf.name + ":" + mf.type;
			switch (key)
			{
					// Pointer to the class name
				case "namep:I":
					initializer.memWriteInt(Modifier.JAR_OFFSET,
						wp, this.romOffset() + this.poolEntryOffset(
						this._class.thisName().toString()) + 4);
					break;
					
					// The number of objects in this class
				case "numobjects:I":
					initializer.memWriteInt(
						wp, this._class.header.ifobjs);
					break;
					
					// Pointer to our own class info
................................................................................
						}
						break;
						
						// Pointer to the class data in ROM
					case "miniptr:I":
						initializer.memWriteInt(Modifier.JAR_OFFSET,
							wp, bi._classoffset);












						break;
						
						// Super class info
					case "superclass:Lcc/squirreljme/jvm/ClassInfo;":
						{
							ClassName sn = bi._class.superName();
							if (sn == null)
................................................................................
		if (supername == null)
			return bi._class.header.imcount;
		
		// Otherwise include the super class count as well
		return this.__classMethodSize(supername) + bi._class.header.imcount;
		*/
	}
	
	/**
	 * Returns the pointer to the offset of the given pool value.
	 *
	 * @param __v The value to get.
	 * @return The offset of the given value.
	 * @since 2019/09/14
	 */
	public final int poolEntryOffset(Object __v)
	{
		// Need pool for this!
		DualClassRuntimePool pool = this._class.pool;
		
		// Flagged if this is in the runtime pool?
		boolean inruntime;
		
		// Try to find the value from some pool
		BasicPoolEntry entry = pool.getByValue(false, __v);
		if ((inruntime = (entry == null)))
			entry = pool.getByValue(true, __v);
		
		// {@squirreljme.error BC0f Value not found in any pool. (The value)}
		if (entry == null)
			throw new InvalidClassFormatException("BC0f " + __v);
		
		// The offset of this entry is based on where it was found!
		return (inruntime ? this._class.header.runtimepooloff :
			this._class.header.staticpooloff) + entry.offset;
	}
	
	/**
	 * Returns a pointer to the class's constant pool.
	 *
	 * @return The pointer to the class constant pool.
	 * @since 2019/09/14
	 */