Define multiple classes at runtime using Unsafe.defineClass
问题 I am working on a REPL for a custom programming language of mine. It is implemented on top of the compiler, which it uses to generate the bytecode for the input and convert it to a Class<?> instance using the sun.misc.Unsafe.defineClass(String, byte[], int, int, ClassLoader, ProtectionDomain) method. The relevant code looks like this (irrelevant parts like exception handling omitted): void compileAndLoad(List<ICompilable> compilables) { List<Class<?>> classes = ...; for (ICompilable c :