annotate graal/GraalCompiler/src/com/sun/c1x/ir/Conditional.java @ 2852:c6bdec623ef9

Move TypeCHeck to floating nodes, rename Nodes to aboid using an *Op suffix
author Gilles Duboscq <gilles.duboscq@oracle.com>
date Tue, 07 Jun 2011 12:10:27 +0200
parents graal/GraalCompiler/src/com/sun/c1x/ir/IfOp.java@14708c03abba
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
1 /*
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
4 *
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
7 * published by the Free Software Foundation.
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
8 *
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
13 * accompanied this code).
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
14 *
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
18 *
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
21 * questions.
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
22 */
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
23 package com.sun.c1x.ir;
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
24
2586
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
25 import com.oracle.graal.graph.*;
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
26 import com.sun.c1x.debug.*;
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
27 import com.sun.c1x.util.*;
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
28 import com.sun.cri.bytecode.*;
2827
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
29 import com.sun.cri.ci.*;
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
30
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
31 /**
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
32 * The {@code IfOp} class represents a comparison that yields one of two values.
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
33 * Note that these nodes are not built directly from the bytecode but are introduced
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
34 * by conditional expression elimination.
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
35 */
2852
c6bdec623ef9 Move TypeCHeck to floating nodes, rename Nodes to aboid using an *Op suffix
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 2851
diff changeset
36 public final class Conditional extends Binary {
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
37
2586
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
38 private static final int INPUT_COUNT = 2;
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
39 private static final int INPUT_TRUE_VALUE = 0;
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
40 private static final int INPUT_FALSE_VALUE = 1;
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
41
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
42 private static final int SUCCESSOR_COUNT = 0;
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
43
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
44 @Override
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
45 protected int inputCount() {
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
46 return super.inputCount() + INPUT_COUNT;
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
47 }
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
48
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
49 @Override
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
50 protected int successorCount() {
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
51 return super.successorCount() + SUCCESSOR_COUNT;
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
52 }
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
53
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
54
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
55 /**
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
56 * The instruction that produces the value if the comparison is true.
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
57 */
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
58 public Value trueValue() {
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
59 return (Value) inputs().get(super.inputCount() + INPUT_TRUE_VALUE);
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
60 }
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
61
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
62 public Value setTrueValue(Value n) {
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
63 return (Value) inputs().set(super.inputCount() + INPUT_TRUE_VALUE, n);
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
64 }
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
65
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
66 /**
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
67 * The instruction that produces the value if the comparison is false.
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
68 */
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
69 public Value falseValue() {
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
70 return (Value) inputs().get(super.inputCount() + INPUT_FALSE_VALUE);
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
71 }
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
72
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
73 public Value setFalseValue(Value n) {
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
74 return (Value) inputs().set(super.inputCount() + INPUT_FALSE_VALUE, n);
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
75 }
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
76
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
77
2827
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
78 Condition condition;
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
79
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
80 /**
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
81 * Constructs a new IfOp.
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
82 * @param x the instruction producing the first value to be compared
2834
bfce42cd9c07 Graph duplication now passes all tests
Lukas Stadler <lukas.stadler@jku.at>
parents: 2827
diff changeset
83 * @param condition the condition of the comparison
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
84 * @param y the instruction producing the second value to be compared
2586
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
85 * @param trueValue the value produced if the condition is true
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
86 * @param falseValue the value produced if the condition is false
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
87 */
2852
c6bdec623ef9 Move TypeCHeck to floating nodes, rename Nodes to aboid using an *Op suffix
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 2851
diff changeset
88 public Conditional(Value x, Condition condition, Value y, Value trueValue, Value falseValue, Graph graph) {
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
89 // TODO: return the appropriate bytecode IF_ICMPEQ, etc
2587
51ebe5f0516f changed NegateOp, more Op2 changes (generic inputValuesDo impl)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2586
diff changeset
90 super(trueValue.kind.meet(falseValue.kind), Bytecodes.ILLEGAL, x, y, INPUT_COUNT, SUCCESSOR_COUNT, graph);
2834
bfce42cd9c07 Graph duplication now passes all tests
Lukas Stadler <lukas.stadler@jku.at>
parents: 2827
diff changeset
91 this.condition = condition;
2586
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
92 setTrueValue(trueValue);
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
93 setFalseValue(falseValue);
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
94 }
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
95
2834
bfce42cd9c07 Graph duplication now passes all tests
Lukas Stadler <lukas.stadler@jku.at>
parents: 2827
diff changeset
96 // for copying
2852
c6bdec623ef9 Move TypeCHeck to floating nodes, rename Nodes to aboid using an *Op suffix
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 2851
diff changeset
97 private Conditional(CiKind kind, Condition cond, Graph graph) {
2827
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
98 super(kind, Bytecodes.ILLEGAL, null, null, INPUT_COUNT, SUCCESSOR_COUNT, graph);
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
99 this.condition = cond;
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
100 }
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
101
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
102 /**
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
103 * Gets the condition of this if operation.
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
104 * @return the condition
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
105 */
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
106 public Condition condition() {
2827
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
107 return condition;
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
108 }
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
109
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
110 /**
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
111 * Checks whether this comparison operator is commutative (i.e. it is either == or !=).
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
112 * @return {@code true} if this comparison is commutative
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
113 */
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
114 public boolean isCommutative() {
2827
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
115 return condition == Condition.EQ || condition == Condition.NE;
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
116 }
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
117
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
118 @Override
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
119 public void accept(ValueVisitor v) {
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
120 v.visitIfOp(this);
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
121 }
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
122
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
123 @Override
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
124 public int valueNumber() {
2827
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
125 return Util.hash4(condition.hashCode(), x(), y(), trueValue(), falseValue());
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
126 }
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
127
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
128 @Override
2805
c3f64b66fc78 Towards removing the next pointer from Constant and ArithmeticOp
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2594
diff changeset
129 public boolean valueEqual(Node i) {
2852
c6bdec623ef9 Move TypeCHeck to floating nodes, rename Nodes to aboid using an *Op suffix
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 2851
diff changeset
130 if (i instanceof Conditional) {
c6bdec623ef9 Move TypeCHeck to floating nodes, rename Nodes to aboid using an *Op suffix
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 2851
diff changeset
131 Conditional o = (Conditional) i;
2586
421da5f53b5e more Op2 changes
Lukas Stadler <lukas.stadler@jku.at>
parents: 2509
diff changeset
132 return opcode == o.opcode && x() == o.x() && y() == o.y() && trueValue() == o.trueValue() && falseValue() == o.falseValue();
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
133 }
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
134 return false;
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
135 }
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
136
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
137 @Override
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
138 public void print(LogStream out) {
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
139 out.print(x()).
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
140 print(' ').
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
141 print(condition().operator).
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
142 print(' ').
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
143 print(y()).
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
144 print(" ? ").
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
145 print(trueValue()).
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
146 print(" : ").
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
147 print(falseValue());
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
148 }
2827
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
149
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
150 @Override
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
151 public Node copy(Graph into) {
2852
c6bdec623ef9 Move TypeCHeck to floating nodes, rename Nodes to aboid using an *Op suffix
Gilles Duboscq <gilles.duboscq@oracle.com>
parents: 2851
diff changeset
152 Conditional x = new Conditional(kind, condition, into);
2827
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
153 return x;
bd17ac598c6e Graph cloning, initial version (not completely working)
Lukas Stadler <lukas.stadler@jku.at>
parents: 2805
diff changeset
154 }
2507
9ec15d6914ca Pull over of compiler from maxine repository.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff changeset
155 }