Mercurial > hg > truffle
comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java @ 19396:7e2c87dae93e
Create static final NodeClass field named TYPE in Node subclasses.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 16 Feb 2015 15:43:03 +0100 |
parents | 3fc907b46313 |
children | 61d3cb8e1280 |
comparison
equal
deleted
inserted
replaced
19395:a306749d3e86 | 19396:7e2c87dae93e |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2011, 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 | 35 |
36 /** | 36 /** |
37 * Reads an {@linkplain FixedAccessNode accessed} value. | 37 * Reads an {@linkplain FixedAccessNode accessed} value. |
38 */ | 38 */ |
39 @NodeInfo | 39 @NodeInfo |
40 public class ReadNode extends FloatableAccessNode implements LIRLowerable, Canonicalizable, PiPushable, Virtualizable, GuardingNode { | 40 public final class ReadNode extends FloatableAccessNode implements LIRLowerable, Canonicalizable, PiPushable, Virtualizable, GuardingNode { |
41 | |
42 public static final NodeClass TYPE = NodeClass.get(ReadNode.class); | |
41 | 43 |
42 public ReadNode(ValueNode object, ValueNode location, Stamp stamp, BarrierType barrierType) { | 44 public ReadNode(ValueNode object, ValueNode location, Stamp stamp, BarrierType barrierType) { |
43 super(object, location, stamp, null, barrierType); | 45 super(TYPE, object, location, stamp, null, barrierType); |
44 } | 46 } |
45 | 47 |
46 public ReadNode(ValueNode object, ValueNode location, Stamp stamp, GuardingNode guard, BarrierType barrierType) { | 48 public ReadNode(ValueNode object, ValueNode location, Stamp stamp, GuardingNode guard, BarrierType barrierType) { |
47 super(object, location, stamp, guard, barrierType); | 49 super(TYPE, object, location, stamp, guard, barrierType); |
48 } | 50 } |
49 | 51 |
50 public ReadNode(ValueNode object, ValueNode location, Stamp stamp, GuardingNode guard, BarrierType barrierType, boolean nullCheck, FrameState stateBefore) { | 52 public ReadNode(ValueNode object, ValueNode location, Stamp stamp, GuardingNode guard, BarrierType barrierType, boolean nullCheck, FrameState stateBefore) { |
51 super(object, location, stamp, guard, barrierType, nullCheck, stateBefore); | 53 super(TYPE, object, location, stamp, guard, barrierType, nullCheck, stateBefore); |
52 } | 54 } |
53 | 55 |
54 public ReadNode(ValueNode object, ValueNode location, ValueNode guard, BarrierType barrierType) { | 56 public ReadNode(ValueNode object, ValueNode location, ValueNode guard, BarrierType barrierType) { |
55 /* | 57 /* |
56 * Used by node intrinsics. Really, you can trust me on that! Since the initial value for | 58 * Used by node intrinsics. Really, you can trust me on that! Since the initial value for |
57 * location is a parameter, i.e., a ParameterNode, the constructor cannot use the declared | 59 * location is a parameter, i.e., a ParameterNode, the constructor cannot use the declared |
58 * type LocationNode. | 60 * type LocationNode. |
59 */ | 61 */ |
60 super(object, location, StampFactory.forNodeIntrinsic(), (GuardingNode) guard, barrierType); | 62 super(TYPE, object, location, StampFactory.forNodeIntrinsic(), (GuardingNode) guard, barrierType); |
61 } | 63 } |
62 | 64 |
63 @Override | 65 @Override |
64 public void generate(NodeLIRBuilderTool gen) { | 66 public void generate(NodeLIRBuilderTool gen) { |
65 Value address = location().generateAddress(gen, gen.getLIRGeneratorTool(), gen.operand(object())); | 67 Value address = location().generateAddress(gen, gen.getLIRGeneratorTool(), gen.operand(object())); |