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 |