Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotSnippetUtils.java @ 9352:d4684b468e93
made NewInstanceStub a RuntimeStub that directly calls the C runtime (GRAAL-81)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Sat, 27 Apr 2013 00:32:22 +0200 |
parents | bdf4604fec2e |
children | 5fa54bf57f8c |
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 |
8472
f71fec3fadae
made method substitutions for Thread be interpretable
Doug Simon <doug.simon@oracle.com>
parents:
8451
diff
changeset
|
25 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; |
8415
2361bf148c06
rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents:
8354
diff
changeset
|
26 import static com.oracle.graal.replacements.nodes.BranchProbabilityNode.*; |
7841
674a8b9e62f8
Remove unused fields in TargetDescription. Use Unsafe.pageSize().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7760
diff
changeset
|
27 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
|
28 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 import com.oracle.graal.api.code.*; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 import com.oracle.graal.api.meta.*; |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
31 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
|
32 import com.oracle.graal.graph.Node.NodeIntrinsic; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
33 import com.oracle.graal.hotspot.*; |
7099
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6950
diff
changeset
|
34 import com.oracle.graal.hotspot.meta.*; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
35 import com.oracle.graal.hotspot.nodes.*; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
36 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
|
37 import com.oracle.graal.replacements.Snippet.Fold; |
8415
2361bf148c06
rename packages: *snippets* -> *replacements*
Doug Simon <doug.simon@oracle.com>
parents:
8354
diff
changeset
|
38 import com.oracle.graal.replacements.nodes.*; |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7275
diff
changeset
|
39 import com.oracle.graal.word.*; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
40 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
41 //JaCoCo Exclude |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
42 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
43 /** |
7543
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
44 * A collection of methods used in HotSpot snippets and substitutions. |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
45 */ |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
46 public class HotSpotSnippetUtils { |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
47 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
48 public static final Object ANY_LOCATION = LocationNode.ANY_LOCATION; |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
49 public static final Object FINAL_LOCATION = LocationNode.FINAL_LOCATION; |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
50 |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
51 public static HotSpotVMConfig config() { |
9289
261a43921c5e
rename: HotSpotGraalRuntime.getInstance() -> graalRuntime()
Doug Simon <doug.simon@oracle.com>
parents:
8643
diff
changeset
|
52 return graalRuntime().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
|
53 } |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
54 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
55 @Fold |
8502
ff4fa8b0516e
-Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8501
diff
changeset
|
56 public static boolean useTLAB() { |
ff4fa8b0516e
-Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8501
diff
changeset
|
57 return config().useTLAB; |
ff4fa8b0516e
-Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8501
diff
changeset
|
58 } |
ff4fa8b0516e
-Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8501
diff
changeset
|
59 |
ff4fa8b0516e
-Create push patch
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8501
diff
changeset
|
60 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
61 public static 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
|
62 return config().verifyOops; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
63 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
64 |
8643
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
65 public static final Object EXCEPTION_OOP_LOCATION = LocationNode.createLocation("ExceptionOop"); |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
66 |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
67 @Fold |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
68 public static int threadExceptionOopOffset() { |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
69 return config().threadExceptionOopOffset; |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
70 } |
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 public static final Object EXCEPTION_PC_LOCATION = LocationNode.createLocation("ExceptionPc"); |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
73 |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
74 @Fold |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
75 public static int threadExceptionPcOffset() { |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
76 return config().threadExceptionPcOffset; |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
77 } |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
78 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
79 public static final Object TLAB_TOP_LOCATION = LocationNode.createLocation("TlabTop"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
80 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
81 @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
|
82 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
|
83 return config().threadTlabTopOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
84 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
85 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
86 public static final Object TLAB_END_LOCATION = LocationNode.createLocation("TlabEnd"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
87 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
88 @Fold |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
89 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
|
90 return config().threadTlabEndOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
91 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
92 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
93 public static final Object TLAB_START_LOCATION = LocationNode.createLocation("TlabStart"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
94 |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
95 @Fold |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
96 private static int threadTlabStartOffset() { |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
97 return config().threadTlabStartOffset; |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
98 } |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
99 |
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
|
100 public static final Object PENDING_EXCEPTION_LOCATION = LocationNode.createLocation("PendingException"); |
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
|
101 |
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 @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
|
103 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
|
104 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
|
105 } |
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 |
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 public static final Object OBJECT_RESULT_LOCATION = LocationNode.createLocation("ObjectResult"); |
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 |
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 @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
|
110 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
|
111 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
|
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 |
8643
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
114 public static Object readExceptionOop(Word thread) { |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
115 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
|
116 } |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
117 |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
118 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
|
119 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
|
120 } |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
121 |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
122 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
|
123 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
|
124 } |
3d2c2b68fe93
lower ExceptionObjectNode with a snippet (GRAAL-133)
Doug Simon <doug.simon@oracle.com>
parents:
8634
diff
changeset
|
125 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
126 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
|
127 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
|
128 } |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
129 |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
130 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
|
131 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
|
132 } |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
133 |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
134 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
|
135 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
|
136 } |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
137 |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
138 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
|
139 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
|
140 } |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
141 |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
142 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
|
143 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
|
144 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
|
145 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
|
146 } |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
147 |
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
|
148 /** |
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
|
149 * Clears the pending exception if for the given 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
|
150 * |
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
|
151 * @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
|
152 */ |
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
|
153 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
|
154 boolean result = thread.readObject(threadPendingExceptionOffset(), PENDING_EXCEPTION_LOCATION) != null; |
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
|
155 thread.writeObject(threadPendingExceptionOffset(), null); |
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
|
156 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
|
157 } |
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
|
158 |
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
|
159 /** |
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
|
160 * 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
|
161 * |
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 * @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
|
163 */ |
9352
d4684b468e93
made NewInstanceStub a RuntimeStub that directly calls the C runtime (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9339
diff
changeset
|
164 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
|
165 Object result = thread.readObject(objectResultOffset(), OBJECT_RESULT_LOCATION); |
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 thread.writeObject(objectResultOffset(), null); |
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 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
|
168 } |
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
|
169 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
170 @Fold |
7222 | 171 public static int threadObjectOffset() { |
7227 | 172 return config().threadObjectOffset; |
7222 | 173 } |
174 | |
175 @Fold | |
176 public static int osThreadOffset() { | |
8451
2ffd472c5d25
Backed out changeset: 10293cbfc2b6
Doug Simon <doug.simon@oracle.com>
parents:
8436
diff
changeset
|
177 return config().osThreadOffset; |
7222 | 178 } |
179 | |
180 @Fold | |
181 public static int osThreadInterruptedOffset() { | |
7227 | 182 return config().osThreadInterruptedOffset; |
7222 | 183 } |
184 | |
185 @Fold | |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
186 public static Kind wordKind() { |
9289
261a43921c5e
rename: HotSpotGraalRuntime.getInstance() -> graalRuntime()
Doug Simon <doug.simon@oracle.com>
parents:
8643
diff
changeset
|
187 return graalRuntime().getTarget().wordKind; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
188 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
189 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
190 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
191 public static Register threadRegister() { |
9289
261a43921c5e
rename: HotSpotGraalRuntime.getInstance() -> graalRuntime()
Doug Simon <doug.simon@oracle.com>
parents:
8643
diff
changeset
|
192 return graalRuntime().getRuntime().threadRegister(); |
6364
07da50ea3275
thread register is now retrieved from HotSpotVMConfig instead of being hard coded
Doug Simon <doug.simon@oracle.com>
parents:
6362
diff
changeset
|
193 } |
07da50ea3275
thread register is now retrieved from HotSpotVMConfig instead of being hard coded
Doug Simon <doug.simon@oracle.com>
parents:
6362
diff
changeset
|
194 |
07da50ea3275
thread register is now retrieved from HotSpotVMConfig instead of being hard coded
Doug Simon <doug.simon@oracle.com>
parents:
6362
diff
changeset
|
195 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
196 public static Register stackPointerRegister() { |
9289
261a43921c5e
rename: HotSpotGraalRuntime.getInstance() -> graalRuntime()
Doug Simon <doug.simon@oracle.com>
parents:
8643
diff
changeset
|
197 return graalRuntime().getRuntime().stackPointerRegister(); |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
198 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
199 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
200 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
201 public static int wordSize() { |
9289
261a43921c5e
rename: HotSpotGraalRuntime.getInstance() -> graalRuntime()
Doug Simon <doug.simon@oracle.com>
parents:
8643
diff
changeset
|
202 return graalRuntime().getTarget().wordSize; |
6362
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 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
205 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
206 public static int pageSize() { |
7841
674a8b9e62f8
Remove unused fields in TargetDescription. Use Unsafe.pageSize().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7760
diff
changeset
|
207 return Unsafe.getUnsafe().pageSize(); |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
208 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
209 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
210 public static final Object PROTOTYPE_MARK_WORD_LOCATION = LocationNode.createLocation("PrototypeMarkWord"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
211 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
212 @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
|
213 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
|
214 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
|
215 } |
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
|
216 |
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
|
217 @Fold |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
218 public static long arrayPrototypeMarkWord() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
219 return config().arrayPrototypeMarkWord; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
220 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
221 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
222 @Fold |
7222 | 223 public static int klassAccessFlagsOffset() { |
7227 | 224 return config().klassAccessFlagsOffset; |
7222 | 225 } |
226 | |
227 @Fold | |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
228 private static int klassLayoutHelperOffset() { |
7227 | 229 return config().klassLayoutHelperOffset; |
7222 | 230 } |
231 | |
7902
14fedab0419e
improved arraycopy and Object.clone snippets
Lukas Stadler <lukas.stadler@jku.at>
parents:
7868
diff
changeset
|
232 public static int readLayoutHelper(Word hub) { |
14fedab0419e
improved arraycopy and Object.clone snippets
Lukas Stadler <lukas.stadler@jku.at>
parents:
7868
diff
changeset
|
233 return hub.readInt(klassLayoutHelperOffset(), FINAL_LOCATION); |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
234 } |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
235 |
7222 | 236 @Fold |
237 public static int arrayKlassLayoutHelperIdentifier() { | |
7227 | 238 return config().arrayKlassLayoutHelperIdentifier; |
7222 | 239 } |
240 | |
241 @Fold | |
242 public static int arrayKlassComponentMirrorOffset() { | |
7227 | 243 return config().arrayKlassComponentMirrorOffset; |
7222 | 244 } |
245 | |
246 @Fold | |
247 public static int klassSuperKlassOffset() { | |
7227 | 248 return config().klassSuperKlassOffset; |
7222 | 249 } |
250 | |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
251 public static final Object MARK_WORD_LOCATION = LocationNode.createLocation("MarkWord"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
252 |
7222 | 253 @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
|
254 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
|
255 return config().markOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
256 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
257 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
258 public static final Object HUB_LOCATION = LocationNode.createLocation("Hub"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
259 |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
260 @Fold |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
261 private static int hubOffset() { |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
262 return config().hubOffset; |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
263 } |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
264 |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
265 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
|
266 memory.writeWord(markOffset(), markWord, MARK_WORD_LOCATION); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
267 memory.writeWord(hubOffset(), hub, HUB_LOCATION); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
268 } |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
269 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
270 @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
|
271 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
|
272 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
|
273 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
274 |
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
|
275 /** |
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
|
276 * 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
|
277 * |
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
|
278 * <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
|
279 * +----------------------------------+-+-+ |
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
|
280 * | 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
|
281 * +----------------------------------+-+-+ |
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
|
282 * </pre> |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
283 * |
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
|
284 */ |
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
|
285 @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
|
286 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
|
287 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
|
288 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
289 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
290 @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
|
291 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
|
292 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
|
293 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
294 |
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
|
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 * 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
|
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 * <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
|
299 * +----------------------------------+-+-+ |
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
|
300 * | 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
|
301 * +----------------------------------+-+-+ |
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
|
302 * </pre> |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
303 * |
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
|
304 */ |
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
|
305 @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
|
306 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
|
307 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
|
308 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
309 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
310 @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
|
311 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
|
312 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
|
313 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
314 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
315 @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
|
316 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
|
317 return config().metaspaceArrayLengthOffset; |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
318 } |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
319 |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
320 @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
|
321 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
|
322 return config().metaspaceArrayBaseOffset; |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
323 } |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
324 |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
325 @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
|
326 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
|
327 return config().arrayLengthOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
328 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
329 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
330 @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
|
331 public static int arrayBaseOffset(Kind elementKind) { |
7099
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6950
diff
changeset
|
332 return HotSpotRuntime.getArrayBaseOffset(elementKind); |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
333 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
334 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
335 @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
|
336 public static int arrayIndexScale(Kind elementKind) { |
7099
3656236c7d27
Cleanup of Kind class: remove use of Unsafe class
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6950
diff
changeset
|
337 return HotSpotRuntime.getArrayIndexScale(elementKind); |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
338 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
339 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
340 @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
|
341 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
|
342 return config().cardtableShift; |
6362
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 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
345 @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
|
346 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
|
347 return config().cardtableStartAddress; |
6362
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 |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
350 @Fold |
8490
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
351 public static int g1CardQueueIndexOffset() { |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
352 return config().g1CardQueueIndexOffset; |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
353 } |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
354 |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
355 @Fold |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
356 public static int g1CardQueueBufferOffset() { |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
357 return config().g1CardQueueBufferOffset; |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
358 } |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
359 |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
360 @Fold |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
361 public static int logOfHRGrainBytes() { |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
362 return config().logOfHRGrainBytes; |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
363 } |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
364 |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
365 @Fold |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
366 public static int g1SATBQueueMarkingOffset() { |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
367 return config().g1SATBQueueMarkingOffset; |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
368 } |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
369 |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
370 @Fold |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
371 public static int g1SATBQueueIndexOffset() { |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
372 return config().g1SATBQueueIndexOffset; |
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 |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
375 @Fold |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
376 public static int g1SATBQueueBufferOffset() { |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
377 return config().g1SATBQueueBufferOffset; |
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 |
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
7760
diff
changeset
|
380 @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
|
381 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
|
382 return config().superCheckOffsetOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
383 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
384 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
385 public static final Object SECONDARY_SUPER_CACHE_LOCATION = LocationNode.createLocation("SecondarySuperCache"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
386 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
387 @Fold |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
388 public static int 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
|
389 return config().secondarySuperCacheOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
390 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
391 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
392 public static final Object SECONDARY_SUPERS_LOCATION = LocationNode.createLocation("SecondarySupers"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
393 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
394 @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
|
395 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
|
396 return config().secondarySupersOffset; |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
397 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
398 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
399 public static final Object DISPLACED_MARK_WORD_LOCATION = LocationNode.createLocation("DisplacedMarkWord"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
400 |
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
|
401 @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
|
402 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
|
403 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
|
404 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
405 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
406 @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 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
|
408 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
|
409 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
6375
diff
changeset
|
410 |
7222 | 411 @Fold |
8501
41fc46da946a
-More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8492
diff
changeset
|
412 public static boolean useG1GC() { |
41fc46da946a
-More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8492
diff
changeset
|
413 return config().useG1GC; |
41fc46da946a
-More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8492
diff
changeset
|
414 } |
41fc46da946a
-More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8492
diff
changeset
|
415 |
41fc46da946a
-More fixes and passrate(fop)
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8492
diff
changeset
|
416 @Fold |
7222 | 417 static int uninitializedIdentityHashCodeValue() { |
7227 | 418 return config().uninitializedIdentityHashCodeValue; |
7222 | 419 } |
420 | |
421 @Fold | |
422 static int identityHashCodeShift() { | |
7227 | 423 return config().identityHashCodeShift; |
7222 | 424 } |
425 | |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
426 /** |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
427 * Loads the hub from a object, null checking it first. |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
428 */ |
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
|
429 public static Word loadHub(Object object) { |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
430 return loadHubIntrinsic(object, wordKind()); |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
431 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
432 |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7099
diff
changeset
|
433 public static Object verifyOop(Object object) { |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
434 if (verifyOops()) { |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
435 VerifyOopStubCall.call(object); |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
436 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
437 return object; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
438 } |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
439 |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
440 /** |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
441 * 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
|
442 */ |
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
|
443 public static Word stackPointer() { |
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
|
444 return HotSpotSnippetUtils.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
|
445 } |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
446 |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
447 /** |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
448 * 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
|
449 */ |
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
|
450 public static Word thread() { |
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
|
451 return HotSpotSnippetUtils.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
|
452 } |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
453 |
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
|
454 public static Word loadWordFromObject(Object object, int offset) { |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
455 return loadWordFromObjectIntrinsic(object, 0, offset, wordKind()); |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
456 } |
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
457 |
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
|
458 @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
|
459 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
|
460 |
8472
f71fec3fadae
made method substitutions for Thread be interpretable
Doug Simon <doug.simon@oracle.com>
parents:
8451
diff
changeset
|
461 @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
|
462 @NodeIntrinsic(value = UnsafeLoadNode.class, setStampFromReturnType = true) |
8472
f71fec3fadae
made method substitutions for Thread be interpretable
Doug Simon <doug.simon@oracle.com>
parents:
8451
diff
changeset
|
463 private static Word loadWordFromObjectIntrinsic(Object object, @ConstantNodeParameter int displacement, long offset, @ConstantNodeParameter Kind wordKind) { |
f71fec3fadae
made method substitutions for Thread be interpretable
Doug Simon <doug.simon@oracle.com>
parents:
8451
diff
changeset
|
464 return Word.box(unsafeReadWord(object, offset + displacement)); |
f71fec3fadae
made method substitutions for Thread be interpretable
Doug Simon <doug.simon@oracle.com>
parents:
8451
diff
changeset
|
465 } |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
466 |
8479
a6ba61be2b5f
made method substitutions for Object be interpretable
Doug Simon <doug.simon@oracle.com>
parents:
8472
diff
changeset
|
467 @SuppressWarnings("unused") |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6521
diff
changeset
|
468 @NodeIntrinsic(value = LoadHubNode.class, setStampFromReturnType = true) |
8479
a6ba61be2b5f
made method substitutions for Object be interpretable
Doug Simon <doug.simon@oracle.com>
parents:
8472
diff
changeset
|
469 static Word loadHubIntrinsic(Object object, @ConstantNodeParameter Kind word) { |
a6ba61be2b5f
made method substitutions for Object be interpretable
Doug Simon <doug.simon@oracle.com>
parents:
8472
diff
changeset
|
470 return Word.box(unsafeReadWord(object, hubOffset())); |
a6ba61be2b5f
made method substitutions for Object be interpretable
Doug Simon <doug.simon@oracle.com>
parents:
8472
diff
changeset
|
471 } |
7160
d526fa5640c8
replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7158
diff
changeset
|
472 |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
473 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
474 public static int log2WordSize() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
475 return CodeUtil.log2(wordSize()); |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
476 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
477 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
478 public static final Object CLASS_STATE_LOCATION = LocationNode.createLocation("ClassState"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
479 |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
480 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
481 public static int klassStateOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
482 return config().klassStateOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
483 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
484 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
485 @Fold |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
486 public static int klassStateFullyInitialized() { |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
487 return config().klassStateFullyInitialized; |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
488 } |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
489 |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
490 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
491 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
|
492 return config().klassModifierFlagsOffset; |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
493 } |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
494 |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
495 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
496 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
|
497 return config().klassOffset; |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
498 } |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
499 |
7915888f5db5
replace manual intrinsification of Class.getModifiers() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7147
diff
changeset
|
500 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
501 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
|
502 return config().classMirrorOffset; |
d526fa5640c8
replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7158
diff
changeset
|
503 } |
d526fa5640c8
replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7158
diff
changeset
|
504 |
d526fa5640c8
replaced manual intrinsification of Object.getClass() with a snippet
Doug Simon <doug.simon@oracle.com>
parents:
7158
diff
changeset
|
505 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
506 public static int klassInstanceSizeOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
507 return config().klassInstanceSizeOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
508 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
509 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
510 public static final Object HEAP_TOP_LOCATION = LocationNode.createLocation("HeapTop"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
511 |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
512 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
513 public static long heapTopAddress() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
514 return config().heapTopAddress; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
515 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
516 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
517 public static final Object HEAP_END_LOCATION = LocationNode.createLocation("HeapEnd"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
518 |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
519 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
520 public static long heapEndAddress() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
521 return config().heapEndAddress; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
522 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
523 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
524 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
525 public static long tlabIntArrayMarkWord() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
526 return config().tlabIntArrayMarkWord; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
527 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
528 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
529 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
530 public static boolean inlineContiguousAllocationSupported() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
531 return config().inlineContiguousAllocationSupported; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
532 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
533 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
534 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
535 public static int tlabAlignmentReserveInHeapWords() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
536 return config().tlabAlignmentReserve; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
537 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
538 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
539 public static final Object TLAB_SIZE_LOCATION = LocationNode.createLocation("TlabSize"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
540 |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
541 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
542 public static int threadTlabSizeOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
543 return config().threadTlabSizeOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
544 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
545 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
546 public static final Object TLAB_THREAD_ALLOCATED_BYTES_LOCATION = LocationNode.createLocation("TlabThreadAllocatedBytes"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
547 |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
548 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
549 public static int threadAllocatedBytesOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
550 return config().threadAllocatedBytesOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
551 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
552 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
553 public static final Object TLAB_REFILL_WASTE_LIMIT_LOCATION = LocationNode.createLocation("RefillWasteLimit"); |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
554 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
555 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
556 public static int tlabRefillWasteLimitOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
557 return config().tlabRefillWasteLimitOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
558 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
559 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
560 public static final Object TLAB_NOF_REFILLS_LOCATION = LocationNode.createLocation("TlabNOfRefills"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
561 |
7147
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 int tlabNumberOfRefillsOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
564 return config().tlabNumberOfRefillsOffset; |
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 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
567 public static final Object TLAB_FAST_REFILL_WASTE_LOCATION = LocationNode.createLocation("TlabFastRefillWaste"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
568 |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
569 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
570 public static int tlabFastRefillWasteOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
571 return config().tlabFastRefillWasteOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
572 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
573 |
7868
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
574 public static final Object TLAB_SLOW_ALLOCATIONS_LOCATION = LocationNode.createLocation("TlabSlowAllocations"); |
7a5bbcc36bb2
add location identity to Pointer read and write operations
Lukas Stadler <lukas.stadler@jku.at>
parents:
7841
diff
changeset
|
575 |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
576 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
577 public static int tlabSlowAllocationsOffset() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
578 return config().tlabSlowAllocationsOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
579 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
580 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
581 @Fold |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
582 public static int tlabRefillWasteIncrement() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
583 return config().tlabRefillWasteIncrement; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
584 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
585 |
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 boolean tlabStats() { |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
588 return config().tlabStats; |
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 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
591 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
592 public static int layoutHelperOffset() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
593 return config().layoutHelperOffset; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
594 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
595 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
596 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
597 public static int layoutHelperHeaderSizeShift() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
598 return config().layoutHelperHeaderSizeShift; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
599 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
600 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
601 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
602 public static int layoutHelperHeaderSizeMask() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
603 return config().layoutHelperHeaderSizeMask; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
604 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
605 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
606 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
607 public static int layoutHelperLog2ElementSizeShift() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
608 return config().layoutHelperLog2ElementSizeShift; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
609 } |
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 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
612 public static int layoutHelperLog2ElementSizeMask() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
613 return config().layoutHelperLog2ElementSizeMask; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
614 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
615 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
616 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
617 public static int layoutHelperElementTypeShift() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
618 return config().layoutHelperElementTypeShift; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
619 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
620 |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
621 @Fold |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
622 public static int layoutHelperElementTypeMask() { |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
623 return config().layoutHelperElementTypeMask; |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
624 } |
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
625 |
7760
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
626 @Fold |
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
627 public static int layoutHelperElementTypePrimitiveInPlace() { |
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
628 return config().layoutHelperElementTypePrimitiveInPlace; |
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
629 } |
0ae87cf94914
add primitive type mask to HotSpotVMConfig
Lukas Stadler <lukas.stadler@jku.at>
parents:
7701
diff
changeset
|
630 |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
631 static { |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
632 assert arrayIndexScale(Kind.Byte) == 1; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
633 assert arrayIndexScale(Kind.Boolean) == 1; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
634 assert arrayIndexScale(Kind.Char) == 2; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
635 assert arrayIndexScale(Kind.Short) == 2; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
636 assert arrayIndexScale(Kind.Int) == 4; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
637 assert arrayIndexScale(Kind.Long) == 8; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
638 assert arrayIndexScale(Kind.Float) == 4; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
639 assert arrayIndexScale(Kind.Double) == 8; |
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
640 } |
7543
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
641 |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
642 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
|
643 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
|
644 |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
645 // 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
|
646 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
|
647 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
|
648 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
|
649 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
|
650 return hash; |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
651 } |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
652 } |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
653 |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
654 return IdentityHashCodeStubCall.call(x); |
be0d995ef51e
factored out code common to SystemSubstitutions.identityHashCode() and ObjectSubstitutions.hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
655 } |
8564
bbd8167f21f9
Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
8522
diff
changeset
|
656 |
bbd8167f21f9
Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
8522
diff
changeset
|
657 @Fold |
bbd8167f21f9
Added executeHelper to HotSpotInstalled code that gets replaced by a MethodSubstitution
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
8522
diff
changeset
|
658 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
|
659 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
|
660 } |
6362
6d232ee6a62d
factored shared snippet functionality into HotSpotSnippetUtils
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
661 } |