8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 package sun.jvm.hotspot.opto;
26
27 import java.util.*;
28 import sun.jvm.hotspot.ci.*;
29 import sun.jvm.hotspot.debugger.*;
30 import sun.jvm.hotspot.runtime.*;
31 import sun.jvm.hotspot.oops.*;
32 import sun.jvm.hotspot.types.*;
33
34 public class Compile extends VMObject {
35 static {
36 VM.registerVMInitializedObserver(new Observer() {
37 public void update(Observable o, Object data) {
38 initialize(VM.getVM().getTypeDataBase());
39 }
40 });
41 }
42
43 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
44 Type type = db.lookupType("Compile");
45 rootField = type.getAddressField("_root");
46 uniqueField = new CIntField(type.getCIntegerField("_unique"), 0);
47 entryBciField = new CIntField(type.getCIntegerField("_entry_bci"), 0);
75
76 public ciMethod method() {
77 return (ciMethod) ciObjectFactory.getMetadata(methodField.getValue(getAddress()));
78 }
79
80 public PhaseCFG cfg() {
81 Address a = cfgField.getValue(this.getAddress());
82 if (a != null) {
83 return new PhaseCFG(a);
84 }
85 return null;
86 }
87
88 public InlineTree ilt() {
89 Address a = iltField.getValue(this.getAddress());
90 if (a != null) {
91 return new InlineTree(a);
92 }
93 return null;
94 }
95 }
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 package sun.jvm.hotspot.opto;
26
27 import java.util.*;
28 import java.io.PrintStream;
29 import sun.jvm.hotspot.ci.*;
30 import sun.jvm.hotspot.debugger.*;
31 import sun.jvm.hotspot.runtime.*;
32 import sun.jvm.hotspot.oops.*;
33 import sun.jvm.hotspot.types.*;
34
35 public class Compile extends VMObject {
36 static {
37 VM.registerVMInitializedObserver(new Observer() {
38 public void update(Observable o, Object data) {
39 initialize(VM.getVM().getTypeDataBase());
40 }
41 });
42 }
43
44 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
45 Type type = db.lookupType("Compile");
46 rootField = type.getAddressField("_root");
47 uniqueField = new CIntField(type.getCIntegerField("_unique"), 0);
48 entryBciField = new CIntField(type.getCIntegerField("_entry_bci"), 0);
76
77 public ciMethod method() {
78 return (ciMethod) ciObjectFactory.getMetadata(methodField.getValue(getAddress()));
79 }
80
81 public PhaseCFG cfg() {
82 Address a = cfgField.getValue(this.getAddress());
83 if (a != null) {
84 return new PhaseCFG(a);
85 }
86 return null;
87 }
88
89 public InlineTree ilt() {
90 Address a = iltField.getValue(this.getAddress());
91 if (a != null) {
92 return new InlineTree(a);
93 }
94 return null;
95 }
96
97 public void dumpInlineData(PrintStream out) {
98 InlineTree inlTree = ilt();
99 if (inlTree != null) {
100 out.print(" inline " + inlTree.count());
101 inlTree.dumpReplayData(out);
102 }
103 }
104
105 }
|