Check-in [925f4d70f5]

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

Overview
Comment:Read of class names.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:925f4d70f573474d644a9f84eb637f4f7c6ff7f4
User & Date: stephanie.gawroriski 2019-09-11 14:23:17
Context
2019-09-11
14:30
Initialize pool values. check-in: 609678434f user: stephanie.gawroriski tags: trunk
14:23
Read of class names. check-in: 925f4d70f5 user: stephanie.gawroriski tags: trunk
14:17
Decode method descriptors. check-in: 0f5627ea25 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.

20
21
22
23
24
25
26

27
28
29
30
31
32
33
...
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
...
180
181
182
183
184
185
186











187
188
189
190
191
192
193
...
233
234
235
236
237
238
239




240
241
242
243
244
245
246
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import net.multiphasicapps.classfile.ClassName;

import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.MethodDescriptor;
import net.multiphasicapps.io.TableSectionOutputStream;

/**
 * This contains the encoder and decoder for dual pools.
 *
................................................................................
					throw new InvalidClassFormatException("JC4j " + etype +
						" " + isruntime);
				
				// Get reader for the entry data
				DataInputStream xd = new DataInputStream(
					new ByteArrayInputStream(__b, baseoff + eoff, elen));
				
				todo.DEBUG.note("Entry: tag=%s, np=%d, off=%d (%d), len=%d",
					etype, numparts, eoff, baseoff + eoff, elen);
				
				// Is this wide?
				boolean iswide = (numparts < 0);
				if (iswide)
					numparts = -numparts;
				
				// Resulting parts and value
				Object value;
................................................................................
						switch (etype)
						{
								// Name of class, has extra meta-data
							case CLASS_NAME:
								value = new ClassName(entries.get(parts[0]).
									<String>value(String.class));
								break;











								
								// Raw integer value
							case INTEGER:
								value = ((parts[0] & 0xFFFF) << 16) |
									(parts[1] & 0xFFFF);
								break;
								
................................................................................
						// Unknown
					default:
						throw new todo.OOPS(etype.name());
				}
				
				// Record entry
				entries.add(new BasicPoolEntry(i, value, parts));




			}
			
			// Build pool
			BasicPool result = new BasicPool(entries);
			
			// Store pool in the right spot
			if (isruntime)







>







 







<
<
<







 







>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
...
125
126
127
128
129
130
131



132
133
134
135
136
137
138
...
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
...
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
import java.io.DataOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import net.multiphasicapps.classfile.ClassName;
import net.multiphasicapps.classfile.ClassNames;
import net.multiphasicapps.classfile.InvalidClassFormatException;
import net.multiphasicapps.classfile.MethodDescriptor;
import net.multiphasicapps.io.TableSectionOutputStream;

/**
 * This contains the encoder and decoder for dual pools.
 *
................................................................................
					throw new InvalidClassFormatException("JC4j " + etype +
						" " + isruntime);
				
				// Get reader for the entry data
				DataInputStream xd = new DataInputStream(
					new ByteArrayInputStream(__b, baseoff + eoff, elen));
				



				// Is this wide?
				boolean iswide = (numparts < 0);
				if (iswide)
					numparts = -numparts;
				
				// Resulting parts and value
				Object value;
................................................................................
						switch (etype)
						{
								// Name of class, has extra meta-data
							case CLASS_NAME:
								value = new ClassName(entries.get(parts[0]).
									<String>value(String.class));
								break;
							
								// A list of class names
							case CLASS_NAMES:
								ClassName[] cnn = new ClassName[numparts];
								
								for (int j = 0; j < numparts; j++)
									cnn[j] = entries.get(parts[j]).
										<ClassName>value(ClassName.class);
								
								value = new ClassNames(cnn);
								break;
								
								// Raw integer value
							case INTEGER:
								value = ((parts[0] & 0xFFFF) << 16) |
									(parts[1] & 0xFFFF);
								break;
								
................................................................................
						// Unknown
					default:
						throw new todo.OOPS(etype.name());
				}
				
				// Record entry
				entries.add(new BasicPoolEntry(i, value, parts));
				
				// Debug
				todo.DEBUG.note("Entry: ty=%s, np=%d, of=%d(%d), ln=%d --> %s",
					etype, numparts, eoff, baseoff + eoff, elen, value);
			}
			
			// Build pool
			BasicPool result = new BasicPool(entries);
			
			// Store pool in the right spot
			if (isruntime)