-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic class splitting #942
Comments
I've tried the mentioned suggestion and it made very little difference for the particular example I was working on. It turns out that the more general solution to this problem is to distribute constants more deeply in the generated classes. What's happening is that all the classes are being initialized inside the module class itself when they can be instantiated in the required closures that are demanded by the user. By distributing class constants this way, we avoid hitting the classfile limits and avoid having to do workaround patches in packages like |
Would it fix errors with too big methods? |
Nope, which is why this is a separate issue. Overflowing the constant pool is a serious problem since the entire class file is considered invalid and will cause issues with tools like Proguard. Overflowing the bytecode limit is not as much of a problem - the bytecode size can be specified in a |
When you have really large source files (2K+ lines), there's a chance that the generated class will be so huge that the constant pool size will exceed the 65,535 size limit. The compiler should change its code generation to avoid such problem - perhaps by shifting static methods definitions to individual classes instead of putting all the implementations into the Module class.
The text was updated successfully, but these errors were encountered: