4141
4242import com .oracle .svm .core .SubstrateUtil ;
4343import com .oracle .svm .core .c .NonmovableArrays ;
44- import com .oracle .svm .core .configure .RuntimeConditionSet ;
44+ import com .oracle .svm .core .configure .RuntimeDynamicAccessMetadata ;
4545import com .oracle .svm .core .feature .AutomaticallyRegisteredImageSingleton ;
4646import com .oracle .svm .core .hub .DynamicHub ;
4747import com .oracle .svm .core .layeredimagesingleton .MultiLayeredImageSingleton ;
@@ -356,15 +356,15 @@ private static Object decodeField(UnsafeArrayTypeReader buf, Class<?> declaringC
356356 boolean complete = (modifiers & COMPLETE_FLAG_MASK ) != 0 ;
357357 boolean preserved = (modifiers & PRESERVED_FLAG_MASK ) != 0 ;
358358
359- RuntimeConditionSet conditions = decodeConditions (buf , layerId , preserved );
359+ RuntimeDynamicAccessMetadata dynamicAccessMetadata = decodeDynamicAccessMetadata (buf , layerId , preserved );
360360 if (inHeap ) {
361361 Field field = (Field ) decodeObject (buf , layerId );
362362 if (publicOnly && !Modifier .isPublic (field .getModifiers ())) {
363363 /*
364364 * Generate negative copy of the field. Finding a non-public field when looking for
365365 * a public one should not result in a missing registration exception.
366366 */
367- return ReflectionObjectFactory .newField (conditions , declaringClass , field .getName (), Object .class , field .getModifiers () | NEGATIVE_FLAG_MASK , false ,
367+ return ReflectionObjectFactory .newField (dynamicAccessMetadata , declaringClass , field .getName (), Object .class , field .getModifiers () | NEGATIVE_FLAG_MASK , false ,
368368 null , null , ReflectionObjectFactory .FIELD_OFFSET_NONE , null , null );
369369 }
370370 if (reflectOnly ) {
@@ -393,7 +393,8 @@ private static Object decodeField(UnsafeArrayTypeReader buf, Class<?> declaringC
393393 if (!reflectOnly ) {
394394 return new FieldDescriptor (declaringClass , name );
395395 }
396- return ReflectionObjectFactory .newField (conditions , declaringClass , name , negative ? Object .class : type , modifiers , false , null , null , ReflectionObjectFactory .FIELD_OFFSET_NONE , null ,
396+ return ReflectionObjectFactory .newField (dynamicAccessMetadata , declaringClass , name , negative ? Object .class : type , modifiers , false , null , null ,
397+ ReflectionObjectFactory .FIELD_OFFSET_NONE , null ,
397398 null );
398399 }
399400 boolean trustedFinal = buf .getU1 () == 1 ;
@@ -406,13 +407,14 @@ private static Object decodeField(UnsafeArrayTypeReader buf, Class<?> declaringC
406407 modifiers |= NEGATIVE_FLAG_MASK ;
407408 }
408409
409- Field reflectField = ReflectionObjectFactory .newField (conditions , declaringClass , name , type , modifiers , trustedFinal , signature , annotations , offset , deletedReason , typeAnnotations );
410+ Field reflectField = ReflectionObjectFactory .newField (dynamicAccessMetadata , declaringClass , name , type , modifiers , trustedFinal , signature , annotations , offset , deletedReason ,
411+ typeAnnotations );
410412 return reflectOnly ? reflectField : new FieldDescriptor (reflectField );
411413 }
412414
413- private static RuntimeConditionSet decodeConditions (UnsafeArrayTypeReader buf , int layerId , boolean preserved ) {
415+ private static RuntimeDynamicAccessMetadata decodeDynamicAccessMetadata (UnsafeArrayTypeReader buf , int layerId , boolean preserved ) {
414416 var conditionTypes = decodeArray (buf , Class .class , _ -> decodeType (buf , layerId ), layerId );
415- return RuntimeConditionSet .createDecoded (conditionTypes , preserved );
417+ return RuntimeDynamicAccessMetadata .createDecoded (conditionTypes , preserved );
416418 }
417419
418420 /**
@@ -523,7 +525,7 @@ private static Object decodeExecutable(UnsafeArrayTypeReader buf, Class<?> decla
523525 boolean inHeap = (modifiers & IN_HEAP_FLAG_MASK ) != 0 ;
524526 boolean complete = (modifiers & COMPLETE_FLAG_MASK ) != 0 ;
525527 boolean preserved = (modifiers & PRESERVED_FLAG_MASK ) != 0 ;
526- RuntimeConditionSet conditions = decodeConditions (buf , layerId , preserved );
528+ RuntimeDynamicAccessMetadata dynamicAccessMetadata = decodeDynamicAccessMetadata (buf , layerId , preserved );
527529 if (inHeap ) {
528530 Executable executable = (Executable ) decodeObject (buf , layerId );
529531 if (publicOnly && !Modifier .isPublic (executable .getModifiers ())) {
@@ -532,10 +534,12 @@ private static Object decodeExecutable(UnsafeArrayTypeReader buf, Class<?> decla
532534 * looking for a public one should not result in a missing registration exception.
533535 */
534536 if (isMethod ) {
535- executable = ReflectionObjectFactory .newMethod (conditions , declaringClass , executable .getName (), executable .getParameterTypes (), Object .class , null , modifiers | NEGATIVE_FLAG_MASK ,
537+ executable = ReflectionObjectFactory .newMethod (dynamicAccessMetadata , declaringClass , executable .getName (), executable .getParameterTypes (), Object .class , null ,
538+ modifiers | NEGATIVE_FLAG_MASK ,
536539 null , null , null , null , null , null , null , layerId );
537540 } else {
538- executable = ReflectionObjectFactory .newConstructor (conditions , declaringClass , executable .getParameterTypes (), null , modifiers | NEGATIVE_FLAG_MASK , null , null , null , null , null ,
541+ executable = ReflectionObjectFactory .newConstructor (dynamicAccessMetadata , declaringClass , executable .getParameterTypes (), null , modifiers | NEGATIVE_FLAG_MASK , null , null , null ,
542+ null , null ,
539543 null );
540544 }
541545 }
@@ -578,13 +582,13 @@ private static Object decodeExecutable(UnsafeArrayTypeReader buf, Class<?> decla
578582 if (!reflectOnly ) {
579583 return new MethodDescriptor (declaringClass , name , (String []) parameterTypes );
580584 }
581- return ReflectionObjectFactory .newMethod (conditions , declaringClass , name , (Class <?>[]) parameterTypes , negative ? Object .class : returnType , null , modifiers ,
585+ return ReflectionObjectFactory .newMethod (dynamicAccessMetadata , declaringClass , name , (Class <?>[]) parameterTypes , negative ? Object .class : returnType , null , modifiers ,
582586 null , null , null , null , null , null , null , layerId );
583587 } else {
584588 if (!reflectOnly ) {
585589 return new ConstructorDescriptor (declaringClass , (String []) parameterTypes );
586590 }
587- return ReflectionObjectFactory .newConstructor (conditions , declaringClass , (Class <?>[]) parameterTypes , null , modifiers , null , null , null , null , null , null );
591+ return ReflectionObjectFactory .newConstructor (dynamicAccessMetadata , declaringClass , (Class <?>[]) parameterTypes , null , modifiers , null , null , null , null , null , null );
588592 }
589593 }
590594 Class <?>[] exceptionTypes = decodeArray (buf , Class .class , _ -> decodeType (buf , layerId ), layerId );
@@ -601,14 +605,14 @@ private static Object decodeExecutable(UnsafeArrayTypeReader buf, Class<?> decla
601605
602606 Target_java_lang_reflect_Executable executable ;
603607 if (isMethod ) {
604- Method method = ReflectionObjectFactory .newMethod (conditions , declaringClass , name , (Class <?>[]) parameterTypes , returnType , exceptionTypes , modifiers ,
608+ Method method = ReflectionObjectFactory .newMethod (dynamicAccessMetadata , declaringClass , name , (Class <?>[]) parameterTypes , returnType , exceptionTypes , modifiers ,
605609 signature , annotations , parameterAnnotations , annotationDefault , accessor , reflectParameters , typeAnnotations , layerId );
606610 if (!reflectOnly ) {
607611 return new MethodDescriptor (method );
608612 }
609613 executable = SubstrateUtil .cast (method , Target_java_lang_reflect_Executable .class );
610614 } else {
611- Constructor <?> constructor = ReflectionObjectFactory .newConstructor (conditions , declaringClass , (Class <?>[]) parameterTypes , exceptionTypes ,
615+ Constructor <?> constructor = ReflectionObjectFactory .newConstructor (dynamicAccessMetadata , declaringClass , (Class <?>[]) parameterTypes , exceptionTypes ,
612616 modifiers , signature , annotations , parameterAnnotations , accessor , reflectParameters , typeAnnotations );
613617 if (!reflectOnly ) {
614618 return new ConstructorDescriptor (constructor );
0 commit comments