annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java @ 18502:f38677340519

Add memory operations to MetaspacePointer
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Tue, 25 Nov 2014 08:17:33 -0800
parents e7ab82e7cc37
children 8b87897f5b42
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
18362
ea0fbb571466 Use pointer stamps in LoadHub and LoadMethod.
Roland Schatz <roland.schatz@oracle.com>
parents: 18341
diff changeset
2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
6362
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 */
8415
2361bf148c06 rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents: 8354
diff changeset
23 package com.oracle.graal.hotspot.replacements;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
15291
471e28b8f03b Move UnsafeAccess to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents: 15193
diff changeset
25 import static com.oracle.graal.compiler.common.UnsafeAccess.*;
8472
f71fec3fadae made method substitutions for Thread be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
26 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*;
13582
be5006687c43 Add initialization checks to Unsafe.allocateInstance intrinsic
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13520
diff changeset
27 import static com.oracle.graal.hotspot.meta.HotSpotForeignCallsProviderImpl.*;
10787
388fbd0dd4a4 moved BranchNodeProbabilities to graal.nodes project
Doug Simon <doug.simon@oracle.com>
parents: 10745
diff changeset
28 import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*;
7543
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
29
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
30 import com.oracle.graal.api.code.*;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 import com.oracle.graal.api.meta.*;
18370
6713fef8c859 Make the @Fold annotation a top-level interface in the api project. It is not tied to the Snippet class where it was located before.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 18362
diff changeset
32 import com.oracle.graal.api.replacements.*;
15193
96bb07a5d667 Spit up and move GraalInternalError.
Josef Eisl <josef.eisl@jku.at>
parents: 15104
diff changeset
33 import com.oracle.graal.compiler.common.*;
6419
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
34 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
35 import com.oracle.graal.graph.Node.NodeIntrinsic;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
36 import com.oracle.graal.hotspot.*;
18380
ed0fce2e999a Fold klass._java_mirror._klass into klass and improve stamps from layout_helper
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18370
diff changeset
37 import com.oracle.graal.hotspot.nodes.*;
18401
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
38 import com.oracle.graal.hotspot.word.*;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
39 import com.oracle.graal.nodes.extended.*;
16084
b37dbfdfbbfb assertion mechanism for snippets and stubs
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16018
diff changeset
40 import com.oracle.graal.replacements.*;
8415
2361bf148c06 rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents: 8354
diff changeset
41 import com.oracle.graal.replacements.nodes.*;
7300
2912b72d840a More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents: 7275
diff changeset
42 import com.oracle.graal.word.*;
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 //JaCoCo Exclude
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
45
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
46 /**
9513
659bb6cf930c rename: HotSpotSnippetUtils -> HotSpotReplacementsUtil
Doug Simon <doug.simon@oracle.com>
parents: 9471
diff changeset
47 * A collection of methods used in HotSpot snippets, substitutions and stubs.
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
48 */
9513
659bb6cf930c rename: HotSpotSnippetUtils -> HotSpotReplacementsUtil
Doug Simon <doug.simon@oracle.com>
parents: 9471
diff changeset
49 public class HotSpotReplacementsUtil {
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
50
14125
e09829e6680f implement initial security model for Graal (JBS:GRAAL-22)
Doug Simon <doug.simon@oracle.com>
parents: 13933
diff changeset
51 // Must be @Fold as the security checks in HotSpotGraalRuntime.runtime()
e09829e6680f implement initial security model for Graal (JBS:GRAAL-22)
Doug Simon <doug.simon@oracle.com>
parents: 13933
diff changeset
52 // don't work well inside snippets
e09829e6680f implement initial security model for Graal (JBS:GRAAL-22)
Doug Simon <doug.simon@oracle.com>
parents: 13933
diff changeset
53 @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
54 public static HotSpotVMConfig config() {
12431
7080a96be216 rename: graalRuntime -> runtime, getGraalRuntime -> getRuntime
Doug Simon <doug.simon@oracle.com>
parents: 12429
diff changeset
55 return runtime().getConfig();
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 }
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
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
58 @Fold
8502
ff4fa8b0516e -Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
59 public static boolean useTLAB() {
ff4fa8b0516e -Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
60 return config().useTLAB;
ff4fa8b0516e -Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
61 }
ff4fa8b0516e -Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
62
ff4fa8b0516e -Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
63 @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
64 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
65 return config().verifyOops;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
66 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
67
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
68 public static final LocationIdentity EXCEPTION_OOP_LOCATION = NamedLocationIdentity.mutable("ExceptionOop");
8643
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
69
9517
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
70 /**
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
71 * @see HotSpotVMConfig#threadExceptionOopOffset
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
72 */
8643
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
73 @Fold
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
74 public static int threadExceptionOopOffset() {
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
75 return config().threadExceptionOopOffset;
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
76 }
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
77
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
78 public static final LocationIdentity EXCEPTION_PC_LOCATION = NamedLocationIdentity.mutable("ExceptionPc");
8643
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
79
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
80 @Fold
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
81 public static int threadExceptionPcOffset() {
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
82 return config().threadExceptionPcOffset;
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
83 }
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
84
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
85 public static final LocationIdentity LAST_JAVA_PC_LOCATION = NamedLocationIdentity.mutable("LastJavaPc");
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
86
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
87 @Fold
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
88 public static int threadLastJavaPcOffset() {
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
89 return config().threadLastJavaPcOffset();
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
90 }
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
91
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
92 public static final LocationIdentity LAST_JAVA_FP_LOCATION = NamedLocationIdentity.mutable("LastJavaFp");
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
93
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
94 @Fold
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
95 public static int threadLastJavaFpOffset() {
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
96 return config().threadLastJavaFpOffset();
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
97 }
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
98
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
99 public static final LocationIdentity TLAB_TOP_LOCATION = NamedLocationIdentity.mutable("TlabTop");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
100
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
101 @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
102 public static int threadTlabTopOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
103 return config().threadTlabTopOffset();
6362
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
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
106 public static final LocationIdentity TLAB_END_LOCATION = NamedLocationIdentity.mutable("TlabEnd");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
107
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
108 @Fold
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
109 private static int threadTlabEndOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
110 return config().threadTlabEndOffset();
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
111 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
112
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
113 public static final LocationIdentity TLAB_START_LOCATION = NamedLocationIdentity.mutable("TlabStart");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
114
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
115 @Fold
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
116 private static int threadTlabStartOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
117 return config().threadTlabStartOffset();
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
118 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
119
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
120 public static final LocationIdentity PENDING_EXCEPTION_LOCATION = NamedLocationIdentity.mutable("PendingException");
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
121
9517
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
122 /**
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
123 * @see HotSpotVMConfig#pendingExceptionOffset
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
124 */
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
125 @Fold
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
126 private static int threadPendingExceptionOffset() {
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
127 return config().pendingExceptionOffset;
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
128 }
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
129
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
130 public static final LocationIdentity PENDING_DEOPTIMIZATION_LOCATION = NamedLocationIdentity.mutable("PendingDeoptimization");
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
131
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
132 /**
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
133 * @see HotSpotVMConfig#pendingDeoptimizationOffset
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
134 */
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
135 @Fold
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
136 private static int threadPendingDeoptimizationOffset() {
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
137 return config().pendingDeoptimizationOffset;
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
138 }
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
139
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
140 public static final LocationIdentity OBJECT_RESULT_LOCATION = NamedLocationIdentity.mutable("ObjectResult");
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
141
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
142 @Fold
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
143 private static int objectResultOffset() {
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
144 return config().threadObjectResultOffset;
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
145 }
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
146
9517
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
147 /**
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
148 * @see HotSpotVMConfig#threadExceptionOopOffset
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
149 */
8643
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
150 public static Object readExceptionOop(Word thread) {
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
151 return thread.readObject(threadExceptionOopOffset(), EXCEPTION_OOP_LOCATION);
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
152 }
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
153
9471
5fa54bf57f8c replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9352
diff changeset
154 public static Word readExceptionPc(Word thread) {
9517
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
155 return thread.readWord(threadExceptionPcOffset(), EXCEPTION_PC_LOCATION);
9471
5fa54bf57f8c replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9352
diff changeset
156 }
5fa54bf57f8c replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9352
diff changeset
157
9517
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
158 /**
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
159 * @see HotSpotVMConfig#threadExceptionOopOffset
51973e9ec004 added comments clarifying the difference between _exception_oop and _pending_exception in the HotSpot Thread class
Doug Simon <doug.simon@oracle.com>
parents: 9513
diff changeset
160 */
8643
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
161 public static void writeExceptionOop(Word thread, Object value) {
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
162 thread.writeObject(threadExceptionOopOffset(), value, EXCEPTION_OOP_LOCATION);
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
163 }
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
164
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
165 public static void writeExceptionPc(Word thread, Word value) {
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
166 thread.writeWord(threadExceptionPcOffset(), value, EXCEPTION_PC_LOCATION);
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
167 }
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
168
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
169 public static void writeLastJavaPc(Word thread, Word value) {
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
170 thread.writeWord(threadLastJavaPcOffset(), value, LAST_JAVA_PC_LOCATION);
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
171 }
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
172
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
173 public static void writeLastJavaFp(Word thread, Word value) {
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
174 thread.writeWord(threadLastJavaFpOffset(), value, LAST_JAVA_FP_LOCATION);
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
175 }
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
176
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
177 public static Word readTlabTop(Word thread) {
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
178 return thread.readWord(threadTlabTopOffset(), TLAB_TOP_LOCATION);
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
179 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
180
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
181 public static Word readTlabEnd(Word thread) {
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
182 return thread.readWord(threadTlabEndOffset(), TLAB_END_LOCATION);
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
183 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
184
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
185 public static Word readTlabStart(Word thread) {
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
186 return thread.readWord(threadTlabStartOffset(), TLAB_START_LOCATION);
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
187 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
188
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
189 public static void writeTlabTop(Word thread, Word top) {
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
190 thread.writeWord(threadTlabTopOffset(), top, TLAB_TOP_LOCATION);
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
191 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
192
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
193 public static void initializeTlab(Word thread, Word start, Word end) {
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
194 thread.writeWord(threadTlabStartOffset(), start, TLAB_START_LOCATION);
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
195 thread.writeWord(threadTlabTopOffset(), start, TLAB_TOP_LOCATION);
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
196 thread.writeWord(threadTlabEndOffset(), end, TLAB_END_LOCATION);
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
197 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
198
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
199 /**
9471
5fa54bf57f8c replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9352
diff changeset
200 * Clears the pending exception for the given thread.
14996
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
201 *
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
202 * @return {@code true} if there was a pending exception
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
203 */
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
204 public static boolean clearPendingException(Word thread) {
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
205 boolean result = thread.readObject(threadPendingExceptionOffset(), PENDING_EXCEPTION_LOCATION) != null;
11549
794127021076 pending exception: use locations on a write
Bernhard Urban <bernhard.urban@jku.at>
parents: 11337
diff changeset
206 thread.writeObject(threadPendingExceptionOffset(), null, PENDING_EXCEPTION_LOCATION);
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
207 return result;
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
208 }
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
209
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
210 /**
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
211 * Reads the pending deoptimization value for the given thread.
16018
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
212 *
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
213 * @return {@code true} if there was a pending deoptimization
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
214 */
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
215 public static int readPendingDeoptimization(Word thread) {
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
216 return thread.readInt(threadPendingDeoptimizationOffset(), PENDING_DEOPTIMIZATION_LOCATION);
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
217 }
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
218
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
219 /**
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
220 * Writes the pending deoptimization value for the given thread.
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
221 */
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
222 public static void writePendingDeoptimization(Word thread, int value) {
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
223 thread.writeInt(threadPendingDeoptimizationOffset(), value, PENDING_DEOPTIMIZATION_LOCATION);
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
224 }
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
225
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
226 /**
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
227 * Gets and clears the object result from a runtime call stored in a thread local.
14996
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
228 *
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
229 * @return the object that was in the thread local
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
230 */
9352
d4684b468e93 made NewInstanceStub a RuntimeStub that directly calls the C runtime (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9339
diff changeset
231 public static Object getAndClearObjectResult(Word thread) {
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
232 Object result = thread.readObject(objectResultOffset(), OBJECT_RESULT_LOCATION);
11549
794127021076 pending exception: use locations on a write
Bernhard Urban <bernhard.urban@jku.at>
parents: 11337
diff changeset
233 thread.writeObject(objectResultOffset(), null, OBJECT_RESULT_LOCATION);
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
234 return result;
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
235 }
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9289
diff changeset
236
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
237 public static final LocationIdentity JAVA_THREAD_THREAD_OBJECT_LOCATION = NamedLocationIdentity.mutable("JavaThread::_threadObj");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
238
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
239 @Fold
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
240 public static int threadObjectOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
241 return config().threadObjectOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
242 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
243
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
244 public static final LocationIdentity JAVA_THREAD_OSTHREAD_LOCATION = NamedLocationIdentity.mutable("JavaThread::_osthread");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
245
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
246 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
247 public static int osThreadOffset() {
8451
2ffd472c5d25 Backed out changeset: 10293cbfc2b6
Doug Simon <doug.simon@oracle.com>
parents: 8436
diff changeset
248 return config().osThreadOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
249 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
250
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
251 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
252 public static int osThreadInterruptedOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
253 return config().osThreadInterruptedOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
254 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
255
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
256 @Fold
9793
b4f12c603be5 added support for the runtime to specify for each foreign call whether it is re-executable and what memory locations it kills
Doug Simon <doug.simon@oracle.com>
parents: 9792
diff changeset
257 public static Kind getWordKind() {
12431
7080a96be216 rename: graalRuntime -> runtime, getGraalRuntime -> getRuntime
Doug Simon <doug.simon@oracle.com>
parents: 12429
diff changeset
258 return runtime().getTarget().wordKind;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
259 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
260
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
261 @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
262 public static int wordSize() {
12431
7080a96be216 rename: graalRuntime -> runtime, getGraalRuntime -> getRuntime
Doug Simon <doug.simon@oracle.com>
parents: 12429
diff changeset
263 return runtime().getTarget().wordSize;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
264 }
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 @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
267 public static int pageSize() {
16395
ad431bf0de07 added support to load classes from graal.jar with a separate class loader
Doug Simon <doug.simon@oracle.com>
parents: 16386
diff changeset
268 return unsafe.pageSize();
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
269 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
270
13933
ebd2dfc2b780 use hotspot stubs for primitive arraycopy calls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13895
diff changeset
271 @Fold
ebd2dfc2b780 use hotspot stubs for primitive arraycopy calls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13895
diff changeset
272 public static int heapWordSize() {
ebd2dfc2b780 use hotspot stubs for primitive arraycopy calls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13895
diff changeset
273 return config().heapWordSize;
ebd2dfc2b780 use hotspot stubs for primitive arraycopy calls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13895
diff changeset
274 }
ebd2dfc2b780 use hotspot stubs for primitive arraycopy calls
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13895
diff changeset
275
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
276 public static final LocationIdentity PROTOTYPE_MARK_WORD_LOCATION = NamedLocationIdentity.mutable("PrototypeMarkWord");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
277
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
278 @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
279 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
280 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
281 }
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
282
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
283 @Fold
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
284 public static long arrayPrototypeMarkWord() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
285 return config().arrayPrototypeMarkWord();
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
286 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
287
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
288 public static final LocationIdentity KLASS_ACCESS_FLAGS_LOCATION = NamedLocationIdentity.immutable("Klass::_access_flags");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
289
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
290 @Fold
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
291 public static int klassAccessFlagsOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
292 return config().klassAccessFlagsOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
293 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
294
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
295 public static final LocationIdentity KLASS_LAYOUT_HELPER_LOCATION = NamedLocationIdentity.immutable("Klass::_layout_helper");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
296
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
297 @Fold
13261
0ffe9e4bb364 don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents: 12793
diff changeset
298 public static int klassLayoutHelperOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
299 return config().klassLayoutHelperOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
300 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
301
18401
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
302 public static int readLayoutHelper(KlassPointer hub) {
18380
ed0fce2e999a Fold klass._java_mirror._klass into klass and improve stamps from layout_helper
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18370
diff changeset
303 // return hub.readInt(klassLayoutHelperOffset(), KLASS_LAYOUT_HELPER_LOCATION);
ed0fce2e999a Fold klass._java_mirror._klass into klass and improve stamps from layout_helper
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18370
diff changeset
304 GuardingNode anchorNode = SnippetAnchorNode.anchor();
ed0fce2e999a Fold klass._java_mirror._klass into klass and improve stamps from layout_helper
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18370
diff changeset
305 return loadKlassLayoutHelperIntrinsic(hub, anchorNode);
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
306 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
307
18380
ed0fce2e999a Fold klass._java_mirror._klass into klass and improve stamps from layout_helper
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18370
diff changeset
308 @NodeIntrinsic(value = KlassLayoutHelperNode.class)
18401
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
309 public static native int loadKlassLayoutHelperIntrinsic(KlassPointer object, GuardingNode anchor);
18380
ed0fce2e999a Fold klass._java_mirror._klass into klass and improve stamps from layout_helper
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18370
diff changeset
310
ed0fce2e999a Fold klass._java_mirror._klass into klass and improve stamps from layout_helper
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18370
diff changeset
311 @NodeIntrinsic(value = KlassLayoutHelperNode.class)
18401
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
312 public static native int loadKlassLayoutHelperIntrinsic(KlassPointer object);
18380
ed0fce2e999a Fold klass._java_mirror._klass into klass and improve stamps from layout_helper
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18370
diff changeset
313
13593
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
314 /**
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
315 * Checks if class {@code klass} is an array.
14996
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
316 *
13593
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
317 * See: Klass::layout_helper_is_array
14996
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
318 *
13593
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
319 * @param klass the class to be checked
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
320 * @return true if klass is an array, false otherwise
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
321 */
18401
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
322 public static boolean klassIsArray(KlassPointer klass) {
13593
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
323 /*
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
324 * The less-than check only works if both values are ints. We use local variables to make
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
325 * sure these are still ints and haven't changed.
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
326 */
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
327 final int layoutHelper = readLayoutHelper(klass);
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
328 final int layoutHelperNeutralValue = config().klassLayoutHelperNeutralValue;
24353c21ef34 slightly better (denser) Class.isArray check
twisti
parents: 13582
diff changeset
329 return (layoutHelper < layoutHelperNeutralValue);
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
330 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
331
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
332 public static final LocationIdentity ARRAY_KLASS_COMPONENT_MIRROR = NamedLocationIdentity.immutable("ArrayKlass::_component_mirror");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
333
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
334 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
335 public static int arrayKlassComponentMirrorOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
336 return config().arrayKlassComponentMirrorOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
337 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
338
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
339 public static final LocationIdentity KLASS_SUPER_KLASS_LOCATION = NamedLocationIdentity.immutable("Klass::_super");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
340
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
341 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
342 public static int klassSuperKlassOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
343 return config().klassSuperKlassOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
344 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
345
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
346 public static final LocationIdentity MARK_WORD_LOCATION = NamedLocationIdentity.mutable("MarkWord");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
347
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
348 @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
349 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
350 return config().markOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
351 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
352
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
353 public static final LocationIdentity HUB_WRITE_LOCATION = NamedLocationIdentity.mutable("Hub:write");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
354
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
355 public static final LocationIdentity HUB_LOCATION = NamedLocationIdentity.immutable("Hub");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
356
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
357 @Fold
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
358 private static int hubOffset() {
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
359 return config().hubOffset;
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
360 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
361
18401
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
362 public static void initializeObjectHeader(Word memory, Word markWord, KlassPointer hub) {
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
363 memory.writeWord(markOffset(), markWord, MARK_WORD_LOCATION);
13520
fb7b39f07232 Embed compressed constants when possible and use more efficient patterns for encoding
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13261
diff changeset
364 StoreHubNode.write(memory, hub);
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
365 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
366
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
367 @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
368 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
369 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
370 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
371
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
372 /**
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
373 * Mask for a biasable, locked or unlocked mark word.
14996
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
374 *
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
375 * <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
376 * +----------------------------------+-+-+
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
377 * | 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
378 * +----------------------------------+-+-+
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
379 * </pre>
14996
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
380 *
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
381 */
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
382 @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
383 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
384 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
385 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
386
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
387 @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
388 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
389 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
390 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
391
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
392 /**
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
393 * Pattern for a biasable, unlocked mark word.
14996
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
394 *
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
395 * <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
396 * +----------------------------------+-+-+
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
397 * | 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
398 * +----------------------------------+-+-+
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
399 * </pre>
14996
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
400 *
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
401 */
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
402 @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
403 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
404 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
405 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
406
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
407 @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
408 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
409 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
410 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
411
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
412 @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
413 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
414 return config().metaspaceArrayLengthOffset;
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
415 }
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
416
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
417 @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
418 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
419 return config().metaspaceArrayBaseOffset;
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
420 }
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
421
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
422 @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
423 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
424 return config().arrayLengthOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
425 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
426
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
427 @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
428 public static int arrayBaseOffset(Kind elementKind) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12372
diff changeset
429 return HotSpotGraalRuntime.getArrayBaseOffset(elementKind);
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
430 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
431
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
432 @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
433 public static int arrayIndexScale(Kind elementKind) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12372
diff changeset
434 return HotSpotGraalRuntime.getArrayIndexScale(elementKind);
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
435 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
436
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
437 @Fold
10745
cbaf26740df8 Method renaming
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10734
diff changeset
438 public static int instanceHeaderSize() {
12356
359f7e70ae7f Reduce HotSpot diff and fix previous merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11923
diff changeset
439 return config().useCompressedClassPointers ? (2 * wordSize()) - 4 : 2 * wordSize();
10717
0517026315a0 Adjust header size to compressed klass pointers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10638
diff changeset
440 }
0517026315a0 Adjust header size to compressed klass pointers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10638
diff changeset
441
0517026315a0 Adjust header size to compressed klass pointers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10638
diff changeset
442 @Fold
16018
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
443 public static byte dirtyCardValue() {
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
444 return config().dirtyCardValue;
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
445 }
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
446
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
447 @Fold
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
448 public static byte g1YoungCardValue() {
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
449 return config().g1YoungCardValue;
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
450 }
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
451
6a62ccbd1658 add support for new G1 marking behavior
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15291
diff changeset
452 @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
453 public static int cardTableShift() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
454 return config().cardtableShift();
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
455 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
456
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
457 @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
458 public static long cardTableStart() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
459 return config().cardtableStartAddress();
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
460 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
461
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
462 @Fold
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
463 public static int g1CardQueueIndexOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
464 return config().g1CardQueueIndexOffset();
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
465 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
466
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
467 @Fold
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
468 public static int g1CardQueueBufferOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
469 return config().g1CardQueueBufferOffset();
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
470 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
471
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
472 @Fold
10519
3891371b2a3b Method renaming
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10026
diff changeset
473 public static int logOfHeapRegionGrainBytes() {
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
474 return config().logOfHRGrainBytes;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
475 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
476
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
477 @Fold
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
478 public static int g1SATBQueueMarkingOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
479 return config().g1SATBQueueMarkingOffset();
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
480 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
481
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
482 @Fold
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
483 public static int g1SATBQueueIndexOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
484 return config().g1SATBQueueIndexOffset();
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
485 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
486
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
487 @Fold
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
488 public static int g1SATBQueueBufferOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
489 return config().g1SATBQueueBufferOffset();
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
490 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
491
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
492 public static final LocationIdentity KLASS_SUPER_CHECK_OFFSET_LOCATION = NamedLocationIdentity.immutable("Klass::_super_check_offset");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
493
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
494 @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
495 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
496 return config().superCheckOffsetOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
497 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
498
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
499 public static final LocationIdentity SECONDARY_SUPER_CACHE_LOCATION = NamedLocationIdentity.mutable("SecondarySuperCache");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
500
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
501 @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
502 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
503 return config().secondarySuperCacheOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
504 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
505
18340
a0381103324b More folding of constant classes and NodeClass references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18307
diff changeset
506 public static final LocationIdentity SECONDARY_SUPERS_LOCATION = NamedLocationIdentity.immutable("SecondarySupers");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
507
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
508 @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
509 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
510 return config().secondarySupersOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
511 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
512
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
513 public static final LocationIdentity DISPLACED_MARK_WORD_LOCATION = NamedLocationIdentity.mutable("DisplacedMarkWord");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
514
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
515 @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
516 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
517 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
518 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
519
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
520 @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
521 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
522 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
523 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
524
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
525 @Fold
12365
ee746f35ae17 Delegate deferred barrier arguments to graal
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 11549
diff changeset
526 public static boolean useDeferredInitBarriers() {
ee746f35ae17 Delegate deferred barrier arguments to graal
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 11549
diff changeset
527 return config().useDeferredInitBarriers;
ee746f35ae17 Delegate deferred barrier arguments to graal
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 11549
diff changeset
528 }
ee746f35ae17 Delegate deferred barrier arguments to graal
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 11549
diff changeset
529
ee746f35ae17 Delegate deferred barrier arguments to graal
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 11549
diff changeset
530 @Fold
8501
41fc46da946a -More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8492
diff changeset
531 public static boolean useG1GC() {
41fc46da946a -More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8492
diff changeset
532 return config().useG1GC;
41fc46da946a -More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8492
diff changeset
533 }
41fc46da946a -More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8492
diff changeset
534
41fc46da946a -More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8492
diff changeset
535 @Fold
11218
db33e696de4d Add util method for gc
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10798
diff changeset
536 public static boolean useCompressedOops() {
db33e696de4d Add util method for gc
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10798
diff changeset
537 return config().useCompressedOops;
db33e696de4d Add util method for gc
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10798
diff changeset
538 }
db33e696de4d Add util method for gc
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10798
diff changeset
539
db33e696de4d Add util method for gc
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10798
diff changeset
540 @Fold
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
541 static int uninitializedIdentityHashCodeValue() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
542 return config().uninitializedIdentityHashCodeValue;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
543 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
544
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
545 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
546 static int identityHashCodeShift() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
547 return config().identityHashCodeShift;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
548 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
549
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
550 /**
10637
ba1fbbfac0cd remove null check semantics from LoadHubNode (GRAAL-248)
Doug Simon <doug.simon@oracle.com>
parents: 10519
diff changeset
551 * Loads the hub of an object (without null checking it first).
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
552 */
18401
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
553 public static KlassPointer loadHub(Object object) {
18380
ed0fce2e999a Fold klass._java_mirror._klass into klass and improve stamps from layout_helper
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18370
diff changeset
554 return loadHubIntrinsic(object);
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
555 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
556
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
557 public static Object verifyOop(Object object) {
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
558 if (verifyOops()) {
9773
8a1b0a3d4fc3 replaced VerifyOopStubCall with usage of ForeignCallNode
Doug Simon <doug.simon@oracle.com>
parents: 9746
diff changeset
559 verifyOopStub(VERIFY_OOP, object);
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
560 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
561 return object;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
562 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
563
9773
8a1b0a3d4fc3 replaced VerifyOopStubCall with usage of ForeignCallNode
Doug Simon <doug.simon@oracle.com>
parents: 9746
diff changeset
564 @NodeIntrinsic(ForeignCallNode.class)
8a1b0a3d4fc3 replaced VerifyOopStubCall with usage of ForeignCallNode
Doug Simon <doug.simon@oracle.com>
parents: 9746
diff changeset
565 private static native Object verifyOopStub(@ConstantNodeParameter ForeignCallDescriptor descriptor, Object object);
8a1b0a3d4fc3 replaced VerifyOopStubCall with usage of ForeignCallNode
Doug Simon <doug.simon@oracle.com>
parents: 9746
diff changeset
566
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
567 public static Word loadWordFromObject(Object object, int offset) {
16084
b37dbfdfbbfb assertion mechanism for snippets and stubs
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16018
diff changeset
568 ReplacementsUtil.staticAssert(offset != hubOffset(), "Use loadHubIntrinsic instead of loadWordFromObject");
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12456
diff changeset
569 return loadWordFromObjectIntrinsic(object, offset, getWordKind(), LocationIdentity.ANY_LOCATION);
6419
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
570 }
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
571
18340
a0381103324b More folding of constant classes and NodeClass references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18307
diff changeset
572 public static Word loadWordFromObject(Object object, int offset, LocationIdentity identity) {
a0381103324b More folding of constant classes and NodeClass references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18307
diff changeset
573 ReplacementsUtil.staticAssert(offset != hubOffset(), "Use loadHubIntrinsic instead of loadWordFromObject");
a0381103324b More folding of constant classes and NodeClass references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18307
diff changeset
574 return loadWordFromObjectIntrinsic(object, offset, getWordKind(), identity);
a0381103324b More folding of constant classes and NodeClass references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18307
diff changeset
575 }
a0381103324b More folding of constant classes and NodeClass references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18307
diff changeset
576
12792
be9c3426daad pass thread register into allocation stubs instead of getting it from the host provider
Doug Simon <doug.simon@oracle.com>
parents: 12788
diff changeset
577 /**
be9c3426daad pass thread register into allocation stubs instead of getting it from the host provider
Doug Simon <doug.simon@oracle.com>
parents: 12788
diff changeset
578 * Reads the value of a given register.
14996
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
579 *
12792
be9c3426daad pass thread register into allocation stubs instead of getting it from the host provider
Doug Simon <doug.simon@oracle.com>
parents: 12788
diff changeset
580 * @param register a register which must not be available to the register allocator
be9c3426daad pass thread register into allocation stubs instead of getting it from the host provider
Doug Simon <doug.simon@oracle.com>
parents: 12788
diff changeset
581 * @return the value of {@code register} as a word
be9c3426daad pass thread register into allocation stubs instead of getting it from the host provider
Doug Simon <doug.simon@oracle.com>
parents: 12788
diff changeset
582 */
12788
100d20e8d460 pass thread register into monitorenter snippet instead of getting it from the host provider
Doug Simon <doug.simon@oracle.com>
parents: 12786
diff changeset
583 public static Word registerAsWord(@ConstantNodeParameter Register register) {
100d20e8d460 pass thread register into monitorenter snippet instead of getting it from the host provider
Doug Simon <doug.simon@oracle.com>
parents: 12786
diff changeset
584 return registerAsWord(register, true, false);
100d20e8d460 pass thread register into monitorenter snippet instead of getting it from the host provider
Doug Simon <doug.simon@oracle.com>
parents: 12786
diff changeset
585 }
100d20e8d460 pass thread register into monitorenter snippet instead of getting it from the host provider
Doug Simon <doug.simon@oracle.com>
parents: 12786
diff changeset
586
8354
55ef03d64f03 Generalize read and write of fixed register for snippets. Move to HotSpot-independent project.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 7902
diff changeset
587 @NodeIntrinsic(value = ReadRegisterNode.class, setStampFromReturnType = true)
55ef03d64f03 Generalize read and write of fixed register for snippets. Move to HotSpot-independent project.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 7902
diff changeset
588 public static native Word registerAsWord(@ConstantNodeParameter Register register, @ConstantNodeParameter boolean directUse, @ConstantNodeParameter boolean incoming);
6419
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
589
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
590 @NodeIntrinsic(value = WriteRegisterNode.class, setStampFromReturnType = true)
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
591 public static native void writeRegisterAsWord(@ConstantNodeParameter Register register, Word value);
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15052
diff changeset
592
8472
f71fec3fadae made method substitutions for Thread be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
593 @SuppressWarnings("unused")
6419
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
594 @NodeIntrinsic(value = UnsafeLoadNode.class, setStampFromReturnType = true)
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12456
diff changeset
595 private static Word loadWordFromObjectIntrinsic(Object object, long offset, @ConstantNodeParameter Kind wordKind, @ConstantNodeParameter LocationIdentity locationIdentity) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11549
diff changeset
596 return Word.unsigned(unsafeReadWord(object, offset));
8472
f71fec3fadae made method substitutions for Thread be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
597 }
6419
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
598
8479
a6ba61be2b5f made method substitutions for Object be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8472
diff changeset
599 @SuppressWarnings("unused")
18362
ea0fbb571466 Use pointer stamps in LoadHub and LoadMethod.
Roland Schatz <roland.schatz@oracle.com>
parents: 18341
diff changeset
600 @NodeIntrinsic(value = LoadHubNode.class)
18401
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
601 public static KlassPointer loadHubIntrinsic(Object object, GuardingNode anchor) {
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
602 return KlassPointer.fromWord(Word.unsigned(unsafeReadKlassPointer(object)));
8479
a6ba61be2b5f made method substitutions for Object be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8472
diff changeset
603 }
7160
d526fa5640c8 replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7158
diff changeset
604
18362
ea0fbb571466 Use pointer stamps in LoadHub and LoadMethod.
Roland Schatz <roland.schatz@oracle.com>
parents: 18341
diff changeset
605 @NodeIntrinsic(value = LoadHubNode.class)
18401
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
606 public static KlassPointer loadHubIntrinsic(Object object) {
e7ab82e7cc37 Move metaspace pointer handling to hotspot specific WordTypeRewriter.
Roland Schatz <roland.schatz@oracle.com>
parents: 18380
diff changeset
607 return KlassPointer.fromWord(Word.unsigned(unsafeReadKlassPointer(object)));
14996
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
608 }
88d77743dff3 do not implicitly set guard to null in LoadHubNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 14125
diff changeset
609
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
610 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
611 public static int log2WordSize() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
612 return CodeUtil.log2(wordSize());
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
613 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
614
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
615 public static final LocationIdentity CLASS_STATE_LOCATION = NamedLocationIdentity.mutable("ClassState");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
616
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
617 @Fold
16386
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
618 public static int instanceKlassInitStateOffset() {
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
619 return config().instanceKlassInitStateOffset;
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
620 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
621
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
622 @Fold
16386
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
623 public static int instanceKlassStateFullyInitialized() {
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
624 return config().instanceKlassStateFullyInitialized;
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
625 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
626
16386
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
627 /**
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
628 *
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
629 * @param hub the hub of an InstanceKlass
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
630 * @return true is the InstanceKlass represented by hub is fully initialized
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
631 */
18502
f38677340519 Add memory operations to MetaspacePointer
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18401
diff changeset
632 public static boolean isInstanceKlassFullyInitialized(KlassPointer hub) {
16386
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
633 return readInstanceKlassState(hub) == instanceKlassStateFullyInitialized();
13582
be5006687c43 Add initialization checks to Unsafe.allocateInstance intrinsic
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13520
diff changeset
634 }
be5006687c43 Add initialization checks to Unsafe.allocateInstance intrinsic
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13520
diff changeset
635
18502
f38677340519 Add memory operations to MetaspacePointer
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18401
diff changeset
636 private static byte readInstanceKlassState(KlassPointer hub) {
16386
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
637 return hub.readByte(instanceKlassInitStateOffset(), CLASS_STATE_LOCATION);
13582
be5006687c43 Add initialization checks to Unsafe.allocateInstance intrinsic
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13520
diff changeset
638 }
be5006687c43 Add initialization checks to Unsafe.allocateInstance intrinsic
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13520
diff changeset
639
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
640 public static final LocationIdentity KLASS_MODIFIER_FLAGS_LOCATION = NamedLocationIdentity.immutable("Klass::_modifier_flags");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
641
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
642 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
643 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
644 return config().klassModifierFlagsOffset;
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
645 }
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
646
18340
a0381103324b More folding of constant classes and NodeClass references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18307
diff changeset
647 public static final LocationIdentity CLASS_KLASS_LOCATION = NamedLocationIdentity.immutable("Class._klass");
a0381103324b More folding of constant classes and NodeClass references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18307
diff changeset
648
7158
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
649 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
650 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
651 return config().klassOffset;
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
652 }
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
653
18341
8169f68e9530 Class._array_klass is not immutable
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18340
diff changeset
654 public static final LocationIdentity CLASS_ARRAY_KLASS_LOCATION = NamedLocationIdentity.mutable("Class._array_klass");
18340
a0381103324b More folding of constant classes and NodeClass references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18307
diff changeset
655
7158
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
656 @Fold
10026
2beeb916aa31 Add arrayKlassOffset field to HotSpotVMConfig.
Roland Schatz <roland.schatz@oracle.com>
parents: 9873
diff changeset
657 public static int arrayKlassOffset() {
2beeb916aa31 Add arrayKlassOffset field to HotSpotVMConfig.
Roland Schatz <roland.schatz@oracle.com>
parents: 9873
diff changeset
658 return config().arrayKlassOffset;
2beeb916aa31 Add arrayKlassOffset field to HotSpotVMConfig.
Roland Schatz <roland.schatz@oracle.com>
parents: 9873
diff changeset
659 }
2beeb916aa31 Add arrayKlassOffset field to HotSpotVMConfig.
Roland Schatz <roland.schatz@oracle.com>
parents: 9873
diff changeset
660
18340
a0381103324b More folding of constant classes and NodeClass references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18307
diff changeset
661 public static final LocationIdentity KLASS_NODE_CLASS = NamedLocationIdentity.immutable("KlassNodeClass");
15052
5e6f29f287d6 added InstanceKlass::_graal_node_class field to accelerate Node.getNodeClass()
Doug Simon <doug.simon@oracle.com>
parents: 14996
diff changeset
662
5e6f29f287d6 added InstanceKlass::_graal_node_class field to accelerate Node.getNodeClass()
Doug Simon <doug.simon@oracle.com>
parents: 14996
diff changeset
663 @Fold
16386
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
664 public static int instanceKlassNodeClassOffset() {
9ce3b1efc4e7 InstanceKlass::_init_state only exists for InstanceKlasses
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16084
diff changeset
665 return config().instanceKlassNodeClassOffset;
15052
5e6f29f287d6 added InstanceKlass::_graal_node_class field to accelerate Node.getNodeClass()
Doug Simon <doug.simon@oracle.com>
parents: 14996
diff changeset
666 }
5e6f29f287d6 added InstanceKlass::_graal_node_class field to accelerate Node.getNodeClass()
Doug Simon <doug.simon@oracle.com>
parents: 14996
diff changeset
667
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
668 public static final LocationIdentity CLASS_MIRROR_LOCATION = NamedLocationIdentity.immutable("Klass::_java_mirror");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
669
10026
2beeb916aa31 Add arrayKlassOffset field to HotSpotVMConfig.
Roland Schatz <roland.schatz@oracle.com>
parents: 9873
diff changeset
670 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
671 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
672 return config().classMirrorOffset;
d526fa5640c8 replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7158
diff changeset
673 }
d526fa5640c8 replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7158
diff changeset
674
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
675 public static final LocationIdentity HEAP_TOP_LOCATION = NamedLocationIdentity.mutable("HeapTop");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
676
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
677 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
678 public static long heapTopAddress() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
679 return config().heapTopAddress;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
680 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
681
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
682 public static final LocationIdentity HEAP_END_LOCATION = NamedLocationIdentity.mutable("HeapEnd");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
683
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
684 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
685 public static long heapEndAddress() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
686 return config().heapEndAddress;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
687 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
688
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
689 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
690 public static long tlabIntArrayMarkWord() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
691 return config().tlabIntArrayMarkWord();
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
692 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
693
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
694 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
695 public static boolean inlineContiguousAllocationSupported() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
696 return config().inlineContiguousAllocationSupported;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
697 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
698
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
699 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
700 public static int tlabAlignmentReserveInHeapWords() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
701 return config().tlabAlignmentReserve;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
702 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
703
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
704 public static final LocationIdentity TLAB_SIZE_LOCATION = NamedLocationIdentity.mutable("TlabSize");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
705
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
706 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
707 public static int threadTlabSizeOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
708 return config().threadTlabSizeOffset();
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
709 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
710
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
711 public static final LocationIdentity TLAB_THREAD_ALLOCATED_BYTES_LOCATION = NamedLocationIdentity.mutable("TlabThreadAllocatedBytes");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
712
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
713 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
714 public static int threadAllocatedBytesOffset() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
715 return config().threadAllocatedBytesOffset;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
716 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
717
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
718 public static final LocationIdentity TLAB_REFILL_WASTE_LIMIT_LOCATION = NamedLocationIdentity.mutable("RefillWasteLimit");
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
719
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
720 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
721 public static int tlabRefillWasteLimitOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
722 return config().tlabRefillWasteLimitOffset();
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
723 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
724
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
725 public static final LocationIdentity TLAB_NOF_REFILLS_LOCATION = NamedLocationIdentity.mutable("TlabNOfRefills");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
726
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
727 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
728 public static int tlabNumberOfRefillsOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
729 return config().tlabNumberOfRefillsOffset();
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
730 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
731
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
732 public static final LocationIdentity TLAB_FAST_REFILL_WASTE_LOCATION = NamedLocationIdentity.mutable("TlabFastRefillWaste");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
733
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
734 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
735 public static int tlabFastRefillWasteOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
736 return config().tlabFastRefillWasteOffset();
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
737 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
738
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
739 public static final LocationIdentity TLAB_SLOW_ALLOCATIONS_LOCATION = NamedLocationIdentity.mutable("TlabSlowAllocations");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
740
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
741 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
742 public static int tlabSlowAllocationsOffset() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
743 return config().tlabSlowAllocationsOffset();
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
744 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
745
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
746 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
747 public static int tlabRefillWasteIncrement() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
748 return config().tlabRefillWasteIncrement;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
749 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
750
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
751 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
752 public static boolean tlabStats() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
753 return config().tlabStats;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
754 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
755
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
756 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
757 public static int layoutHelperHeaderSizeShift() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
758 return config().layoutHelperHeaderSizeShift;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
759 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
760
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
761 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
762 public static int layoutHelperHeaderSizeMask() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
763 return config().layoutHelperHeaderSizeMask;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
764 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
765
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
766 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
767 public static int layoutHelperLog2ElementSizeShift() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
768 return config().layoutHelperLog2ElementSizeShift;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
769 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
770
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
771 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
772 public static int layoutHelperLog2ElementSizeMask() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
773 return config().layoutHelperLog2ElementSizeMask;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
774 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
775
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
776 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
777 public static int layoutHelperElementTypeShift() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
778 return config().layoutHelperElementTypeShift;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
779 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
780
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
781 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
782 public static int layoutHelperElementTypeMask() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
783 return config().layoutHelperElementTypeMask;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
784 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
785
7760
0ae87cf94914 add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents: 7701
diff changeset
786 @Fold
0ae87cf94914 add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents: 7701
diff changeset
787 public static int layoutHelperElementTypePrimitiveInPlace() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
788 return config().layoutHelperElementTypePrimitiveInPlace();
7760
0ae87cf94914 add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents: 7701
diff changeset
789 }
0ae87cf94914 add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents: 7701
diff changeset
790
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
791 static {
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
792 assert arrayIndexScale(Kind.Byte) == 1;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
793 assert arrayIndexScale(Kind.Boolean) == 1;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
794 assert arrayIndexScale(Kind.Char) == 2;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
795 assert arrayIndexScale(Kind.Short) == 2;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
796 assert arrayIndexScale(Kind.Int) == 4;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
797 assert arrayIndexScale(Kind.Long) == 8;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
798 assert arrayIndexScale(Kind.Float) == 4;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
799 assert arrayIndexScale(Kind.Double) == 8;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
800 }
7543
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
801
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
802 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
803 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
804
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
805 // 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
806 final Word biasedLock = mark.and(biasedLockMaskInPlace());
9316
5e1465ec46d6 Change the way branch probabilities are injected. Update all snippets.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9289
diff changeset
807 if (probability(FAST_PATH_PROBABILITY, biasedLock.equal(Word.unsigned(unlockedMask())))) {
7543
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
808 int hash = (int) mark.unsignedShiftRight(identityHashCodeShift()).rawValue();
9316
5e1465ec46d6 Change the way branch probabilities are injected. Update all snippets.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9289
diff changeset
809 if (probability(FAST_PATH_PROBABILITY, hash != uninitializedIdentityHashCodeValue())) {
7543
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
810 return hash;
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
811 }
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
812 }
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
813
9656
53cbcd9ff217 replaced IdentityHashCodeStub[Call] with use of RuntimeStubCall
Doug Simon <doug.simon@oracle.com>
parents: 9562
diff changeset
814 return identityHashCode(IDENTITY_HASHCODE, x);
53cbcd9ff217 replaced IdentityHashCodeStub[Call] with use of RuntimeStubCall
Doug Simon <doug.simon@oracle.com>
parents: 9562
diff changeset
815 }
53cbcd9ff217 replaced IdentityHashCodeStub[Call] with use of RuntimeStubCall
Doug Simon <doug.simon@oracle.com>
parents: 9562
diff changeset
816
9746
82e3c8d5c77f removed CRuntimeCall and replaced its usages with ForeignCallNode
Doug Simon <doug.simon@oracle.com>
parents: 9736
diff changeset
817 @NodeIntrinsic(ForeignCallNode.class)
18228
ab489bac3bc8 Correct the bci used by stateDuring in ForeignCallNode
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 16395
diff changeset
818 public static native int identityHashCode(@ConstantNodeParameter ForeignCallDescriptor descriptor, Object object);
8564
bbd8167f21f9 Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 8522
diff changeset
819
bbd8167f21f9 Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 8522
diff changeset
820 @Fold
bbd8167f21f9 Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 8522
diff changeset
821 public static int verifiedEntryPointOffset() {
bbd8167f21f9 Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 8522
diff changeset
822 return config().nmethodEntryOffset;
bbd8167f21f9 Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 8522
diff changeset
823 }
10618
72d0ea03635b Delegate GC counter from HotSpot to Graal for tracing purposes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10519
diff changeset
824
72d0ea03635b Delegate GC counter from HotSpot to Graal for tracing purposes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10519
diff changeset
825 @Fold
72d0ea03635b Delegate GC counter from HotSpot to Graal for tracing purposes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10519
diff changeset
826 public static long gcTotalCollectionsAddress() {
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12548
diff changeset
827 return config().gcTotalCollectionsAddress();
10618
72d0ea03635b Delegate GC counter from HotSpot to Graal for tracing purposes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10519
diff changeset
828 }
10798
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
829
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
830 @Fold
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
831 public static long referentOffset() {
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
832 try {
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
833 return unsafe.objectFieldOffset(java.lang.ref.Reference.class.getDeclaredField("referent"));
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
834 } catch (Exception e) {
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
835 throw new GraalInternalError(e);
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
836 }
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
837 }
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
838
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
839 public static final LocationIdentity OBJ_ARRAY_KLASS_ELEMENT_KLASS_LOCATION = NamedLocationIdentity.immutable("ObjArrayKlass::_element_klass");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
840
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
841 public static final LocationIdentity PRIMARY_SUPERS_LOCATION = NamedLocationIdentity.immutable("PrimarySupers");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
842
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
843 public static final LocationIdentity METASPACE_ARRAY_LENGTH_LOCATION = NamedLocationIdentity.immutable("MetaspaceArrayLength");
18232
31832ebd40cf Fine grained naming of immutable HotSpot LocationIdentities
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18228
diff changeset
844
18307
85f5227a7a37 add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18259
diff changeset
845 public static final LocationIdentity SECONDARY_SUPERS_ELEMENT_LOCATION = NamedLocationIdentity.immutable("SecondarySupersElement");
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
846 }