annotate c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotVMConfig.java @ 1437:9e5e83ca2259

Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Mon, 25 Oct 2010 16:47:52 +0200
parents 72cfb36c6bb2
children 8cfe3537a0d3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1419
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
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: 1434
diff changeset
2 * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved.
1419
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
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: 1434
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: 1434
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: 1434
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: 1434
diff changeset
7 * more additional patents or pending patent applications in the U.S. and in other countries.
1419
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
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: 1434
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: 1434
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: 1434
diff changeset
11 * supplements.
1419
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
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: 1434
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: 1434
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: 1434
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: 1434
diff changeset
16 * U.S. and other countries.
1419
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
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: 1434
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: 1434
diff changeset
19 * Company, Ltd.
1419
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
20 */
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
21 package com.sun.hotspot.c1x;
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
22
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
23 import com.sun.cri.ci.*;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
24
1419
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
25 /**
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
26 * Used to communicate configuration details, runtime offsets, etc. to c1x upon compileMethod.
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
27 *
1419
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
28 * @author Lukas Stadler
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
29 */
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
30 public class HotSpotVMConfig implements CompilerObject {
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
31
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
32 // os information, register layout, code generation, ...
1421
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
33 public boolean windowsOs;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
34 public int codeEntryAlignment;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
35
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
36 // offsets, ...
1421
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
37 public int vmPageSize;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
38 public int stackShadowPages;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
39 public int hubOffset;
1422
3483ec571caf * using reflected objects instead of oops
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1421
diff changeset
40 public int arrayLengthOffset;
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
41 public int klassStateOffset;
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
42 public int klassStateFullyInitialized;
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
43 public int[] arrayOffsets;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
44 public int arrayClassElementOffset;
1425
98fffb304868 tlab-allocated "new instance", invokespecial, support for static fields in COMPILER_CLASSES_DO
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1423
diff changeset
45 public int threadTlabTopOffset;
98fffb304868 tlab-allocated "new instance", invokespecial, support for static fields in COMPILER_CLASSES_DO
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1423
diff changeset
46 public int threadTlabEndOffset;
98fffb304868 tlab-allocated "new instance", invokespecial, support for static fields in COMPILER_CLASSES_DO
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1423
diff changeset
47 public int instanceHeaderPrototypeOffset;
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
48 public int threadExceptionOopOffset;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
49 public int threadExceptionPcOffset;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
50 public int threadMultiNewArrayStorage;
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
51 public long cardtableStartAddress;
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
52 public int cardtableShift;
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
53 public long safepointPollingAddress;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
54
1421
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
55 // runtime stubs
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
56 public long debugStub;
1421
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
57 public long instanceofStub;
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
58 public long newInstanceStub;
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
59 public long unresolvedNewInstanceStub;
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
60 public long newTypeArrayStub;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
61 public long newObjectArrayStub;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
62 public long newMultiArrayStub;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
63 public long loadKlassStub;
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
64 public long accessFieldStub;
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
65 public long resolveStaticCallStub;
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
66 public long inlineCacheMissStub;
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
67 public long unwindExceptionStub;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
68 public long handleExceptionStub;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
69 public long throwClassCastException;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
70 public long throwArrayStoreException;
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
71 public long throwArrayIndexException;
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
72 public long monitorEnterStub;
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
73 public long monitorExitStub;
1421
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
74
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
75 public void check() {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
76 assert vmPageSize >= 16;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
77 assert codeEntryAlignment > 0;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
78 assert stackShadowPages > 0;
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
79 }
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
80
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
81 public int getArrayOffset(CiKind kind) {
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
82 return arrayOffsets[getKindNumber(kind)];
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
83 }
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
84
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
85 private int getKindNumber(CiKind kind) {
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
86 if (kind == CiKind.Boolean) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
87 return 0;
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
88 } else if (kind == CiKind.Byte) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
89 return 1;
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
90 } else if (kind == CiKind.Short) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
91 return 2;
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
92 } else if (kind == CiKind.Char) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
93 return 3;
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
94 } else if (kind == CiKind.Int) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
95 return 4;
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
96 } else if (kind == CiKind.Float) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
97 return 5;
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
98 } else if (kind == CiKind.Long) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
99 return 6;
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
100 } else if (kind == CiKind.Double) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
101 return 7;
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
102 } else if (kind == CiKind.Object) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
103 return 8;
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
104 } else {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
105 throw new RuntimeException(kind + " is not a Java kind");
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
106 }
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
107 }
1419
7bf6a77b9c5a implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
diff changeset
108 }