comparison graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/ValuePositionTest3.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.
36 import com.oracle.graal.lir.asm.*; 36 import com.oracle.graal.lir.asm.*;
37 37
38 public class ValuePositionTest3 { 38 public class ValuePositionTest3 {
39 39
40 public static final class TestAddressValue extends CompositeValue { 40 public static final class TestAddressValue extends CompositeValue {
41 public static final CompositeValueClass<TestAddressValue> TYPE = CompositeValueClass.create(TestAddressValue.class);
41 42
42 private static final long serialVersionUID = -2679790860680123026L; 43 private static final long serialVersionUID = -2679790860680123026L;
43 44
44 @Component({REG, OperandFlag.ILLEGAL}) protected AllocatableValue base; 45 @Component({REG, OperandFlag.ILLEGAL}) protected AllocatableValue base;
45 @Component({REG, OperandFlag.ILLEGAL}) protected AllocatableValue index; 46 @Component({REG, OperandFlag.ILLEGAL}) protected AllocatableValue index;
47 public TestAddressValue(LIRKind kind, AllocatableValue base) { 48 public TestAddressValue(LIRKind kind, AllocatableValue base) {
48 this(kind, base, Value.ILLEGAL); 49 this(kind, base, Value.ILLEGAL);
49 } 50 }
50 51
51 public TestAddressValue(LIRKind kind, AllocatableValue base, AllocatableValue index) { 52 public TestAddressValue(LIRKind kind, AllocatableValue base, AllocatableValue index) {
52 super(kind); 53 super(TYPE, kind);
53 this.base = base; 54 this.base = base;
54 this.index = index; 55 this.index = index;
55 } 56 }
56 } 57 }
57 58
98 } 99 }
99 100
100 } 101 }
101 102
102 private static class TestOp extends LIRInstruction { 103 private static class TestOp extends LIRInstruction {
104 public static final LIRInstructionClass<TestOp> TYPE = LIRInstructionClass.create(TestOp.class);
103 105
104 @Use({COMPOSITE}) protected Value value; 106 @Use({COMPOSITE}) protected Value value;
105 107
106 public TestOp(Value value) { 108 public TestOp(Value value) {
109 super(TYPE);
107 this.value = value; 110 this.value = value;
108 } 111 }
109 112
110 @Override 113 @Override
111 public void emitCode(CompilationResultBuilder crb) { 114 public void emitCode(CompilationResultBuilder crb) {