Source Code Cross Referenced for InstructionContainer.java in  » Development » jode » jode » flow » 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 » jode » jode.flow 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* InstructionContainer Copyright (C) 1998-2002 Jochen Hoenicke.
002:         *
003:         * This program is free software; you can redistribute it and/or modify
004:         * it under the terms of the GNU Lesser General Public License as published by
005:         * the Free Software Foundation; either version 2, or (at your option)
006:         * any later version.
007:         *
008:         * This program is distributed in the hope that it will be useful,
009:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
010:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
011:         * GNU General Public License for more details.
012:         *
013:         * You should have received a copy of the GNU Lesser General Public License
014:         * along with this program; see the file COPYING.LESSER.  If not, write to
015:         * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
016:         *
017:         * $Id: InstructionContainer.java.in,v 4.2.2.1 2002/05/28 17:34:09 hoenicke Exp $
018:         */
019:
020:        package jode.flow;
021:
022:        import jode.decompiler.LocalInfo;
023:        import jode.expr.Expression;
024:        import jode.expr.InvokeOperator;
025:        import jode.expr.LocalVarOperator;
026:        import jode.util.SimpleSet;
027:
028:        import java.util.Set;
029:
030:        /**
031:         * This is a method for block containing a single instruction.
032:         */
033:        public abstract class InstructionContainer extends StructuredBlock {
034:            /**
035:             * The instruction.
036:             */
037:            Expression instr;
038:
039:            public InstructionContainer(Expression instr) {
040:                this .instr = instr;
041:            }
042:
043:            public InstructionContainer(Expression instr, Jump jump) {
044:                this (instr);
045:                setJump(jump);
046:            }
047:
048:            /**
049:             * Make the declarations, i.e. initialize the declare variable
050:             * to correct values.  This will declare every variable that
051:             * is marked as used, but not done.<br>
052:             *
053:             * This will now also combine locals, that use the same slot, have
054:             * compatible types and are declared in the same block. <br>
055:             *
056:             * @param done The set of the already declare variables.
057:             */
058:            public void makeDeclaration(Set done) {
059:                if (instr != null)
060:                    instr.makeDeclaration(done);
061:                super .makeDeclaration(done);
062:            }
063:
064:            /** 
065:             * This method should remove local variables that are only written
066:             * and read one time directly after another.  <br>
067:             *
068:             * This is especially important for stack locals, that are created
069:             * when there are unusual swap or dup instructions, but also makes
070:             * inlined functions more pretty (but not that close to the
071:             * bytecode).  
072:             */
073:            public void removeOnetimeLocals() {
074:                if (instr != null)
075:                    instr = instr.removeOnetimeLocals();
076:                super .removeOnetimeLocals();
077:            }
078:
079:            /**
080:             * Fill all in variables into the given VariableSet.
081:             * @param in The VariableSet, the in variables should be stored to.
082:             */
083:            public void fillInGenSet(Set in, Set gen) {
084:                if (instr != null)
085:                    instr.fillInGenSet(in, gen);
086:            }
087:
088:            public Set getDeclarables() {
089:                Set used = new SimpleSet();
090:                if (instr != null)
091:                    instr.fillDeclarables(used);
092:                return used;
093:            }
094:
095:            public boolean doTransformations() {
096:                if (instr == null)
097:                    return false;
098:                /* Do on the fly access$ transformation, since some further
099:                 * operations need this.
100:                 */
101:                if (instr instanceof  InvokeOperator) {
102:                    Expression expr = ((InvokeOperator) instr).simplifyAccess();
103:                    if (expr != null)
104:                        instr = expr;
105:                }
106:                StructuredBlock last = flowBlock.lastModified;
107:                return CreateNewConstructor.transform(this , last)
108:                        || CreateAssignExpression.transform(this , last)
109:                        || CreateExpression.transform(this , last)
110:                        || CreatePrePostIncExpression.transform(this , last)
111:                        || CreateIfThenElseOperator.create(this , last)
112:                        || CreateConstantArray.transform(this , last)
113:                        || CreateCheckNull.transformJavac(this , last);
114:            }
115:
116:            /**
117:             * Get the contained instruction.
118:             * @return the contained instruction.
119:             */
120:            public final Expression getInstruction() {
121:                return instr;
122:            }
123:
124:            public void simplify() {
125:                if (instr != null)
126:                    instr = instr.simplify();
127:                super .simplify();
128:            }
129:
130:            /**
131:             * Set the contained instruction.
132:             * @param instr the new instruction.
133:             */
134:            public final void setInstruction(Expression instr) {
135:                this.instr = instr;
136:            }
137:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.