comparison graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java @ 19526:8fc336a04d77

Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 20 Feb 2015 22:22:55 +0100
parents 35481bcb5882
children cb406df0ecc3
comparison
equal deleted inserted replaced
19525:35481bcb5882 19526:8fc336a04d77
1 /* 1 /*
2 * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
37 * of a {@link CompositeValue} results in a new {@link CompositeValue}. 37 * of a {@link CompositeValue} results in a new {@link CompositeValue}.
38 */ 38 */
39 public class CompositeValueReplacementTest1 { 39 public class CompositeValueReplacementTest1 {
40 40
41 private static class NestedCompositeValue extends CompositeValue { 41 private static class NestedCompositeValue extends CompositeValue {
42 public static final CompositeValueClass<NestedCompositeValue> TYPE = CompositeValueClass.create(NestedCompositeValue.class);
42 43
43 private static final long serialVersionUID = -8804214200173503527L; 44 private static final long serialVersionUID = -8804214200173503527L;
44 @Component({REG, OperandFlag.ILLEGAL}) protected Value value; 45 @Component({REG, OperandFlag.ILLEGAL}) protected Value value;
45 46
46 public NestedCompositeValue(Value value) { 47 public NestedCompositeValue(Value value) {
47 super(LIRKind.Illegal); 48 super(TYPE, LIRKind.Illegal);
48 this.value = value; 49 this.value = value;
49 } 50 }
50 51
51 } 52 }
52 53
92 return "DummyValue [id=" + id + "]"; 93 return "DummyValue [id=" + id + "]";
93 } 94 }
94 95
95 } 96 }
96 97
97 private static class TestOp extends LIRInstruction { 98 private static final class TestOp extends LIRInstruction {
99 public static final LIRInstructionClass<TestOp> TYPE = LIRInstructionClass.create(TestOp.class);
98 100
99 @Use({COMPOSITE}) protected NestedCompositeValue compValue; 101 @Use({COMPOSITE}) protected NestedCompositeValue compValue;
100 102
101 public TestOp(NestedCompositeValue compValue) { 103 public TestOp(NestedCompositeValue compValue) {
104 super(TYPE);
102 this.compValue = compValue; 105 this.compValue = compValue;
103 } 106 }
104 107
105 @Override 108 @Override
106 public void emitCode(CompilationResultBuilder crb) { 109 public void emitCode(CompilationResultBuilder crb) {