KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > G


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2003 Ondrej Lhotak
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20 /*
21  * Modified by the Sable Research Group and others 1997-1999.
22  * See the 'credits' file distributed with Soot for the complete list of
23  * contributors. (Soot is distributed at http://www.sable.mcgill.ca/soot)
24  */

25
26 package soot;
27 import soot.coffi.*;
28 import java.io.PrintStream JavaDoc;
29 import java.util.*;
30 import soot.jimple.toolkits.pointer.util.NativeHelper;
31 import soot.jimple.spark.sets.P2SetFactory;
32 import soot.jimple.toolkits.invoke.*;
33 import soot.jimple.toolkits.pointer.UnionFactory;
34 import soot.shimple.*;
35
36 /** A class to group together all the global variables in Soot. */
37 public class G extends Singletons
38 {
39     private static G instance = new G();
40     public static G v() { return instance; }
41     public static void reset() { instance = new G(); }
42
43     public PrintStream JavaDoc out = System.out;
44
45     public class Global {
46     }
47
48     public long coffi_BasicBlock_ids = 0;
49     public Utf8_Enumeration coffi_CONSTANT_Utf8_info_e1 = new Utf8_Enumeration();
50     public Utf8_Enumeration coffi_CONSTANT_Utf8_info_e2 = new Utf8_Enumeration();
51     public int SETNodeLabel_uniqueId = 0;
52     public HashMap SETBasicBlock_binding = new HashMap();
53     public boolean ASTAnalysis_modified;
54     public NativeHelper NativeHelper_helper = null;
55     public P2SetFactory newSetFactory;
56     public P2SetFactory oldSetFactory;
57     public HashMap Parm_pairToElement = new HashMap();
58     public int SparkNativeHelper_tempVar = 0;
59     public int PaddleNativeHelper_tempVar = 0;
60     public boolean PointsToSetInternal_warnedAlready = false;
61     public HashMap MethodPAG_methodToPag = new HashMap();
62     public Set MethodRWSet_allGlobals = new HashSet();
63     public Set MethodRWSet_allFields = new HashSet();
64     public int GeneralConstObject_counter = 0;
65     public UnionFactory Union_factory = null;
66     public HashMap Array2ndDimensionSymbol_pool = new HashMap();
67     public Map AbstractUnit_allMapToUnnamed = Collections.unmodifiableMap(new AbstractUnitAllMapTo("<unnamed>"));
68     public List Timer_outstandingTimers = new ArrayList();
69     public boolean Timer_isGarbageCollecting;
70     public Timer Timer_forcedGarbageCollectionTimer = new Timer("gc");
71     public int Timer_count;
72     public final Map ClassHierarchy_classHierarchyMap = new HashMap();
73     public final Map MethodContext_map = new HashMap();
74
75     public ShimpleFactory shimpleFactory = new DefaultShimpleFactory();
76
77     
78     public boolean ASTTransformations_modified;
79     
80     /*
81      * 16th Feb 2006 Nomair
82      * The AST transformations are unfortunately non-monotonic.
83      * Infact one transformation on each iteration simply reverses the bodies of an if-else
84      * To make the remaining transformations monotonic this transformation is handled with
85      * a separate flag...clumsy but works
86      */

87     public boolean ASTIfElseFlipped;
88     
89     
90     
91     // hack for J2ME, patch provided by Stephen Chen
92
// by default, this is set as false, to use SOOT with J2ME library
93
// flag isJ2ME true. Type system works around Clonable, Serializeable.
94
// see changes in:
95
// soot/jimple/toolkits/typing/ClassHierarchy.java
96
// soot/jimple/toolkits/typing/TypeResolver.java
97
// soot/jimple/toolkits/typing/TypeVariable.java
98
// soot/jimple/toolkits/typing/TypeNode.java
99
public final boolean isJ2ME = false;
100
101     /*
102      * Nomair A. Naeem January 15th 2006
103      * Added For Dava.toolkits.AST.transformations.SuperFirstStmtHandler
104      *
105      * The SootMethodAddedByDava is checked by the PackManager after
106      * decompiling methods for a class. If any additional methods
107      * were added by the decompiler (refer to filer SuperFirstStmtHandler)
108      * SootMethodsAdded ArrayList contains these method. These
109      * methods are then added to the SootClass
110      *
111      * Some of these newly added methods make use of an object of
112      * a static inner class DavaSuperHandler which is to be output
113      * in the decompilers
114      * output. The class is marked to need a DavaSuperHandlerClass
115      * by adding it into the SootClassNeedsDavaSuperHandlerClass list.
116      * The DavaPrinter when printing out the class checks this list and
117      * if this class's name exists in the list prints out an implementation
118      * of DavSuperHandler
119      */

120     public boolean SootMethodAddedByDava;
121     public ArrayList SootClassNeedsDavaSuperHandlerClass = new ArrayList();
122     public ArrayList SootMethodsAdded = new ArrayList();
123     
124     //ASTMetrics Data
125
public ArrayList ASTMetricsData = new ArrayList();
126 }
127
128
Popular Tags