Check-in [0ca1cefb3a]

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

Overview
Comment:Add field reference.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0ca1cefb3a336dce2b326af6305e276c6a4707f0
User & Date: stephanie.gawroriski 2019-09-11 15:09:45
Context
2019-09-11
15:14
Add decode of method index. check-in: 8eb04afde1 user: stephanie.gawroriski tags: trunk
15:09
Add field reference. check-in: 0ca1cefb3a user: stephanie.gawroriski tags: trunk
15:02
Decode of class pool reference. check-in: a42203c959 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

5
6
7
8
9
10
11

12
13
14
15
16
17
18


19
20
21
22
23
24
25
...
242
243
244
245
246
247
248













249
250
251
252
253
254
255
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package dev.shadowtail.classfile.mini;


import dev.shadowtail.classfile.pool.BasicPool;
import dev.shadowtail.classfile.pool.BasicPoolBuilder;
import dev.shadowtail.classfile.pool.BasicPoolEntry;
import dev.shadowtail.classfile.pool.ClassInfoPointer;
import dev.shadowtail.classfile.pool.ClassPool;
import dev.shadowtail.classfile.pool.DualClassRuntimePool;
import dev.shadowtail.classfile.pool.DualClassRuntimePoolBuilder;


import dev.shadowtail.classfile.pool.InvokeType;
import dev.shadowtail.classfile.pool.InvokedMethod;
import dev.shadowtail.classfile.pool.NotedString;
import dev.shadowtail.classfile.pool.UsedString;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
................................................................................
								// Method descriptor, has extra meta-data
							case METHOD_DESCRIPTOR:
								value = new MethodDescriptor(
									entries.get(parts[0]).
									<String>value(String.class));
								break;
								













								// Class information point
							case CLASS_INFO_POINTER:
								value = new ClassInfoPointer(
									classpool.byIndex(parts[0]).
									<ClassName>value(ClassName.class));
								break;
								







>







>
>







 







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







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

package dev.shadowtail.classfile.mini;

import dev.shadowtail.classfile.pool.AccessedField;
import dev.shadowtail.classfile.pool.BasicPool;
import dev.shadowtail.classfile.pool.BasicPoolBuilder;
import dev.shadowtail.classfile.pool.BasicPoolEntry;
import dev.shadowtail.classfile.pool.ClassInfoPointer;
import dev.shadowtail.classfile.pool.ClassPool;
import dev.shadowtail.classfile.pool.DualClassRuntimePool;
import dev.shadowtail.classfile.pool.DualClassRuntimePoolBuilder;
import dev.shadowtail.classfile.pool.FieldAccessTime;
import dev.shadowtail.classfile.pool.FieldAccessType;
import dev.shadowtail.classfile.pool.InvokeType;
import dev.shadowtail.classfile.pool.InvokedMethod;
import dev.shadowtail.classfile.pool.NotedString;
import dev.shadowtail.classfile.pool.UsedString;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
................................................................................
								// Method descriptor, has extra meta-data
							case METHOD_DESCRIPTOR:
								value = new MethodDescriptor(
									entries.get(parts[0]).
									<String>value(String.class));
								break;
								
								// A field which has been accessed
							case ACCESSED_FIELD:
								value = new AccessedField(
									FieldAccessTime.of(parts[0]),
									FieldAccessType.of(parts[1]),
									classpool.<ClassName>byIndex(
										ClassName.class, parts[2]),
									classpool.<String>byIndex(
										String.class, parts[3]),
									classpool.<ClassName>byIndex(
										ClassName.class, parts[4]).field());
								break;
							
								// Class information point
							case CLASS_INFO_POINTER:
								value = new ClassInfoPointer(
									classpool.byIndex(parts[0]).
									<ClassName>value(ClassName.class));
								break;
								

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

8
9
10
11
12
13
14



15
16
17
18
19
20
21
..
28
29
30
31
32
33
34


















35
36
37
38
39
40
41
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package dev.shadowtail.classfile.pool;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;



import net.multiphasicapps.classfile.FieldReference;

/**
 * This represents a field which has been accessed.
 *
 * @since 2019/03/24
 */
................................................................................
	public final FieldAccessTime time;
	
	/** The access type. */
	public final FieldAccessType type;
	
	/** String representation. */
	private Reference<String> _string;


















	
	/**
	 * Initializes the accessed field.
	 *
	 * @param __ti The access time.
	 * @param __ty The access type.
	 * @param __f The field to access.







>
>
>







 







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







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
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
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package dev.shadowtail.classfile.pool;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import net.multiphasicapps.classfile.ClassName;
import net.multiphasicapps.classfile.FieldDescriptor;
import net.multiphasicapps.classfile.FieldName;
import net.multiphasicapps.classfile.FieldReference;

/**
 * This represents a field which has been accessed.
 *
 * @since 2019/03/24
 */
................................................................................
	public final FieldAccessTime time;
	
	/** The access type. */
	public final FieldAccessType type;
	
	/** String representation. */
	private Reference<String> _string;
	
	/**
	 * Initializes the accessed field.
	 *
	 * @param __ti The access time.
	 * @param __ty The access type.
	 * @param __cn The class name.
	 * @param __fn The field name.
	 * @param __fd The field descriptor.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/09/11
	 */
	public AccessedField(FieldAccessTime __ti, FieldAccessType __ty,
		ClassName __cn, String __fn, FieldDescriptor __fd)
		throws NullPointerException
	{
		this(__ti, __ty, new FieldReference(__cn, new FieldName(__fn), __fd));
	}
	
	/**
	 * Initializes the accessed field.
	 *
	 * @param __ti The access time.
	 * @param __ty The access type.
	 * @param __f The field to access.