r/Compilers 9d ago

JVM & ART Compiler

Hi everyone,

TLDR: ask for advice about learning optimizing passes inside JVM and ART

I am doing research about fuzzing JVM and Android runtime. I found most research these days are focusing on the backend which is compiler part.(C1/C2 for JVM and R8/optimizing compiler for ART).

I have done a shallow course about compiler long time ago like building frontend and some parts of backend like code generating. But I still feel it is not easy to understand the optimization passes inside JVM and ART in order to figure out how to create mutants and get into the direction to find the vulnerability.

So I am writing here to ask for advice like how to get myself onboard. Feeling like spending time reading a whole compiler book or building compiler would be inefficient and I guess frontend won’t be my focus(maybe I am wrong)

Thanks in advance!

5 Upvotes

1 comment sorted by

1

u/_dasion_ 9d ago

Reading a compiler book gives u fundamentals, one day will go back to read the dragon book for example, you could skip every phase and read what you need for papers.

Now, if you think fronted isn't your real focus that's alright, But for me the best way to understand "how x optimization /pass works" is building it(at least for me), u could do a simple frontend lexer->parser->Semantic->IR for a simple language (starting whit arithmetic an variable assignment is a good choice) an then build a stack based virtual machine(is easier and, this might be your real interest here), after u see "my VM works for arithmetic operators" then you could start to implement optimization passes if you want

In resume: build a simple frontend and then apply all you want, think of an "tiny experimental compiler"

At least is my recommendation