annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java @ 17450:45b45f902bed

removed Node generation (GRAAL-857)
author Doug Simon <doug.simon@oracle.com>
date Wed, 15 Oct 2014 15:35:33 +0200
parents 845e881ce054
children 9619ba4daf4c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
23 package com.oracle.graal.nodes.extended;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
15291
471e28b8f03b Move UnsafeAccess to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents: 15261
diff changeset
25 import static com.oracle.graal.compiler.common.UnsafeAccess.*;
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
26
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5504
diff changeset
27 import com.oracle.graal.api.meta.*;
15261
882f4cb7cfcf Move Stamps to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents: 15039
diff changeset
28 import com.oracle.graal.compiler.common.type.*;
16841
cbd42807a31f moved NodeInfo and friends into separate com.oracle.graal.nodeinfo project so that annotation processor can be applied to the base Node class
Doug Simon <doug.simon@oracle.com>
parents: 16811
diff changeset
29 import com.oracle.graal.nodeinfo.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
30 import com.oracle.graal.nodes.*;
7091
08fe3a509cf1 Canoncialize UnsafeLoad/Store
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7090
diff changeset
31 import com.oracle.graal.nodes.java.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
32 import com.oracle.graal.nodes.spi.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7394
diff changeset
35 * Store of a value at a location specified as an offset relative to an object. No null check is
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7394
diff changeset
36 * performed before the store.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 */
16811
5d468add216f added @NodeInfo annotations to all Node classes
Doug Simon <doug.simon@oracle.com>
parents: 16792
diff changeset
38 @NodeInfo
10647
2ea604c4c6ec Factor and improve unsafe load/store canonicalization.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10646
diff changeset
39 public class UnsafeStoreNode extends UnsafeAccessNode implements StateSplit, Lowerable, Virtualizable, MemoryCheckpoint.Single {
7090
05ce1defa4f9 Common out some parts of UnsafeLoad/Store in UnsafeAccess
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7049
diff changeset
40
16897
f90dcdbbb75e switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
41 @Input ValueNode value;
f90dcdbbb75e switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
42 @OptionalInput(InputType.State) FrameState stateAfter;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
44 public static UnsafeStoreNode create(ValueNode object, ValueNode offset, ValueNode value, Kind accessKind, LocationIdentity locationIdentity) {
17450
45b45f902bed removed Node generation (GRAAL-857)
Doug Simon <doug.simon@oracle.com>
parents: 17306
diff changeset
45 return new UnsafeStoreNode(object, offset, value, accessKind, locationIdentity);
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
46 }
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
47
17306
845e881ce054 constructors in a Node class must be protected
Doug Simon <doug.simon@oracle.com>
parents: 16920
diff changeset
48 protected UnsafeStoreNode(ValueNode object, ValueNode offset, ValueNode value, Kind accessKind, LocationIdentity locationIdentity) {
16256
6f02ff62c3ef new constructor (with stateAfter) for UnsafeStoreNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16254
diff changeset
49 this(object, offset, value, accessKind, locationIdentity, null);
6f02ff62c3ef new constructor (with stateAfter) for UnsafeStoreNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16254
diff changeset
50 }
6f02ff62c3ef new constructor (with stateAfter) for UnsafeStoreNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16254
diff changeset
51
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
52 public static UnsafeStoreNode create(ValueNode object, ValueNode offset, ValueNode value, Kind accessKind, LocationIdentity locationIdentity, FrameState stateAfter) {
17450
45b45f902bed removed Node generation (GRAAL-857)
Doug Simon <doug.simon@oracle.com>
parents: 17306
diff changeset
53 return new UnsafeStoreNode(object, offset, value, accessKind, locationIdentity, stateAfter);
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
54 }
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
55
17306
845e881ce054 constructors in a Node class must be protected
Doug Simon <doug.simon@oracle.com>
parents: 16920
diff changeset
56 protected UnsafeStoreNode(ValueNode object, ValueNode offset, ValueNode value, Kind accessKind, LocationIdentity locationIdentity, FrameState stateAfter) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11787
diff changeset
57 super(StampFactory.forVoid(), object, offset, accessKind, locationIdentity);
16256
6f02ff62c3ef new constructor (with stateAfter) for UnsafeStoreNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16254
diff changeset
58 this.value = value;
6f02ff62c3ef new constructor (with stateAfter) for UnsafeStoreNode
Lukas Stadler <lukas.stadler@oracle.com>
parents: 16254
diff changeset
59 this.stateAfter = stateAfter;
7090
05ce1defa4f9 Common out some parts of UnsafeLoad/Store in UnsafeAccess
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7049
diff changeset
60 assert accessKind != Kind.Void && accessKind != Kind.Illegal;
05ce1defa4f9 Common out some parts of UnsafeLoad/Store in UnsafeAccess
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7049
diff changeset
61 }
5375
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
62
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
63 public FrameState stateAfter() {
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
64 return stateAfter;
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
65 }
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
66
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
67 public void setStateAfter(FrameState x) {
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
68 assert x == null || x.isAlive() : "frame state must be in a graph";
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
69 updateUsages(stateAfter, x);
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
70 stateAfter = x;
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
71 }
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
72
6534
feb579677b58 SnippetTemplate must not depend on CodeCacheProvider (only on MetaAccessProvider). This means that the hasSideEffect flag of a RuntimeCall must be already fixed in the RuntimeCall.Descriptor to avoid a lookup of the actual RuntimeCall using the CodeCacheProvider.
Christian Wimmer <christian.wimmer@oracle.com>
parents: 6521
diff changeset
73 public boolean hasSideEffect() {
5375
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
74 return true;
3035b6b881d9 removed stateAfter field from FixedWithNextNode - now only StateSplit implementations have this field
Doug Simon <doug.simon@oracle.com>
parents: 5362
diff changeset
75 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
76
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
77 public ValueNode value() {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78 return value;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
79 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
80
5705
f96e7b39e9fe Be more strict on isInt check in CAS lowering when index is constant
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5540
diff changeset
81 @Override
11579
ae619d70bf4b Rename LoweringType to GuardsPhase and make it an attribute of StructuredGraphs
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 10647
diff changeset
82 public void lower(LoweringTool tool) {
12045
0fc653a9e019 made GraalCodeCacheProvider independent of CodeCacheProvider and renamed the former to LoweringProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents: 11959
diff changeset
83 tool.getLowerer().lower(this, tool);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
85
7049
ccade022ec83 virtualization of unsafeload and unsafestore
Lukas Stadler <lukas.stadler@jku.at>
parents: 6716
diff changeset
86 @Override
ccade022ec83 virtualization of unsafeload and unsafestore
Lukas Stadler <lukas.stadler@jku.at>
parents: 6716
diff changeset
87 public void virtualize(VirtualizerTool tool) {
7394
94f032472c28 changed PEA interface:
Lukas Stadler <lukas.stadler@jku.at>
parents: 7091
diff changeset
88 State state = tool.getObjectState(object());
94f032472c28 changed PEA interface:
Lukas Stadler <lukas.stadler@jku.at>
parents: 7091
diff changeset
89 if (state != null && state.getState() == EscapeState.Virtual) {
7049
ccade022ec83 virtualization of unsafeload and unsafestore
Lukas Stadler <lukas.stadler@jku.at>
parents: 6716
diff changeset
90 ValueNode indexValue = tool.getReplacedValue(offset());
ccade022ec83 virtualization of unsafeload and unsafestore
Lukas Stadler <lukas.stadler@jku.at>
parents: 6716
diff changeset
91 if (indexValue.isConstant()) {
16897
f90dcdbbb75e switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
92 long off = indexValue.asConstant().asLong();
f90dcdbbb75e switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
93 int entryIndex = state.getVirtualObject().entryIndexForOffset(off);
12405
139b84d713bc Truffle API adjustments: Simplify frame handling. Introduce cast for MaterializedFrame objects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 12045
diff changeset
94 if (entryIndex != -1) {
12617
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
95 Kind entryKind = state.getVirtualObject().entryKind(entryIndex);
12405
139b84d713bc Truffle API adjustments: Simplify frame handling. Introduce cast for MaterializedFrame objects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 12045
diff changeset
96 ValueNode entry = state.getEntry(entryIndex);
14633
da2431cc1506 Rename ValueNode kind() to getKind().
Josef Eisl <josef.eisl@jku.at>
parents: 13153
diff changeset
97 if (entry.getKind() == value.getKind() || entryKind == accessKind()) {
12617
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
98 tool.setVirtualEntry(state, entryIndex, value(), true);
12405
139b84d713bc Truffle API adjustments: Simplify frame handling. Introduce cast for MaterializedFrame objects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 12045
diff changeset
99 tool.delete();
12617
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
100 } else {
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
101 if ((accessKind() == Kind.Long || accessKind() == Kind.Double) && entryKind == Kind.Int) {
16897
f90dcdbbb75e switched to using new NodeFieldIterator and NodeFieldIterable for traversing Node inputs and successors
Doug Simon <doug.simon@oracle.com>
parents: 16895
diff changeset
102 int nextIndex = state.getVirtualObject().entryIndexForOffset(off + 4);
12617
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
103 if (nextIndex != -1) {
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
104 Kind nextKind = state.getVirtualObject().entryKind(nextIndex);
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
105 if (nextKind == Kind.Int) {
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
106 tool.setVirtualEntry(state, entryIndex, value(), true);
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
107 tool.setVirtualEntry(state, nextIndex, ConstantNode.forConstant(Constant.forIllegal(), tool.getMetaAccessProvider(), graph()), true);
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
108 tool.delete();
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
109 }
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
110 }
bca33c3135de PEA: support for unsafe stores of mismatching sizes, cleanup, documentation
Lukas Stadler <lukas.stadler@jku.at>
parents: 12548
diff changeset
111 }
12405
139b84d713bc Truffle API adjustments: Simplify frame handling. Introduce cast for MaterializedFrame objects.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 12045
diff changeset
112 }
7049
ccade022ec83 virtualization of unsafeload and unsafestore
Lukas Stadler <lukas.stadler@jku.at>
parents: 6716
diff changeset
113 }
ccade022ec83 virtualization of unsafeload and unsafestore
Lukas Stadler <lukas.stadler@jku.at>
parents: 6716
diff changeset
114 }
ccade022ec83 virtualization of unsafeload and unsafestore
Lukas Stadler <lukas.stadler@jku.at>
parents: 6716
diff changeset
115 }
ccade022ec83 virtualization of unsafeload and unsafestore
Lukas Stadler <lukas.stadler@jku.at>
parents: 6716
diff changeset
116 }
ccade022ec83 virtualization of unsafeload and unsafestore
Lukas Stadler <lukas.stadler@jku.at>
parents: 6716
diff changeset
117
7091
08fe3a509cf1 Canoncialize UnsafeLoad/Store
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7090
diff changeset
118 @Override
10647
2ea604c4c6ec Factor and improve unsafe load/store canonicalization.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10646
diff changeset
119 protected ValueNode cloneAsFieldAccess(ResolvedJavaField field) {
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
120 return StoreFieldNode.create(object(), field, value(), stateAfter());
10647
2ea604c4c6ec Factor and improve unsafe load/store canonicalization.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10646
diff changeset
121 }
2ea604c4c6ec Factor and improve unsafe load/store canonicalization.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10646
diff changeset
122
15039
631ca3972292 Allow Unsafe operations on Java to use precise LocationIdentity and improve address formation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15001
diff changeset
123 @Override
631ca3972292 Allow Unsafe operations on Java to use precise LocationIdentity and improve address formation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15001
diff changeset
124 protected ValueNode cloneAsArrayAccess(ValueNode location, LocationIdentity identity) {
16895
06c15e88d383 added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
Doug Simon <doug.simon@oracle.com>
parents: 16841
diff changeset
125 return UnsafeStoreNode.create(object(), location, value, accessKind(), identity, stateAfter());
15039
631ca3972292 Allow Unsafe operations on Java to use precise LocationIdentity and improve address formation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15001
diff changeset
126 }
631ca3972292 Allow Unsafe operations on Java to use precise LocationIdentity and improve address formation
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 15001
diff changeset
127
11787
4fc75b6ca3dd Introduce NodeWithState for nodes that hold some VirtualState. Use this interface in the required special cases (Scheduling and PEA)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11579
diff changeset
128 public FrameState getState() {
4fc75b6ca3dd Introduce NodeWithState for nodes that hold some VirtualState. Use this interface in the required special cases (Scheduling and PEA)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11579
diff changeset
129 return stateAfter;
4fc75b6ca3dd Introduce NodeWithState for nodes that hold some VirtualState. Use this interface in the required special cases (Scheduling and PEA)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11579
diff changeset
130 }
4fc75b6ca3dd Introduce NodeWithState for nodes that hold some VirtualState. Use this interface in the required special cases (Scheduling and PEA)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11579
diff changeset
131
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
132 // specialized on value type until boxing/unboxing is sorted out in intrinsification
8436
10293cbfc2b6 wrote implementations for node intrinsics so that they can be interpreted when a method substitution is deoptimized and added unit tests to ensure existing method substitutions can run interpreted
Doug Simon <doug.simon@oracle.com>
parents: 8394
diff changeset
133
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
134 @SuppressWarnings("unused")
8436
10293cbfc2b6 wrote implementations for node intrinsics so that they can be interpreted when a method substitution is deoptimized and added unit tests to ensure existing method substitutions can run interpreted
Doug Simon <doug.simon@oracle.com>
parents: 8394
diff changeset
135 @NodeIntrinsic
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12445
diff changeset
136 public static void store(Object object, long offset, Object value, @ConstantNodeParameter Kind kind, @ConstantNodeParameter LocationIdentity locationIdentity) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11787
diff changeset
137 unsafe.putObject(object, offset, value);
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
138 }
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
139
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
140 @SuppressWarnings("unused")
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
141 @NodeIntrinsic
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12445
diff changeset
142 public static void store(Object object, long offset, boolean value, @ConstantNodeParameter Kind kind, @ConstantNodeParameter LocationIdentity locationIdentity) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11787
diff changeset
143 unsafe.putBoolean(object, offset, value);
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
144 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
145
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
146 @SuppressWarnings("unused")
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
147 @NodeIntrinsic
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12445
diff changeset
148 public static void store(Object object, long offset, byte value, @ConstantNodeParameter Kind kind, @ConstantNodeParameter LocationIdentity locationIdentity) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11787
diff changeset
149 unsafe.putByte(object, offset, value);
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
150 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
151
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
152 @SuppressWarnings("unused")
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
153 @NodeIntrinsic
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12445
diff changeset
154 public static void store(Object object, long offset, char value, @ConstantNodeParameter Kind kind, @ConstantNodeParameter LocationIdentity locationIdentity) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11787
diff changeset
155 unsafe.putChar(object, offset, value);
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
156 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
157
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
158 @SuppressWarnings("unused")
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
159 @NodeIntrinsic
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12445
diff changeset
160 public static void store(Object object, long offset, double value, @ConstantNodeParameter Kind kind, @ConstantNodeParameter LocationIdentity locationIdentity) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11787
diff changeset
161 unsafe.putDouble(object, offset, value);
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
162 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
163
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
164 @SuppressWarnings("unused")
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
165 @NodeIntrinsic
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12445
diff changeset
166 public static void store(Object object, long offset, float value, @ConstantNodeParameter Kind kind, @ConstantNodeParameter LocationIdentity locationIdentity) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11787
diff changeset
167 unsafe.putFloat(object, offset, value);
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
168 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
170 @SuppressWarnings("unused")
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
171 @NodeIntrinsic
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12445
diff changeset
172 public static void store(Object object, long offset, int value, @ConstantNodeParameter Kind kind, @ConstantNodeParameter LocationIdentity locationIdentity) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11787
diff changeset
173 unsafe.putInt(object, offset, value);
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
174 }
5187
9b8c0d1bc2dd unsafe load/store snippets now require a displacement argument which allows x86 complex addressing modes to be used for tighter encoding of array store/load operations
Doug Simon <doug.simon@oracle.com>
parents: 5061
diff changeset
175
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
176 @SuppressWarnings("unused")
8436
10293cbfc2b6 wrote implementations for node intrinsics so that they can be interpreted when a method substitution is deoptimized and added unit tests to ensure existing method substitutions can run interpreted
Doug Simon <doug.simon@oracle.com>
parents: 8394
diff changeset
177 @NodeIntrinsic
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12445
diff changeset
178 public static void store(Object object, long offset, long value, @ConstantNodeParameter Kind kind, @ConstantNodeParameter LocationIdentity locationIdentity) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11787
diff changeset
179 unsafe.putLong(object, offset, value);
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
180 }
8451
2ffd472c5d25 Backed out changeset: 10293cbfc2b6
Doug Simon <doug.simon@oracle.com>
parents: 8436
diff changeset
181
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
182 @SuppressWarnings("unused")
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
183 @NodeIntrinsic
12548
e1f40574c309 Unsafe{Load,Store}Node: users must provide an LocationIdentity explicitly. Provide more specific LocationIdentity in UnsafeArraySnippets (instead of ANY_LOCATION)
Bernhard Urban <bernhard.urban@jku.at>
parents: 12445
diff changeset
184 public static void store(Object object, long offset, short value, @ConstantNodeParameter Kind kind, @ConstantNodeParameter LocationIdentity locationIdentity) {
11923
88fb9cba8751 Simplify handling of unsafe store and unsafe load.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 11787
diff changeset
185 unsafe.putShort(object, offset, value);
8481
92571f3eeeeb made VM independent method substitutions be interpretable
Doug Simon <doug.simon@oracle.com>
parents: 8451
diff changeset
186 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
187 }