Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5035821

RedefineClasses needs to clear inline caches

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • hotspot
    • b54
    • sparc
    • solaris_8

      the inline caches of nmethods can contain references to methodOop and if they are redefined but the IC isn't cleared the nmethod will continue to invoke the old method.

      I've created a test case which demonstrates this problem. In /net/smite/never/redef is a trivial program loop.java which will run forever. redef/new/loop.java contains a redefinition of one of the classes which will cause the loop to terminate. The script cmd runs the program under the under the debugger and redefines a couple of the classes in hopes of causing the loop to terminate. redefining dummy should be sufficient and indeed it is in most cases because a method of dummy gets compiled which is sufficient to cause the clearing of the inline cache of loop.main. However if I restrict compilation to loop.main then redefining dummy doesn't cause the loop to terminate. Redefining force does since force.<init> was inlined into loop.main.

      Run cmd with no arguments to see the program termination. Run it with -XX:CompileOnly=loop.main to see that it requires redefining force for the loop to terminate.

            swamyv Swamy Venkataramanappa
            never Tom Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: