30
30
import java .security .ProtectionDomain ;
31
31
import java .util .Enumeration ;
32
32
import java .util .HashMap ;
33
+ import java .util .Map ;
34
+ import java .util .Set ;
33
35
import java .util .Vector ;
34
36
import java .util .concurrent .ConcurrentHashMap ;
35
37
@@ -242,6 +244,9 @@ private void clearAssertionStatus() {
242
244
throw VMError .unsupportedFeature ("The assertion status of classes is fixed at image build time." );
243
245
}
244
246
247
+ @ Delete
248
+ private native void initializeJavaAssertionMaps ();
249
+
245
250
/*
246
251
* We are defensive and also handle private native methods by marking them as deleted. If they
247
252
* are reachable, the user is certainly doing something wrong. But we do not want to fail with a
@@ -251,6 +256,9 @@ private void clearAssertionStatus() {
251
256
@ Delete
252
257
private static native void registerNatives ();
253
258
259
+ @ Delete
260
+ private static native long findNative (ClassLoader loader , String entryName );
261
+
254
262
@ Substitute
255
263
@ SuppressWarnings ({"unused" , "static-method" })
256
264
Class <?> defineClass (byte [] b , int off , int len ) throws ClassFormatError {
@@ -333,6 +341,41 @@ protected void resolveClass(@SuppressWarnings("unused") Class<?> c) {
333
341
334
342
@ Delete
335
343
private static native Target_java_lang_AssertionStatusDirectives retrieveDirectives ();
344
+
345
+ /*
346
+ * Ensure that fields and methods that hold state of the image generator are not reachable when
347
+ * all fields or methods of the class are registered for reflection.
348
+ */
349
+
350
+ @ Delete //
351
+ @ TargetElement (onlyWith = {JDK11OrLater .class , JDK11OrEarlier .class }) //
352
+ private static Set <String > loadedLibraryNames ;
353
+ @ Delete //
354
+ @ TargetElement (onlyWith = {JDK11OrLater .class , JDK11OrEarlier .class }) //
355
+ private static Map <String , Target_java_lang_ClassLoader_NativeLibrary > systemNativeLibraries ;
356
+ @ Delete //
357
+ @ TargetElement (onlyWith = {JDK11OrLater .class , JDK11OrEarlier .class }) //
358
+ private Map <String , Target_java_lang_ClassLoader_NativeLibrary > nativeLibraries ;
359
+ // Checkstyle: stop
360
+ @ Delete //
361
+ @ TargetElement (onlyWith = JDK11OrEarlier .class ) //
362
+ private static String [] usr_paths ;
363
+ @ Delete //
364
+ @ TargetElement (onlyWith = JDK11OrEarlier .class ) //
365
+ private static String [] sys_paths ;
366
+ // Checkstyle: resume
367
+
368
+ @ Delete
369
+ @ TargetElement (onlyWith = {JDK11OrLater .class , JDK11OrEarlier .class })
370
+ private native Map <String , Target_java_lang_ClassLoader_NativeLibrary > nativeLibraries ();
371
+
372
+ @ Delete
373
+ @ TargetElement (onlyWith = {JDK11OrLater .class , JDK11OrEarlier .class })
374
+ private static native Map <String , Target_java_lang_ClassLoader_NativeLibrary > systemNativeLibraries ();
375
+
376
+ @ Delete
377
+ @ TargetElement (onlyWith = JDK11OrEarlier .class )
378
+ private static native boolean loadLibrary0 (Class <?> fromClass , File file );
336
379
}
337
380
338
381
@ TargetClass (value = ClassLoader .class , innerClass = "NativeLibrary" , onlyWith = JDK11OrEarlier .class )
0 commit comments