< prev index next >

src/java.base/share/classes/jdk/internal/reflect/SerializationConstructorAccessorGenerator.java

Print this page

282         targetMethodRef = asm.cpi();
283         if (isConstructor) {
284             asm.emitConstantPoolUTF8("newInstance");
285         } else {
286             asm.emitConstantPoolUTF8("invoke");
287         }
288         invokeIdx = asm.cpi();
289         if (isConstructor) {
290             asm.emitConstantPoolUTF8("([Ljava/lang/Object;)Ljava/lang/Object;");
291         } else {
292             asm.emitConstantPoolUTF8
293                 ("(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;");
294         }
295         invokeDescriptorIdx = asm.cpi();
296 
297         // Output class information for non-primitive parameter types
298         nonPrimitiveParametersBaseIdx = add(asm.cpi(), S2);
299         for (int i = 0; i < parameterTypes.length; i++) {
300             Class<?> c = parameterTypes[i];
301             if (!isPrimitive(c)) {
302                 asm.emitConstantPoolUTF8(getClassName(c, false));
303                 asm.emitConstantPoolClass(asm.cpi());
304             }
305         }
306 
307         // Entries common to FieldAccessor, MethodAccessor and ConstructorAccessor
308         emitCommonConstantPoolEntries();
309 
310         // Boxing entries
311         if (usesPrimitives) {
312             emitBoxingContantPoolEntries();
313         }
314 
315         if (asm.cpi() != numCPEntries) {
316             throw new InternalError("Adjust this code (cpi = " + asm.cpi() +
317                                     ", numCPEntries = " + numCPEntries + ")");
318         }
319 
320         // Access flags
321         asm.emitShort(ACC_PUBLIC);
322 

282         targetMethodRef = asm.cpi();
283         if (isConstructor) {
284             asm.emitConstantPoolUTF8("newInstance");
285         } else {
286             asm.emitConstantPoolUTF8("invoke");
287         }
288         invokeIdx = asm.cpi();
289         if (isConstructor) {
290             asm.emitConstantPoolUTF8("([Ljava/lang/Object;)Ljava/lang/Object;");
291         } else {
292             asm.emitConstantPoolUTF8
293                 ("(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;");
294         }
295         invokeDescriptorIdx = asm.cpi();
296 
297         // Output class information for non-primitive parameter types
298         nonPrimitiveParametersBaseIdx = add(asm.cpi(), S2);
299         for (int i = 0; i < parameterTypes.length; i++) {
300             Class<?> c = parameterTypes[i];
301             if (!isPrimitive(c)) {
302                 asm.emitConstantPoolUTF8(getClassName(c, true));
303                 asm.emitConstantPoolClass(asm.cpi());
304             }
305         }
306 
307         // Entries common to FieldAccessor, MethodAccessor and ConstructorAccessor
308         emitCommonConstantPoolEntries();
309 
310         // Boxing entries
311         if (usesPrimitives) {
312             emitBoxingContantPoolEntries();
313         }
314 
315         if (asm.cpi() != numCPEntries) {
316             throw new InternalError("Adjust this code (cpi = " + asm.cpi() +
317                                     ", numCPEntries = " + numCPEntries + ")");
318         }
319 
320         // Access flags
321         asm.emitShort(ACC_PUBLIC);
322 
< prev index next >