comparison graal/GraalCompiler/src/com/sun/c1x/ir/Shift.java @ 2865:7a4e6e11877f

Subclasses for Shift
author Gilles Duboscq <gilles.duboscq@oracle.com>
date Tue, 07 Jun 2011 19:06:20 +0200
parents c6bdec623ef9
children
comparison
equal deleted inserted replaced
2864:32c3d7b51716 2865:7a4e6e11877f
22 */ 22 */
23 package com.sun.c1x.ir; 23 package com.sun.c1x.ir;
24 24
25 import com.oracle.graal.graph.*; 25 import com.oracle.graal.graph.*;
26 import com.sun.c1x.debug.*; 26 import com.sun.c1x.debug.*;
27 import com.sun.cri.bytecode.*;
28 import com.sun.cri.ci.*; 27 import com.sun.cri.ci.*;
29 28
30 /** 29 /**
31 * The {@code ShiftOp} class represents shift operations. 30 * The {@code ShiftOp} class represents shift operations.
32 */ 31 */
33 public final class Shift extends Binary { 32 public abstract class Shift extends Binary {
34 33
35 private static final int INPUT_COUNT = 0; 34 private static final int INPUT_COUNT = 0;
36 private static final int SUCCESSOR_COUNT = 0; 35 private static final int SUCCESSOR_COUNT = 0;
37 36
38 /** 37 /**
39 * Creates a new shift operation. 38 * Creates a new shift operation.
40 * @param opcode the opcode of the shift 39 * @param opcode the opcode of the shift
41 * @param x the first input value 40 * @param x the first input value
42 * @param y the second input value 41 * @param y the second input value
43 */ 42 */
44 public Shift(int opcode, Value x, Value y, Graph graph) { 43 public Shift(CiKind kind, int opcode, Value x, Value y, Graph graph) {
45 super(x.kind, opcode, x, y, INPUT_COUNT, SUCCESSOR_COUNT, graph); 44 super(kind, opcode, x, y, INPUT_COUNT, SUCCESSOR_COUNT, graph);
46 }
47
48 private Shift(CiKind kind, int opcode, Graph graph) {
49 super(kind, opcode, null, null, INPUT_COUNT, SUCCESSOR_COUNT, graph);
50 } 45 }
51 46
52 @Override 47 @Override
53 public void accept(ValueVisitor v) { 48 public void accept(ValueVisitor v) {
54 v.visitShift(this); 49 v.visitShift(this);
55 } 50 }
56 51
57 @Override 52 @Override
58 public void print(LogStream out) { 53 public void print(LogStream out) {
59 out.print(x()).print(' ').print(Bytecodes.operator(opcode)).print(' ').print(y()); 54 out.print(x()).print(' ').print(this.shortName()).print(' ').print(y());
60 } 55 }
61 56
62 @Override 57 @Override
63 public Node copy(Graph into) { 58 public abstract String shortName();
64 Shift x = new Shift(kind, opcode, into);
65 return x;
66 }
67 } 59 }