01: /* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com
02:
03: This file is part of the db4o open source object database.
04:
05: db4o is free software; you can redistribute it and/or modify it under
06: the terms of version 2 of the GNU General Public License as published
07: by the Free Software Foundation and as clarified by db4objects' GPL
08: interpretation policy, available at
09: http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10: Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11: Suite 350, San Mateo, CA 94403, USA.
12:
13: db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14: WARRANTY; without even the implied warranty of MERCHANTABILITY or
15: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16: for more details.
17:
18: You should have received a copy of the GNU General Public License along
19: with this program; if not, write to the Free Software Foundation, Inc.,
20: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21: package EDU.purdue.cs.bloat.inline;
22:
23: import java.util.*;
24:
25: import EDU.purdue.cs.bloat.editor.*;
26:
27: /**
28: * An <Tt>InlineContext</tt> gives access to the <Tt>CallGraph</tt> for the
29: * program whose classes are being operated on by BLOAT.
30: */
31: public interface InlineContext extends EditorContext {
32:
33: /**
34: * Returns the call graph for the program.
35: */
36: public CallGraph getCallGraph();
37:
38: /**
39: * Sets the root methods for this <tt>InlineContext</tt>.
40: *
41: * @param roots
42: * The root methods (<tt>MemberRef</tt>s) of the program
43: * @throws IllegalStateException
44: * Call graph has already been created with different roots.
45: */
46: public void setRootMethods(Set roots);
47:
48: /**
49: * Returns an <tt>InlineStats</tt> object for getting statistics about
50: * inlining.
51: */
52: public InlineStats getInlineStats();
53:
54: /**
55: * Notes that all classes, methods, and fields in a package should be
56: * "ignored" by inlining. That is, methods won't be inlined, classes won't
57: * be involved in specialization, etc. Note that it is exceptable to just
58: * add a prefix of a package name. For instance, adding "java" will ignore
59: * java.lang.Object, java.io.File, etc.
60: */
61: public void addIgnorePackage(String name);
62:
63: /**
64: * Notes that a class should be ignored by inlining. That is, none of its
65: * methods will be inlined and it won't be involved in specialization.
66: */
67: public void addIgnoreClass(Type type);
68:
69: /**
70: * Notes that a method should be ignored by inlining. That is, it will not
71: * be inlined.
72: */
73: public void addIgnoreMethod(MemberRef method);
74:
75: /**
76: * Notes that a field should be ignored by inlining.
77: */
78: public void addIgnoreField(MemberRef field);
79:
80: /**
81: * Returns <tt>true</tt> if a class should be ignored by inlining.
82: */
83: public boolean ignoreClass(Type type);
84:
85: /**
86: * Returns <tt>true</tt> if a method should be ignored by inlining.
87: */
88: public boolean ignoreMethod(MemberRef method);
89:
90: /**
91: * Returns <tt>true</tt> if a field should be ignored by inlining.
92: */
93: public boolean ignoreField(MemberRef field);
94:
95: /**
96: * Sets whether or not we ignore all system classes.
97: */
98: public void setIgnoreSystem(boolean ignoreSystem);
99: }
|