Hi Tom, One question regarding deoptimization and C1: the StoreField and LoadField code relies on deoptimization in case a load/store cannot be determined to be volatile at compile time. In the c1 runtime patch_code method, a VM_DeoptimizeFrame vm operation is executed. What is puzzling me, is that when I follow the code of this vm operation I don't find where the nmethod is made not entrant so that the method will eventually be recompiled. Indeed when I run this simple test: public class TestDeopt { static class A { volatile int i; } static void m() { A a = new A(); a.i = 0; } static public void main(String[] args) { m(); m(); m(); } } With: -client -Xcomp -XX:+PrintCompilation -XX:-Inline -XX:+TracePatching -XX:+TraceDeoptimization I see the m method being compiled once but I see 3 "Deoptimizing for patching volatile field reference" which proves that the compiled code is not dropped. Am I missing something? Thanks, Roland.
|