Source Code Cross Referenced for IFEQCommand.java in  » Development » jdec » net » sf » jdec » jvminstructions » commands » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » jdec » net.sf.jdec.jvminstructions.commands 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sf.jdec.jvminstructions.commands;
002:
003:        import net.sf.jdec.blockhelpers.BranchHelper;
004:        import net.sf.jdec.blockhelpers.IFHelper;
005:        import net.sf.jdec.blockhelpers.LoopHelper;
006:        import net.sf.jdec.blocks.IFBlock;
007:        import net.sf.jdec.blocks.Loop;
008:        import net.sf.jdec.core.*;
009:        import net.sf.jdec.reflection.Behaviour;
010:        import net.sf.jdec.util.Util;
011:
012:        import java.util.ArrayList;
013:        import java.util.Iterator;
014:
015:        public class IFEQCommand extends AbstractInstructionCommand {
016:
017:            public IFEQCommand(Behaviour context) {
018:                super (context);
019:
020:            }
021:
022:            public int getSkipBytes() {
023:                return 2;
024:            }
025:
026:            public void execute() {
027:                handleIFEQ(getCode());
028:            }
029:
030:            private void handleIFEQ(byte[] info) {
031:                int currentForIndex = getCurrentInstPosInCode();
032:                String tempString = "";
033:                Behaviour behavior = getContext();
034:
035:                Loop this Loop;
036:                boolean encounteredAndOrComp = GlobalVariableStore
037:                        .isEncounteredAndOrComp();
038:                boolean isIfInScope = GlobalVariableStore.isIfInScope();
039:                java.lang.String previnstret = DecompilerHelper
040:                        .getReturnTypeIfPreviousInvoke(currentForIndex, info);
041:                int i = currentForIndex;
042:                OperandStack opStack = getStack();
043:                Operand op = (Operand) opStack.pop();
044:                int classIndex = getGenericFinder().getJumpAddress(i);
045:                i += 2;
046:                ArrayList list = getContext().getBehaviourLoops();
047:
048:                IFBlock ifst = new IFBlock();
049:                ifst.setIfStart(currentForIndex);
050:                ifst.setHasIfBeenGenerated(true);
051:                // ifst.setIfCloseLineNumber(classIndex-3);
052:                boolean addBreak = LoopHelper.checkForParentLoopForIF(ifst);
053:                getContext().getMethodIfs().add(ifst);
054:
055:                int prevStart = getGenericFinder().getPrevStartOfInst(
056:                        currentForIndex);
057:                BranchHelper.addBranchLabel(classIndex, i, ifst,
058:                        currentForIndex, info);
059:                boolean beyondLoop = LoopHelper.isBeyondLoop(ifst
060:                        .getIfCloseLineNumber(), list, info);
061:                boolean isEndOfLoop = LoopHelper.isIndexEndOfLoop(list, ifst
062:                        .getIfCloseLineNumber());
063:                this Loop = GlobalVariableStore.getThisLoop();
064:                boolean correctIf = false;
065:                java.lang.String tempstr = "";
066:                prevStart = getGenericFinder().getPrevStartOfInst(
067:                        currentForIndex);
068:                java.lang.String t3 = op.getClassType();
069:                java.lang.String t1 = op.getLocalVarType();
070:                if ((t3 != null && t3.trim().equals("boolean"))
071:                        || (t1 != null && t1.trim().equals("boolean"))) {
072:                    if (previnstret != null && previnstret.trim().equals("1")) {
073:                        previnstret = "true";
074:                    }
075:                    if (previnstret != null && previnstret.trim().equals("0")) {
076:                        previnstret = "false";
077:                    }
078:                }
079:                if (getGenericFinder().isThisInstrStart(currentForIndex - 1)
080:                        && info[currentForIndex - 1] != JvmOpCodes.DCMPG
081:                        && info[currentForIndex - 1] != JvmOpCodes.DCMPL
082:                        && info[currentForIndex - 1] != JvmOpCodes.FCMPG
083:                        && info[currentForIndex - 1] != JvmOpCodes.FCMPL
084:                        && info[currentForIndex - 1] != JvmOpCodes.LCMP) {
085:
086:                    tempstr = op.getOperandValue() + "!=" + previnstret;
087:                } else if (getGenericFinder().isThisInstrStart(
088:
089:                currentForIndex - 3)
090:                        && info[currentForIndex - 3] != JvmOpCodes.INSTANCEOF) {
091:
092:                    tempstr = op.getOperandValue() + "!=" + previnstret;
093:                } else if (prevStart != currentForIndex - 1
094:                        && prevStart != currentForIndex - 3) {
095:                    tempstr = op.getOperandValue() + "!=" + previnstret;
096:                } else {
097:
098:                    tempstr = op.getOperandValue();
099:                }
100:                boolean processIF = true;// checkForTernaryIf(ifst, info, tempstr);
101:                if (processIF) {
102:
103:                    if (ifst.getDonotclose() == false
104:                            && ifst.getIfCloseLineNumber() == -1) {
105:                        int end = IFHelper.checkIFEndIfUnset(ifst, info,
106:                                currentForIndex);
107:                        ifst.setIfCloseLineNumber(end);
108:                    }
109:
110:                    if (isEndOfLoop) {
111:                        int loopstart = LoopHelper.getLoopStartForEnd(ifst
112:                                .getIfCloseLineNumber(), list);
113:                        if (currentForIndex > loopstart) {
114:                            boolean ifinstcodepresent = IFHelper.getIfinst(
115:                                    loopstart, info, currentForIndex);
116:                            if (ifinstcodepresent) {
117:                                correctIf = false;
118:                            } else
119:                                correctIf = true;
120:                        }
121:                    }
122:
123:                    if ((ifst.getIfCloseLineNumber() >= 0 && ifst
124:                            .getIfCloseLineNumber() < info.length)
125:                            && info[ifst.getIfCloseLineNumber()] == JvmOpCodes.GOTO
126:                            && isEndOfLoop && correctIf) {
127:                        int t = ifst.getIfCloseLineNumber();
128:                        int gotoIndex = getGenericFinder().getJumpAddress(t);// ((info[t+1]
129:                        // << 8)
130:                        // |
131:                        // info[t+2]) +
132:                        // (ifst.getIfCloseLineNumber());
133:                        if (gotoIndex < (t + 3)) {
134:                            boolean isInfiniteLoop = false;
135:                            Iterator infLoop = getContext().getBehaviourLoops()
136:                                    .iterator();
137:                            while (infLoop.hasNext()) {
138:                                Loop iloop = (Loop) infLoop.next();
139:                                if (iloop.getStartIndex() == gotoIndex
140:                                        && iloop.isInfinite()) {
141:                                    isInfiniteLoop = true;
142:                                    /*
143:                                     * ifLevel++; ifst = new IFBlock();
144:                                     * ifst.setIfStart(currentForIndex);
145:                                     * ifst.setHasIfBeenGenerated(true);
146:                                     * //ifst.setIfCloseLineNumber(classIndex-3);
147:                                     */
148:                                    ifst.setElseCloseLineNumber(gotoIndex);
149:                                    // ifHashTable.put(""+(ifLevel),ifst);
150:
151:                                    isIfInScope = true;
152:                                    // addBranchLabel(classIndex,i,ifst,currentForIndex,info);
153:                                    boolean bb = LoopHelper.isBeyondLoop(
154:                                            getGenericFinder().getJumpAddress(
155:                                                    currentForIndex),
156:                                            getContext().getBehaviourLoops(),
157:                                            info);
158:                                    boolean print = true;
159:                                    this Loop = GlobalVariableStore
160:                                            .getThisLoop();
161:                                    boolean addifbreak = false;
162:                                    java.lang.String tempString2 = "";
163:                                    if (bb && this Loop != null
164:                                            && this Loop.isInfinite()
165:                                            && !encounteredAndOrComp
166:                                            && addBreak) {
167:                                        // info[currentForIndex-3]!=JvmOpCodes.INSTANCEOF
168:                                        // &&
169:                                        Loop dowl = LoopHelper.isIfInADoWhile(
170:                                                currentForIndex, ifst,
171:                                                getContext()
172:                                                        .getBehaviourLoops());
173:                                        if (dowl != null) {
174:                                            tempString = "";
175:                                        } else {
176:                                            if (getGenericFinder()
177:                                                    .isThisInstrStart(
178:
179:                                                    currentForIndex - 1)
180:                                                    && (info[currentForIndex - 1] != JvmOpCodes.DCMPG)
181:                                                    && (info[currentForIndex - 1] != JvmOpCodes.DCMPL)
182:                                                    && info[currentForIndex - 1] != JvmOpCodes.FCMPG
183:                                                    && info[currentForIndex - 1] != JvmOpCodes.FCMPL
184:                                                    && info[currentForIndex - 1] != JvmOpCodes.LCMP)
185:                                                tempString = "\nif("
186:                                                        + op.getOperandValue()
187:                                                        + "==" + previnstret
188:                                                        + ")\n{\nbreak;\n}\n";
189:                                            else if (getGenericFinder()
190:                                                    .isThisInstrStart(
191:
192:                                                    currentForIndex - 3)
193:                                                    && info[currentForIndex - 3] != JvmOpCodes.INSTANCEOF
194:                                                    && getGenericFinder()
195:                                                            .isPreviousInst(
196:                                                                    currentForIndex,
197:                                                                    currentForIndex - 3)) {
198:                                                tempString = "\nif("
199:                                                        + op.getOperandValue()
200:                                                        + "==" + previnstret
201:                                                        + ")\n{\nbreak;\n}\n";
202:                                            } else if (prevStart != currentForIndex - 1
203:                                                    && prevStart != currentForIndex - 3) {
204:                                                tempString = "\nif("
205:                                                        + op.getOperandValue()
206:                                                        + "==" + previnstret
207:                                                        + ")\n{\nbreak;\n}\n";
208:                                            } else if (prevStart != currentForIndex - 1
209:                                                    && prevStart != currentForIndex - 3) {
210:                                                tempString = "\nif("
211:                                                        + op.getOperandValue()
212:                                                        + "==" + previnstret
213:                                                        + ")\n{\nbreak;\n}\n";
214:                                            } else
215:                                                tempString = "\nif("
216:                                                        + op.getOperandValue()
217:                                                        + ")\n{\nbreak;\n}\n";
218:                                            // codeStatements
219:                                            // +=Util.formatDecompiledStatement(tempString);
220:                                            tempString2 = tempString;
221:                                            addifbreak = true;
222:                                        }
223:                                        print = false;
224:                                    }
225:                                    tempstr = "";
226:                                    boolean last = IFHelper
227:                                            .lastIFinShortCutChain(info, ifst,
228:                                                    currentForIndex);
229:                                    boolean bc = false; // boolean comparision
230:                                    if (getGenericFinder().isThisInstrStart(
231:
232:                                    currentForIndex - 1)
233:                                            && info[currentForIndex - 1] != JvmOpCodes.DCMPG
234:                                            && info[currentForIndex - 1] != JvmOpCodes.DCMPL
235:                                            && info[currentForIndex - 1] != JvmOpCodes.FCMPG
236:                                            && info[currentForIndex - 1] != JvmOpCodes.FCMPL
237:                                            && info[currentForIndex - 1] != JvmOpCodes.LCMP) {
238:                                        tempString = "\nif("
239:                                                + op.getOperandValue() + "!="
240:                                                + previnstret + ")\n{\n";
241:                                        tempstr = op.getOperandValue() + "=="
242:                                                + previnstret;
243:                                    } else if (getGenericFinder()
244:                                            .isThisInstrStart(
245:
246:                                            currentForIndex - 3)
247:                                            && info[currentForIndex - 3] != JvmOpCodes.INSTANCEOF
248:                                            && getGenericFinder()
249:                                                    .isPreviousInst(
250:                                                            currentForIndex,
251:                                                            currentForIndex - 3)) {
252:                                        tempString = "\nif("
253:                                                + op.getOperandValue() + "!="
254:                                                + previnstret + ")\n{\n";
255:                                        tempstr = op.getOperandValue() + "=="
256:                                                + previnstret;
257:                                    } else if (prevStart != currentForIndex - 1
258:                                            && prevStart != currentForIndex - 3) {
259:                                        tempString = "\nif("
260:                                                + op.getOperandValue() + "!="
261:                                                + previnstret + ")\n{\n";
262:                                        tempstr = op.getOperandValue() + "=="
263:                                                + previnstret;
264:                                    } else {
265:                                        tempString = "\nif("
266:                                                + op.getOperandValue()
267:                                                + ")\n{\n";
268:                                        tempstr = op.getOperandValue();
269:                                        bc = true;
270:                                    }
271:                                    java.lang.String alt;
272:                                    if (bc == false)
273:                                        alt = op.getOperandValue() + "!="
274:                                                + previnstret;
275:                                    else
276:                                        alt = op.getOperandValue();
277:                                    boolean c = IFHelper
278:                                            .addCodeStatementWRTShortcutOR(
279:                                                    ifst, tempstr, print, "if",
280:                                                    last, alt);
281:                                    if (c) {
282:                                        if (addifbreak) {
283:                                            behavior
284:                                                    .appendToBuffer(Util
285:                                                            .formatDecompiledStatement(tempString2));
286:                                        }
287:                                        behavior
288:                                                .appendToBuffer(Util
289:                                                        .formatDecompiledStatement(tempString));
290:                                    } else {
291:                                        boolean firstIfForLoop = LoopHelper
292:                                                .isIfFirstIfInLoopCondition(
293:                                                        info, currentForIndex);
294:                                        if (firstIfForLoop) {
295:                                            IFHelper
296:                                                    .registerElseBreakForIfChain(currentForIndex);
297:                                        }
298:                                    }
299:
300:                                    break;
301:                                }
302:                            }
303:                            if (isInfiniteLoop) {
304:                                GlobalVariableStore
305:                                        .setEncounteredAndOrComp(encounteredAndOrComp);
306:                                GlobalVariableStore.setIfInScope(isIfInScope);
307:                                GlobalVariableStore.setThisLoop(this Loop);
308:
309:                                return;
310:                            }
311:                            tempstr = "";
312:                            boolean bc = false;
313:                            if (getGenericFinder().isThisInstrStart(
314:
315:                            currentForIndex - 1)
316:                                    && info[currentForIndex - 1] != JvmOpCodes.DCMPG
317:                                    && info[currentForIndex - 1] != JvmOpCodes.DCMPL
318:                                    && info[currentForIndex - 1] != JvmOpCodes.FCMPG
319:                                    && info[currentForIndex - 1] != JvmOpCodes.FCMPL
320:                                    && info[currentForIndex - 1] != JvmOpCodes.LCMP) {
321:                                tempString = "\nwhile(" + op.getOperandValue()
322:                                        + "!=" + previnstret + ")\n{\n";
323:                                tempstr = op.getOperandValue() + "=="
324:                                        + previnstret;
325:                            } else if (getGenericFinder().isThisInstrStart(
326:
327:                            currentForIndex - 3)
328:                                    && info[currentForIndex - 3] != JvmOpCodes.INSTANCEOF
329:                                    && getGenericFinder().isPreviousInst(
330:                                            currentForIndex,
331:                                            currentForIndex - 3)) {
332:                                tempString = "\nwhile(" + op.getOperandValue()
333:                                        + "!=" + previnstret + ")\n{\n";
334:                                tempstr = op.getOperandValue() + "=="
335:                                        + previnstret;
336:                            } else if (prevStart != currentForIndex - 1
337:                                    && prevStart != currentForIndex - 3) {
338:                                tempString = "\nwhile(" + op.getOperandValue()
339:                                        + "!=" + previnstret + ")\n{\n";
340:                                tempstr = op.getOperandValue() + "=="
341:                                        + previnstret;
342:                            } else {
343:                                tempString = "\nwhile(" + op.getOperandValue()
344:                                        + ")\n{\n";
345:                                tempstr = op.getOperandValue();
346:                                bc = true;
347:                            }
348:                            boolean last = IFHelper.lastIFinShortCutChain(info,
349:                                    ifst, currentForIndex);
350:                            java.lang.String alt;
351:                            if (bc == false)
352:                                alt = op.getOperandValue() + "!=" + previnstret;
353:                            else
354:                                alt = op.getOperandValue();
355:                            boolean c = IFHelper.addCodeStatementWRTShortcutOR(
356:                                    ifst, tempstr, true, "while", last, alt);
357:                            if (c)
358:                                behavior.appendToBuffer(Util
359:                                        .formatDecompiledStatement(tempString));
360:
361:                        } else {
362:                            /*
363:                             * ifLevel++; ifst = new IFBlock();
364:                             * ifst.setIfStart(currentForIndex);
365:                             * ifst.setHasIfBeenGenerated(true); //
366:                             * ifst.setIfCloseLineNumber(classIndex-3);
367:                             */
368:                            ifst.setElseCloseLineNumber(gotoIndex);
369:                            // ifHashTable.put(""+(ifLevel),ifst);
370:
371:                            isIfInScope = true;
372:                            // addBranchLabel(classIndex,i,ifst,currentForIndex,info);
373:                            boolean bb = LoopHelper.isBeyondLoop(
374:                                    getGenericFinder().getJumpAddress(
375:                                            currentForIndex), getContext()
376:                                            .getBehaviourLoops(), info);
377:                            boolean print = true;
378:                            this Loop = GlobalVariableStore.getThisLoop();
379:                            boolean addifbreak = false;
380:                            java.lang.String tempString2 = "";
381:                            // prevStart=getPrevStartOfInst(currentForIndex,info);
382:                            if (bb && this Loop != null && this Loop.isInfinite()
383:                                    && !encounteredAndOrComp && addBreak) {
384:                                Loop dowl = LoopHelper.isIfInADoWhile(
385:                                        currentForIndex, ifst, getContext()
386:                                                .getBehaviourLoops());
387:                                if (dowl != null) {
388:                                    tempString = "";
389:                                } else {
390:                                    if (getGenericFinder().isThisInstrStart(
391:
392:                                    currentForIndex - 1)
393:                                            && (info[currentForIndex - 1] != JvmOpCodes.DCMPG)
394:                                            && (info[currentForIndex - 1] != JvmOpCodes.DCMPL)
395:                                            && info[currentForIndex - 1] != JvmOpCodes.FCMPG
396:                                            && info[currentForIndex - 1] != JvmOpCodes.FCMPL
397:                                            && info[currentForIndex - 1] != JvmOpCodes.LCMP)
398:                                        tempString = "\nif("
399:                                                + op.getOperandValue() + "=="
400:                                                + previnstret
401:                                                + ")\n{\nbreak;\n}\n";
402:                                    else if (getGenericFinder()
403:                                            .isThisInstrStart(
404:
405:                                            currentForIndex - 3)
406:                                            && info[currentForIndex - 3] != JvmOpCodes.INSTANCEOF
407:                                            && getGenericFinder()
408:                                                    .isPreviousInst(
409:                                                            currentForIndex,
410:                                                            currentForIndex - 3)) {
411:                                        tempString = "\nif("
412:                                                + op.getOperandValue() + "=="
413:                                                + previnstret
414:                                                + ")\n{\nbreak;\n}\n";
415:                                    } else if (prevStart != currentForIndex - 1
416:                                            && prevStart != currentForIndex - 3) {
417:                                        tempString = "\nif("
418:                                                + op.getOperandValue() + "=="
419:                                                + previnstret
420:                                                + ")\n{\nbreak;\n}\n";
421:                                    } else
422:                                        tempString = "\nif("
423:                                                + op.getOperandValue()
424:                                                + ")\n{\nbreak;\n}\n";
425:                                    // codeStatements
426:                                    // +=Util.formatDecompiledStatement(tempString);
427:                                    tempString2 = tempString;
428:                                    addifbreak = true;
429:                                }
430:                                print = false;
431:                            }
432:                            tempstr = "";
433:                            boolean bc = false;
434:                            if (getGenericFinder().isThisInstrStart(
435:
436:                            currentForIndex - 1)
437:                                    && info[currentForIndex - 1] != JvmOpCodes.DCMPG
438:                                    && info[currentForIndex - 1] != JvmOpCodes.DCMPL
439:                                    && info[currentForIndex - 1] != JvmOpCodes.FCMPG
440:                                    && info[currentForIndex - 1] != JvmOpCodes.FCMPL
441:                                    && info[currentForIndex - 1] != JvmOpCodes.LCMP) {
442:                                tempString = "\nif(" + op.getOperandValue()
443:                                        + "!=" + previnstret + ")\n{\n";
444:                                tempstr = op.getOperandValue() + "=="
445:                                        + previnstret;
446:                            } else if (getGenericFinder().isThisInstrStart(
447:
448:                            currentForIndex - 3)
449:                                    && info[currentForIndex - 3] != JvmOpCodes.INSTANCEOF
450:                                    && getGenericFinder().isPreviousInst(
451:                                            currentForIndex,
452:                                            currentForIndex - 3)) {
453:                                tempString = "\nif(" + op.getOperandValue()
454:                                        + "!=" + previnstret + ")\n{\n";
455:                                tempstr = op.getOperandValue() + "=="
456:                                        + previnstret;
457:                            } else if (prevStart != currentForIndex - 1
458:                                    && prevStart != currentForIndex - 3) {
459:                                tempString = "\nif(" + op.getOperandValue()
460:                                        + "!=" + previnstret + ")\n{\n";
461:                                tempstr = op.getOperandValue() + "=="
462:                                        + previnstret;
463:                            } else {
464:                                tempString = "\nif(" + op.getOperandValue()
465:                                        + ")\n{\n";
466:                                tempstr = op.getOperandValue();
467:                                bc = true;
468:                            }
469:                            boolean last = IFHelper.lastIFinShortCutChain(info,
470:                                    ifst, currentForIndex);
471:                            java.lang.String alt;
472:                            if (bc == false)
473:                                alt = op.getOperandValue() + "!=" + previnstret;
474:                            else
475:                                alt = op.getOperandValue();
476:                            boolean c = IFHelper.addCodeStatementWRTShortcutOR(
477:                                    ifst, tempstr, print, "if", last, alt);
478:                            if (c) {
479:                                if (addifbreak) {
480:                                    behavior
481:                                            .appendToBuffer(Util
482:                                                    .formatDecompiledStatement(tempString2));
483:                                }
484:                                behavior.appendToBuffer(Util
485:                                        .formatDecompiledStatement(tempString));
486:                            } else {
487:                                boolean firstIfForLoop = LoopHelper
488:                                        .isIfFirstIfInLoopCondition(info,
489:                                                currentForIndex);
490:                                if (firstIfForLoop) {
491:                                    IFHelper
492:                                            .registerElseBreakForIfChain(currentForIndex);
493:                                }
494:                            }
495:
496:                        }
497:
498:                    } else {
499:                        /*
500:                         * ifLevel++; ifst = new IFBlock();
501:                         * ifst.setIfStart(currentForIndex);
502:                         * ifst.setHasIfBeenGenerated(true);
503:                         * ifHashTable.put(""+(ifLevel),ifst);
504:                         */
505:                        isIfInScope = true;
506:                        // addBranchLabel(classIndex,i,ifst,currentForIndex,info);
507:                        boolean bb = LoopHelper.isBeyondLoop(getGenericFinder()
508:                                .getJumpAddress(currentForIndex), getContext()
509:                                .getBehaviourLoops(), info);
510:                        boolean print = true;
511:                        this Loop = GlobalVariableStore.getThisLoop();
512:                        tempString = "";
513:                        java.lang.String tempString2 = "";
514:                        boolean addifbreak = false;
515:                        // prevStart=getPrevStartOfInst(currentForIndex,info);
516:                        if (bb && this Loop != null && this Loop.isInfinite()
517:                                && !encounteredAndOrComp && addBreak) {
518:                            Loop dowl = LoopHelper.isIfInADoWhile(
519:                                    currentForIndex, ifst, getContext()
520:                                            .getBehaviourLoops());
521:                            if (dowl != null) {
522:                                tempString = "";
523:                            } else {
524:                                if (getGenericFinder().isThisInstrStart(
525:
526:                                currentForIndex - 1)
527:                                        && (info[currentForIndex - 1] != JvmOpCodes.DCMPG)
528:                                        && (info[currentForIndex - 1] != JvmOpCodes.DCMPL)
529:                                        && info[currentForIndex - 1] != JvmOpCodes.FCMPG
530:                                        && info[currentForIndex - 1] != JvmOpCodes.FCMPL
531:                                        && info[currentForIndex - 1] != JvmOpCodes.LCMP)
532:                                    tempString = "\nif(" + op.getOperandValue()
533:                                            + "==" + previnstret
534:                                            + ")\n{\nbreak;\n}\n";
535:                                else if (getGenericFinder().isThisInstrStart(
536:
537:                                currentForIndex - 3)
538:                                        && info[currentForIndex - 3] != JvmOpCodes.INSTANCEOF
539:                                        && getGenericFinder().isPreviousInst(
540:                                                currentForIndex,
541:                                                currentForIndex - 3)) {
542:                                    tempString = "\nif(" + op.getOperandValue()
543:                                            + "==" + previnstret
544:                                            + ")\n{\nbreak;\n}\n";
545:                                } else if (prevStart != currentForIndex - 1
546:                                        && prevStart != currentForIndex - 3) {
547:                                    tempString = "\nif(" + op.getOperandValue()
548:                                            + "==" + previnstret
549:                                            + ")\n{\nbreak;\n}\n";
550:                                } else
551:                                    tempString = "\nif(" + op.getOperandValue()
552:                                            + ")\n{\nbreak;\n}\n";
553:                                // codeStatements
554:                                // +=Util.formatDecompiledStatement(tempString);
555:                                addifbreak = true;
556:                                tempString2 = tempString;
557:                            }
558:                            print = false;
559:                        }
560:                        tempstr = "";
561:                        boolean bc = false;
562:                        if (getGenericFinder().isThisInstrStart(
563:                                currentForIndex - 1)
564:                                && info[currentForIndex - 1] != JvmOpCodes.DCMPG
565:                                && info[currentForIndex - 1] != JvmOpCodes.DCMPL
566:                                && info[currentForIndex - 1] != JvmOpCodes.FCMPG
567:                                && info[currentForIndex - 1] != JvmOpCodes.FCMPL
568:                                && info[currentForIndex - 1] != JvmOpCodes.LCMP) {
569:                            tempString = "\nif(" + op.getOperandValue() + "!="
570:                                    + previnstret + ")\n{\n";
571:                            tempstr = op.getOperandValue() + "==" + previnstret;
572:                        } else if (getGenericFinder().isThisInstrStart(
573:
574:                        currentForIndex - 3)
575:                                && info[currentForIndex - 3] != JvmOpCodes.INSTANCEOF
576:                                && getGenericFinder().isPreviousInst(
577:                                        currentForIndex, currentForIndex - 3)) {
578:                            tempString = "\nif(" + op.getOperandValue() + "!="
579:                                    + previnstret + ")\n{\n";
580:                            tempstr = op.getOperandValue() + "==" + previnstret;
581:                        } else if (prevStart != currentForIndex - 1
582:                                && prevStart != currentForIndex - 3) {
583:                            tempString = "\nif(" + op.getOperandValue() + "!="
584:                                    + previnstret + ")\n{\n";
585:                            tempstr = op.getOperandValue() + "==" + previnstret;
586:                        } else {
587:                            tempString = "\nif(" + op.getOperandValue()
588:                                    + ")\n{\n";
589:                            tempstr = op.getOperandValue();
590:                            bc = true;
591:                        }
592:                        boolean last = IFHelper.lastIFinShortCutChain(info,
593:                                ifst, currentForIndex);
594:                        java.lang.String alt;
595:                        if (bc == false)
596:                            alt = op.getOperandValue() + "!=" + previnstret;
597:                        else
598:                            alt = op.getOperandValue();
599:                        boolean c = IFHelper.addCodeStatementWRTShortcutOR(
600:                                ifst, tempstr, print, "if", last, alt);
601:                        if (c) {
602:                            if (addifbreak) {
603:                                behavior
604:                                        .appendToBuffer(Util
605:                                                .formatDecompiledStatement(tempString2));
606:                            }
607:                            behavior.appendToBuffer(Util
608:                                    .formatDecompiledStatement(tempString));
609:                        } else {
610:                            boolean firstIfForLoop = LoopHelper
611:                                    .isIfFirstIfInLoopCondition(info,
612:                                            currentForIndex);
613:                            if (firstIfForLoop) {
614:                                IFHelper
615:                                        .registerElseBreakForIfChain(currentForIndex);
616:                            }
617:                        }
618:
619:                    }
620:                }
621:                GlobalVariableStore
622:                        .setEncounteredAndOrComp(encounteredAndOrComp);
623:                GlobalVariableStore.setIfInScope(isIfInScope);
624:                GlobalVariableStore.setThisLoop(thisLoop);
625:
626:            }
627:
628:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.