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

Bad code generation for opc_interface, opc_interface_quick

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.1.4
    • 1.1
    • vm-legacy
    • None
    • jit
    • 1.1.4
    • generic
    • solaris_2.3
    • Not verified

      Both the x86 and SPARC JIT compilers mistakenly believe that interfaces
      and interface methods are always "carefully resolvable" and can be resolved without loading classes. This was true in 1.0, but not in 1.1.

      There are several bugs, some on the x86, some on SPARC, some on both.

      1) resolveCarefullyCommon (both architectures) would return true when asked about a CONST_InterfaceMethodref. It would not bother to check and see if the
      interface class had been loaded. Resolving an interface method ref causes the
      interface to be loaded. So roughly the same code that is used for
      CONSTANT_Methodref needs to be applied to CONSTANT_InterfaceMethodref

      2) Neither compiler provides any support for "patching" the code should
      the "careful" resolution of the interface method return false. This turns out
      to be a rather trivial patch to implement.

      3) On the x86, the JITCompile_md() loop completely forgot to include
      opc_invoke_interface_quick. This seems to be either an overside, or based on
      1.0, when more re-writing was done between opc_invokeinterface and opc_invokeinterface_quick. Simply having the two byte codes do the same thing
      seems to work fine.

      I have already fixed these bugs in the JavaOS world. Feel free to copy my changes.

            dmcox David Cox (Inactive)
            fyellinsunw Frank Yellin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: