Mercurial > hg > graal-jvmci-8
annotate c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotProxy.java @ 1449:8cfe3537a0d3
Pointer verification stub. Two loose oop fixes in C1X C++ part. Logging which methods have been compiled.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Thu, 11 Nov 2010 14:09:37 +0100 |
parents | 9e5e83ca2259 |
children |
rev | line source |
---|---|
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
1 /* |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
2 * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved. |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
3 * |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
5 * that is described in this document. In particular, and without limitation, these intellectual property |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
6 * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
7 * more additional patents or pending patent applications in the U.S. and in other countries. |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
8 * |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
9 * U.S. Government Rights - Commercial software. Government users are subject to the Sun |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
10 * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
11 * supplements. |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
12 * |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
13 * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
14 * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
15 * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
16 * U.S. and other countries. |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
17 * |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
18 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open |
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
19 * Company, Ltd. |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
20 */ |
1421
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
21 package com.sun.hotspot.c1x; |
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
22 |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
23 /** |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
24 * Provides methods to classify the HotSpot-internal identifiers. |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
25 * |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
26 * @author Lukas Stadler |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
27 */ |
1437
9e5e83ca2259
Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1427
diff
changeset
|
28 public final class HotSpotProxy { |
1421
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
29 |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
30 private HotSpotProxy() { |
1421
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
31 } |
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
32 |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
33 private enum CompilerObjectType { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
34 // this enum needs to have the same values as the one in c1x_Compiler.hpp |
1427
149b1d2316de
basic invokeinterface and invokevirtual support
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1423
diff
changeset
|
35 STUB(0x100000000000000L), |
149b1d2316de
basic invokeinterface and invokevirtual support
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1423
diff
changeset
|
36 METHOD(0x200000000000000L), |
149b1d2316de
basic invokeinterface and invokevirtual support
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1423
diff
changeset
|
37 CLASS(0x300000000000000L), |
149b1d2316de
basic invokeinterface and invokevirtual support
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1423
diff
changeset
|
38 SYMBOL(0x400000000000000L), |
149b1d2316de
basic invokeinterface and invokevirtual support
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1423
diff
changeset
|
39 CONSTANT_POOL(0x500000000000000L), |
149b1d2316de
basic invokeinterface and invokevirtual support
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1423
diff
changeset
|
40 CONSTANT(0x600000000000000L), |
149b1d2316de
basic invokeinterface and invokevirtual support
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1423
diff
changeset
|
41 TYPE_MASK(0xf00000000000000L), |
149b1d2316de
basic invokeinterface and invokevirtual support
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1423
diff
changeset
|
42 DUMMY_CONSTANT(0x6ffffffffffffffL); |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
43 |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
44 public final long bits; |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
45 |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
46 CompilerObjectType(long bits) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
47 this.bits = bits; |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
48 } |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
49 } |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
50 |
1427
149b1d2316de
basic invokeinterface and invokevirtual support
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1423
diff
changeset
|
51 public static final Long DUMMY_CONSTANT_OBJ = CompilerObjectType.DUMMY_CONSTANT.bits; |
149b1d2316de
basic invokeinterface and invokevirtual support
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1423
diff
changeset
|
52 |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
53 private static boolean isType(long id, CompilerObjectType type) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
54 return (id & CompilerObjectType.TYPE_MASK.bits) == type.bits; |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
55 } |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
56 |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
57 public static boolean isStub(long id) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
58 return isType(id, CompilerObjectType.STUB); |
1421
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
59 } |
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
60 |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
61 public static boolean isMethod(long id) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
62 return isType(id, CompilerObjectType.METHOD); |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
63 } |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
64 |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
65 public static boolean isClass(long id) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
66 return isType(id, CompilerObjectType.CLASS); |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
67 } |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
68 |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
69 public static boolean isSymbol(long id) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
70 return isType(id, CompilerObjectType.SYMBOL); |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
71 } |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
72 |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
73 public static boolean isConstantPool(long id) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
74 return isType(id, CompilerObjectType.CONSTANT_POOL); |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
75 } |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
76 |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
77 public static boolean isConstant(long id) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
78 return isType(id, CompilerObjectType.CONSTANT_POOL); |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
79 } |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
80 |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
81 public static String toString(long id) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
82 CompilerObjectType type = null; |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
83 for (CompilerObjectType t : CompilerObjectType.values()) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
84 if ((id & CompilerObjectType.TYPE_MASK.bits) == t.bits) { |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
85 type = t; |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
86 } |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
87 } |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
88 long num = id & ~CompilerObjectType.TYPE_MASK.bits; |
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1421
diff
changeset
|
89 return type + " " + num; |
1421
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
90 } |
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
91 |
6223633ce7dd
changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff
changeset
|
92 } |