Check-in [0f5627ea25]

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

Overview
Comment:Decode method descriptors.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:0f5627ea25890e26fc5370acd0b59b1eab710120
User & Date: stephanie.gawroriski 2019-09-11 14:17:37
Context
2019-09-11
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
14:15
Internally represent parts as shorts in the pool entries. check-in: 340a286a61 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.

21
22
23
24
25
26
27

28
29
30
31
32
33
34
...
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
...
214
215
216
217
218
219
220







221
222
223
224
225
226
227
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.io.TableSectionOutputStream;

/**
 * This contains the encoder and decoder for dual pools.
 *
 * @since 2019/07/17
 */
................................................................................
						else
							for (int p = 0; p < numparts; p++)
								parts[p] = xd.readByte() & 0xFF;
						
						// Build value depending on the parts used
						switch (etype)
						{
								// Name of class, the actual class name is
								// the first and secondary ones just indicate
								// and array and its component (not needed
								// to load the information)
							case CLASS_NAME:
								value = new ClassName(entries.get(parts[0]).
									<String>value(String.class));
								break;
								
								// Raw integer value
							case INTEGER:
................................................................................
								value = Double.longBitsToDouble(
									(((long)(((parts[0] & 0xFFFF) << 16) |
									((parts[1] & 0xFFFF))) &
										0xFFFFFFFFL) << 32L) |
									((long)(((parts[2] & 0xFFFF) << 16) |
									((parts[3] & 0xFFFF))) & 0xFFFFFFFFL));
								break;







								
								// Unknown
							default:
								throw new todo.OOPS(etype.name());
						}
						break;
						







>







 







|
<
<
<







 







>
>
>
>
>
>
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
...
175
176
177
178
179
180
181
182



183
184
185
186
187
188
189
...
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
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.
 *
 * @since 2019/07/17
 */
................................................................................
						else
							for (int p = 0; p < numparts; p++)
								parts[p] = xd.readByte() & 0xFF;
						
						// Build value depending on the parts used
						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 = Double.longBitsToDouble(
									(((long)(((parts[0] & 0xFFFF) << 16) |
									((parts[1] & 0xFFFF))) &
										0xFFFFFFFFL) << 32L) |
									((long)(((parts[2] & 0xFFFF) << 16) |
									((parts[3] & 0xFFFF))) & 0xFFFFFFFFL));
								break;
								
								// Method descriptor, has extra meta-data
							case METHOD_DESCRIPTOR:
								value = new MethodDescriptor(
									entries.get(parts[0]).
									<String>value(String.class));
								break;
								
								// Unknown
							default:
								throw new todo.OOPS(etype.name());
						}
						break;