Mercurial > hg > truffle
comparison graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/ValuePositionTest2.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 |
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. |
35 import com.oracle.graal.lir.asm.*; | 35 import com.oracle.graal.lir.asm.*; |
36 | 36 |
37 public class ValuePositionTest2 { | 37 public class ValuePositionTest2 { |
38 | 38 |
39 private static class NestedCompositeValue extends CompositeValue { | 39 private static class NestedCompositeValue extends CompositeValue { |
40 public static final CompositeValueClass<NestedCompositeValue> TYPE = CompositeValueClass.create(NestedCompositeValue.class); | |
40 | 41 |
41 private static final long serialVersionUID = -2243948303328857965L; | 42 private static final long serialVersionUID = -2243948303328857965L; |
42 @Component({REG, OperandFlag.ILLEGAL}) protected Value value1; | 43 @Component({REG, OperandFlag.ILLEGAL}) protected Value value1; |
43 @Component({REG, OperandFlag.ILLEGAL}) protected Value value2; | 44 @Component({REG, OperandFlag.ILLEGAL}) protected Value value2; |
44 | 45 |
45 public NestedCompositeValue(Value value1, Value value2) { | 46 public NestedCompositeValue(Value value1, Value value2) { |
46 super(LIRKind.Illegal); | 47 super(TYPE, LIRKind.Illegal); |
47 this.value1 = value1; | 48 this.value1 = value1; |
48 this.value2 = value2; | 49 this.value2 = value2; |
49 } | 50 } |
50 | 51 |
51 } | 52 } |
87 return true; | 88 return true; |
88 } | 89 } |
89 } | 90 } |
90 | 91 |
91 private static class TestOp extends LIRInstruction { | 92 private static class TestOp extends LIRInstruction { |
93 public static final LIRInstructionClass<TestOp> TYPE = LIRInstructionClass.create(TestOp.class); | |
92 | 94 |
93 @Use({COMPOSITE}) protected NestedCompositeValue compValue; | 95 @Use({COMPOSITE}) protected NestedCompositeValue compValue; |
94 | 96 |
95 public TestOp(NestedCompositeValue compValue) { | 97 public TestOp(NestedCompositeValue compValue) { |
98 super(TYPE); | |
96 this.compValue = compValue; | 99 this.compValue = compValue; |
97 } | 100 } |
98 | 101 |
99 @Override | 102 @Override |
100 public void emitCode(CompilationResultBuilder crb) { | 103 public void emitCode(CompilationResultBuilder crb) { |