@Override public void beforeCompilation(BeforeCompilationAccess config) { if (SubstrateOptions.MultiThreaded.getValue()) { VMThreadMTFeature threadFeature = ImageSingletons.lookup(VMThreadMTFeature.class); vmThreadSize = threadFeature.getVMThreadSize(); } }
@Override public void beforeAnalysis(BeforeAnalysisAccess access) { if (SubstrateOptions.MultiThreaded.getValue()) { /* * The per-thread JNI environment is located at offset 0 of each thread's {@link * VMThread} structure. For that reason, it has the same address as the VMThread and can * be used to restore the designated VMThread register when transitioning from native to * Java. */ VMThreadMTFeature mt = ImageSingletons.lookup(VMThreadMTFeature.class); mt.setThreadLocalAtOffsetZero(JNIThreadLocalEnvironment.jniFunctions); } } }
Registration r = new Registration(invocationPlugins, threadLocalClass); Class<?> valueClass = VMThreadLocalInfo.getValueClass(threadLocalClass); registerAccessors(r, valueClass, false); registerAccessors(r, valueClass, true);