[Fb-contrib-commit] SF.net SVN: fb-contrib:[1141] trunk/fb-contrib/src/com/mebigfatguy/ fbcontrib/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2009-03-15 04:28:52
|
Revision: 1141 http://fb-contrib.svn.sourceforge.net/fb-contrib/?rev=1141&view=rev Author: dbrosius Date: 2009-03-15 04:28:50 +0000 (Sun, 15 Mar 2009) Log Message: ----------- reduce fps Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2009-03-09 04:09:21 UTC (rev 1140) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/LostExceptionStackTrace.java 2009-03-15 04:28:50 UTC (rev 1141) @@ -108,11 +108,15 @@ */ public boolean prescreen(Code code, Method method) { if (method.isSynthetic()) - return false; + { + return false; + } CodeException[] ce = code.getExceptionTable(); if ((ce == null) || (ce.length == 0)) - return false; + { + return false; + } BitSet bytecodeSet = getClassContext().getBytecodeSet(method); return (bytecodeSet != null) && (bytecodeSet.get(Constants.ATHROW)); @@ -163,15 +167,18 @@ int pc = getPC(); for (CodeException ex : exceptions) { if (pc == ex.getEndPC()) { - if (ex.getCatchType() != 0) + if ((seen >= IRETURN) && (seen <= RETURN)) { - if ((seen >= IRETURN) && (seen <= RETURN)) - addCatchBlock(ex.getHandlerPC(), Integer.MAX_VALUE); - else if ((seen == GOTO) || (seen == GOTO_W)) - addCatchBlock(ex.getHandlerPC(), this.getBranchTarget()); - else - addCatchBlock(ex.getHandlerPC(), Integer.MAX_VALUE); + addCatchBlock(ex.getHandlerPC(), Integer.MAX_VALUE); } + else if ((seen == GOTO) || (seen == GOTO_W)) + { + addCatchBlock(ex.getHandlerPC(), this.getBranchTarget()); + } + else + { + addCatchBlock(ex.getHandlerPC(), Integer.MAX_VALUE); + } } else if (pc == ex.getHandlerPC()) { removePreviousHandlers(pc); } @@ -183,7 +190,9 @@ CatchInfo catchInfo = it.next(); if (pc == catchInfo.getStart()) { if (!updateExceptionRegister(catchInfo, seen, pc)) + { it.remove(); + } break; } else if (pc > catchInfo.getFinish()) { it.remove(); @@ -213,7 +222,9 @@ OpcodeStack.Item itm = stack.getStackItem(1); int reg = itm.getRegisterNumber(); if (reg >= 0) - exReg.put(Integer14.valueOf(reg), Boolean.TRUE); + { + exReg.put(Integer14.valueOf(reg), Boolean.TRUE); + } markAsValid = true; // Fixes javac generated code } } @@ -224,7 +235,9 @@ } } else if ((seen == INVOKEINTERFACE) || (seen == INVOKESTATIC)) { if (isPossibleExBuilder(catchInfo.getRegister())) - markAsValid = true; + { + markAsValid = true; + } } else if (seen == ATHROW) { if (stack.getStackDepth() > 0) { OpcodeStack.Item itm = stack.getStackItem(0); @@ -253,7 +266,12 @@ } else if ((seen == ALOAD) || ((seen >= ALOAD_0) && (seen <= ALOAD_3))) { Boolean valid = exReg.get(Integer14.valueOf(RegisterUtils.getALoadReg(this, seen))); if (valid != null) - markAsValid = valid.booleanValue(); + { + markAsValid = valid.booleanValue(); + } + } else if ((seen >= IRETURN) && (seen <= RETURN)) { + removeIndeterminateHandlers(pc); + break; } } } catch (ClassNotFoundException cnfe) { @@ -292,7 +310,9 @@ for (int p = 0; p < numParms; p++) { OpcodeStack.Item item = stack.getStackItem(p); if (item.getRegisterNumber() == exReg) - return true; + { + return true; + } } } } @@ -317,10 +337,24 @@ while (it.hasNext()) { CatchInfo ci = it.next(); if (ci.getStart() < pc) + { it.remove(); + } } } + private void removeIndeterminateHandlers(int pc) + { + Iterator<CatchInfo> it = catchInfos.iterator(); + while (it.hasNext()) { + CatchInfo ci = it.next(); + if ((ci.getStart() < pc) && (ci.getFinish() == Integer.MAX_VALUE)) + { + it.remove(); + } + } + } + /** * looks to update the catchinfo block with the register used for the * exception variable. If their is a local variable table, but the local @@ -343,10 +377,14 @@ if (lv != null) { int finish = lv.getStartPC() + lv.getLength(); if (finish < ci.getFinish()) + { ci.setFinish(finish); + } } else + { return false; + } } } return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |