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

stack depth error in compiler when compiling with -O

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.0fcs
    • CPU:
      sparc
    • OS:
      solaris_2.4
    • Verification:
      Not verified

      Description


      This error occurred when compiling with HotJava with the -O option

      ERROR: sun.tools.java.CompilerError: stack depth error 1/0
      -- listing --
      $217:
      484: aload 0
      484: getfield sun.hotjava.doc.Document doc
      484: astore 3
      252: aload 3
      230: getfield java.util.Hashtable props
      252: ldc "url"
      230: invokevirtual java.lang.Object get(java.lang.Object)
      252: checkcast class java.net.URL
      484: astore 3
      486: aload 0
      486: getfield sun.hotjava.doc.Document errors
      486: ifnonnull $219:
      487: try -295321384
      488: aload 0
      488: new class sun.hotjava.doc.Document
      488: dup
      488: ldc "HTML Errors"
      488: invokenonvirtual sun.hotjava.doc.Document(java.lang.String)
      488: putfield sun.hotjava.doc.Document errors
      490: iconst_0 0
      490: istore 4
      491: aload 3
      491: ifnull $223:
      492: aload 3
      492: invokevirtual java.lang.String toExternalForm()
      492: astore 5
      493: aload 0
      493: getfield sun.hotjava.doc.Document errors
      493: astore 6
      493: aconst_null
      493: astore 7
      652: aload 6
      230: getfield java.util.Hashtable props
      245: ldc "dtd"
      230: invokevirtual java.lang.Object get(java.lang.Object)
      245: checkcast class sun.html.DTD
      493: ldc "h1"
      652: invokevirtual sun.html.Element getElement(java.lang.String)
      652: astore 8
      652: aload 6
      493: iload 4
      652: aload 6
      659: aload 8
      652: aload 7
      659: invokevirtual sun.hotjava.doc.TagItem makeTag(sun.html.Element, sun.html.Attributes)
      659: invokevirtual int insertTagPair(int, sun.hotjava.doc.TagItem)
      493: istore 4
      494: aload 0
      494: getfield sun.hotjava.doc.Document errors
      494: iload 4
      494: new class java.lang.StringBuffer
      494: dup
      494: invokenonvirtual java.lang.StringBuffer()
      494: ldc "HTML Errors: "
      494: invokevirtual java.lang.StringBuffer append(java.lang.String)
      494: aload 5
      494: invokevirtual java.lang.StringBuffer append(java.lang.String)
      494: invokevirtual java.lang.String toString()
      494: invokevirtual int insert(int, java.lang.String)
      95: ldc 65536
      494: iadd
      494: istore 4
      495: aload 0
      495: getfield sun.hotjava.doc.Document errors
      495: astore 6
      495: new class sun.html.Attributes
      495: dup
      495: ldc "href"
      495: new class java.lang.StringBuffer
      495: dup
      495: invokenonvirtual java.lang.StringBuffer()
      495: ldc "verbatim:"
      495: invokevirtual java.lang.StringBuffer append(java.lang.String)
      495: aload 5
      495: invokevirtual java.lang.StringBuffer append(java.lang.String)
      495: invokevirtual java.lang.String toString()
      495: invokenonvirtual sun.html.Attributes(java.lang.String,java.lang.String)
      495: astore 7
      652: aload 6
      230: getfield java.util.Hashtable props
      245: ldc "dtd"
      230: invokevirtual java.lang.Object get(java.lang.Object)
      245: checkcast class sun.html.DTD
      495: ldc "a"
      652: invokevirtual sun.html.Element getElement(java.lang.String)
      652: astore 8
      652: aload 6
      495: iload 4
      652: aload 6
      659: aload 8
      652: aload 7
      659: invokevirtual sun.hotjava.doc.TagItem makeTag(sun.html.Element, sun.html.Attributes)
      659: invokevirtual int insertTagPair(int, sun.hotjava.doc.TagItem)
      495: istore 4
      496: aload 0
      496: getfield sun.hotjava.doc.Document errors
      496: iload 4
      496: aload 5
      496: invokevirtual int insert(int, java.lang.String)
      95: ldc 65536
      496: iadd
      496: istore 4
      497: aload 0
      497: getfield sun.hotjava.doc.Document errors
      497: astore 6
      497: aconst_null
      497: astore 7
      620: aload 6
      230: getfield java.util.Hashtable props
      245: ldc "dtd"
      230: invokevirtual java.lang.Object get(java.lang.Object)
      245: checkcast class sun.html.DTD
      497: ldc "hr"
      620: invokevirtual sun.html.Element getElement(java.lang.String)
      620: astore 8
      620: aload 6
      497: iload 4
      620: aload 6
      627: aload 8
      620: aload 7
      627: invokevirtual sun.hotjava.doc.TagItem makeTag(sun.html.Element, sun.html.Attributes)
      627: invokevirtual int insertTag(int, sun.hotjava.doc.TagItem)
      497: istore 4
      $223:
      500: aload 0
      500: getfield sun.hotjava.doc.Document errors
      500: astore 5
      500: aconst_null
      500: astore 6
      652: aload 5
      230: getfield java.util.Hashtable props
      245: ldc "dtd"
      230: invokevirtual java.lang.Object get(java.lang.Object)
      245: checkcast class sun.html.DTD
      500: ldc "pre"
      652: invokevirtual sun.html.Element getElement(java.lang.String)
      652: astore 7
      652: aload 5
      500: iload 4
      652: aload 5
      659: aload 7
      652: aload 6
      659: invokevirtual sun.hotjava.doc.TagItem makeTag(sun.html.Element, sun.html.Attributes)
      659: invokevirtual int insertTagPair(int, sun.hotjava.doc.TagItem)
      501: aload 0
      501: getfield sun.hotjava.doc.Document doc
      501: ldc "errors"
      501: aload 0
      501: getfield sun.hotjava.doc.Document errors
      501: invokevirtual void setProperty(java.lang.String, java.lang.Object)
      $221:
      487: goto $219:
      $222:
      503: pop
      $219:
      507: try -295317256
      508: aload 0
      508: getfield sun.hotjava.doc.Document errors
      508: astore 4
      508: aload 4
      508: monitorenter
      508: try -295317112
      509: aload 0
      509: getfield sun.hotjava.doc.Document errors
      509: astore 6
      320: aload 6
      320: getfield int nitems
      91: bipush 16
      320: ishl
      95: ldc 65536
      509: isub
      509: istore 6
      511: aload 3
      511: ifnonnull $241:
      512: aload 0
      512: getfield sun.hotjava.doc.Document errors
      512: iload 6
      512: new class java.lang.StringBuffer
      512: dup
      512: invokenonvirtual java.lang.StringBuffer()
      512: ldc "line "
      512: invokevirtual java.lang.StringBuffer append(java.lang.String)
      512: iload 1
      512: invokevirtual java.lang.StringBuffer append(int)
      512: ldc ": "
      512: invokevirtual java.lang.StringBuffer append(java.lang.String)
      512: iload 1
      512: bipush 10
      512: if_icmpge $242:
      512: ldc " "
      512: goto $243:
      $242:
      512: iload 1
      512: bipush 100
      512: if_icmpge $244:
      512: ldc " "
      512: goto $243:
      $244:
      512: ldc ""
      $243:
      512: invokevirtual java.lang.StringBuffer append(java.lang.String)
      512: aload 2
      512: invokevirtual java.lang.StringBuffer append(java.lang.String)
      512: ldc "
      "
      512: invokevirtual java.lang.StringBuffer append(java.lang.String)
      512: invokevirtual java.lang.String toString()
      512: invokevirtual int insert(int, java.lang.String)
      512: istore 6
      511: goto $236:
      $241:
      514: aload 0
      514: getfield sun.hotjava.doc.Document errors
      514: astore 7
      514: new class sun.html.Attributes
      514: dup
      514: ldc "href"
      514: new class java.lang.StringBuffer
      514: dup
      514: invokenonvirtual java.lang.StringBuffer()
      514: ldc "verbatim:"
      514: invokevirtual java.lang.StringBuffer append(java.lang.String)
      514: aload 3
      514: invokevirtual java.lang.String toExternalForm()
      514: invokevirtual java.lang.StringBuffer append(java.lang.String)
      514: ldc "#@"
      514: invokevirtual java.lang.StringBuffer append(java.lang.String)
      514: iload 1
      514: invokevirtual java.lang.StringBuffer append(int)
      514: invokevirtual java.lang.String toString()
      514: invokenonvirtual sun.html.Attributes(java.lang.String,java.lang.String)
      514: astore 8
      652: aload 7
      230: getfield java.util.Hashtable props
      245: ldc "dtd"
      230: invokevirtual java.lang.Object get(java.lang.Object)
      245: checkcast class sun.html.DTD
      514: ldc "a"
      652: invokevirtual sun.html.Element getElement(java.lang.String)
      652: astore 9
      652: aload 7
      514: iload 6
      652: aload 7
      659: aload 9
      652: aload 8
      659: invokevirtual sun.hotjava.doc.TagItem makeTag(sun.html.Element, sun.html.Attributes)
      659: invokevirtual int insertTagPair(int, sun.hotjava.doc.TagItem)
      514: istore 6
      515: aload 0
      515: getfield sun.hotjava.doc.Document errors
      515: iload 6
      515: new class java.lang.StringBuffer
      515: dup
      515: invokenonvirtual java.lang.StringBuffer()
      515: ldc "line "
      515: invokevirtual java.lang.StringBuffer append(java.lang.String)
      515: iload 1
      515: invokevirtual java.lang.StringBuffer append(int)
      515: ldc ":"
      515: invokevirtual java.lang.StringBuffer append(java.lang.String)
      515: invokevirtual java.lang.String toString()
      515: invokevirtual int insert(int, java.lang.String)
      95: ldc 65536
      515: iadd
      515: istore 6
      516: aload 0
      516: getfield sun.hotjava.doc.Document errors
      516: iload 6
      516: new class java.lang.StringBuffer
      516: dup
      516: invokenonvirtual java.lang.StringBuffer()
      516: iload 1
      516: bipush 10
      516: if_icmpge $249:
      516: ldc " "
      516: goto $250:
      $249:
      516: iload 1
      516: bipush 100
      516: if_icmpge $251:
      516: ldc " "
      516: goto $250:
      $251:
      516: ldc " "
      $250:
      516: invokevirtual java.lang.StringBuffer append(java.lang.String)
      516: aload 2
      516: invokevirtual java.lang.StringBuffer append(java.lang.String)
      516: ldc "
      "
      516: invokevirtual java.lang.StringBuffer append(java.lang.String)
      516: invokevirtual java.lang.String toString()
      516: invokevirtual int insert(int, java.lang.String)
      516: istore 6
      $236:
      508: aload 4
      508: monitorexit
      508: return
      $237:
      508: aload 4
      508: monitorexit
      508: athrow
      $233:
      $234:
      519: pop
      483: return
      sun.tools.java.CompilerError: stack depth error 1/0
              at sun.tools.asm.Assembler.balance(Assembler.java:223)
              at sun.tools.asm.Assembler.balance(Assembler.java:252)
              at sun.tools.asm.Assembler.balance(Assembler.java:248)
              at sun.tools.asm.Assembler.write(Assembler.java:344)
              at sun.tools.javac.SourceClass.compileClass(SourceClass.java:695)
              at sun.tools.javac.SourceClass.compile(SourceClass.java:527)
              at sun.tools.javac.Main.compile(Main.java:193)
              at sun.tools.javac.Main.main(Main.java:289)
      error: An error has occurred in the compiler; please file a bug report (###@###.###).
      1 error
      gnumake: *** [.compile.classlist] Error 1
      31.62u 7.73s 0:49.98 78.7%
      Exit 2


      [hinkmond 11/5/96]

      I've added an attachment from GraphOn which is a testcase for this bug. To reproduce the problem just do a optimized compiliation:

      javac -O testcase.java

        Attachments

          Activity

            People

            Assignee:
            jrose John Rose
            Reporter:
            ahoffsunw Arthur Hoff (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: