src/share/classes/com/sun/tools/javac/jvm/Gen.java

changeset 1109
3cdfa97e1be9
parent 1076
02b8381781ab
child 1127
ca49d50318dc
     1.1 --- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Oct 17 12:54:33 2011 +0100
     1.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Mon Oct 17 12:57:36 2011 +0100
     1.3 @@ -959,6 +959,9 @@
     1.4                      code.lastFrame = null;
     1.5                      code.frameBeforeLast = null;
     1.6                  }
     1.7 +
     1.8 +                //compress exception table
     1.9 +                code.compressCatchTable();
    1.10              }
    1.11          }
    1.12  
    1.13 @@ -1437,7 +1440,6 @@
    1.14                      code.markDead();
    1.15                  }
    1.16              }
    1.17 -
    1.18              // Resolve all breaks.
    1.19              code.resolve(exitChain);
    1.20  
    1.21 @@ -1496,23 +1498,21 @@
    1.22          void registerCatch(DiagnosticPosition pos,
    1.23                             int startpc, int endpc,
    1.24                             int handler_pc, int catch_type) {
    1.25 -            if (startpc != endpc) {
    1.26 -                char startpc1 = (char)startpc;
    1.27 -                char endpc1 = (char)endpc;
    1.28 -                char handler_pc1 = (char)handler_pc;
    1.29 -                if (startpc1 == startpc &&
    1.30 -                    endpc1 == endpc &&
    1.31 -                    handler_pc1 == handler_pc) {
    1.32 -                    code.addCatch(startpc1, endpc1, handler_pc1,
    1.33 -                                  (char)catch_type);
    1.34 +            char startpc1 = (char)startpc;
    1.35 +            char endpc1 = (char)endpc;
    1.36 +            char handler_pc1 = (char)handler_pc;
    1.37 +            if (startpc1 == startpc &&
    1.38 +                endpc1 == endpc &&
    1.39 +                handler_pc1 == handler_pc) {
    1.40 +                code.addCatch(startpc1, endpc1, handler_pc1,
    1.41 +                              (char)catch_type);
    1.42 +            } else {
    1.43 +                if (!useJsrLocally && !target.generateStackMapTable()) {
    1.44 +                    useJsrLocally = true;
    1.45 +                    throw new CodeSizeOverflow();
    1.46                  } else {
    1.47 -                    if (!useJsrLocally && !target.generateStackMapTable()) {
    1.48 -                        useJsrLocally = true;
    1.49 -                        throw new CodeSizeOverflow();
    1.50 -                    } else {
    1.51 -                        log.error(pos, "limit.code.too.large.for.try.stmt");
    1.52 -                        nerrs++;
    1.53 -                    }
    1.54 +                    log.error(pos, "limit.code.too.large.for.try.stmt");
    1.55 +                    nerrs++;
    1.56                  }
    1.57              }
    1.58          }

mercurial