comparison graal/Runtime/src/com/sun/hotspot/c1x/HotSpotVMConfig.java @ 2297:099e697d8934

Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 22 Apr 2011 15:08:53 +0200
parents
children
comparison
equal deleted inserted replaced
2296:34354e2e40a3 2297:099e697d8934
1 /*
2 * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved.
3 *
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product
5 * that is described in this document. In particular, and without limitation, these intellectual property
6 * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or
7 * more additional patents or pending patent applications in the U.S. and in other countries.
8 *
9 * U.S. Government Rights - Commercial software. Government users are subject to the Sun
10 * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its
11 * supplements.
12 *
13 * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or
14 * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks
15 * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the
16 * U.S. and other countries.
17 *
18 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open
19 * Company, Ltd.
20 */
21 package com.sun.hotspot.c1x;
22
23 import com.sun.cri.ci.*;
24
25 /**
26 * Used to communicate configuration details, runtime offsets, etc. to c1x upon compileMethod.
27 *
28 * @author Lukas Stadler
29 */
30 public final class HotSpotVMConfig extends CompilerObject {
31
32 private HotSpotVMConfig() {
33 super(null);
34 }
35
36 // os information, register layout, code generation, ...
37 public boolean windowsOs;
38 public int codeEntryAlignment;
39 public boolean verifyPointers;
40 public boolean useFastLocking;
41 public boolean useFastNewObjectArray;
42 public boolean useFastNewTypeArray;
43
44 // offsets, ...
45 public int vmPageSize;
46 public int stackShadowPages;
47 public int hubOffset;
48 public int arrayLengthOffset;
49 public int klassStateOffset;
50 public int klassStateFullyInitialized;
51 public int[] arrayOffsets;
52 public int arrayClassElementOffset;
53 public int threadTlabTopOffset;
54 public int threadTlabEndOffset;
55 public int threadObjectOffset;
56 public int instanceHeaderPrototypeOffset;
57 public int threadExceptionOopOffset;
58 public int threadExceptionPcOffset;
59 public int threadMultiNewArrayStorage;
60 public long cardtableStartAddress;
61 public int cardtableShift;
62 public long safepointPollingAddress;
63 public int classMirrorOffset;
64
65 // runtime stubs
66 public long debugStub;
67 public long instanceofStub;
68 public long newInstanceStub;
69 public long unresolvedNewInstanceStub;
70 public long newTypeArrayStub;
71 public long newObjectArrayStub;
72 public long newMultiArrayStub;
73 public long loadKlassStub;
74 public long accessFieldStub;
75 public long resolveStaticCallStub;
76 public long inlineCacheMissStub;
77 public long unwindExceptionStub;
78 public long handleExceptionStub;
79 public long handleDeoptStub;
80 public long throwClassCastException;
81 public long throwArrayStoreException;
82 public long throwArrayIndexException;
83 public long monitorEnterStub;
84 public long monitorExitStub;
85 public long fastMonitorEnterStub;
86 public long fastMonitorExitStub;
87 public long verifyPointerStub;
88
89 public void check() {
90 assert vmPageSize >= 16;
91 assert codeEntryAlignment > 0;
92 assert stackShadowPages > 0;
93 }
94
95 public int getArrayOffset(CiKind kind) {
96 return arrayOffsets[getKindNumber(kind)];
97 }
98
99 private int getKindNumber(CiKind kind) {
100 if (kind == CiKind.Boolean) {
101 return 0;
102 } else if (kind == CiKind.Byte) {
103 return 1;
104 } else if (kind == CiKind.Short) {
105 return 2;
106 } else if (kind == CiKind.Char) {
107 return 3;
108 } else if (kind == CiKind.Int) {
109 return 4;
110 } else if (kind == CiKind.Float) {
111 return 5;
112 } else if (kind == CiKind.Long) {
113 return 6;
114 } else if (kind == CiKind.Double) {
115 return 7;
116 } else if (kind == CiKind.Object) {
117 return 8;
118 } else {
119 throw new RuntimeException(kind + " is not a Java kind");
120 }
121 }
122 }