annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java @ 12456:f87c68d79f07

improved support for co-existing, multiple backends (GRAAL-363)
author Doug Simon <doug.simon@oracle.com>
date Thu, 17 Oct 2013 01:08:17 +0200
parents 7080a96be216
children e1f40574c309
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 /*
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 */
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
10798
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
25 import static com.oracle.graal.graph.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.*;
12456
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
27 import static com.oracle.graal.hotspot.meta.HotSpotHostForeignCallsProvider.*;
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.*;
7841
674a8b9e62f8 Remove unused fields in TargetDescription. Use Unsafe.pageSize().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7760
diff changeset
29 import sun.misc.*;
7543
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
30
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 import com.oracle.graal.api.code.*;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
32 import com.oracle.graal.api.meta.*;
10798
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
33 import com.oracle.graal.graph.*;
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.*;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37 import com.oracle.graal.nodes.extended.*;
8472
f71fec3fadae made method substitutions for Thread be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
38 import com.oracle.graal.replacements.Snippet.Fold;
8415
2361bf148c06 rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents: 8354
diff changeset
39 import com.oracle.graal.replacements.nodes.*;
7300
2912b72d840a More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents: 7275
diff changeset
40 import com.oracle.graal.word.*;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
41
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
42 //JaCoCo Exclude
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 /**
9513
659bb6cf930c rename: HotSpotSnippetUtils -> HotSpotReplacementsUtil
Doug Simon <doug.simon@oracle.com>
parents: 9471
diff changeset
45 * 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
46 */
9513
659bb6cf930c rename: HotSpotSnippetUtils -> HotSpotReplacementsUtil
Doug Simon <doug.simon@oracle.com>
parents: 9471
diff changeset
47 public class HotSpotReplacementsUtil {
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
48
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
49 public static HotSpotVMConfig config() {
12431
7080a96be216 rename: graalRuntime -> runtime, getGraalRuntime -> getRuntime
Doug Simon <doug.simon@oracle.com>
parents: 12429
diff changeset
50 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
51 }
445193cc2a7d added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents: 7099
diff changeset
52
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
53 @Fold
8502
ff4fa8b0516e -Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
54 public static boolean useTLAB() {
ff4fa8b0516e -Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
55 return config().useTLAB;
ff4fa8b0516e -Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
56 }
ff4fa8b0516e -Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
57
ff4fa8b0516e -Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8501
diff changeset
58 @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
59 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
60 return config().verifyOops;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
61 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
62
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
63 public static final LocationIdentity EXCEPTION_OOP_LOCATION = new NamedLocationIdentity("ExceptionOop");
8643
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
64
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
65 /**
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
66 * @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
67 */
8643
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
68 @Fold
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
69 public static int threadExceptionOopOffset() {
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
70 return config().threadExceptionOopOffset;
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
71 }
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
72
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
73 public static final LocationIdentity EXCEPTION_PC_LOCATION = new NamedLocationIdentity("ExceptionPc");
8643
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
74
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
75 @Fold
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
76 public static int threadExceptionPcOffset() {
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
77 return config().threadExceptionPcOffset;
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
78 }
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
79
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
80 public static final LocationIdentity TLAB_TOP_LOCATION = new NamedLocationIdentity("TlabTop");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
81
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
82 @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
83 public static int threadTlabTopOffset() {
445193cc2a7d added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents: 7099
diff changeset
84 return config().threadTlabTopOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
85 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
86
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
87 public static final LocationIdentity TLAB_END_LOCATION = new NamedLocationIdentity("TlabEnd");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
88
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
89 @Fold
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
90 private static int threadTlabEndOffset() {
7143
445193cc2a7d added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents: 7099
diff changeset
91 return config().threadTlabEndOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
92 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
93
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
94 public static final LocationIdentity TLAB_START_LOCATION = new NamedLocationIdentity("TlabStart");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
95
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
96 @Fold
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
97 private static int threadTlabStartOffset() {
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
98 return config().threadTlabStartOffset;
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
99 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
100
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
101 public static final LocationIdentity PENDING_EXCEPTION_LOCATION = new NamedLocationIdentity("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
102
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
103 /**
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
104 * @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
105 */
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
106 @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
107 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
108 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
109 }
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
110
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
111 public static final LocationIdentity OBJECT_RESULT_LOCATION = new NamedLocationIdentity("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
112
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
113 @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
114 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
115 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
116 }
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
117
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
118 /**
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
119 * @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
120 */
8643
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
121 public static Object readExceptionOop(Word thread) {
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
122 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
123 }
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
124
9471
5fa54bf57f8c replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9352
diff changeset
125 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
126 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
127 }
5fa54bf57f8c replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9352
diff changeset
128
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
129 /**
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
130 * @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
131 */
8643
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
132 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
133 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
134 }
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
135
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
136 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
137 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
138 }
3d2c2b68fe93 lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents: 8634
diff changeset
139
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
140 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
141 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
142 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
143
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
144 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
145 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
146 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
147
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
148 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
149 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
150 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
151
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
152 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
153 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
154 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
155
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
156 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
157 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
158 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
159 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
160 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
161
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
162 /**
9471
5fa54bf57f8c replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9352
diff changeset
163 * Clears the pending exception for the given 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
164 *
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
165 * @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
166 */
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
167 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
168 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
169 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
170 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
171 }
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
172
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
173 /**
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
174 * Gets and clears the object result from a runtime call stored in a 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
175 *
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
176 * @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
177 */
9352
d4684b468e93 made NewInstanceStub a RuntimeStub that directly calls the C runtime (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9339
diff changeset
178 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
179 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
180 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
181 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
182 }
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
183
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
184 @Fold
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
185 public static int threadObjectOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
186 return config().threadObjectOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
187 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
188
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
189 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
190 public static int osThreadOffset() {
8451
2ffd472c5d25 Backed out changeset: 10293cbfc2b6
Doug Simon <doug.simon@oracle.com>
parents: 8436
diff changeset
191 return config().osThreadOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
192 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
193
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
194 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
195 public static int osThreadInterruptedOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
196 return config().osThreadInterruptedOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
197 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
198
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
199 @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
200 public static Kind getWordKind() {
12431
7080a96be216 rename: graalRuntime -> runtime, getGraalRuntime -> getRuntime
Doug Simon <doug.simon@oracle.com>
parents: 12429
diff changeset
201 return runtime().getTarget().wordKind;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
202 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
203
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
204 @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
205 public static Register threadRegister() {
12456
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
206 return runtime().getHostProviders().getRegisters().getThreadRegister();
6364
07da50ea3275 thread register is now retrieved from HotSpotVMConfig instead of being hard coded
Doug Simon <doug.simon@oracle.com>
parents: 6362
diff changeset
207 }
07da50ea3275 thread register is now retrieved from HotSpotVMConfig instead of being hard coded
Doug Simon <doug.simon@oracle.com>
parents: 6362
diff changeset
208
07da50ea3275 thread register is now retrieved from HotSpotVMConfig instead of being hard coded
Doug Simon <doug.simon@oracle.com>
parents: 6362
diff changeset
209 @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
210 public static Register stackPointerRegister() {
12456
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
211 return runtime().getHostProviders().getRegisters().getStackPointerRegister();
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
212 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
213
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
214 @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
215 public static int wordSize() {
12431
7080a96be216 rename: graalRuntime -> runtime, getGraalRuntime -> getRuntime
Doug Simon <doug.simon@oracle.com>
parents: 12429
diff changeset
216 return runtime().getTarget().wordSize;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
217 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
218
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
219 @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
220 public static int pageSize() {
7841
674a8b9e62f8 Remove unused fields in TargetDescription. Use Unsafe.pageSize().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7760
diff changeset
221 return Unsafe.getUnsafe().pageSize();
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
222 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
223
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
224 public static final LocationIdentity PROTOTYPE_MARK_WORD_LOCATION = new NamedLocationIdentity("PrototypeMarkWord");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
225
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
226 @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
227 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
228 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
229 }
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
230
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
231 @Fold
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
232 public static long arrayPrototypeMarkWord() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
233 return config().arrayPrototypeMarkWord;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
234 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
235
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
236 @Fold
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
237 public static int klassAccessFlagsOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
238 return config().klassAccessFlagsOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
239 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
240
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
241 @Fold
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
242 private static int klassLayoutHelperOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
243 return config().klassLayoutHelperOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
244 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
245
7902
14fedab0419e improved arraycopy and Object.clone snippets
Lukas Stadler <lukas.stadler@jku.at>
parents: 7868
diff changeset
246 public static int readLayoutHelper(Word hub) {
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
247 return hub.readInt(klassLayoutHelperOffset(), LocationIdentity.FINAL_LOCATION);
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
248 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
249
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
250 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
251 public static int arrayKlassLayoutHelperIdentifier() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
252 return config().arrayKlassLayoutHelperIdentifier;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
253 }
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 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
256 public static int arrayKlassComponentMirrorOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
257 return config().arrayKlassComponentMirrorOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
258 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
259
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
260 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
261 public static int klassSuperKlassOffset() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
262 return config().klassSuperKlassOffset;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
263 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
264
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
265 public static final LocationIdentity MARK_WORD_LOCATION = new NamedLocationIdentity("MarkWord");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
266
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
267 @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
268 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
269 return config().markOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
270 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
271
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
272 public static final LocationIdentity HUB_LOCATION = new NamedLocationIdentity("Hub");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
273
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
274 @Fold
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
275 private static int hubOffset() {
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
276 return config().hubOffset;
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
277 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
278
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
279 public static void initializeObjectHeader(Word memory, Word markWord, Word hub) {
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
280 memory.writeWord(markOffset(), markWord, MARK_WORD_LOCATION);
10734
8b8587c32812 Adjust load/store hub intrinsics to account for Compressed Klass pointers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10717
diff changeset
281 StoreHubNode.write(memory.toObject(), hub);
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
282 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
283
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
284 @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
285 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
286 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
287 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
288
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
289 /**
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
290 * Mask for a biasable, locked or unlocked mark word.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
291 *
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
292 * <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
293 * +----------------------------------+-+-+
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
294 * | 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
295 * +----------------------------------+-+-+
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
296 * </pre>
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
297 *
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
298 */
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
299 @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
300 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
301 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
302 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
303
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
304 @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
305 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
306 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
307 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
308
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
309 /**
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
310 * Pattern for a biasable, unlocked mark word.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
311 *
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
312 * <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
313 * +----------------------------------+-+-+
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
314 * | 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
315 * +----------------------------------+-+-+
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
316 * </pre>
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
317 *
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
318 */
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
319 @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
320 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
321 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
322 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
323
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
324 @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
325 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
326 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
327 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
328
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
329 @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
330 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
331 return config().metaspaceArrayLengthOffset;
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
332 }
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
333
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
334 @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
335 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
336 return config().metaspaceArrayBaseOffset;
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
337 }
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
338
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
339 @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
340 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
341 return config().arrayLengthOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
342 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
343
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
344 @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
345 public static int arrayBaseOffset(Kind elementKind) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12372
diff changeset
346 return HotSpotGraalRuntime.getArrayBaseOffset(elementKind);
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
347 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
348
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
349 @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
350 public static int arrayIndexScale(Kind elementKind) {
12429
5124eeec1a7b split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents: 12372
diff changeset
351 return HotSpotGraalRuntime.getArrayIndexScale(elementKind);
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
352 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
353
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
354 @Fold
10745
cbaf26740df8 Method renaming
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10734
diff changeset
355 public static int instanceHeaderSize() {
12356
359f7e70ae7f Reduce HotSpot diff and fix previous merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11923
diff changeset
356 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
357 }
0517026315a0 Adjust header size to compressed klass pointers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10638
diff changeset
358
0517026315a0 Adjust header size to compressed klass pointers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10638
diff changeset
359 @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
360 public static int cardTableShift() {
445193cc2a7d added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents: 7099
diff changeset
361 return config().cardtableShift;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
362 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
363
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
364 @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
365 public static long cardTableStart() {
445193cc2a7d added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents: 7099
diff changeset
366 return config().cardtableStartAddress;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
367 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
368
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
369 @Fold
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
370 public static int g1CardQueueIndexOffset() {
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
371 return config().g1CardQueueIndexOffset;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
372 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
373
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
374 @Fold
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
375 public static int g1CardQueueBufferOffset() {
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
376 return config().g1CardQueueBufferOffset;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
377 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
378
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
379 @Fold
10519
3891371b2a3b Method renaming
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10026
diff changeset
380 public static int logOfHeapRegionGrainBytes() {
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
381 return config().logOfHRGrainBytes;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
382 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
383
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
384 @Fold
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
385 public static int g1SATBQueueMarkingOffset() {
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
386 return config().g1SATBQueueMarkingOffset;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
387 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
388
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
389 @Fold
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
390 public static int g1SATBQueueIndexOffset() {
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
391 return config().g1SATBQueueIndexOffset;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
392 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
393
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
394 @Fold
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
395 public static int g1SATBQueueBufferOffset() {
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
396 return config().g1SATBQueueBufferOffset;
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
397 }
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
398
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 7760
diff changeset
399 @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
400 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
401 return config().superCheckOffsetOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
402 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
403
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
404 public static final LocationIdentity SECONDARY_SUPER_CACHE_LOCATION = new NamedLocationIdentity("SecondarySuperCache");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
405
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
406 @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
407 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
408 return config().secondarySuperCacheOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
409 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
410
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
411 public static final LocationIdentity SECONDARY_SUPERS_LOCATION = new NamedLocationIdentity("SecondarySupers");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
412
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
413 @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
414 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
415 return config().secondarySupersOffset;
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
416 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
417
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
418 public static final LocationIdentity DISPLACED_MARK_WORD_LOCATION = new NamedLocationIdentity("DisplacedMarkWord");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
419
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
420 @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
421 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
422 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
423 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
424
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
425 @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
426 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
427 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
428 }
abeeb57b655d added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents: 6375
diff changeset
429
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
430 @Fold
12365
ee746f35ae17 Delegate deferred barrier arguments to graal
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 11549
diff changeset
431 public static boolean useDeferredInitBarriers() {
ee746f35ae17 Delegate deferred barrier arguments to graal
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 11549
diff changeset
432 return config().useDeferredInitBarriers;
ee746f35ae17 Delegate deferred barrier arguments to graal
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 11549
diff changeset
433 }
ee746f35ae17 Delegate deferred barrier arguments to graal
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 11549
diff changeset
434
ee746f35ae17 Delegate deferred barrier arguments to graal
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 11549
diff changeset
435 @Fold
8501
41fc46da946a -More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8492
diff changeset
436 public static boolean useG1GC() {
41fc46da946a -More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8492
diff changeset
437 return config().useG1GC;
41fc46da946a -More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8492
diff changeset
438 }
41fc46da946a -More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8492
diff changeset
439
41fc46da946a -More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8492
diff changeset
440 @Fold
11218
db33e696de4d Add util method for gc
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10798
diff changeset
441 public static boolean useCompressedOops() {
db33e696de4d Add util method for gc
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10798
diff changeset
442 return config().useCompressedOops;
db33e696de4d Add util method for gc
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10798
diff changeset
443 }
db33e696de4d Add util method for gc
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10798
diff changeset
444
db33e696de4d Add util method for gc
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10798
diff changeset
445 @Fold
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
446 static int uninitializedIdentityHashCodeValue() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
447 return config().uninitializedIdentityHashCodeValue;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
448 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
449
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
450 @Fold
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
451 static int identityHashCodeShift() {
7227
8fbb97b0016a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7226
diff changeset
452 return config().identityHashCodeShift;
7222
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
453 }
720925633b3a fixes after merge
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7221
diff changeset
454
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
455 /**
10637
ba1fbbfac0cd remove null check semantics from LoadHubNode (GRAAL-248)
Doug Simon <doug.simon@oracle.com>
parents: 10519
diff changeset
456 * 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
457 */
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 Word loadHub(Object object) {
11258
56f1aa40e13b made LoadHubNode be floating
Doug Simon <doug.simon@oracle.com>
parents: 11218
diff changeset
459 return loadHubIntrinsic(object, getWordKind(), null);
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
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
462 public static Object verifyOop(Object object) {
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
463 if (verifyOops()) {
9773
8a1b0a3d4fc3 replaced VerifyOopStubCall with usage of ForeignCallNode
Doug Simon <doug.simon@oracle.com>
parents: 9746
diff changeset
464 verifyOopStub(VERIFY_OOP, object);
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
465 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
466 return object;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
467 }
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
468
9773
8a1b0a3d4fc3 replaced VerifyOopStubCall with usage of ForeignCallNode
Doug Simon <doug.simon@oracle.com>
parents: 9746
diff changeset
469 @NodeIntrinsic(ForeignCallNode.class)
8a1b0a3d4fc3 replaced VerifyOopStubCall with usage of ForeignCallNode
Doug Simon <doug.simon@oracle.com>
parents: 9746
diff changeset
470 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
471
6419
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
472 /**
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
473 * Gets the value of the stack pointer register as a Word.
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
474 */
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
475 public static Word stackPointer() {
9562
99ef9bcb3f32 replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9526
diff changeset
476 return registerAsWord(stackPointerRegister(), true, false);
6419
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
477 }
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
478
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
479 /**
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
480 * Gets the value of the thread register as a Word.
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
481 */
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
482 public static Word thread() {
9562
99ef9bcb3f32 replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9526
diff changeset
483 return registerAsWord(threadRegister(), true, false);
6419
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
484 }
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
485
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
486 public static Word loadWordFromObject(Object object, int offset) {
10734
8b8587c32812 Adjust load/store hub intrinsics to account for Compressed Klass pointers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10717
diff changeset
487 assert offset != hubOffset() : "Use loadHubIntrinsic instead";
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11549
diff changeset
488 return loadWordFromObjectIntrinsic(object, offset, getWordKind());
6419
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
489 }
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
490
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
491 @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
492 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
493
8472
f71fec3fadae made method substitutions for Thread be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
494 @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
495 @NodeIntrinsic(value = UnsafeLoadNode.class, setStampFromReturnType = true)
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11549
diff changeset
496 private static Word loadWordFromObjectIntrinsic(Object object, long offset, @ConstantNodeParameter Kind wordKind) {
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11549
diff changeset
497 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
498 }
6419
b74402a7079b fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents: 6389
diff changeset
499
8479
a6ba61be2b5f made method substitutions for Object be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8472
diff changeset
500 @SuppressWarnings("unused")
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6521
diff changeset
501 @NodeIntrinsic(value = LoadHubNode.class, setStampFromReturnType = true)
11337
39e83065426e Add anchors for loadHubs in verifyObject and monitor enter.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11277
diff changeset
502 public static Word loadHubIntrinsic(Object object, @ConstantNodeParameter Kind word, GuardingNode anchor) {
11277
e75e8ffdf87c Made Word.box() private: Outside users should use the different signed() and unsigned() methods to ensure proper expansion of 32-bit values on 64-bit systems.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 11258
diff changeset
503 return Word.unsigned(unsafeReadKlassPointer(object));
8479
a6ba61be2b5f made method substitutions for Object be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8472
diff changeset
504 }
7160
d526fa5640c8 replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7158
diff changeset
505
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
506 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
507 public static int log2WordSize() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
508 return CodeUtil.log2(wordSize());
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
509 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
510
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
511 public static final LocationIdentity CLASS_STATE_LOCATION = new NamedLocationIdentity("ClassState");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
512
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
513 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
514 public static int klassStateOffset() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
515 return config().klassStateOffset;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
516 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
517
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
518 @Fold
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
519 public static int klassStateFullyInitialized() {
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
520 return config().klassStateFullyInitialized;
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
521 }
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
522
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
523 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
524 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
525 return config().klassModifierFlagsOffset;
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
526 }
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
527
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
528 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
529 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
530 return config().klassOffset;
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
531 }
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
532
7915888f5db5 replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7147
diff changeset
533 @Fold
10026
2beeb916aa31 Add arrayKlassOffset field to HotSpotVMConfig.
Roland Schatz <roland.schatz@oracle.com>
parents: 9873
diff changeset
534 public static int arrayKlassOffset() {
2beeb916aa31 Add arrayKlassOffset field to HotSpotVMConfig.
Roland Schatz <roland.schatz@oracle.com>
parents: 9873
diff changeset
535 return config().arrayKlassOffset;
2beeb916aa31 Add arrayKlassOffset field to HotSpotVMConfig.
Roland Schatz <roland.schatz@oracle.com>
parents: 9873
diff changeset
536 }
2beeb916aa31 Add arrayKlassOffset field to HotSpotVMConfig.
Roland Schatz <roland.schatz@oracle.com>
parents: 9873
diff changeset
537
2beeb916aa31 Add arrayKlassOffset field to HotSpotVMConfig.
Roland Schatz <roland.schatz@oracle.com>
parents: 9873
diff changeset
538 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
539 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
540 return config().classMirrorOffset;
d526fa5640c8 replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7158
diff changeset
541 }
d526fa5640c8 replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7158
diff changeset
542
d526fa5640c8 replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents: 7158
diff changeset
543 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
544 public static int klassInstanceSizeOffset() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
545 return config().klassInstanceSizeOffset;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
546 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
547
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
548 public static final LocationIdentity HEAP_TOP_LOCATION = new NamedLocationIdentity("HeapTop");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
549
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
550 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
551 public static long heapTopAddress() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
552 return config().heapTopAddress;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
553 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
554
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
555 public static final LocationIdentity HEAP_END_LOCATION = new NamedLocationIdentity("HeapEnd");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
556
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
557 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
558 public static long heapEndAddress() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
559 return config().heapEndAddress;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
560 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
561
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
562 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
563 public static long tlabIntArrayMarkWord() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
564 return config().tlabIntArrayMarkWord;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
565 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
566
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
567 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
568 public static boolean inlineContiguousAllocationSupported() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
569 return config().inlineContiguousAllocationSupported;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
570 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
571
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
572 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
573 public static int tlabAlignmentReserveInHeapWords() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
574 return config().tlabAlignmentReserve;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
575 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
576
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
577 public static final LocationIdentity TLAB_SIZE_LOCATION = new NamedLocationIdentity("TlabSize");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
578
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
579 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
580 public static int threadTlabSizeOffset() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
581 return config().threadTlabSizeOffset;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
582 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
583
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
584 public static final LocationIdentity TLAB_THREAD_ALLOCATED_BYTES_LOCATION = new NamedLocationIdentity("TlabThreadAllocatedBytes");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
585
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
586 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
587 public static int threadAllocatedBytesOffset() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
588 return config().threadAllocatedBytesOffset;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
589 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
590
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
591 public static final LocationIdentity TLAB_REFILL_WASTE_LIMIT_LOCATION = new NamedLocationIdentity("RefillWasteLimit");
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
592
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
593 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
594 public static int tlabRefillWasteLimitOffset() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
595 return config().tlabRefillWasteLimitOffset;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
596 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
597
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
598 public static final LocationIdentity TLAB_NOF_REFILLS_LOCATION = new NamedLocationIdentity("TlabNOfRefills");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
599
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
600 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
601 public static int tlabNumberOfRefillsOffset() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
602 return config().tlabNumberOfRefillsOffset;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
603 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
604
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
605 public static final LocationIdentity TLAB_FAST_REFILL_WASTE_LOCATION = new NamedLocationIdentity("TlabFastRefillWaste");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
606
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
607 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
608 public static int tlabFastRefillWasteOffset() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
609 return config().tlabFastRefillWasteOffset;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
610 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
611
9792
06dc2d2324d6 pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents: 9773
diff changeset
612 public static final LocationIdentity TLAB_SLOW_ALLOCATIONS_LOCATION = new NamedLocationIdentity("TlabSlowAllocations");
7868
7a5bbcc36bb2 add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents: 7841
diff changeset
613
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
614 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
615 public static int tlabSlowAllocationsOffset() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
616 return config().tlabSlowAllocationsOffset;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
617 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
618
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
619 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
620 public static int tlabRefillWasteIncrement() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
621 return config().tlabRefillWasteIncrement;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
622 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
623
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
624 @Fold
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7300
diff changeset
625 public static boolean tlabStats() {
7147
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
626 return config().tlabStats;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
627 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
628
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
629 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
630 public static int layoutHelperOffset() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
631 return config().layoutHelperOffset;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
632 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
633
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
634 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
635 public static int layoutHelperHeaderSizeShift() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
636 return config().layoutHelperHeaderSizeShift;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
637 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
638
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
639 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
640 public static int layoutHelperHeaderSizeMask() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
641 return config().layoutHelperHeaderSizeMask;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
642 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
643
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
644 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
645 public static int layoutHelperLog2ElementSizeShift() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
646 return config().layoutHelperLog2ElementSizeShift;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
647 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
648
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
649 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
650 public static int layoutHelperLog2ElementSizeMask() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
651 return config().layoutHelperLog2ElementSizeMask;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
652 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
653
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
654 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
655 public static int layoutHelperElementTypeShift() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
656 return config().layoutHelperElementTypeShift;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
657 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
658
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
659 @Fold
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
660 public static int layoutHelperElementTypeMask() {
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
661 return config().layoutHelperElementTypeMask;
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
662 }
88d626e2c2a8 added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
663
7760
0ae87cf94914 add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents: 7701
diff changeset
664 @Fold
0ae87cf94914 add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents: 7701
diff changeset
665 public static int layoutHelperElementTypePrimitiveInPlace() {
0ae87cf94914 add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents: 7701
diff changeset
666 return config().layoutHelperElementTypePrimitiveInPlace;
0ae87cf94914 add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents: 7701
diff changeset
667 }
0ae87cf94914 add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents: 7701
diff changeset
668
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
669 static {
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
670 assert arrayIndexScale(Kind.Byte) == 1;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
671 assert arrayIndexScale(Kind.Boolean) == 1;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
672 assert arrayIndexScale(Kind.Char) == 2;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
673 assert arrayIndexScale(Kind.Short) == 2;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
674 assert arrayIndexScale(Kind.Int) == 4;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
675 assert arrayIndexScale(Kind.Long) == 8;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
676 assert arrayIndexScale(Kind.Float) == 4;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
677 assert arrayIndexScale(Kind.Double) == 8;
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
678 }
7543
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
679
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
680 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
681 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
682
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
683 // 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
684 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
685 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
686 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
687 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
688 return hash;
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
689 }
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
690 }
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
691
9656
53cbcd9ff217 replaced IdentityHashCodeStub[Call] with use of RuntimeStubCall
Doug Simon <doug.simon@oracle.com>
parents: 9562
diff changeset
692 return identityHashCode(IDENTITY_HASHCODE, x);
53cbcd9ff217 replaced IdentityHashCodeStub[Call] with use of RuntimeStubCall
Doug Simon <doug.simon@oracle.com>
parents: 9562
diff changeset
693 }
53cbcd9ff217 replaced IdentityHashCodeStub[Call] with use of RuntimeStubCall
Doug Simon <doug.simon@oracle.com>
parents: 9562
diff changeset
694
53cbcd9ff217 replaced IdentityHashCodeStub[Call] with use of RuntimeStubCall
Doug Simon <doug.simon@oracle.com>
parents: 9562
diff changeset
695 @SuppressWarnings("unused")
9746
82e3c8d5c77f removed CRuntimeCall and replaced its usages with ForeignCallNode
Doug Simon <doug.simon@oracle.com>
parents: 9736
diff changeset
696 @NodeIntrinsic(ForeignCallNode.class)
9735
2e4f035186cf rename: Descriptor -> ForeignCallDescriptor
Doug Simon <doug.simon@oracle.com>
parents: 9732
diff changeset
697 public static int identityHashCode(@ConstantNodeParameter ForeignCallDescriptor descriptor, Object object) {
9656
53cbcd9ff217 replaced IdentityHashCodeStub[Call] with use of RuntimeStubCall
Doug Simon <doug.simon@oracle.com>
parents: 9562
diff changeset
698 return System.identityHashCode(object);
7543
be0d995ef51e factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
699 }
8564
bbd8167f21f9 Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 8522
diff changeset
700
bbd8167f21f9 Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 8522
diff changeset
701 @Fold
bbd8167f21f9 Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 8522
diff changeset
702 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
703 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
704 }
10618
72d0ea03635b Delegate GC counter from HotSpot to Graal for tracing purposes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10519
diff changeset
705
72d0ea03635b Delegate GC counter from HotSpot to Graal for tracing purposes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10519
diff changeset
706 @Fold
72d0ea03635b Delegate GC counter from HotSpot to Graal for tracing purposes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10519
diff changeset
707 public static long gcTotalCollectionsAddress() {
72d0ea03635b Delegate GC counter from HotSpot to Graal for tracing purposes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10519
diff changeset
708 return config().gcTotalCollectionsAddress;
72d0ea03635b Delegate GC counter from HotSpot to Graal for tracing purposes
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10519
diff changeset
709 }
10798
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
710
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
711 @Fold
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
712 public static long referentOffset() {
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
713 try {
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
714 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
715 } catch (Exception e) {
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
716 throw new GraalInternalError(e);
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
717 }
7d3e74190a09 Code refactoring and cleanup
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10787
diff changeset
718 }
6362
6d232ee6a62d factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
719 }