Curious? Pick some JVM (list of them is available here: http://en.wikipedia.org/wiki/Java_Virtual_Machine) with source code open and go debug output of the JIT compiler.
I don't know if internals of the Oracle JVM in particular (the one you're probably running on Windows) went open source, but perhaps their engineers might answer your question clearly, especially if you file in a performance-problem ticket (I used to solve this kind of tickets for Symbian JVM (there 2 of them) and we had tools to diagnose this kind stuff in detail).
In general the question how modern Java optimizes something does not have general simple answer. IMHO best way to learn more is to go pick one and play with it (run benchmarks, study traces etc.)
If you're asking how to write better code then this - super cool Stack Overflow answer - can give you some hints
EDIT: Is there a guide to setting up the JDK to compile your java code from a C Compiler? (Ideally an eclipse set up)
Yes there should be one. Just be warned that working with larger software repositories (thousands of files and hundreds of thousands up to milions of lines of code) is usually not for the faint-hearted and to get the environment setup right (even with some documentation) can take some days.
Wikipedia - List of Java virtual machines lists some open source JVMs. The Oracle JVM page points to OpenJDK - the The HotSpot Group where you can find some (lots of) resources and guides, but mainly invaluable contacts to developers who should be able to help you get up and running.
(I can not provide you with more precise instructions as I'm out of the JVM and Symbian OS business for nearly 5 years and things had changed a bit...)