Check-in [af1c1684e1]

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

Overview
Comment:Add building of method references to the VTable.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:af1c1684e138549612c2327fcd7ad1137445318e
User & Date: stephanie.gawroriski 2019-02-08 01:37:12
Context
2019-02-08
08:02
Backup developer notes. check-in: 798c62c479 user: squirreljme tags: trunk
01:37
Add building of method references to the VTable. check-in: af1c1684e1 user: stephanie.gawroriski tags: trunk
01:31
Add VTableMethodReference. check-in: ea0cb43e36 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/libs/tool-classfile-scrf-compiler/net/multiphasicapps/scrf/compiler/VTableBuilder.java.

11
12
13
14
15
16
17



18
19

20
21
22
23
24
25
26
...
110
111
112
113
114
115
116
117


118






















package net.multiphasicapps.scrf.compiler;

import net.multiphasicapps.classfile.ClassName;
import net.multiphasicapps.classfile.FieldDescriptor;
import net.multiphasicapps.classfile.FieldReference;
import net.multiphasicapps.classfile.MemberDescriptor;
import net.multiphasicapps.classfile.MemberName;



import net.multiphasicapps.scrf.VTableFieldReference;
import net.multiphasicapps.scrf.VTableIndex;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * This is the builder for vtables which are used to contain some run-time
 * determined information about a class, it effectively allows the VM to
 * access other classes and information without needing to build a combined
................................................................................
		// Need to register the names and such for the reference
		StringTableBuilder strings = this.strings;
		return this.add(new VTableFieldReference(__static,
			strings.<ClassName>register(__f.className()),
			strings.<MemberName>register(__f.memberName()),
			strings.<FieldDescriptor>register(__f.memberType())));
	}
}
































>
>
>


>







 







|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
...
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
package net.multiphasicapps.scrf.compiler;

import net.multiphasicapps.classfile.ClassName;
import net.multiphasicapps.classfile.FieldDescriptor;
import net.multiphasicapps.classfile.FieldReference;
import net.multiphasicapps.classfile.MemberDescriptor;
import net.multiphasicapps.classfile.MemberName;
import net.multiphasicapps.classfile.MethodDescriptor;
import net.multiphasicapps.classfile.MethodReference;
import net.multiphasicapps.scrf.InvokeType;
import net.multiphasicapps.scrf.VTableFieldReference;
import net.multiphasicapps.scrf.VTableIndex;
import net.multiphasicapps.scrf.VTableMethodReference;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * This is the builder for vtables which are used to contain some run-time
 * determined information about a class, it effectively allows the VM to
 * access other classes and information without needing to build a combined
................................................................................
		// Need to register the names and such for the reference
		StringTableBuilder strings = this.strings;
		return this.add(new VTableFieldReference(__static,
			strings.<ClassName>register(__f.className()),
			strings.<MemberName>register(__f.memberName()),
			strings.<FieldDescriptor>register(__f.memberType())));
	}
	
	/**
	 * Adds a method reference to the vtable.
	 *
	 * @param __it The type of invocation to perform (when linking).
	 * @param __f The method to add.
	 * @return The index of the added entry.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/07
	 */
	public final VTableIndex addMethodReference(InvokeType __it,
		MethodReference __f)
		throws NullPointerException
	{
		if (__it == null || __f == null)
			throw new NullPointerException("NARG");
		
		// Need to register the names and such for the reference
		StringTableBuilder strings = this.strings;
		return this.add(new VTableMethodReference(__it,
			strings.<ClassName>register(__f.className()),
			strings.<MemberName>register(__f.memberName()),
			strings.<MethodDescriptor>register(__f.memberType())));
	}
}

Changes to runt/libs/tool-scrf/net/multiphasicapps/scrf/VTableMethodReference.java.

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
 * This represents a reference to another method.
 *
 * @since 2019/02/07
 */
public final class VTableMethodReference
	extends VTableMemberReference
{



	/**
	 * Initializes the reference.
	 *
	 * @param __s Is this static?
	 * @param __cl The class name.
	 * @param __mn The member name.
	 * @param __mt The member type.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/07
	 */
	public VTableMethodReference(boolean __s, ClassName __cl, MemberName __mn,
		MethodDescriptor __mt)
		throws NullPointerException
	{
		super(__s, __cl, __mn, __mt);





	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/07
	 */
	@Override
	public boolean equals(Object __o)
	{



		return super.equals(__o) && (__o instanceof VTableMethodReference);



	}
}








>
>
>



|






|
|


|
>
>
>
>
>









>
>
>
|
>
>
>



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
 * This represents a reference to another method.
 *
 * @since 2019/02/07
 */
public final class VTableMethodReference
	extends VTableMemberReference
{
	/** The invocation type. */
	protected final InvokeType invoketype;
	
	/**
	 * Initializes the reference.
	 *
	 * @param __it Invocation type.
	 * @param __cl The class name.
	 * @param __mn The member name.
	 * @param __mt The member type.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/02/07
	 */
	public VTableMethodReference(InvokeType __it, ClassName __cl,
		MemberName __mn, MethodDescriptor __mt)
		throws NullPointerException
	{
		super((__it == InvokeType.STATIC), __cl, __mn, __mt);
		
		if (__it == null)
			throw new NullPointerException("NARG");
		
		this.invoketype = __it;
	}
	
	/**
	 * {@inheritDoc}
	 * @since 2019/02/07
	 */
	@Override
	public boolean equals(Object __o)
	{
		if (!super.equals(__o))
			return false;
		
		if (!(__o instanceof VTableMethodReference))
			return false;
		
		return this.invoketype == ((VTableMethodReference)__o).invoketype;
	}
}