annotate graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatableAccessNode.java @ 13153:ae0001b445c0

Common base interface for nodes in the memory graph.
author Roland Schatz <roland.schatz@oracle.com>
date Mon, 25 Nov 2013 17:10:22 +0100
parents b05e1ff3aac0
children 1734954cc73d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8423
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
1 /*
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
4 *
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
8 *
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
13 * accompanied this code).
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
14 *
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
18 *
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
21 * questions.
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
22 */
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
23 package com.oracle.graal.nodes.extended;
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
24
10492
34444b095a51 Read nodes with attached barrier (G1) can not float
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9850
diff changeset
25 import com.oracle.graal.api.meta.*;
8423
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
26 import com.oracle.graal.nodes.*;
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
27 import com.oracle.graal.nodes.type.*;
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
28
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
29 /**
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
30 * An {@link AccessNode} that can be converted to a {@link FloatingAccessNode}.
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
31 */
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
32 public abstract class FloatableAccessNode extends AccessNode {
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
33
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
34 public FloatableAccessNode(ValueNode object, ValueNode location, Stamp stamp) {
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
35 super(object, location, stamp);
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
36 }
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
37
10828
b05e1ff3aac0 Rename WriteBarrierType to BarrierType
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10821
diff changeset
38 public FloatableAccessNode(ValueNode object, ValueNode location, Stamp stamp, GuardingNode guard, BarrierType barrierType, boolean compressible) {
10821
0910c930c66e Method and variables' renaming
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10492
diff changeset
39 super(object, location, stamp, guard, barrierType, compressible);
9850
6e0c6526334b Add HeapInfo interface for write barriers and compressed oops support
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9646
diff changeset
40 }
6e0c6526334b Add HeapInfo interface for write barriers and compressed oops support
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9646
diff changeset
41
10828
b05e1ff3aac0 Rename WriteBarrierType to BarrierType
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10821
diff changeset
42 public FloatableAccessNode(ValueNode object, ValueNode location, Stamp stamp, BarrierType barrierType, boolean compressible) {
10821
0910c930c66e Method and variables' renaming
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10492
diff changeset
43 super(object, location, stamp, barrierType, compressible);
8423
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
44 }
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
45
13153
ae0001b445c0 Common base interface for nodes in the memory graph.
Roland Schatz <roland.schatz@oracle.com>
parents: 10828
diff changeset
46 public abstract FloatingAccessNode asFloatingNode(MemoryNode lastLocationAccess);
10492
34444b095a51 Read nodes with attached barrier (G1) can not float
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9850
diff changeset
47
34444b095a51 Read nodes with attached barrier (G1) can not float
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9850
diff changeset
48 /**
34444b095a51 Read nodes with attached barrier (G1) can not float
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9850
diff changeset
49 * AccessNodes can float only if their location identities are not ANY_LOCATION. Furthermore, in
34444b095a51 Read nodes with attached barrier (G1) can not float
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9850
diff changeset
50 * case G1 is enabled any access (read) to the java.lang.ref.Reference.referent field which has
34444b095a51 Read nodes with attached barrier (G1) can not float
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9850
diff changeset
51 * an attached write barrier with pre-semantics can not also float.
34444b095a51 Read nodes with attached barrier (G1) can not float
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9850
diff changeset
52 */
34444b095a51 Read nodes with attached barrier (G1) can not float
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9850
diff changeset
53 public boolean canFloat() {
10828
b05e1ff3aac0 Rename WriteBarrierType to BarrierType
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10821
diff changeset
54 return location().getLocationIdentity() != LocationIdentity.ANY_LOCATION && getBarrierType() == BarrierType.NONE;
10492
34444b095a51 Read nodes with attached barrier (G1) can not float
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 9850
diff changeset
55 }
8423
86ef0438d1d3 Generalize FloatingReadPhase to support arbitrary floatable access nodes.
Roland Schatz <roland.schatz@oracle.com>
parents:
diff changeset
56 }