JDK-4163136 : STD: Source mapping problem with source >8000 lines
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 1.1.6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1998-08-04
  • Updated: 1998-11-09
  • Resolved: 1998-11-09
Related Reports
Duplicate :  
Description

Name: mf23781			Date: 08/04/98


Any class file with more than 8200 lines of source code will 
do as a test case.

The problem can be reproduced by the following commands:

jdb Big
stop in Big.main
run
stop at Big:8301

jdb says "No code at line 8301, or class is optimized." but 
there is code there.  The limit seems to be 8200 (approx.)

// ---- Big.java -----

public class Big
{
   public static void main (String args[])
   {
      int i = 0;

// Repeat the following line enough times to exceed the 8200 limit

    i++;

// End with:

   }
}

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

Comments
EVALUATION During compilation of a big source file (>8191 lines) using javac, the current 'position' is maintained in the Parser class (superclass Scanner). This position is a 32bit signed number (int) and is split such that : position = ( ( Line # << OFFSETBITS ) | offset ) (This definition comes from the top of Scanner.java). Since OFFSETBITS is 18, this leaves the top 13 bits for the line # (topmost bit is the sign). Thus, the maximum line number is 8191. This is only significant if the code is compiled non-optimized, otherwise the line numbers are ignored. ###@###.### 1998-11-09 Note that in 1.2 the representation changed to use 64 bits instead of 32, so the 16 bit limit in the LineNumberTable attribute is now the problem. I'm closing this as a duplicate of 4029944, which documents that limit. The 8192 limit will not be fixed in the 1.1 line. david.stoutamire@Eng 1998-11-09
09-11-1998