annotate graal/GraalRuntime/src/com/oracle/graal/runtime/HotSpotVMConfig.java @ 2659:40248577d587

Deoptimize on array store and array bounds exception.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 11 May 2011 16:25:15 +0200
parents 16b9a8b5ad39
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2501
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
2502
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2501
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
2502
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
7 * published by the Free Software Foundation.
2501
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
2502
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
13 * accompanied this code).
2501
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
2502
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
15 * You should have received a copy of the GNU General Public License version
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2501
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
2502
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
3e3e8bd12730 Copyright rebranding. Update checkstyle file.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 2501
diff changeset
21 * questions.
2501
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.runtime;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25 import com.sun.cri.ci.*;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
27 /**
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
28 * Used to communicate configuration details, runtime offsets, etc. to c1x upon compileMethod.
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29 */
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
30 public final class HotSpotVMConfig extends CompilerObject {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
31
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32 private HotSpotVMConfig() {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33 super(null);
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34 }
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36 // os information, register layout, code generation, ...
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 public boolean windowsOs;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38 public int codeEntryAlignment;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 public boolean verifyPointers;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 public boolean useFastLocking;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 public boolean useFastNewObjectArray;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 public boolean useFastNewTypeArray;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44 // offsets, ...
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 public int vmPageSize;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46 public int stackShadowPages;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 public int hubOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 public int arrayLengthOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49 public int klassStateOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 public int klassStateFullyInitialized;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
51 public int[] arrayOffsets;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
52 public int arrayClassElementOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 public int threadTlabTopOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 public int threadTlabEndOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55 public int threadObjectOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56 public int instanceHeaderPrototypeOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57 public int threadExceptionOopOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
58 public int threadExceptionPcOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59 public int threadMultiNewArrayStorage;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
60 public long cardtableStartAddress;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
61 public int cardtableShift;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62 public long safepointPollingAddress;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63 public int classMirrorOffset;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
64
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65 // runtime stubs
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
66 public long debugStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
67 public long instanceofStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
68 public long newInstanceStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69 public long unresolvedNewInstanceStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70 public long newTypeArrayStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
71 public long newObjectArrayStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
72 public long newMultiArrayStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
73 public long loadKlassStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
74 public long accessFieldStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
75 public long resolveStaticCallStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
76 public long inlineCacheMissStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
77 public long unwindExceptionStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78 public long handleExceptionStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
79 public long handleDeoptStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
80 public long monitorEnterStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
81 public long monitorExitStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
82 public long fastMonitorEnterStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
83 public long fastMonitorExitStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 public long verifyPointerStub;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
85
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
86 public void check() {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
87 assert vmPageSize >= 16;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
88 assert codeEntryAlignment > 0;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89 assert stackShadowPages > 0;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
90 }
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
91
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92 public int getArrayOffset(CiKind kind) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
93 return arrayOffsets[getKindNumber(kind)];
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
94 }
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
95
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
96 private int getKindNumber(CiKind kind) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
97 if (kind == CiKind.Boolean) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
98 return 0;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
99 } else if (kind == CiKind.Byte) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
100 return 1;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
101 } else if (kind == CiKind.Short) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
102 return 2;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
103 } else if (kind == CiKind.Char) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
104 return 3;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
105 } else if (kind == CiKind.Int) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
106 return 4;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
107 } else if (kind == CiKind.Float) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
108 return 5;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
109 } else if (kind == CiKind.Long) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
110 return 6;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
111 } else if (kind == CiKind.Double) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
112 return 7;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
113 } else if (kind == CiKind.Object) {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
114 return 8;
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
115 } else {
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
116 throw new RuntimeException(kind + " is not a Java kind");
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
117 }
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
118 }
6594e6d8bfe7 Rebranding to com.oracle.graal
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
119 }