Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java @ 7708:14720c279875
Merge
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Mon, 04 Feb 2013 20:23:57 +0100 |
parents | a87bebe5e650 47467b2c3fc5 |
children | 7a5bbcc36bb2 |
rev | line source |
---|---|
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot.snippets; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 import static com.oracle.graal.hotspot.nodes.BeginLockScopeNode.*; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
26 import static com.oracle.graal.hotspot.nodes.DirectCompareAndSwapNode.*; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
27 import static com.oracle.graal.hotspot.nodes.EndLockScopeNode.*; |
6453
3bba61323b38
added VMErrorNode intrinsic to support handling fatal errors in snippets
Doug Simon <doug.simon@oracle.com>
parents:
6451
diff
changeset
|
28 import static com.oracle.graal.hotspot.nodes.VMErrorNode.*; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 import static com.oracle.graal.hotspot.snippets.HotSpotSnippetUtils.*; |
6568
d8408e5563e5
added indirection for the replacement of a snippet-lowered node with the snippet's return value
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
30 import static com.oracle.graal.snippets.SnippetTemplate.*; |
7490
4c474119df1c
Probabilities for the monitor snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7300
diff
changeset
|
31 import static com.oracle.graal.snippets.nodes.BranchProbabilityNode.*; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
32 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
33 import java.util.*; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
34 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
35 import com.oracle.graal.api.code.*; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
36 import com.oracle.graal.api.meta.*; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 import com.oracle.graal.graph.*; |
6424
be2f614bdeac
fixed bug in MonitorSnippets and enabled them for general use
Doug Simon <doug.simon@oracle.com>
parents:
6419
diff
changeset
|
38 import com.oracle.graal.graph.Node.NodeIntrinsic; |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
39 import com.oracle.graal.graph.iterators.*; |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7075
diff
changeset
|
40 import com.oracle.graal.hotspot.meta.*; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
41 import com.oracle.graal.hotspot.nodes.*; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
42 import com.oracle.graal.nodes.*; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
43 import com.oracle.graal.nodes.java.*; |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
44 import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
45 import com.oracle.graal.nodes.spi.*; |
6526
ee651c726397
split phases out of graal.phases project into graal.phases.common project
Doug Simon <doug.simon@oracle.com>
parents:
6525
diff
changeset
|
46 import com.oracle.graal.phases.common.*; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
47 import com.oracle.graal.snippets.*; |
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
|
48 import com.oracle.graal.snippets.Snippet.ConstantParameter; |
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
|
49 import com.oracle.graal.snippets.Snippet.Parameter; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
50 import com.oracle.graal.snippets.SnippetTemplate.AbstractTemplates; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
51 import com.oracle.graal.snippets.SnippetTemplate.Arguments; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
52 import com.oracle.graal.snippets.SnippetTemplate.Key; |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
53 import com.oracle.graal.word.*; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
54 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
55 /** |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
56 * Snippets used for implementing the monitorenter and monitorexit instructions. |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
57 * |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
58 * The locking algorithm used is described in the paper <a |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
59 * href="http://dl.acm.org/citation.cfm?id=1167515.1167496"> Eliminating synchronization-related |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
60 * atomic operations with biased locking and bulk rebiasing</a> by Kenneth Russell and David |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
61 * Detlefs. |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
62 */ |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
63 public class MonitorSnippets implements SnippetsInterface { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
64 |
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
|
65 /** |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
66 * Monitor operations on objects whose type contains this substring will be traced. |
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
|
67 */ |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
68 private static final String TRACE_TYPE_FILTER = System.getProperty("graal.monitors.trace.typeFilter"); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
69 |
6424
be2f614bdeac
fixed bug in MonitorSnippets and enabled them for general use
Doug Simon <doug.simon@oracle.com>
parents:
6419
diff
changeset
|
70 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
71 * Monitor operations in methods whose fully qualified name contains this substring will be |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
72 * traced. |
6424
be2f614bdeac
fixed bug in MonitorSnippets and enabled them for general use
Doug Simon <doug.simon@oracle.com>
parents:
6419
diff
changeset
|
73 */ |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
74 private static final String TRACE_METHOD_FILTER = System.getProperty("graal.monitors.trace.methodFilter"); |
6424
be2f614bdeac
fixed bug in MonitorSnippets and enabled them for general use
Doug Simon <doug.simon@oracle.com>
parents:
6419
diff
changeset
|
75 |
6453
3bba61323b38
added VMErrorNode intrinsic to support handling fatal errors in snippets
Doug Simon <doug.simon@oracle.com>
parents:
6451
diff
changeset
|
76 public static final boolean CHECK_BALANCED_MONITORS = Boolean.getBoolean("graal.monitors.checkBalanced"); |
6424
be2f614bdeac
fixed bug in MonitorSnippets and enabled them for general use
Doug Simon <doug.simon@oracle.com>
parents:
6419
diff
changeset
|
77 |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
78 @Snippet |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
79 public static void monitorenter(@Parameter("object") Object object, @ConstantParameter("checkNull") boolean checkNull, @ConstantParameter("trace") boolean trace) { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
80 verifyOop(object); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
81 |
6716
536dbb4dd212
removed null check from UnsafeLoadNode, UnsafeStoreNode, ReadNode and WriteNode as it violates the sun.misc.Unsafe API
Doug Simon <doug.simon@oracle.com>
parents:
6673
diff
changeset
|
82 if (checkNull && object == null) { |
536dbb4dd212
removed null check from UnsafeLoadNode, UnsafeStoreNode, ReadNode and WriteNode as it violates the sun.misc.Unsafe API
Doug Simon <doug.simon@oracle.com>
parents:
6673
diff
changeset
|
83 DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.NullCheckException); |
536dbb4dd212
removed null check from UnsafeLoadNode, UnsafeStoreNode, ReadNode and WriteNode as it violates the sun.misc.Unsafe API
Doug Simon <doug.simon@oracle.com>
parents:
6673
diff
changeset
|
84 } |
536dbb4dd212
removed null check from UnsafeLoadNode, UnsafeStoreNode, ReadNode and WriteNode as it violates the sun.misc.Unsafe API
Doug Simon <doug.simon@oracle.com>
parents:
6673
diff
changeset
|
85 |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
86 // Load the mark word - this includes a null-check on object |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
87 final Word mark = loadWordFromObject(object, markOffset()); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
88 |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
89 final Word lock = beginLockScope(false); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
90 |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
91 trace(trace, " object: 0x%016lx\n", Word.fromObject(object)); |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
92 trace(trace, " lock: 0x%016lx\n", lock); |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
93 trace(trace, " mark: 0x%016lx\n", mark); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
94 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
95 incCounter(); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
96 |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
97 if (useBiasedLocking()) { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
98 // See whether the lock is currently biased toward our thread and |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
99 // whether the epoch is still valid. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
100 // Note that the runtime guarantees sufficient alignment of JavaThread |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
101 // pointers to allow age to be placed into low bits. |
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
|
102 final Word biasableLockBits = mark.and(biasedLockMaskInPlace()); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
103 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
104 // First check to see whether biasing is enabled for this object |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
105 if (biasableLockBits.notEqual(Word.unsigned(biasedLockPattern()))) { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
106 // Biasing not enabled -> fall through to lightweight locking |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
107 } else { |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
108 probability(FREQUENT_PROBABILITY); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
109 // The bias pattern is present in the object's mark word. Need to check |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
110 // whether the bias owner and the epoch are both still current. |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6673
diff
changeset
|
111 Word hub = loadHub(object); |
7275
4f220c85044d
replaces node intrinsics for loadinf from a Word with methods directly in the Word class itself
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
112 final Word prototypeMarkWord = hub.readWord(prototypeMarkWordOffset()); |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
113 final Word thread = thread(); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
114 final Word tmp = prototypeMarkWord.or(thread).xor(mark).and(~ageMaskInPlace()); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
115 trace(trace, "prototypeMarkWord: 0x%016lx\n", prototypeMarkWord); |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
116 trace(trace, " thread: 0x%016lx\n", thread); |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
117 trace(trace, " tmp: 0x%016lx\n", tmp); |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
118 if (tmp.equal(0)) { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
119 // Object is already biased to current thread -> done |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
120 probability(FREQUENT_PROBABILITY); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
121 traceObject(trace, "+lock{bias:existing}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
122 return; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
123 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
124 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
125 // At this point we know that the mark word has the bias pattern and |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
126 // that we are not the bias owner in the current epoch. We need to |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
127 // figure out more details about the state of the mark word in order to |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
128 // know what operations can be legally performed on the object's |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
129 // mark word. |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
130 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
131 // If the low three bits in the xor result aren't clear, that means |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
132 // the prototype header is no longer biasable and we have to revoke |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
133 // the bias on this object. |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
134 if (tmp.and(biasedLockMaskInPlace()).equal(0)) { |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
135 probability(FREQUENT_PROBABILITY); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
136 // Biasing is still enabled for object's type. See whether the |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
137 // epoch of the current bias is still valid, meaning that the epoch |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
138 // bits of the mark word are equal to the epoch bits of the |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
139 // prototype mark word. (Note that the prototype mark word's epoch bits |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
140 // only change at a safepoint.) If not, attempt to rebias the object |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
141 // toward the current thread. Note that we must be absolutely sure |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
142 // that the current epoch is invalid in order to do this because |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
143 // otherwise the manipulations it performs on the mark word are |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
144 // illegal. |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
145 if (tmp.and(epochMaskInPlace()).equal(0)) { |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
146 probability(FREQUENT_PROBABILITY); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
147 // The epoch of the current bias is still valid but we know nothing |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
148 // about the owner; it might be set or it might be clear. Try to |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
149 // acquire the bias of the object using an atomic operation. If this |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
150 // fails we will go in to the runtime to revoke the object's bias. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
151 // Note that we first construct the presumed unbiased header so we |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
152 // don't accidentally blow away another thread's valid bias. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
153 Word unbiasedMark = mark.and(biasedLockMaskInPlace() | ageMaskInPlace() | epochMaskInPlace()); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
154 Word biasedMark = unbiasedMark.or(thread); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
155 trace(trace, " unbiasedMark: 0x%016lx\n", unbiasedMark); |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
156 trace(trace, " biasedMark: 0x%016lx\n", biasedMark); |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
157 if (compareAndSwap(object, markOffset(), unbiasedMark, biasedMark).equal(unbiasedMark)) { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
158 // Object is now biased to current thread -> done |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
159 traceObject(trace, "+lock{bias:acquired}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
160 return; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
161 } |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
162 // If the biasing toward our thread failed, this means that another thread |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
163 // owns the bias and we need to revoke that bias. The revocation will occur |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
164 // in the interpreter runtime. |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
165 probability(DEOPT_PATH_PROBABILITY); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
166 traceObject(trace, "+lock{stub:revoke}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
167 MonitorEnterStubCall.call(object, lock); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
168 return; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
169 } else { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
170 // At this point we know the epoch has expired, meaning that the |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
171 // current bias owner, if any, is actually invalid. Under these |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
172 // circumstances _only_, are we allowed to use the current mark word |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
173 // value as the comparison value when doing the CAS to acquire the |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
174 // bias in the current epoch. In other words, we allow transfer of |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
175 // the bias from one thread to another directly in this situation. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
176 Word biasedMark = prototypeMarkWord.or(thread); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
177 trace(trace, " biasedMark: 0x%016lx\n", biasedMark); |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
178 if (compareAndSwap(object, markOffset(), mark, biasedMark).equal(mark)) { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
179 // Object is now biased to current thread -> done |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
180 traceObject(trace, "+lock{bias:transfer}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
181 return; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
182 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
183 // If the biasing toward our thread failed, then another thread |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
184 // succeeded in biasing it toward itself and we need to revoke that |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
185 // bias. The revocation will occur in the runtime in the slow case. |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
186 probability(DEOPT_PATH_PROBABILITY); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
187 traceObject(trace, "+lock{stub:epoch-expired}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
188 MonitorEnterStubCall.call(object, lock); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
189 return; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
190 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
191 } else { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
192 // The prototype mark word doesn't have the bias bit set any |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
193 // more, indicating that objects of this data type are not supposed |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
194 // to be biased any more. We are going to try to reset the mark of |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
195 // this object to the prototype value and fall through to the |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
196 // CAS-based locking scheme. Note that if our CAS fails, it means |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
197 // that another thread raced us for the privilege of revoking the |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
198 // bias of this particular object, so it's okay to continue in the |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
199 // normal locking code. |
6424
be2f614bdeac
fixed bug in MonitorSnippets and enabled them for general use
Doug Simon <doug.simon@oracle.com>
parents:
6419
diff
changeset
|
200 Word result = compareAndSwap(object, markOffset(), mark, prototypeMarkWord); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
201 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
202 // Fall through to the normal CAS-based lock, because no matter what |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
203 // the result of the above CAS, some thread must have succeeded in |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
204 // removing the bias bit from the object's header. |
6424
be2f614bdeac
fixed bug in MonitorSnippets and enabled them for general use
Doug Simon <doug.simon@oracle.com>
parents:
6419
diff
changeset
|
205 |
be2f614bdeac
fixed bug in MonitorSnippets and enabled them for general use
Doug Simon <doug.simon@oracle.com>
parents:
6419
diff
changeset
|
206 if (ENABLE_BREAKPOINT) { |
be2f614bdeac
fixed bug in MonitorSnippets and enabled them for general use
Doug Simon <doug.simon@oracle.com>
parents:
6419
diff
changeset
|
207 bkpt(object, mark, tmp, result); |
be2f614bdeac
fixed bug in MonitorSnippets and enabled them for general use
Doug Simon <doug.simon@oracle.com>
parents:
6419
diff
changeset
|
208 } |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
209 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
210 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
211 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
212 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
213 // Create the unlocked mark word pattern |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
214 Word unlockedMark = mark.or(unlockedMask()); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
215 trace(trace, " unlockedMark: 0x%016lx\n", unlockedMark); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
216 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
217 // Copy this unlocked mark word into the lock slot on the stack |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
218 lock.writeWord(lockDisplacedMarkOffset(), unlockedMark); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
219 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
220 // Test if the object's mark word is unlocked, and if so, store the |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
221 // (address of) the lock slot into the object's mark word. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
222 Word currentMark = compareAndSwap(object, markOffset(), unlockedMark, lock); |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
223 if (currentMark.notEqual(unlockedMark)) { |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
224 trace(trace, " currentMark: 0x%016lx\n", currentMark); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
225 // The mark word in the object header was not the same. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
226 // Either the object is locked by another thread or is already locked |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
227 // by the current thread. The latter is true if the mark word |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
228 // is a stack pointer into the current thread's stack, i.e.: |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
229 // |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
230 // 1) (currentMark & aligned_mask) == 0 |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
231 // 2) rsp <= currentMark |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
232 // 3) currentMark <= rsp + page_size |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
233 // |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
234 // These 3 tests can be done by evaluating the following expression: |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
235 // |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
236 // (currentMark - rsp) & (aligned_mask - page_size) |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
237 // |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
238 // assuming both the stack pointer and page_size have their least |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
239 // significant 2 bits cleared and page_size is a power of 2 |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
240 final Word alignedMask = Word.unsigned(wordSize() - 1); |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
241 final Word stackPointer = stackPointer(); |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
242 if (currentMark.subtract(stackPointer).and(alignedMask.subtract(pageSize())).notEqual(0)) { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
243 // Most likely not a recursive lock, go into a slow runtime call |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
244 probability(DEOPT_PATH_PROBABILITY); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
245 traceObject(trace, "+lock{stub:failed-cas}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
246 MonitorEnterStubCall.call(object, lock); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
247 return; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
248 } else { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
249 // Recursively locked => write 0 to the lock slot |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
250 lock.writeWord(lockDisplacedMarkOffset(), Word.zero()); |
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
251 traceObject(trace, "+lock{recursive}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
252 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
253 } else { |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
254 traceObject(trace, "+lock{cas}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
255 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
256 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
257 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
258 @Snippet |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6424
diff
changeset
|
259 public static void monitorenterEliminated() { |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
260 incCounter(); |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
261 beginLockScope(true); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
262 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
263 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
264 /** |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
265 * Calls straight out to the monitorenter stub. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
266 */ |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
267 @Snippet |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
268 public static void monitorenterStub(@Parameter("object") Object object, @ConstantParameter("checkNull") boolean checkNull, @ConstantParameter("trace") boolean trace) { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
269 verifyOop(object); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
270 incCounter(); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
271 if (checkNull && object == null) { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
272 DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.NullCheckException); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
273 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
274 // BeginLockScope nodes do not read from object so a use of object |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
275 // cannot float about the null check above |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
276 final Word lock = beginLockScope(false); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
277 traceObject(trace, "+lock{stub}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
278 MonitorEnterStubCall.call(object, lock); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
279 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
280 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
281 @Snippet |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
282 public static void monitorexit(@Parameter("object") Object object, @ConstantParameter("trace") boolean trace) { |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
283 trace(trace, " object: 0x%016lx\n", Word.fromObject(object)); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
284 if (useBiasedLocking()) { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
285 // Check for biased locking unlock case, which is a no-op |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
286 // Note: we do not have to check the thread ID for two reasons. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
287 // First, the interpreter checks for IllegalMonitorStateException at |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
288 // a higher level. Second, if the bias was revoked while we held the |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
289 // lock, the object could not be rebiased toward another thread, so |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
290 // the bias bit would be clear. |
6419
b74402a7079b
fixed oopmap bug caused by unsafe mixing of word and object values
Doug Simon <doug.simon@oracle.com>
parents:
6389
diff
changeset
|
291 final Word mark = loadWordFromObject(object, markOffset()); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
292 trace(trace, " mark: 0x%016lx\n", mark); |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
293 if (mark.and(biasedLockMaskInPlace()).equal(Word.unsigned(biasedLockPattern()))) { |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
294 probability(FREQUENT_PROBABILITY); |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6424
diff
changeset
|
295 endLockScope(); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
296 decCounter(); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
297 traceObject(trace, "-lock{bias}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
298 return; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
299 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
300 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
301 |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
302 final Word lock = CurrentLockNode.currentLock(); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
303 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
304 // Load displaced mark |
7275
4f220c85044d
replaces node intrinsics for loadinf from a Word with methods directly in the Word class itself
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
305 final Word displacedMark = lock.readWord(lockDisplacedMarkOffset()); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
306 trace(trace, " displacedMark: 0x%016lx\n", displacedMark); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
307 |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
308 if (displacedMark.equal(0)) { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
309 // Recursive locking => done |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
310 traceObject(trace, "-lock{recursive}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
311 } else { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
312 verifyOop(object); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
313 // Test if object's mark word is pointing to the displaced mark word, and if so, restore |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
314 // the displaced mark in the object - if the object's mark word is not pointing to |
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
|
315 // the displaced mark word, do unlocking via runtime call. |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
316 if (DirectCompareAndSwapNode.compareAndSwap(object, markOffset(), lock, displacedMark).notEqual(lock)) { |
7490
4c474119df1c
Probabilities for the monitor snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7300
diff
changeset
|
317 // The object's mark word was not pointing to the displaced header, |
4c474119df1c
Probabilities for the monitor snippets
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7300
diff
changeset
|
318 // we do unlocking via runtime call. |
7554
9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
Lukas Stadler <lukas.stadler@jku.at>
parents:
7530
diff
changeset
|
319 probability(DEOPT_PATH_PROBABILITY); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
320 traceObject(trace, "-lock{stub}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
321 MonitorExitStubCall.call(object); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
322 } else { |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
323 traceObject(trace, "-lock{cas}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
324 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
325 } |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6424
diff
changeset
|
326 endLockScope(); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
327 decCounter(); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
328 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
329 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
330 /** |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
331 * Calls straight out to the monitorexit stub. |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
332 */ |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
333 @Snippet |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
334 public static void monitorexitStub(@Parameter("object") Object object, @ConstantParameter("trace") boolean trace) { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
335 verifyOop(object); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
336 traceObject(trace, "-lock{stub}", object); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
337 MonitorExitStubCall.call(object); |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6424
diff
changeset
|
338 endLockScope(); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
339 decCounter(); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
340 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
341 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
342 @Snippet |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6424
diff
changeset
|
343 public static void monitorexitEliminated() { |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6424
diff
changeset
|
344 endLockScope(); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
345 decCounter(); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
346 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
347 |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
348 private static void traceObject(boolean enabled, String action, Object object) { |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
349 if (enabled) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
350 Log.print(action); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
351 Log.print(' '); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
352 Log.printlnObject(object); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
353 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
354 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
355 |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
356 private static void trace(boolean enabled, String format, WordBase value) { |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
357 if (enabled) { |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
358 Log.printf(format, value.rawValue()); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
359 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
360 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
361 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
362 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
363 * Leaving the breakpoint code in to provide an example of how to use the {@link BreakpointNode} |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
364 * intrinsic. |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
365 */ |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
366 private static final boolean ENABLE_BREAKPOINT = false; |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
367 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
368 @NodeIntrinsic(BreakpointNode.class) |
6458
fb66841a0994
made all @NodeIntrinsic annotated methods be native (this is a requirement now enforced during snippet intrinsification)
Doug Simon <doug.simon@oracle.com>
parents:
6453
diff
changeset
|
369 static native void bkpt(Object object, Word mark, Word tmp, Word value); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
370 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
371 private static void incCounter() { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
372 if (CHECK_BALANCED_MONITORS) { |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
373 final Word counter = MonitorCounterNode.counter(); |
7275
4f220c85044d
replaces node intrinsics for loadinf from a Word with methods directly in the Word class itself
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
374 final int count = counter.readInt(0); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
375 counter.writeInt(0, count + 1); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
376 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
377 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
378 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
379 private static void decCounter() { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
380 if (CHECK_BALANCED_MONITORS) { |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
381 final Word counter = MonitorCounterNode.counter(); |
7275
4f220c85044d
replaces node intrinsics for loadinf from a Word with methods directly in the Word class itself
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
382 final int count = counter.readInt(0); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
383 counter.writeInt(0, count - 1); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
384 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
385 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
386 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
387 @Snippet |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
388 private static void initCounter() { |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
389 final Word counter = MonitorCounterNode.counter(); |
7300
2912b72d840a
More complete and reusable Word type
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7276
diff
changeset
|
390 counter.writeInt(0, 0); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
391 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
392 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
393 @Snippet |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
394 private static void checkCounter(String errMsg) { |
6954
0e20ad1ea98b
removed WordStamp (and a nasty bug associated with its misusage)
Doug Simon <doug.simon@oracle.com>
parents:
6952
diff
changeset
|
395 final Word counter = MonitorCounterNode.counter(); |
7275
4f220c85044d
replaces node intrinsics for loadinf from a Word with methods directly in the Word class itself
Doug Simon <doug.simon@oracle.com>
parents:
7143
diff
changeset
|
396 final int count = counter.readInt(0); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
397 if (count != 0) { |
6453
3bba61323b38
added VMErrorNode intrinsic to support handling fatal errors in snippets
Doug Simon <doug.simon@oracle.com>
parents:
6451
diff
changeset
|
398 vmError(errMsg, count); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
399 } |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
400 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
401 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
402 public static class Templates extends AbstractTemplates<MonitorSnippets> { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
403 |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
404 private final ResolvedJavaMethod monitorenter; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
405 private final ResolvedJavaMethod monitorexit; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
406 private final ResolvedJavaMethod monitorenterStub; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
407 private final ResolvedJavaMethod monitorexitStub; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
408 private final ResolvedJavaMethod monitorenterEliminated; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
409 private final ResolvedJavaMethod monitorexitEliminated; |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
410 private final ResolvedJavaMethod initCounter; |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
411 private final ResolvedJavaMethod checkCounter; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
412 private final boolean useFastLocking; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
413 |
7075 | 414 public Templates(CodeCacheProvider runtime, Assumptions assumptions, TargetDescription target, boolean useFastLocking) { |
415 super(runtime, assumptions, target, MonitorSnippets.class); | |
6716
536dbb4dd212
removed null check from UnsafeLoadNode, UnsafeStoreNode, ReadNode and WriteNode as it violates the sun.misc.Unsafe API
Doug Simon <doug.simon@oracle.com>
parents:
6673
diff
changeset
|
416 monitorenter = snippet("monitorenter", Object.class, boolean.class, boolean.class); |
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
|
417 monitorexit = snippet("monitorexit", Object.class, boolean.class); |
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
|
418 monitorenterStub = snippet("monitorenterStub", Object.class, boolean.class, boolean.class); |
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
|
419 monitorexitStub = snippet("monitorexitStub", Object.class, boolean.class); |
6436
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6424
diff
changeset
|
420 monitorenterEliminated = snippet("monitorenterEliminated"); |
5395ecdfce8a
move monitors into FrameState (fixes subtle issues for tail duplication and other optimizations)
Lukas Stadler <lukas.stadler@jku.at>
parents:
6424
diff
changeset
|
421 monitorexitEliminated = snippet("monitorexitEliminated"); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
422 initCounter = snippet("initCounter"); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
423 checkCounter = snippet("checkCounter", String.class); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
424 this.useFastLocking = useFastLocking; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
425 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
426 |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
427 public void lower(MonitorEnterNode monitorenterNode, @SuppressWarnings("unused") LoweringTool tool) { |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
428 StructuredGraph graph = (StructuredGraph) monitorenterNode.graph(); |
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
|
429 |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
430 checkBalancedMonitors(graph); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
431 |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
432 FrameState stateAfter = monitorenterNode.stateAfter(); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
433 boolean eliminated = monitorenterNode.eliminated(); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
434 ResolvedJavaMethod method = eliminated ? monitorenterEliminated : useFastLocking ? monitorenter : monitorenterStub; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
435 boolean checkNull = !monitorenterNode.object().stamp().nonNull(); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
436 Key key = new Key(method); |
6716
536dbb4dd212
removed null check from UnsafeLoadNode, UnsafeStoreNode, ReadNode and WriteNode as it violates the sun.misc.Unsafe API
Doug Simon <doug.simon@oracle.com>
parents:
6673
diff
changeset
|
437 if (method != monitorenterEliminated) { |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
438 key.add("checkNull", checkNull); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
439 } |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
440 if (!eliminated) { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
441 key.add("trace", isTracingEnabledForType(monitorenterNode.object()) || isTracingEnabledForMethod(stateAfter.method()) || isTracingEnabledForMethod(graph.method())); |
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
|
442 } |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
443 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
444 Arguments arguments = new Arguments(); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
445 if (!eliminated) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
446 arguments.add("object", monitorenterNode.object()); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
447 } |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6716
diff
changeset
|
448 SnippetTemplate template = cache.get(key, assumptions); |
6568
d8408e5563e5
added indirection for the replacement of a snippet-lowered node with the snippet's return value
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
449 Map<Node, Node> nodes = template.instantiate(runtime, monitorenterNode, DEFAULT_REPLACER, arguments); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
450 for (Node n : nodes.values()) { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
451 if (n instanceof BeginLockScopeNode) { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
452 BeginLockScopeNode begin = (BeginLockScopeNode) n; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
453 begin.setStateAfter(stateAfter); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
454 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
455 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
456 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
457 |
7701
47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
Christian Wimmer <christian.wimmer@oracle.com>
parents:
7660
diff
changeset
|
458 public void lower(MonitorExitNode monitorexitNode, @SuppressWarnings("unused") LoweringTool tool) { |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
459 StructuredGraph graph = (StructuredGraph) monitorexitNode.graph(); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
460 FrameState stateAfter = monitorexitNode.stateAfter(); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
461 boolean eliminated = monitorexitNode.eliminated(); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
462 ResolvedJavaMethod method = eliminated ? monitorexitEliminated : useFastLocking ? monitorexit : monitorexitStub; |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
463 Key key = new Key(method); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
464 if (!eliminated) { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
465 key.add("trace", isTracingEnabledForType(monitorexitNode.object()) || isTracingEnabledForMethod(stateAfter.method()) || isTracingEnabledForMethod(graph.method())); |
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
|
466 } |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
467 Arguments arguments = new Arguments(); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
468 if (!eliminated) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
469 arguments.add("object", monitorexitNode.object()); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
470 } |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
6716
diff
changeset
|
471 SnippetTemplate template = cache.get(key, assumptions); |
6568
d8408e5563e5
added indirection for the replacement of a snippet-lowered node with the snippet's return value
Doug Simon <doug.simon@oracle.com>
parents:
6539
diff
changeset
|
472 Map<Node, Node> nodes = template.instantiate(runtime, monitorexitNode, DEFAULT_REPLACER, arguments); |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
473 for (Node n : nodes.values()) { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
474 if (n instanceof EndLockScopeNode) { |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
475 EndLockScopeNode end = (EndLockScopeNode) n; |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
476 end.setStateAfter(stateAfter); |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
477 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
478 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
479 } |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
480 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
481 static boolean isTracingEnabledForType(ValueNode object) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
482 ResolvedJavaType type = object.objectStamp().type(); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
483 if (TRACE_TYPE_FILTER == null) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
484 return false; |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
485 } else { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
486 if (TRACE_TYPE_FILTER.length() == 0) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
487 return true; |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
488 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
489 if (type == null) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
490 return false; |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
491 } |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6526
diff
changeset
|
492 return (type.getName().contains(TRACE_TYPE_FILTER)); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
493 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
494 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
495 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
496 static boolean isTracingEnabledForMethod(ResolvedJavaMethod method) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
497 if (TRACE_METHOD_FILTER == null) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
498 return false; |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
499 } else { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
500 if (TRACE_METHOD_FILTER.length() == 0) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
501 return true; |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
502 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
503 if (method == null) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
504 return false; |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
505 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
506 return (MetaUtil.format("%H.%n", method).contains(TRACE_METHOD_FILTER)); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
507 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
508 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
509 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
510 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
511 * If balanced monitor checking is enabled then nodes are inserted at the start and all |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
512 * return points of the graph to initialize and check the monitor counter respectively. |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
513 */ |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
514 private void checkBalancedMonitors(StructuredGraph graph) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
515 if (CHECK_BALANCED_MONITORS) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
516 NodeIterable<MonitorCounterNode> nodes = graph.getNodes().filter(MonitorCounterNode.class); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
517 if (nodes.isEmpty()) { |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
518 // Only insert the nodes if this is the first monitorenter being lowered. |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6526
diff
changeset
|
519 JavaType returnType = initCounter.getSignature().getReturnType(initCounter.getDeclaringClass()); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
520 MethodCallTargetNode callTarget = graph.add(new MethodCallTargetNode(InvokeKind.Static, initCounter, new ValueNode[0], returnType)); |
7660
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7556
diff
changeset
|
521 InvokeNode invoke = graph.add(new InvokeNode(callTarget, 0)); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
522 invoke.setStateAfter(graph.start().stateAfter()); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
523 graph.addAfterFixed(graph.start(), invoke); |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6526
diff
changeset
|
524 StructuredGraph inlineeGraph = (StructuredGraph) initCounter.getCompilerStorage().get(Graph.class); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
525 InliningUtil.inline(invoke, inlineeGraph, false); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
526 |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
527 List<ReturnNode> rets = graph.getNodes().filter(ReturnNode.class).snapshot(); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
528 for (ReturnNode ret : rets) { |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6526
diff
changeset
|
529 returnType = checkCounter.getSignature().getReturnType(checkCounter.getDeclaringClass()); |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7075
diff
changeset
|
530 Object msg = ((HotSpotRuntime) runtime).registerGCRoot("unbalanced monitors in " + MetaUtil.format("%H.%n(%p)", graph.method()) + ", count = %d"); |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7075
diff
changeset
|
531 ConstantNode errMsg = ConstantNode.forObject(msg, runtime, graph); |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7490
diff
changeset
|
532 callTarget = graph.add(new MethodCallTargetNode(InvokeKind.Static, checkCounter, new ValueNode[]{errMsg}, returnType)); |
7660
0b646334c5f7
keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents:
7556
diff
changeset
|
533 invoke = graph.add(new InvokeNode(callTarget, 0)); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
534 List<ValueNode> stack = Collections.emptyList(); |
6673
a52320a6bbda
remove InliningIdentifier
Lukas Stadler <lukas.stadler@jku.at>
parents:
6568
diff
changeset
|
535 FrameState stateAfter = new FrameState(graph.method(), FrameState.AFTER_BCI, new ValueNode[0], stack, new ValueNode[0], false, false); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
536 invoke.setStateAfter(graph.add(stateAfter)); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
537 graph.addBeforeFixed(ret, invoke); |
6539
2463eb24b644
Cleanup of Graal API: Rename methods so that it follows the getXxx naming convention and so that they are similar to the names of the java.lang.reflect classes. Remove unused methods.
Christian Wimmer <christian.wimmer@oracle.com>
parents:
6526
diff
changeset
|
538 inlineeGraph = (StructuredGraph) checkCounter.getCompilerStorage().get(Graph.class); |
6451
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
539 InliningUtil.inline(invoke, inlineeGraph, false); |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
540 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
541 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
542 } |
c9f45d2d96cf
fixed bug in monitor snippets; they are now used for general lowering of monitor operations
Doug Simon <doug.simon@oracle.com>
parents:
6436
diff
changeset
|
543 } |
6386
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
544 } |
abeeb57b655d
added MonitorSnippets which passes MonitorTest but is not yet enabled for general lowering
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
545 } |