Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java @ 7841:674a8b9e62f8
Remove unused fields in TargetDescription. Use Unsafe.pageSize().
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 25 Feb 2013 16:15:17 +0100 |
parents | 0ae87cf94914 |
children | 7a5bbcc36bb2 |
rev | line source |
---|---|
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot.snippets; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
7543
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
25 import static com.oracle.graal.snippets.nodes.BranchProbabilityNode.*; |
7841
674a8b9e62f8
Remove unused fields in TargetDescription. Use Unsafe.pageSize().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7760
diff
changeset
|
26 import sun.misc.*; |
7543
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
27 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
28 import com.oracle.graal.api.code.*; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 import com.oracle.graal.api.meta.*; |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
30 import com.oracle.graal.graph.Node.ConstantNodeParameter; |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
31 import com.oracle.graal.graph.Node.NodeIntrinsic; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
32 import com.oracle.graal.hotspot.*; |
7099
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6950
diff
changeset
|
33 import com.oracle.graal.hotspot.meta.*; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
34 import com.oracle.graal.hotspot.nodes.*; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
35 import com.oracle.graal.nodes.extended.*; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
36 import com.oracle.graal.snippets.Snippet.Fold; |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7275
diff
changeset
|
37 import com.oracle.graal.word.*; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
38 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
39 //JaCoCo Exclude |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
40 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
41 /** |
7543
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
42 * A collection of methods used in HotSpot snippets and substitutions. |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
43 */ |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
44 public class HotSpotSnippetUtils { |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
45 |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
46 public static HotSpotVMConfig config() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
47 return HotSpotGraalRuntime.getInstance().getConfig(); |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
48 } |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
49 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
50 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
51 public static boolean verifyOops() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
52 return config().verifyOops; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
53 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
54 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
55 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
56 public static int threadTlabTopOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
57 return config().threadTlabTopOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
58 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
59 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
60 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
61 public static int threadTlabEndOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
62 return config().threadTlabEndOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
63 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
64 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
65 @Fold |
7222 | 66 public static int threadObjectOffset() { |
7227 | 67 return config().threadObjectOffset; |
7222 | 68 } |
69 | |
70 @Fold | |
71 public static int osThreadOffset() { | |
7227 | 72 return config().osThreadOffset; |
7222 | 73 } |
74 | |
75 @Fold | |
76 public static int osThreadInterruptedOffset() { | |
7227 | 77 return config().osThreadInterruptedOffset; |
7222 | 78 } |
79 | |
80 @Fold | |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
81 public static Kind wordKind() { |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
82 return HotSpotGraalRuntime.getInstance().getTarget().wordKind; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
83 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
84 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
85 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
86 public static Register threadRegister() { |
6494
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6493
diff
changeset
|
87 return HotSpotGraalRuntime.getInstance().getRuntime().threadRegister(); |
6364
07da50ea3275
thread register is now retrieved from HotSpotVMConfig instead of being hard coded
Doug Simon <doug.simon@oracle.com>
parents:
6362
diff
changeset
|
88 } |
07da50ea3275
thread register is now retrieved from HotSpotVMConfig instead of being hard coded
Doug Simon <doug.simon@oracle.com>
parents:
6362
diff
changeset
|
89 |
07da50ea3275
thread register is now retrieved from HotSpotVMConfig instead of being hard coded
Doug Simon <doug.simon@oracle.com>
parents:
6362
diff
changeset
|
90 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
91 public static Register stackPointerRegister() { |
6494
df02fa2bce58
refactored all AMD64 specific HotSpot code in com.oracle.graal.hotspot.target.amd64 package
Doug Simon <doug.simon@oracle.com>
parents:
6493
diff
changeset
|
92 return HotSpotGraalRuntime.getInstance().getRuntime().stackPointerRegister(); |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
93 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
94 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
95 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
96 public static int wordSize() { |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
97 return HotSpotGraalRuntime.getInstance().getTarget().wordSize; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
98 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
99 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
100 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
101 public static int pageSize() { |
7841
674a8b9e62f8
Remove unused fields in TargetDescription. Use Unsafe.pageSize().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7760
diff
changeset
|
102 return Unsafe.getUnsafe().pageSize(); |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
103 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
104 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
105 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
106 public static int prototypeMarkWordOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
107 return config().prototypeMarkWordOffset; |
6368
43e274f43a9a
made NewObjectSnippets optionally load the initial mark word when initializing an object - this is disabled until the bug triggered in lusearch by this change is fixed
Doug Simon <doug.simon@oracle.com>
parents:
6364
diff
changeset
|
108 } |
43e274f43a9a
made NewObjectSnippets optionally load the initial mark word when initializing an object - this is disabled until the bug triggered in lusearch by this change is fixed
Doug Simon <doug.simon@oracle.com>
parents:
6364
diff
changeset
|
109 |
43e274f43a9a
made NewObjectSnippets optionally load the initial mark word when initializing an object - this is disabled until the bug triggered in lusearch by this change is fixed
Doug Simon <doug.simon@oracle.com>
parents:
6364
diff
changeset
|
110 @Fold |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
111 public static long arrayPrototypeMarkWord() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
112 return config().arrayPrototypeMarkWord; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
113 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
114 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
115 @Fold |
7222 | 116 public static int klassAccessFlagsOffset() { |
7227 | 117 return config().klassAccessFlagsOffset; |
7222 | 118 } |
119 | |
120 @Fold | |
121 public static int klassLayoutHelperOffset() { | |
7227 | 122 return config().klassLayoutHelperOffset; |
7222 | 123 } |
124 | |
125 @Fold | |
126 public static int arrayKlassLayoutHelperIdentifier() { | |
7227 | 127 return config().arrayKlassLayoutHelperIdentifier; |
7222 | 128 } |
129 | |
130 @Fold | |
131 public static int arrayKlassComponentMirrorOffset() { | |
7227 | 132 return config().arrayKlassComponentMirrorOffset; |
7222 | 133 } |
134 | |
135 @Fold | |
136 public static int klassSuperKlassOffset() { | |
7227 | 137 return config().klassSuperKlassOffset; |
7222 | 138 } |
139 | |
140 @Fold | |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
141 public static int markOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
142 return config().markOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
143 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
144 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
145 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
146 public static int unlockedMask() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
147 return config().unlockedMask; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
148 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
149 |
6389
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
150 /** |
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
151 * Mask for a biasable, locked or unlocked mark word. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
152 * |
6389
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
153 * <pre> |
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
154 * +----------------------------------+-+-+ |
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
155 * | 1|1|1| |
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
156 * +----------------------------------+-+-+ |
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
157 * </pre> |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
158 * |
6389
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
159 */ |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
160 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
161 public static int biasedLockMaskInPlace() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
162 return config().biasedLockMaskInPlace; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
163 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
164 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
165 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
166 public static int epochMaskInPlace() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
167 return config().epochMaskInPlace; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
168 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
169 |
6389
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
170 /** |
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
171 * Pattern for a biasable, unlocked mark word. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
172 * |
6389
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
173 * <pre> |
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
174 * +----------------------------------+-+-+ |
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
175 * | 1|0|1| |
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
176 * +----------------------------------+-+-+ |
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
177 * </pre> |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
178 * |
6389
2d84f74e394c
enabled type-filter based logging of (snippet-based) monitor operations with the "graal.monitorsnippets.log" system property
Doug Simon <doug.simon@oracle.com>
parents:
6386
diff
changeset
|
179 */ |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
180 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
181 public static int biasedLockPattern() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
182 return config().biasedLockPattern; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
183 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
184 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
185 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
186 public static int ageMaskInPlace() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
187 return config().ageMaskInPlace; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
188 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
189 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
190 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
191 public static int hubOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
192 return config().hubOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
193 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
194 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
195 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
196 public static int metaspaceArrayLengthOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
197 return config().metaspaceArrayLengthOffset; |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
198 } |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
199 |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
200 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
201 public static int metaspaceArrayBaseOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
202 return config().metaspaceArrayBaseOffset; |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
203 } |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
204 |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
205 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
206 public static int arrayLengthOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
207 return config().arrayLengthOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
208 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
209 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
210 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
211 public static int arrayBaseOffset(Kind elementKind) { |
7099
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6950
diff
changeset
|
212 return HotSpotRuntime.getArrayBaseOffset(elementKind); |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
213 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
214 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
215 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
216 public static int arrayIndexScale(Kind elementKind) { |
7099
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6950
diff
changeset
|
217 return HotSpotRuntime.getArrayIndexScale(elementKind); |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
218 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
219 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
220 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
221 public static int cardTableShift() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
222 return config().cardtableShift; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
223 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
224 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
225 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
226 public static long cardTableStart() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
227 return config().cardtableStartAddress; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
228 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
229 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
230 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
231 public static int superCheckOffsetOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
232 return config().superCheckOffsetOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
233 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
234 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
235 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
236 public static int secondarySuperCacheOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
237 return config().secondarySuperCacheOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
238 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
239 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
240 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
241 public static int secondarySupersOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
242 return config().secondarySupersOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
243 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
244 |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
245 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
246 public static int lockDisplacedMarkOffset() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
247 return config().basicLockDisplacedHeaderOffset; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
248 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
249 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
250 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
251 public static boolean useBiasedLocking() { |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
252 return config().useBiasedLocking; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
253 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
254 |
7222 | 255 @Fold |
256 static int uninitializedIdentityHashCodeValue() { | |
7227 | 257 return config().uninitializedIdentityHashCodeValue; |
7222 | 258 } |
259 | |
260 @Fold | |
261 static int identityHashCodeShift() { | |
7227 | 262 return config().identityHashCodeShift; |
7222 | 263 } |
264 | |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
265 /** |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
266 * Loads the hub from a object, null checking it first. |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
267 */ |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
268 public static Word loadHub(Object object) { |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
269 return loadHubIntrinsic(object, wordKind()); |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
270 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
271 |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
272 public static Object verifyOop(Object object) { |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
273 if (verifyOops()) { |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
274 VerifyOopStubCall.call(object); |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
275 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
276 return object; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
277 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
278 |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
279 /** |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
280 * Gets the value of the stack pointer register as a Word. |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
281 */ |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
282 public static Word stackPointer() { |
6459
a938e15e3bd7
made ReadHubNode floating
Doug Simon <doug.simon@oracle.com>
parents:
6458
diff
changeset
|
283 return HotSpotSnippetUtils.registerAsWord(stackPointerRegister()); |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
284 } |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
285 |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
286 /** |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
287 * Gets the value of the thread register as a Word. |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
288 */ |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
289 public static Word thread() { |
6459
a938e15e3bd7
made ReadHubNode floating
Doug Simon <doug.simon@oracle.com>
parents:
6458
diff
changeset
|
290 return HotSpotSnippetUtils.registerAsWord(threadRegister()); |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
291 } |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
292 |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
293 public static Word loadWordFromObject(Object object, int offset) { |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
294 return loadWordFromObjectIntrinsic(object, 0, offset, wordKind()); |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
295 } |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
296 |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
297 @NodeIntrinsic(value = RegisterNode.class, setStampFromReturnType = true) |
7556
630ea5001e33
Modified formatter settings to not insert line break after annotation on parameters.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7554
diff
changeset
|
298 public static native Word registerAsWord(@ConstantNodeParameter Register register); |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
299 |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
300 @NodeIntrinsic(value = UnsafeLoadNode.class, setStampFromReturnType = true) |
7556
630ea5001e33
Modified formatter settings to not insert line break after annotation on parameters.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7554
diff
changeset
|
301 private static native Word loadWordFromObjectIntrinsic(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter Kind wordKind); |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
302 |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
303 @NodeIntrinsic(value = LoadHubNode.class, setStampFromReturnType = true) |
7556
630ea5001e33
Modified formatter settings to not insert line break after annotation on parameters.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7554
diff
changeset
|
304 static native Word loadHubIntrinsic(Object object, @ConstantNodeParameter Kind word); |
7160
d526fa5640c8
replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7158
diff
changeset
|
305 |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
306 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
307 public static int log2WordSize() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
308 return CodeUtil.log2(wordSize()); |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
309 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
310 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
311 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
312 public static int klassStateOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
313 return config().klassStateOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
314 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
315 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
316 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
317 public static int klassModifierFlagsOffset() { |
7158
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
318 return config().klassModifierFlagsOffset; |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
319 } |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
320 |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
321 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
322 public static int klassOffset() { |
7158
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
323 return config().klassOffset; |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
324 } |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
325 |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
326 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
327 public static int classMirrorOffset() { |
7160
d526fa5640c8
replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7158
diff
changeset
|
328 return config().classMirrorOffset; |
d526fa5640c8
replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7158
diff
changeset
|
329 } |
d526fa5640c8
replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7158
diff
changeset
|
330 |
d526fa5640c8
replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7158
diff
changeset
|
331 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
332 public static int klassInstanceSizeOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
333 return config().klassInstanceSizeOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
334 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
335 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
336 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
337 public static long heapTopAddress() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
338 return config().heapTopAddress; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
339 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
340 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
341 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
342 public static long heapEndAddress() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
343 return config().heapEndAddress; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
344 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
345 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
346 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
347 public static int threadTlabStartOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
348 return config().threadTlabStartOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
349 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
350 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
351 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
352 public static long tlabIntArrayMarkWord() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
353 return config().tlabIntArrayMarkWord; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
354 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
355 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
356 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
357 public static boolean inlineContiguousAllocationSupported() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
358 return config().inlineContiguousAllocationSupported; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
359 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
360 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
361 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
362 public static int tlabAlignmentReserveInHeapWords() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
363 return config().tlabAlignmentReserve; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
364 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
365 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
366 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
367 public static int threadTlabSizeOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
368 return config().threadTlabSizeOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
369 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
370 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
371 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
372 public static int threadAllocatedBytesOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
373 return config().threadAllocatedBytesOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
374 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
375 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
376 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
377 public static int klassStateFullyInitialized() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
378 return config().klassStateFullyInitialized; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
379 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
380 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
381 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
382 public static int tlabRefillWasteLimitOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
383 return config().tlabRefillWasteLimitOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
384 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
385 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
386 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
387 public static int tlabNumberOfRefillsOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
388 return config().tlabNumberOfRefillsOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
389 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
390 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
391 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
392 public static int tlabFastRefillWasteOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
393 return config().tlabFastRefillWasteOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
394 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
395 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
396 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
397 public static int tlabSlowAllocationsOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
398 return config().tlabSlowAllocationsOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
399 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
400 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
401 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
402 public static int tlabRefillWasteIncrement() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
403 return config().tlabRefillWasteIncrement; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
404 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
405 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
406 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
407 public static boolean tlabStats() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
408 return config().tlabStats; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
409 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
410 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
411 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
412 public static int layoutHelperOffset() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
413 return config().layoutHelperOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
414 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
415 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
416 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
417 public static int layoutHelperHeaderSizeShift() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
418 return config().layoutHelperHeaderSizeShift; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
419 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
420 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
421 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
422 public static int layoutHelperHeaderSizeMask() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
423 return config().layoutHelperHeaderSizeMask; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
424 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
425 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
426 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
427 public static int layoutHelperLog2ElementSizeShift() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
428 return config().layoutHelperLog2ElementSizeShift; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
429 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
430 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
431 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
432 public static int layoutHelperLog2ElementSizeMask() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
433 return config().layoutHelperLog2ElementSizeMask; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
434 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
435 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
436 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
437 public static int layoutHelperElementTypeShift() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
438 return config().layoutHelperElementTypeShift; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
439 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
440 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
441 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
442 public static int layoutHelperElementTypeMask() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
443 return config().layoutHelperElementTypeMask; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
444 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
445 |
7760
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
446 @Fold |
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
447 public static int layoutHelperElementTypePrimitiveInPlace() { |
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
448 System.out.println(String.format("%x", config().layoutHelperElementTypePrimitiveInPlace)); |
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
449 return config().layoutHelperElementTypePrimitiveInPlace; |
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
450 } |
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
451 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
452 static { |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
453 assert arrayIndexScale(Kind.Byte) == 1; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
454 assert arrayIndexScale(Kind.Boolean) == 1; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
455 assert arrayIndexScale(Kind.Char) == 2; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
456 assert arrayIndexScale(Kind.Short) == 2; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
457 assert arrayIndexScale(Kind.Int) == 4; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
458 assert arrayIndexScale(Kind.Long) == 8; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
459 assert arrayIndexScale(Kind.Float) == 4; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
460 assert arrayIndexScale(Kind.Double) == 8; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
461 } |
7543
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
462 |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
463 static int computeHashCode(Object x) { |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
464 Word mark = loadWordFromObject(x, markOffset()); |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
465 |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
466 // this code is independent from biased locking (although it does not look that way) |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
467 final Word biasedLock = mark.and(biasedLockMaskInPlace()); |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7556
diff
changeset
|
468 if (biasedLock.equal(Word.unsigned(unlockedMask()))) { |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7543
diff
changeset
|
469 probability(FAST_PATH_PROBABILITY); |
7543
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
470 int hash = (int) mark.unsignedShiftRight(identityHashCodeShift()).rawValue(); |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
471 if (hash != uninitializedIdentityHashCodeValue()) { |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7543
diff
changeset
|
472 probability(FAST_PATH_PROBABILITY); |
7543
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
473 return hash; |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
474 } |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
475 } |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
476 |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
477 return IdentityHashCodeStubCall.call(x); |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
478 } |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
479 } |