Check (Prelude) is used to emit compiled unchecked files into bytecode and load it in current compilation process, this is needed because ClassWriter::getCommonType(String, String) from ASM lib requires types already exists in JVM environment. But we can override it by checking caching to make sure class exists with our internal type table.
Pros:
By profiling our compiler, it seems it has some relatively heavy performance penalty from ClassLoader::defineClass(byte[]). With this proposal, we can reduce lots of time on compilation.
Cons:
Our typing system needs to be refined so no cached class will be requested to ClassLoader::loadClass(String) calling and throws exception.
Current status
[ ] Implement type symbol table lookup in CommonClassWriter::getCommonType
[ ] Remove phase Check (Prelude)
[ ] Stablize cached class registeration (including separating JVM-loaded class and cached class)
Summary
Check (Prelude) is used to emit compiled unchecked files into bytecode and load it in current compilation process, this is needed because
ClassWriter::getCommonType(String, String)
from ASM lib requires types already exists in JVM environment. But we can override it by checking caching to make sure class exists with our internal type table.Pros:
By profiling our compiler, it seems it has some relatively heavy performance penalty from
ClassLoader::defineClass(byte[])
. With this proposal, we can reduce lots of time on compilation.Cons:
Our typing system needs to be refined so no cached class will be requested to
ClassLoader::loadClass(String)
calling and throws exception.Current status
CommonClassWriter::getCommonType