-
Notifications
You must be signed in to change notification settings - Fork 45
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
Investigate the possibility of using D8/R8/L8 as shirnking & desugaring tool #171
Investigate the possibility of using D8/R8/L8 as shirnking & desugaring tool #171
Comments
I wonder what moe is doing differently that would cause the recursion than a normal modern android device with a native java 8 api. |
My guess is newer libcore does some kind of magic to support both: |
Because MOE 1.x is based on an ART version that does not support Java 8 language & JVM features. |
I got a POC for this working. Atm it just uses d8, because r8 was throwing a NPE somewhere, but I haven't really looked into it yet. |
It doesn't work the same way. Present literally means if the class A exist then keep class B, but it doesn't care if class A will be kept or not. |
So I made some tests with R8. Nothing intensiv but I think the results are still interesting!
Also R8 adds back the possibility of predexing the core. There is a "desugared-lib" parameter that specifies rewrite rules. Sadly I couldn't implement this yet, because dex2oat segfaults when doing it. Haven't looked into it yet deeper. // EDIT |
Instead of making a R8 "-keepcompanionclasses" extension, I would rather use the ClassValidator to output some keep configs. |
Is there a specific reason the dex2oat task uses the Quick backend by default? |
Hmm thinking through the issue, that the whole core needs to be evaluated for correct backporting, I might got a idea how to fix this. |
POC was successful 🥳 How it works: |
Actually, it looks like r8 is than inconsistent with proguard. I made a few tests and it looks like it in r8, "-if" means, that the condition class needs to be also kept. |
No description provided.
The text was updated successfully, but these errors were encountered: