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

large number of method locals causes java.lang.InternalError

    XMLWordPrintable

Details

    • 1.2alpha
    • x86, sparc
    • solaris_2.5, solaris_2.5.1
    • Not verified

    Description



      Name: szC45993 Date: 03/23/97



      The following JCK tests fails on JDK1.1.1E:

      vm/instr/astore_w/astore_w004/astore_w00401/astore_w00401.html
      vm/instr/dload_w/dload_w001/dload_w00101/dload_w00101.html
      vm/instr/dstore_w/dstore_w005/dstore_w00501/dstore_w00501.html

      The JVM Specification (chapter 4.10 Limitations of the Java
      Virtual Machine and class File Format, p. 136) says:

      "The number of local variables in a method is limited to 65535 by the
      two-byte index operand of many Java Virtual Machine instructions and
      the size of the max_locals item of the ClassFile structure ($4.1)."

      Test below runs successfully only with locals number <= 1987 and throws
      java.lang.InternalError for larger numbers of locals.

      Note that JDK1.0.2 and JDK1.1 runs successfully with 65535 locals.

      > java -version
      java version "1.1.1"
      > java -oss5m -verify javasoft.sqe.tests.vm.astore_w.astore_w004.astore_w00401.astore_w00401
      java.lang.InternalError
      at javasoft.sqe.tests.vm.astore_w.astore_w004.astore_w00401.astore_w00401.main(astore_w00401.jasm)

      --------------------- astore_w00401.jasm
      //File: @(#)astore_w00401.jasm 1.2 97/01/15
      //Copyright 01/15/97 Sun Microsystems, Inc. All Rights Reserved

      package javasoft/sqe/tests/vm/astore_w/astore_w004/astore_w00401;

      public class astore_w00401 {

      public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
      // stack 2 locals 65535
      stack 2 locals 1988
      // stack 2 locals 1987
      {
      aconst_null;
      // astore_w 65534;
      astore_w 1987;
      // astore_w 1986;
              iconst_0;
      ireturn;
      }

      public static Method main:"([Ljava/lang/String;)V"
      stack 2 locals 2
      {
      aload_0;
      getstatic Field java/lang/System.out:"Ljava/io/PrintStream;";
      invokestatic Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I";
      bipush 95/*STATUS_TEMP*/;
      iadd;
      invokestatic Method java/lang/System.exit:"(I)V";
      return;
      }

      } // end Class astore_w00401
      ---------------------

      ======================================================================

      Attachments

        Activity

          People

            sliangsunw Sheng Liang (Inactive)
            zsssunw Zss Zss (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: