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

changeset 1860
c674b396827c
parent 1802
8fb68f73d4b1
child 1865
d137ce373c4c
equal deleted inserted replaced
1859:36e8bc1907a2 1860:c674b396827c
989 * jumps are within 32K. If this fails, fatcode 989 * jumps are within 32K. If this fails, fatcode
990 * is set to true and we try again. 990 * is set to true and we try again.
991 */ 991 */
992 void genMethod(JCMethodDecl tree, Env<GenContext> env, boolean fatcode) { 992 void genMethod(JCMethodDecl tree, Env<GenContext> env, boolean fatcode) {
993 MethodSymbol meth = tree.sym; 993 MethodSymbol meth = tree.sym;
994 // System.err.println("Generating " + meth + " in " + meth.owner); //DEBUG 994 int extras = 0;
995 if (Code.width(types.erasure(env.enclMethod.sym.type).getParameterTypes()) + 995 // Count up extra parameters
996 (((tree.mods.flags & STATIC) == 0 || meth.isConstructor()) ? 1 : 0) > 996 if (meth.isConstructor()) {
997 extras++;
998 if (meth.enclClass().isInner() &&
999 !meth.enclClass().isStatic()) {
1000 extras++;
1001 }
1002 } else if ((tree.mods.flags & STATIC) == 0) {
1003 extras++;
1004 }
1005 // System.err.println("Generating " + meth + " in " + meth.owner); //DEBUG
1006 if (Code.width(types.erasure(env.enclMethod.sym.type).getParameterTypes()) + extras >
997 ClassFile.MAX_PARAMETERS) { 1007 ClassFile.MAX_PARAMETERS) {
998 log.error(tree.pos(), "limit.parameters"); 1008 log.error(tree.pos(), "limit.parameters");
999 nerrs++; 1009 nerrs++;
1000 } 1010 }
1001 1011

mercurial